Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


pih

pih

666 posts

Ultimate Geek
+1 received by user: 359

Lifetime subscriber

#309255 2-Oct-2023 20:01
Send private message

I'm keen to hear what others are using to sense water tank levels and report to Home Assistant. I know there are various proprietary off-the-shelf solutions out there (all of which seem to be obscenely priced, and integration last I looked was a bit hit and miss). I'm 3/4 of the way to buying a couple of hydrostatic sensors (for my two tanks) and an ESP32 off AliExpress and building my own, but thought I'd ask around before pulling the trigger in case I've missed something.

 

I saw this old thread which mentioned others using or interested in water level monitoring, but there wasn't much detail on what was actually being used.

 

There are other cheaper methods of sensing besides hydrostatic pressure sensors: ultrasonic, floats, capacitative/resistive sensors etc. I'm just keen for something that's low fuss, highly accurate and long lasting, so I think this is the way to go.

 

So, what else is out there? Any gotchas?


Filter this topic showing only the reply marked as answer View this topic in a long page with up to 500 replies per page Create new topic
 1 | 2 | 3
johno1234
3352 posts

Uber Geek
+1 received by user: 2843


  #3138073 3-Oct-2023 07:08
Send private message

I like ultrasonic sensing, no moving parts:

https://www.electroniclinic.com/iot-based-water-level-monitoring-system-using-esp32-waterproof-ultrasonic-sensor-new-blynk/



Hwale
71 posts

Master Geek
+1 received by user: 19


  #3155061 2-Nov-2023 19:24
Send private message

Late to the party but I use one of these:

 

https://www.aliexpress.com/item/1005003614683022.html

 

The TOF400C will measure up to 4m if you have a really big tank. Set the timing budget to 500ms and it's accurate to 1mm. You'll have to figure out the maths based on your tank height and radius but that's easy enough. :)

 

 

 

The good thing about these ones is they ship with the infrared cover assembly which keeps the sensor safe from the humidity etc. Mine was delivered in 1 week, remarkably. 


MarkM536
321 posts

Ultimate Geek
+1 received by user: 146


  #3155161 2-Nov-2023 20:09
Send private message

A few methods I looked into before I made my water tank sensing device into Home Assistant:

 

  • Distance measurement (ultrasonic) - Measures distance from top of the tank to water level. Maths needed for volume/distance calculation.
  • Pressure sensor (sits in the bottom of the tank) - Measures water weight and calculate based on height/volume of the tank. 
  • Mat pressure sensor (sits under the tank) - Measures weight of water and tank, factor out tank and do the maths for water weight/volume.
  • Float sensors - Doesn't give a 0-100% but a true/false at a position for water.
  • Capacitive sensors - Similar to float sensors but sticks on the outside of a plastic tank and detects a change in capacitance when a liquid is behind it.

 

 

I did multiple capacitive sensors.

 

Because I didn't want an AliExpress grade stainless steel pressure sensor sitting in the water which could possibly rust.

 

At the time I thought an ultrasonic distance sensor would not be viable because my water tank is very skinny/tall. But apparently you can buy ultrasonic sensors with a focus adjustment... doh!

 

 

 

I use 7 capacitive sensors taped onto the plastic tank.

 

Using an ESP32 microcontroller + Home Assistant. The ESP32 got a high/low voltage signal from each capacitive sensor on the tank which cosponsored to a rough percentage I entered into the code. Terrible, I should make it sensors '1-7'.

 

Downside is it's 7 sensors... which cost $40 in total and it's just 7 waterline stages I can detect into Home Assistant. Not a linear percentage change.

 

 

 

Notes about this video:

 

This was designed/made for my electronics project at high school (keen eyed spotted 'DTE' means Digital Technology Electronics in NCEA system).

 

Multiple mistakes I had to correct in 2022: I connected two sensors to strapping pins on the ESP which prevented proper boot up and the label says '12v', in reality I am running this ta 9v still (the voltage regulator is still dropping down to 5v for the ESP32.... less wasted heat of 9v to 5v conversion). So the voltage at the ESP from the sensors is 4.5v (10k + 10k voltage divider halves 9v).

 

There is also now a motorized ball valve for water inlet. Because this tank uses a flow diverter and the tank can overflow when it's full. Also great to have the valve so Home Assistant lets the rain wash dirt off the roof before the inlet is opened (rain gauge elsewhere for measurement).

 

 https://youtu.be/gFw1ZPMU3V4?feature=shared&t=103

 

 

 

Chat GPT is also very helpful when it comes to creating or suggesting functions within ESPhome for your needs (E.g. template sensors).




tweake
2641 posts

Uber Geek
+1 received by user: 1137


  #3155163 2-Nov-2023 20:12
Send private message

Hwale:

 

Late to the party but I use one of these:

 

https://www.aliexpress.com/item/1005003614683022.html

 

The TOF400C will measure up to 4m if you have a really big tank. Set the timing budget to 500ms and it's accurate to 1mm. You'll have to figure out the maths based on your tank height and radius but that's easy enough. :)

 

 

 

The good thing about these ones is they ship with the infrared cover assembly which keeps the sensor safe from the humidity etc. Mine was delivered in 1 week, remarkably. 

 

 

the problem with lazer ranging is it doesn't work well with clear liquids. i suspect it may vary a bit depending on color and shape of the bottom of the tank. you don't want the bottom of the tank reflecting a stronger signal back than what the water surface does.


pih

pih

666 posts

Ultimate Geek
+1 received by user: 359

Lifetime subscriber

  #3155216 3-Nov-2023 08:02
Send private message

Thanks everyone, I considered ultrasonic ranging but had dismissed the idea because i didn't think there was going to be a cheap waterproof transducer - I was wrong! They are far cheaper than the hydrostatic sensors - Thanks @johno1234, I've ordered a couple and I'll see how they go.

 

 

Laser ranging sensor is interesting, I didn't know you could buy them, amazing! But yes, I think the ultrasonic one will last longer and will be plenty accurate enough.

Hwale
71 posts

Master Geek
+1 received by user: 19


  #3155220 3-Nov-2023 08:35
Send private message

Let us know how it goes and what kind of results you get, I discarded the ultrasonic method for lack of precision but I have a very big tank so millimetres mattered. 😁


 
 
 
 

Shop now for Lego sets and other gifts (affiliate link).
myopinion
939 posts

Ultimate Geek
+1 received by user: 112


  #3155276 3-Nov-2023 09:35
Send private message

I have a hose attached to the tap on the bottom of the tank. Turn it on and lift it up till it stops, then I know the level. 


Ge0rge
2114 posts

Uber Geek
+1 received by user: 2060

Trusted
Lifetime subscriber

  #3155278 3-Nov-2023 09:48
Send private message

myopinion:

I have a hose attached to the tap on the bottom of the tank. Turn it on and lift it up till it stops, then I know the level. 



That doesn't really get the level into Home Assistant with any sort of automation though, which is what the OP is after?

Azzura
609 posts

Ultimate Geek
+1 received by user: 224

ID Verified

  #3155280 3-Nov-2023 10:06
Send private message

If I ever get one...it'll be this - Receiver (inside plug-in unit) is rated for 100-240V, 50/60Hz, Up to and over 1km can be achieved. - PTLevel Wireless Tank Level Monitor


SumnerBoy
2079 posts

Uber Geek
+1 received by user: 306

ID Verified
Lifetime subscriber

  #3155282 3-Nov-2023 10:15
Send private message

MarkM536:

 

 https://youtu.be/gFw1ZPMU3V4?feature=shared&t=103

 

 

Great video(s) - subscribed :).


pih

pih

666 posts

Ultimate Geek
+1 received by user: 359

Lifetime subscriber

  #3155612 3-Nov-2023 21:25
Send private message

myopinion:

 

I have a hose attached to the tap on the bottom of the tank. Turn it on and lift it up till it stops, then I know the level. 

 

 

That's slightly more advanced than my current method which is to knock on the side of the tank: it turns from a hollow echo to a distinct thud where the water level is. But yes, the point is to add automation to Home Assistant 😉


 
 
 
 

Shop now for Dyson appliances (affiliate link).
tcabw
72 posts

Master Geek
+1 received by user: 27


  #3155616 3-Nov-2023 22:03
Send private message

pih:

 

myopinion:

 

I have a hose attached to the tap on the bottom of the tank. Turn it on and lift it up till it stops, then I know the level. 

 

 

That's slightly more advanced than my current method which is to knock on the side of the tank: it turns from a hollow echo to a distinct thud where the water level is. But yes, the point is to add automation to Home Assistant 😉

 

 

I had three goes at electronic level devices. Have since gone back to the orange float ball through a tube at the top. When the float is at the lid level I know I have a problem! I'm a gadget fan, but not for water tank devices. 

 

TC





Tony C

 

Cheviot NZ

pih

pih

666 posts

Ultimate Geek
+1 received by user: 359

Lifetime subscriber

  #3160301 16-Nov-2023 23:25
Send private message

Update:

 

I ordered an ESP32 and a couple of ultrasonic transducer modules. I flashed Tasmota into the ESP32 and found out that it supports SR04 sensors out of the box - fantastic!

 

Got it all working with Home Assistant and went to add the second transducer... Only to find that Tasmota only supports a single SR04 module 😥. Back to the drawing board, maybe I don't use Tasmota.


fe31nz
1294 posts

Uber Geek
+1 received by user: 423


  #3160303 16-Nov-2023 23:45
Send private message

pih:

 

Update:

 

I ordered an ESP32 and a couple of ultrasonic transducer modules. I flashed Tasmota into the ESP32 and found out that it supports SR04 sensors out of the box - fantastic!

 

Got it all working with Home Assistant and went to add the second transducer... Only to find that Tasmota only supports a single SR04 module 😥. Back to the drawing board, maybe I don't use Tasmota.

 

 

I thought Tasmota is open source - so if the ESP32 hardware can interface to two SR04 sensors, it should be fairly easy to change the Tasmota code to support the second sensor.


johno1234
3352 posts

Uber Geek
+1 received by user: 2843


  #3160316 17-Nov-2023 06:44
Send private message

Or just get two esp32s and run them as separate devices?

 1 | 2 | 3
Filter this topic showing only the reply marked as answer View this topic in a long page with up to 500 replies per page Create new topic








Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.