Hello, im not sure, what numbers i need. Can you help me pls?
My tank:
Tank diameter 2,65m
Height from the bottom of the tank at which the sensor is 2m
hello I am soooo close,
I have been trying to find the right way to do this for a while now and i found your code yesterday. My results seems promising but i am positive the results are off.
I think something is wrong in my lambda filters but I can’t figure what part.
im using the HC-sr04 for testing but will use the waterfproof for realworld (automatic drip irrigation system)
from sensor to bottom of “test bucket”: 68cm
from sensor to max water level: 33cm (22cm away plus safety)
Here’s the important bit of my code, hope you or someone can help me:
lambda: return ((((x100)-33)-(68-33))/(68-33))-1000
I finally understand, the problem is that you left the value 1000l in the code. It is the value between the maximum amount of water and the bottom of the tank. So you have a 20 liter bucket set up as a 1000 liter tank. Try set -20.
Thank you for posting this. I’m a bit of a newbie and while I have a level sensor set up and measuring I have tried to compile the sketch you posted but fail.
Can you please tell me how you compiled the sketch.
Can someone help make my formula perfect?
I now have my new/“almostfinal” setup finished (sensor hooked up, tank, pumps, tubing flow sensor & flow limiter all in place.
Maybe someone can help me to make it even better.
so here are my infos:
EX: 8cm (sensor to max water level)
TD: 46 cm (empty bottom of tank)
TC:72 Litres (44cm deep (36cm max water level) by 40cm wide by 50cm long tank)
Minimum water level (so the pump is still submerged): 13 cm
I still get a 1% error and almost 1 litre error (not so bad but not perfect)
this is the empty tank snapshot:
heres my code:
sensor:
- platform: wifi_signal
name: "WiFi Signal Sensor"
update_interval: 60s
- platform: dht
pin: GPIO 13
model: dht11
temperature:
name: "Temperature_01"
humidity:
name: "Humidity_01"
- platform: ultrasonic
trigger_pin: GPIO 5
echo_pin: GPIO 4
name: 'Water tank Level'
unit_of_measurement: '%'
accuracy_decimals: 1
update_interval: 1s
icon: mdi:water-percent
filters:
- lambda: return ((((x*100)-8)-(46-8))/(46-8))*-100;
- sliding_window_moving_average:
window_size: 10 #creates a moving average of the last 10 values
send_every: 1 #sends the moving average at every measurement (but only if it passes the delta filter below))
send_first_at: 1 #after startup immediately start sending the result rather than wait for the first 10 measurements
- delta : 0.05 #only send the result if the level difference with the last sent result is higher than this
- filter_out: nan
- platform: ultrasonic
trigger_pin: GPIO 5
echo_pin: GPIO 4
update_interval: 2s
name: 'Water Tank Volume'
unit_of_measurement: 'l'
icon: mdi:cup-water
accuracy_decimals: 2
filters:
- lambda: return ((((x*100)-8)-(46-8))/(46-8))*-70;
- sliding_window_moving_average:
window_size: 10 #creates a moving average of the last 10 values
send_every: 1 #sends the moving average at every measurement (but only if it passes the delta filter below))
send_first_at: 1 #after startup immediately start sending the result rather than wait for the first 10 measurements
- delta : 0.05 #only send the result if the level difference with the last sent result is higher than this
- filter_out: nan
Thank you in advance for the help, also i want to give big thanks to everyone in this wonderful community for all the help and learning opportunities!
Thank you very much for nice project. Everything done like described. Everything is working, but… till power-cycle. After power cycle ESP not booting. Only reset (RST–>GND) help to boot again.
my config posted here was working and just stopped out of the blue, now the numbers are all off, and random it seems… connection times out… the whole thing just broke !
So I finally got around to installing this yesterday. I installed sensors on an 800 gal and 400 gal tanks. Here are some pics of my setup.
I also did a sensor calibration at different depths and noticed that as you measure further from the sensor the delta error increases (see table below).
Does anyone know how to apply corrections to output for errors that vary (maybe in lambda function)?
Just in case people in this topic haven’t seen it.
As an alternative you can use a pressure sensor. You just throw it in your water tank so that it drops to the bottom and for me it measures the water depth with a precision of about a millimeter!
Really!!! I cant seem to be able to figure out how to make it work for me!
would you mind sharing that part of your config, i’ve been pulling my on this for days now!
got this model:
I think we’re talking apples and pears.
You are looking for a solution that can measure flow rate.
What I am using is a solution that can measure pressure differences and translate that into water levels (how much water is in the tank).