Did you get the timeout issue resolved? By default the pulse time used for Ultrasonic sensors is 10usec whereas these sensors need 20usec (from the spec sheets). I changed this parameter plus the timeout parameter (default is 2.0m), but I was getting erroneous readings with the HC-SR04 above 1.80m.
No timeout errors since I made these changes months ago. Still to resolve in code the random readings I get when it’s actually raining (so the water surface is rippled) which really mess up the charts (negative levels and percentages creep in), and temperature stabilisation (tank level inflates a few percent through the day as it gets warmer).
Thanks, I didn’t know about the pulse time though it is in the docs I didn’t think to try it. I’ll give that try. Thanks for that. My tank is way smaller that 1.8m.
After a month of stable operations (still to resolve temperature-based variations, and stable readings when it’s raining), my level sensor started playing up two weeks ago - often reading a distance greater than the height of my tank, frequent time-outs, etc. I figured I had a moisture or corrosion problem, but after replacing the Wemos D1 mini and the sensor board and sensors…same problem!
My fix? Upgrade ESPHome and HASSOS to current versions. I was running 2021.08 versions, not on 2021.10 and everything seems good.
I’m using the JSN-SR20 (samre as HC-SR04 with 2x waterproof sensors), it has a much better range than the JSN-SR20:
I do multiple readings / calls presently, to return other calculations for litres and %full. I’d guess there’s an easier (smarter!) way to do this but I’m learning as i go!
Right now in the winter my pit is almost completely empty there is a little bit of water down there. The sensor however is reporting in that the pit is at 80%. I’ve drilled 2 different holes into the lid of my pit to try and figure out if maybe the sensor was hitting off of something else in there but I don’t think thats the case. I live in the US but I converted all of my measurements over to metric for this. My pit is actually 76.2CM deep but I knocked off the decimal and I figure that the exclusion distance is about 10CM which is about the highest level I’d ever like my water to get in that pit anyways. If it ever got above 70% I’d be worried. Thank you all in advance for your help with this.
And, have you confirmed that the distance measurement is working in prinicple? For example tried the sensor outside of your pit just against a wall? And if installed in the top of the pit, is the distance measured correctly in metres (i.e. without that lambda conversion)?
Please note that the sensor is still returning the actual distance, it just can’t measure correctly if the distance is outside its operating range, so in your case you would expect values up to ~0.76 metres.
You could then simplify the lambda:
Yeah I sit here at my desk with it and point it at various things in my office
So I took your code and its now returning that its 70% full which is still not right so I’m still poking around at it trying to determine what its issue is. Thank you for your help this.
ok so I think I figured out my issue. The minimum reading for the sensor is 23cm and with my tank being 76cm deep I think that I’ll either need to change over to the other ultrasonic sensors or see if there is some tweaks I can make to my formula to get a better reading.
EDIT: This is what happens when I work until some odd hour in the morning and my mind isn’t firing on all cylinders. The min reading has nothing to do with my tank depth ugh.
So still attempting to tinker with settings for this thing but its still reporting in that the measurement is 0.23m regardless of where I put the sensor inside of the pit. I’ve tried to lower it down to see if it would change, I’ve held it above the pit and that changes the value but there is something that is causing it to report 0.23m once its placed inside the tank regardless of where its at.
Hi all… Can you helm me somebody? I’m using ultrasonic sensor HY-SRF05 with ESP8266 i see only this Ultrasonic Sensor’ - Distance measurement timed out! I red this topic, but no clear answer. This is my config:
whats everyone doing, would be great to have a image of tank outline shown and then fill it based on % value passed in.
I’ve gone the RPi route with a HC SR04 sensor, with Python, pushing my values to mqtt (to be consumed by HA) and then also into a InfluxDB, which I can display with Grafana if I want to.
i need help with the setup referred above … i did the exact similar setup but the voltage value vary huge at different time of the day these below are the values i set the ESP home and before deciding to map each voltage to level i took the average value from 100 voltage levels at each stage as mapped below in the yaml
How can i make this sensor value report more accurate i feel that 50% of the time its not accurate even when the water level is stable or when water flushes inside the tank .
I am currently trying to figure out how to use this sensor. It does not work for me it seems to work for other people. Seem too many unknowns. I have a 2meter tank and when the water is VERY low it gives me a max reading of 1.1 instead off 1.87. So it seems reflection, tank diameter, and construction all play a role. Have to find another way to monitor levels.