Looking for suggestions on how to measure water level in a reservoir

Hi all,

I’ve got a reservoir that holds a large amount of water (imagine a tank, just bigger). I’m using ESPHome to control several borehole pumps, and monitor the flow into the reservoir.

I’ve been using a small ultrasonic sensor (HC-SR04) to measure the amount of water in the reservoir. This is necessary because the system uses that data to know when the reservoir is full, at which point it suspends all pumping until the level drops below a certain point, at which time the pumps come on again.

Without the ultrasonic, the reservoir can overfill and begin to run over the side, which carries on until I notice a river which has spontaneously come into existence next to the house. If I’m out on the land when this happens, it might be hours before I become aware, and to waste water out here where it’s so precious is awful.

But the problem I’m experiencing is humidity. By its nature, the ultrasonic sensor has to be exposed to the surface of the water, and vapour from evaporation condenses inside the sensor. This kills the ultrasonic, and I must then replace it. Often.

There must be a better way to measure the water level, that doesn’t involve ultrasonics, and get that data into ESPHome. Can you think of one? I mean, I have a float attached to a string that gives me a visual indicator, but I don’t have a way to digitise that information.

Any suggestions would be appreciated.

Many thanks.


This is the type

tl231 level sensor

I was going to suggest a time of flight sensor, but @sender’s is probably a better idea.

Another option is a float on a lever, with a switch of some sort on the lever.

Thank you for this suggestion. The requirement of a 24 volt power supply will be tricky but not impossible (currently only have 5V on site). I’ve been googling for a spec sheet on this item so that I can get a sense of how it works, which will also inform whether I can use it with ESPHome or whether I’ll have to use an Arduino or something. Do you know who makes it / where I might find more info?

Hi @nickrout, that’s an interesting idea and would probably work too, since the important piece of data is when the reservoir is full. Actual current level is sexy but not entirely required. I’ll look into that.

My uncle had a a water problem under his house - in heavy rain water would rise and flood his basement. He solved it by a float connected to a pump switch. When the float got high, it would switch the pump on. Simple, analogue and effective.

To know when it is time to fill the reservoir you could have another switch.

Or you could have a rack and pinion Rack and pinion - Wikipedia attached to the lever, with a potentiometer giving you an analog level proportional to how high the water is.

Yes! totally forgot about that one…

My first suggestion is to measure the actual level.

I also have a " Water Float Ball Valve" in the bottom of my reservoir to see if it is empty. But my reservoir is filled by rain and when it is full it just bypasses.
In the same way, if you put the Water Float Ball Valve on the top of the tank you can “see” when it is full and do some actions.

Good luck!

Yep just look in your toilet cistern for inspiration (but taking the parts doesn’t have a high WAF)

We have out-of-the-box stuff for that in “waterland” :slight_smile:


Looks like you can use 5V with it as per Amazon description for this one

e.NOTES:The output signal of this item has 4 types:4~20mA,0~5VDC,1~5VDC and 0~10VDC,this one output is 4-20mA. The pressure range is 0-1-500M,and this one pressure range is 5M. The cable length is 1-10M,this Default cable length is 1M (If you need other parameters,please contact us).

This looks interesting! I can see doing a setup with ESPhome with a level shifter 0-5V probably would use a ESP32 though for the analog.

He was pretty cheap!

Thank you everyone for your suggestions. It looks like a float switch is the way to go, since I really just want to know when the reservoir is full.

And I can think of a way to get it into ESPHome: just a reed switch and a magnet. The float switch will lift the magnet towards the sensor, and when it gets in range, I get a signal. I even have pins free on the Wemos D1 Mini that drives this whole setup.

You guys are inspiring. Thank you.

That’s why I bought it :slight_smile:

Here is a nice float switch no reed switch needed!

If you’re short… you can LOAD up your pins with these dirty basterds… the work LIKE A CHARM!!!


1 Like

Or if you have time to wait


I have more money than patience!

Amazon says currently out of stock.

After all you’re a doctor, Jeff :rofl:

I also agree that the float sensor is probably the best. A float sensor is typically used in aquariums to top off the water and to keep the chemical levels stable. An example is Tunze Osmolator Auto Top Off System - AquariumStoreDepot

If its sensitive, you might think about 2 sensors as sometimes they might get stuck and with 2 you can at least have a failsafe mechanism.