ESPHome water level sensor

Connect the red wire from transducer to -IN, the other one (black or blue) to ground. +IN (R100) from INA2xx to +24V.
That’s it.

1 Like

Pls see here ESPHome water level sensor - #221 by kimocal

Awesome, will deff this a go as soon as I can get a module.
Thanks!

Ah those are i2c? Nice. Mmm, that would have been easier for me too.

Hi all,

Am I correct in assuming that the ADS1115 is meant to “smooth” out the voltages to make them more consistent?

My voltages seem to be all over the place…
Using the following filters:

  accuracy_decimals: 3
  filters:
    - sliding_window_moving_average:
       window_size: 500
       send_every: 15
       send_first_at: 10

Nope, the ADS1115 just gives you an instantaneous value every time you read it that esphome maps to a voltage via the gain config. All the smoothing is in the filters, and you’re getting results after the filters which means the raw values are probably a lot more chaotic.

Getting back to the raw voltages is going to let you find the cause of variations faster, it’s covering up the rate-of-change and being able to relate spikes and trends. Maybe. It’s at least worth a shot.

Turning on verbose debug might show that without any other changes?

# Logging level
logger:
  level: VERBOSE

in the yaml?

Also, for example, ESP_LOGI("","Lambda incoming value=%f - data array size is %d",x,data.size()); etc in the lambda can log things from in there too.

1 Like

Thanks for the input and feedback - it’s really appreciated.

I think that I seem to be struggling with setting a baseline voltage for when the tank is full.
I’ve tried #'ing out the calibrate_linear but it’s quite difficult to get an average from all the readings.

Is there a trick to doing this?

Quick q:

Did you do a calibrate_linear with an empty tank value and a full tank value?

Using my current setup with an ADS1115 and current to voltage module, I’m using something like this

- calibrate_linear:
  - 0.210 -> 0
  - 0.810 -> 1.565

No, I have not carried out a calibration. That would certainly have been better.
Our tank has an overflow and I know its height above ground. I use that as a reference.
For example, the water in the tank is currently overflowing. The water level calculated via the current sensor matches the height of the overflow.
The calculation formula I used is empirical. Theoretically correct would be: (current - 4mA) / (20mA - 4mA) * 5m
However, the calculated value is constantly approx. 20 cm too low.
Perhaps, contrary to my assumption, my sensor is actually 20 cm above the ground. Could add the 20cm to the formula above.

Ok great, thanks for the clarification and insight!
Got myself an INA219 so will fiddle a bit

If someone is interested in a complete project description, I found this some weeks ago and it is running at home in our fountain water tank for some days now.
Wasserstand in Zisternen mit HomeAssistant, ESPHome und TL-136 Drucksensor messen - UPDATE! • nachbelichtet
(sorry, it’s in german only)

You definitely want to calibrate it. I used a spreadsheet and plugged in some values of the voltage and height to create a function to plug into the configurations.yaml.

1 Like

Thanks for this…
I need to try the INA219 that I purchased…

My current setup is still in place but getting random, large data spikes so hoping your solution may be the answer!

Is the ambient pressure tube on the pressure sensor exposed to gusts of wind possibly?

Nope - it’s inside an IP67 enclosure but the end is “open/not blocked”.
It’s the same enclosure where the 2 other wires from the probe connect with WAGO connectors to bare copper CAT6 outdoor rated Ethernet cable (only using 2 of the 8 pairs) - this then connects to the current to voltage converter which is ± 3 Meters away.

Here’s the random spikes that I’m talking about

Why are you using the Analog to RS485-modbus-RTU module as the ODY30A sensor has the RS485 version?

Is this cost related or sth. else?

I wasn’t sure how good their ADC was in the sensor, and figured having discrete units would let me swap things around more easily, also it was ~$10 more and for $5 I could have the ADC->RS845modbus with two sensor inputs (so saving $20 if I get another sensor).

Just a risk-minimisation approach, if I was ordering again I’d consider the RS-485 version but I’d find the datasheet first. Have you seen one?

1 Like

Has anyone considered using a HX710 based air pressure sensor and a dip tube into the tank? This sensor is pretty cheap, accounts for atmospheric pressure, works at 3.3v, measures up to 4m depth (40Kpa) and even has a 24bit ADC
https://www.aliexpress.com/i/1005003086288493.html

The only issue I see is the the air will dissue out the end of an open pipe over time, so it may be required that an air pump is used to purge the dip tube of water periodically to get a correct reading of depth

To save scrolling through almost 500 posts, can anyone tell me which solution in this thread is the most reliable?

TL;DR

Ultrasonics are cheap but harder to install and may be less reliable; throw-in pressure sensors are more expensive but easy to install and should be reliable long term.