This is best way to solve the problem.
If you leave air in the tube, you will never completely get rid of drift.
This is best way to solve the problem.
If you leave air in the tube, you will never completely get rid of drift.
Because if there is any water in the tube you will be measuring the pressure at the top of the water, not the bottom of the tube. And with an open end in water it will inevitably fill at least partially over time for various reasons.
When container is empty the pressure difference is zero.
Tube can be filled with air, water or olive oil, or combination of them, as long as there is no pressure inside the tube.
When you fill the container, pressure increases. It there is āminimumā leakage through the pipe or connections, the reading is not valid anymore.
if you want to measure from the top, consider this:
I have not tried it yet, but have been considering their one for soil.
Hello Karosm,
the issue has been resolved. The problem stemmed from the silicon hose that was not airtight. I replaced the silicone hose with a PVC one, and now it functions perfectly.
Thank you for your support.
I appreciated it very much.
Regards
Alexander
Hello mekaneck,
the issue has been resolved, at least for me. My problem stemmed from the silicon hose that was not airtight. I replaced the silicone hose with a PVC one, and now it works perfectly.
Thank you for your support.
I appreciated it very much.
Regards
Alexander
Hello clydebarrow,
the issue has been resolved. The problem originated from the silicone hose that was not airtight. I replaced it with a PVC hose, and now it functions perfectly. When the tank is filled, a few millimeters of water remain at the lower end of the hose. As long as air is trapped within the hose and cannot escape, a consistent equilibrium is maintained, primarily dependent on the water level in the tank. This method is more than sufficient for my motorhomeās water tank, as it empties every 4-5 days, making the dissolution of air in the water negligible.
Thank you for your support.
I appreciated it very much.
Regards
Alexander
Most likely it is just spurious returns from the ultrasonic sensor. I gave up on them due to thatā¦
Has anyone tried the 3.3V out 5V supply version of this?
https://vi.aliexpress.com/item/1005005928682318.html
I have a couple on order. Should be easy to connect to an ESP ADC i/p.
Yes I do.
Working for three years
Your version was not available so I went for 0-5v and used ADS1115 with 5v supply (to allow VIN to be measured to 5v).
Approx 25m cable and tank some 2m deep
Note that the small red tube is pressure equalisation; needs to be terminated in a dry āopenā terminal box. There are reports that that these units have failed. My suspicion is that humid air makes it way back down the tube from the top. Execution is everything! Also avoid kinks!
I do get some fluctuations but found that some fiddling with filters helped. It is accurate enough to estimate flow out of the tank. 6,750 litre rain water recycling tank
Not the 3.3V out 5V supply version, no. I do have two of these (0-10V, range 3m, 5m cable) connected to a couple of Shelly Uni (so the transducers are getting 3.3V). Working well.
I chose the 0-10V version for better resolution. As JulianDH notes, itās worthwhile filtering the entity. Iām using an outlier filter.
I have one of these units but purchased it through Newcastle vendor Core Electronics. Yeah I spent more but havenāt had an issue so happy so far. However mine is connected to a shelly uni. Absolutely gold - no fiddling with adcās and stuff. It really was plug and play - well almost.
I ended up running a 24v cable to the top tank to power the shelly and have now had 1 year trouble free operation. previously i was trying to have a solar and battery setup but that meant mucking around with trying to get my initial esp32 setup to sleep etc. Then when a few days of no sun in winter it meant that data was not being sent.
Look at the uni is my thoughts
Iāve been using a similar 4-20mA current loop one in a rainwater tank (with I>V converter into ESP32 ADC) for almost 3yrs now. First unit failed after a couple of years, hoping the second lasts longer.
Very happy with the performance. You can see small variations (+/-0.01V) in adjacent readings so best to sample then average / filter.
Ok Iām super impressed with this sensor. Itās still looks noisy even after averaging 20 samples every minute but I donāt think more averaging is needed. That 0.2% p-p noise is equivalent to about 1mm (over a 500mm depth). And I can see an awful lot through the noise:
I have a 500mm deep pond. I can see 0.5mm of evaporation on a cold but windy day followed by a rise of 2.4mm due to that exact amount of rainfall (before it slowly drains away out the overflow pipe).
Here is my YAML that seemed to help reduce the noise in my data:
sensor:
- platform: ina219
address: 0x40
shunt_resistance: 0.1 ohm
current:
name: "INA219 Current"
id: ina_current
accuracy_decimals: 5
filters:
- multiply: 1000 #convert from Amps to mA
- median:
window_size: 59
send_every: 60
send_first_at: 3
unit_of_measurement: "mA"
power:
name: "INA219 Power"
accuracy_decimals: 5
bus_voltage:
name: "INA219 Bus Voltage"
accuracy_decimals: 2
shunt_voltage:
name: "INA219 Shunt Voltage"
accuracy_decimals: 5
max_voltage: 32.0V
max_current: 400mA
update_interval: 10s
Thatās not for a water level sensor.
Iām currently using:
sensor:
- platform: adc
pin: GPIO33
name: "Pond Level V"
id: pond_v
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
attenuation: auto
update_interval: 3s
filters:
- sliding_window_moving_average:
window_size: 20
send_every: 20
send_first_at: 1
- or:
- delta: 0.5
- throttle: 180s
on_raw_value:
then:
- component.update: pond_level
- platform: template
name: "Pond Level"
id: pond_level
unit_of_measurement: "%"
device_class: ""
state_class: measurement
lambda: |-
return (id(pond_v).state);
filters:
- calibrate_linear:
method: least_squares
datapoints:
# Map from sensor to true value
- 0.075 -> 0.0
- 2.058 -> 100
- sliding_window_moving_average:
window_size: 20
send_every: 20
send_first_at: 1
- or:
- delta: 0.5
- throttle: 180s
The orāed delta and throttle filters ensure I donāt get flooded with updates unless the sensor is changing faster than the noise level.
I could sample 3 times as fast (1sec) and use a 60 sample sliding window but as I said that noise is equivalent to 1mm change in level. It only looks bad because of the scale of the graph. Compare with this:
It is for a water level sensor for my 5,000 gal holding tank. I originally used inches as I had been using a measuring stick to track the height in the tank when I was having well issues before making the smart device. I made a template sensor entity in HA to take the data from the INA to convert to height in inches & gallons:
From my configuration.yaml
template:
- sensor:
- name: "Water Tank Level"
unique_id: "water_tank_level_sensor_inches"
unit_of_measurement: "inches"
state: >
{% set height = ((states('sensor.water_tank_ina219_current')|float * 5.0663) - 24.86) |round(2) %}
{% if 0.000 <= height <= 72.000 %}
{{ height }}
{% else %}
unknown
{% endif %}
- name: "Water Tank Gallons"
unique_id: "water_tank_level_sensor_gallons"
unit_of_measurement: "gallons"
state: >
{% set gallons = (states('sensor.water_tank_level')|float * 68.522) |round(2) %}
{% if 0.000 <= gallons <= 6000 %}
{{ gallons }}
{% else %}
unknown
{% endif %}
I was just sharing what I did to get cleaner data compared to my initial attempt.:
Ok I see what you did now.
Why are you using an ina219 instead of the ADC?
Did you buy a 4-20mA version of the sensor?
Also you can do all that templating on the ESP. See my config above.
Yup I purchased the 4-20mA throw in sensor which at the time I understood needed the INA219.
I think I did it both in ESPHome and the HA Config to learn different things when I was setting them up. Itās been running great since then and havenāt found the need to change anything.
4-20mA is a good choice for electrically noisy environments due to the low loop impedance (usually ~200 Ohms). An INA219 is one way to do it. The other is a 160 Ohm resistor that will convert 4-20mA to 0.64V to 3.2V the ADC can read. However the internal ADC is a bit non-linear at the extreme ends of its range so you are better off with the INA219.