Raspberry Pi automatically refills your water bottle

YouTuber Chris Courses takes hydration seriously, but all those minutes spent filling up water bottles take a toll. 15 hours per year, to be exact. Chris regularly uses three differently sized water bottles and wanted to build something to fill them all to their exact measurements.

(Polite readers may like to be warned of a couple of bleeped swears and a rude whiteboard drawing a few minutes into this video.)


  • Raspberry Pi
  • Water filter (Chris uses this one, which you would find in a fridge with a built-in water dispenser)
  • Solenoid valve (which only opens when an electrical signal is sent to it)

How does the hardware work?

The solenoid valve determines when water can and cannot pass through. Mains water comes in through one tube and passes through the water filter, then the solenoid valve releases water via another tube into the bottle.

Diagram of the water bottle filler setup, hand-drawn by the maker
See – simples!

What does the Raspberry Pi do?

The Raspberry Pi sends a signal to the solenoid valve telling it to open for a specific amount of time — the length of time it takes to fill a particular water bottle — and to close when that time expires. Chris set this up to start running when he clicks a physical button.

We feel the same way about Raspberry Pi, Chris

Chris also programmed lights to indicate when the dispenser is turned on. This manual coding proved to be the most time-consuming part of the project.

But all the wires look so ugly!

Water dispenser mounted onto side of fridge
Sleek and discreet

Chris agreed, so he 3D-printed a beautiful enclosure to house what he dubs the ‘Hydrobot 5000’. It’s a sleek black casing that sits pretty in his kitchen on a wall next to the fridge. It took a fair bit of fridge shuffling and electrical mounting to “sit pretty”, however. This Raspberry Pi-powered creation needed to be connected to a water source, so the tubing had to be snaked from Hydrobot 5000, behind appliances, to the kitchen sink.

Check out those disco lights! Nice work, Chris. Follow Chris on YouTube for loads more coding and dev videos.


Ed avatar

This is fun. One request for the blog editor, though: please don’t add “autoplay” attributes to videos! Especially not those with sound. Thanks.

StevenP avatar

Totally agree with Ed – fortunately I’m still working from home, otherwise the cool sounding auto-play audio would be somewhat embarrassing in my shared office ;-)

Ashley Whittaker avatar

Fixed it now 👍

Anders T. avatar

Very nice Project! But what if water pressure changes? Low pressure: half filled bottle, high pressure: table flooded – if the fill time is a constant. Maybe some kind of sensor could make sense? A flowmeter to track how much water is released? But the you must know the volume of the bottle. A moist sensor that shuts off the water when wet – but requires contact with the water. Will a photocell work with clear water?

Comments are closed