Im looking to set this up in my oil tank so very similar set up except that my tank is a cylinder and it’s lying on its side, which makes converting the distance from the sensor into a volume not that straight forward. I’ve found a formula online to do the calculation but im not sure how to write the c++ for the lambda to include operations like cos-1 and square root. Does anyone have any pointers? Im assuming I’d need to inlclude some additional libraries to be able to use those functions?
Any tips welcome!
I guess I’ll start off with something like:
-lambda: return //need to find out how to use square root and acos here ;
I’m just setting up a float senor using esphome in a similar way to you decribe. I’d really appreciate if you could just confirm the wiring for me? the float senor has two wires, how do these connect to d1 mini? Thanks
Has anyone tried using Time Of Flight laser sensors? I’m setting up rain collecting tanks around the garden as I’m trying to phase out using the brackish well for crops… Using cylindrical tanks that are too narrow to work with ultrasonic sensors and their 50 degree angle field of view.
Just ordered 4 of these: VL53L0X Time-of-Flight (ToF) Laser Ranging Sensor 940nm Breakout Modul - Hitam. These are fairly cheap at 3USD, are compatible with ESPHome, have a 27 degree FOV and seem very precise for distances up to 2m. I’m thinking of using these with ESP32’s so I can use these as Blutooth beacons at the same time. One tank may need solar power or a battery.
If I design a holder for these sensors in a 3/4 thread, I’ll post the link here.
I am using that sensor for my water softener salt level, works pretty well and is MUCH better than the sonic sensor I was using that had a lot of interference and bad readings when my dryer (sits right next to it) was running. I did have to take some measurements and use good ole slope to get my value to calculate how full it was, since obviously measuring from above. To go along with this, I do also use a couple of template sensors.
I am using a d1_mini though on the i2c bus, here is my ESPHome YAML
esphome:
name: softenerlaser
platform: ESP8266
board: d1_mini
wifi:
ssid: "wifissid"
password: "xxxxxx"
manual_ip:
static_ip: xxx.xxx.xxx.xxx
gateway: xxx.xxx.xxx.xxx
subnet: xxx.xxx.xxx.xxx
dns1: xxx.xxx.xxx.xxx
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Softenerlaser Fallback Hotspot"
password: "HotSpotPass"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "*******"
ota:
password: "****"
i2c:
sda: D2 # Light Blue
scl: D1 # Blue
scan: True
#Orange is 5v
#Brown is G
sensor:
- platform: vl53l0x
name: "Water Softener"
update_interval: 60s
unit_of_measurement: "Inches"
filters:
- multiply: 39.37
I’ve got one setup and ready to put on a water tank. Read that the max distance you can measure is 60cm, which would not work for me. Let me know how you fared.
Now stop me if this is a dumb idea or if I’m missing something basic (physics class was a long time ago), but is there any reason why I can’t pop a xiaomi temperature/pressure sensor in a condom and drop it in the bottom of a tank? Pressure range is up to 110kpa. That’s around 10m of water? https://m.gearbest.com/access-control/pp_626702.html
Nice idea, very imaginative. I think it could work and you would also have the temperature.
Don’t forget to tie a wire to pull the sensor up when you need to change the battery;)
Let me know if your experiment works as expected, please.
Does anyone who knows a bit about waterproofing under pressure and water permeability of materials (and knots?) have a view on whether a condom or balloon (maybe two?) will leak water for this idea? I guess we know that a knot in a ballon is quite air tight but I don’t know how these things will hold up over time (creep)? I guess a nice silicone sealant dip could do it too but would make battery replacemnt harder. Thoughts?