During my home renovation, I found myself wasting a lot of time measuring water for mixing concrete, gypsum, and other materials. To streamline the process, I built this automatic water dispenser. It allows precise dispensing from 0.1L to 25L in 0.1L increments. The last set value is stored in memory and retained even after a power cycle.
Pictures of the finished project:
Please accept YouTube cookies to play this video. By accepting you will be accessing content from YouTube, a service provided by an external third party.
If you accept this notice, your choice will be saved and the page will refresh.
The unit runs on a rechargeable lithium battery, which is charged by a water-powered generator. This means the battery charges while water is being dispensed. In the rare case the battery runs out (unlikely, as the charging power exceeds the average consumption), there’s a USB-C charging port hidden behind a screw-in plug on the side.
The solenoid valve I used is pulse-driven: a single pulse opens the valve, and a reverse pulse closes it. This design significantly reduces power usage. To drive the valve, I use a compact MX1508 motor driver board. However, the current spike during valve switching can cause the microcontroller to crash. To avoid this, I added a buffer circuit consisting of 3x 3300µF 6.3V capacitors charged through a 100Ω resistor from the 5V line. This buffer powers only the valve driver, isolating it from the main 5V supply and preventing voltage dips during switching.
The water flow is monitored using a flow sensor that generates 660 pulses per liter. These pulses are fed into a microcontroller pin configured to trigger an interrupt. Each interrupt decrements a remaining volume counter, and once the counter reaches zero, the valve is closed.
A quick sketch circuit diagram:
The firmware can be found on Codeberg: https://codeberg.org/Stynus/Water-Dispenser