ESPHome water level sensor

This is how I wired it as well.
I used a 24V->5V USB buck converter for the ESP, that was powered from the 24V supply. That way I had common ground for both circuits.

I was finally able to get the system up and in my water tank yesterday.

Here’s a 12 hour window of the current measurements:

Here’s a zoomed in view of the busy area:

Yes the installation is outdoors but I do not have a cover on it at the moment. No I do not have any pullup resistors in my setup.

Hi @kimocal thanks for posting the data trend. The data seems much more steady compared to the voltage readings that I take.

Does the change in current correspond with water going in and out of the tank and is not affected by any external factors? Are you happy with the accuracy of the readings with respect to the water level?

So far so good. I didn’t calibrate the sensor initially. As I am monitoring the water tank level with a yard stick I am also entering the current value in a spread sheet to better tune my current to water height formula. Maybe this weekend I’ll calibrate them with a wider spread of data points to tune it more. For now it’s working though.

The only external factor I can think of would be the air tube that the TL316 uses and making sure it doesn’t have wind blowing on it to affect the relative pressure compensation.

My sensor termination and all the electronics ie. power supply, nodemcu etc are located in an ip67 enclosure. That is where I have my temp probe.

My voltage readings fluctuates with the temp. I have a spare ina219 I will wire that up this weekend to see if the readings are affected.

I installed a system over the weekend using the method in the other thread, sonic sensor, so far working pretty well.

Definitely a few spikes there that I would assume are from condensation which appears to be the big issue with the sonic sensors.

This thread really seems to be about using pressure sensors. I see that people are adding additional voltage or current sensor hardware, one of the pressure sensors linked above looks to output RS485, curious why no one has gone that route? Looks like you’d need something like a MAX485 to read it in an ESP / Arduino device anyway, but feels like reading digital data might be easier?

So I connected up my INA219 breakout board to my throw in level sensor and I have noticed the fluctuation with temperature is almost non existent but the downside is with INA219 the accuracy is approx 2% (for me that’s ~100L) compared with the ADS1115 of 0.15%. Is there any way of increasing the accuracy of the INA219, replace the shunt resistor possibly?

WL lovelace

From what I’ve been able to figure out, replacing the shunt will not help much.

You should check if you have an A or B version of the INA219. The B version has higher accuracy and precision.

Also - did you configure “max current” to 400mA? It defaults to 3.2A and that will give you a resolution of 0.8mA. Going to 400mA gives you a resolution of 0.1mA.

Hi @aherbjornsen thanks for the quick response. I have the adafruit INA219 B version. Looking through the documentation it says you can expect a 1.5% accuracy with the B version. So I guess I am not far of it. I have max current set at 400mA.

i use the 0-10v sensor with shelly uni, works perfectly

1 Like

How do you have your hardware all set up?

Like so

1 Like

I almost went that route after seeing that video previously. What is the accuracy of your setup?

I did not realise you can get a TL36 level sensor with a voltage output. Do you know if the readings drift with temperature if the storage tank is located outdoors?

I know this was posted a long time ago but if you didn’t solve the problem, consider this: The ADC on 8266 devices is referenced to the supply voltage to the module. If this voltage is not regulated, then your readings will vary with variations of the supply voltage. I use inexpensive DC-DC converters based on the LM2596 chip to apply a very stable 5V supply to the 8266 device (in my case nodemcu or wemos D1.) I found this particularly useful for soil moisture sensors, but would be equally as useful in your application.

1 Like

Hi @rusty_away could that also possibly explain the drift I was seeing with temperature? Because the reference voltage from the power supply is varying with ambient temperature? I have ordered a LM2596 chip and will give it a try. Also do you know is the esp32 is less prone to drift as compared to esp8266?

Hi
Could you please add some photos on how you connected the Uni? Also, what did you do with the grd sensor on the uni? I am not getting reliable readings.

My understanding is that the ADC in an esp32 is actually less stable than the 8266. Yes, temperature may affect power regulation. Good luck with the lm2596.

I could use one of those

I am going to make. sensor for a 2500 L Diesel Tank for home heating, It is 1.5-1.8 meeter tall, 0.8 meeter wide.
What would you guys recommend, I have read a lot of inconsistencies with ultrasonic modules, and in a tank that is so narrow and so tall, I feel that I would get beams from the walls,
I was thinking on the submerged prove solution, though submerging the wire in diesel I dont know if that would kill either the sensor itself or the cable rubber (in 5 years time)
Also I am concerned about safety, flowing current through a fire hazard as Diesel is not a good option I guess (Gasoline would be worst I know)

So what options do you recommend? I currently have an analogical gauge made from a rope and a weight that floats, suspended from the top of the tank.