[Jumpor] lives in a part of India where the water infrastructure is a little frustrating to use. Water gets delivered to underground tanks outside of homes, and must then be regularly pumped into rooftop tanks prior to use inside the building. Typically, this pumping is handled manually—by switching on a pump and running it until water comes out of an overflow pipe to indicate the rooftop tank is full. [Jumpor] decided to improve this wasteful and time consuming process with a little automation project.
The build is based around an ESP32 microcontroller. It’s hooked up to an ultrasonic sensor which can measure the water level inside the rooftop water tank. When the sensor detects the level descending below a set point, the microcontroller fires a relay to trigger the lift pump to fill up the tank. Once the sensor detects the tank is full, the pump is shut off, saving liters of water compared to waiting for water to pour out of the overflow as an indicator of the same.
It’s a simple enough project, but [Jumpor] was sure to include the important practical considerations. Since the rig was being installed in a rental, it was desirable to not make any permanent modifications to the water system. Thus, a fresh cap for the water tank was modified to host the electronics and level sensor, such that the original could be replaced at a later date. Due consideration was also paid to things like avoiding crossing the minimum detection threshold of the sensor, which could lead to accidental overflows if not managed correctly.
The aim of this project was to ease the day to day burden of maintaining a basic utility. That’s the sort of project we love to see around these parts.

Just wondering, why not a float level sensor?
nah, too reliable.
Harder to make a youtube video sound interesting/different?
First reaction is that moving parts wear and are inherently inaccurate. I have a float sensor on my fish pond that gives me nothing but grief.
Something fishy may be happening there.
It’s actually in a box separated from the koi by a net, so it’s more like algae buildup and leaves and the fact I can’t seem to get quality float sensors, they’re all cheap and nasty.
Hmm, algae seems a bit harder to deal with ….
Stainless steel hydrostatic pressure gauges are pretty cheap and resilient against bio-fouling – and they’re very simple to clean. Their biggest threat are animals that chew on the cables, thinking they’re plant roots.
Float sensor would be more expensive and give less detail on how much water is left?
Ultrasonic is good, no water contact or moving parts. Float switches could directly control a pump. Of course if it gets stuck, the pump runs all night until the well runs dry or it sucks mud, etc. Redundancy – two float switches in series would be a good idea. Also, capacitive switch right through the wall of the container is a thing too. Seemed it was more a video about the interface.
As long as the sensors can handle the humidity levels in a water tank, like 100% RH and condensation
Yep
From experience, the bare PCB module sensors you get off of online places will not hold up long in those environments.
That’s the perk of a float sensor. They are very reliable.
For example: millions of toilets
Also: the gas gauge on your car
The ubiquitous cheap ultrasonic sensor board (HC-SR04) definitely can’t handle that environment over the long term, but its waterproof derivatives, one of which is used in this project, is designed for exactly that environment and still pretty cheap.
Fancier ultrasonic sensors are used industrially to measure the level of much, much nastier liquids (and solids) than water.
Probably more difficult to fit in a reversible manner.
Poor ESP32. Dully sitting doing nothing 99.999999999% of the time…
Hmm. I’ve been looking for something like this for my camper for a while.
I bet it would work just as well for the gray water tank so I know when it needs dumped as well.
Imagine having to change that sensor lol but would definitely be nice, i mean greywater can get stinky
Should you not include the sump water level as an input. How will the signal be transmitted. Is a wireless solution possible
I’ve got the waterproof version of the ultrasonic sensors on my water tanks. I can confirm that condensation is indeed an ongoing issue with this – it will throw off readings every few samples. Mine just feeds to an MRTG graph though, so I can see the longer term trend.
I also built and successfully implemented an ultrasonic sensor-based water level controller. However, I’m still facing one practical issue. During the rainy season, evaporated water droplets tend to form on the face of the ultrasonic sensor, causing it to give erratic readings.
Have you encountered the same issue in your project? If so, what technique did you use to overcome it?
The underground tank makes sense, since it keeps cool there (bacteria). But why then the rooftop tank, that heats up? I mean, it needs no pump from there, since the water falls down to the faucet. But if you still have to pump it up anyway, keep it runnning in a loop to the underground tank (reservoir) only, so people can just plug in?
Usually these on-demand water systems use an air bladder to maintain pressure in the system to get instant water out of the tap, and the pump turns on when needed.
However, if you don’t have power you get no water, so the rooftop version implements a mini water tower for reservoir, so you can get water during a blackout.
Ah, right, India has a bit of a unreliable grid, no?
Or if your grid power is very expensive, you can run the pump when the power prices are low or supplement with solar, since it doesn’t have to meet instant demand.
A stainless steel hydrostatic pressure sensor would cost more than the ultrasonic sensor (30€ vs. 7€) but it would be more accurate and reliable in a clean water tank with no blind spots, temperature compensation or internal reflections for error sources. The output would be 4-20 mA current loop or analog voltage, making it very simple to interface with a MCU.
Considering the total cost of the build, it wouldn’t be too expensive.