Nerd License Renewal - Arduino and Alexa Hot Water Monitor
A few months ago, I read about a contest that represented a perfect opportunity for a Nerd License Renewal.
Nerd License Renewal: A demonstration of nerd aptitude and interests that make it clear the applicant qualifies as a nerd and may be recognized as such. Renewals should be published on a periodic basis to renew your license.
The contest called for a project that involved any Arduino product, and used an Alexa voice interface. I had a project in the back of my brain for a little while that seemed like a perfect fit. By installing a water flow meter and two temperature sensors on my hot water heater, I could measure hot water use and be able to ask Alexa (through a custom skill) how much hot water was left.
The details and required parts for the project are over at the project page at Hackster.io, but I’ll include some additional background here for those interested.
I chose a flow meter that could be easily installed in a hot water heater. The fittings match the flexible pipes used on hot water heaters, which makes for an easy install. The sensor has a small fan inside with a small magnet on it. A hall-effect sensor on the outside of the pipe detects the spinning of the internal fan, and sends a pulse down a wire. The flow range matches regular household hot water use. The sensor does have an operating temperature limit of 60 degrees celcius. That is the upper range of hot water heaters, and I mitigated the temperature risk by isntalling the flow sensor on the cold water input rather than the hot water output.
The device is listed as compatible from 4.5v to 18v, but it operated just fine at the 3.3 volts I was using.
Under use, I would occasionally read just a few pulses on the signal line without any real water flowing. I don’t know why the internal fan was spinning, but may have had something to do with minor fluctuations in volume due to temperature changes in the hot water heater or pipes.
Measuring the temperature difference between the input and output temperatures is critical for calculating the required energy (and therefore time) to heat water. This is used to approximate the rate at which water is heated to replace the hot water used.
I used two one wire temperature sensors so that I could daisy chain them on the same wires and only use one data pin. This worked really well, except for attaching them to the pipes. I designed and 3D printed clips to hold them to the pipes. This is my first time designing clips like this, and they didn’t clip on strong enough to hold the sensors in place. I’ll need to iterate on the design to make it clip tight. Iteration is difficult, as I don’t have a 3D printer. I’ve been using the printer at the local library (which is awesome to have access to) but limites my opportunities for interation and design changes.
Wemos D1 Mini
I used a Wemos D1 mini as the microcontroller for the project. This little microcontroller has been a favorite of mine. With a built in wifi chip and enough pins for most small projects, It is a very convenient board to use. It’s cheap price makes it even easier to use on many projects. You can usually find it for $7-$8 on Amazon but if you can plan ahead further, you can usually find it for $2.50 - $4 on AliExpress. The shipping times are longer, but the lower price makes it easy to over-order and keep a few spares on hand for the next project!
There are a number of expansion boards for the Wemos D1 Mini as well, and I like to keep protoboards on hand for easy projects. I often prototype on one board with headers to fit a breadboard, then transfer the components onto the protoboard and combine that with another Wemos D1 Mini without the long headers.
The instructions in the contest were slightly vague. It was a requirment to use an Arduino ‘product’, but it was not clear if that meant the Arduino IDE, or if it required an official Arduino board. Though there are official Arduino boards with wifi, their cost is high and the availability is low. There were other projects without official Arduino boards, so hopefull my entry counts.
The contest also required an Alexa Skill, but this too was vague. I first understood it to mean that my project instructions were to include how a user would set up their own skill, and I spent significant time including the instructions on how that would be done. Most of my instructions were related to that process. As it turns out, I think they wanted a prepared Alexa skill that could be used by any buider of the device. I could have done that, but by the time I realized what the instructions might have meant, the project was already submitted. I hope my entry still qualifies.
On GitHub. Please use and provide feedback.
There are a whole host of things that can be improved on my design. Here are a few, for anybody working on a similar project, or future me:
- Imperial/Metric option. Right now, it’s measured in Metric, but reported in Imperial.
- Better temperature detection algorithms.
- Sensor for direct heating mode detection.
- Easier calibration for new users.
- Easier setup for wifi access point.
- Calculation of heating cost, based on heating time and wattage of hot water heater.