If you go down this path, be aware the “1/8NPT” thread is a tapered thread so you can’t readily tap something and fit this in - I wasted hours finding this out. I fitted min to an ABS plastic Tee fitting and used the transducer to cut it’s own thread which makes it tight and waterproof. I fitted a baffle with a pinhole in it to minimise water flow pressure changes, but this isn’t good enough.
Dean, That’s the one I’m using. i bought from an Oz supplier and it came with the current to voltage converter. I have sent this signal through an ADS1115 though as apparently the ADC on the ESP32 is not real flash. Everything will be powered off a 5v supply with the sensor receiving it’s power from a dc/dc step up.
Have nearly finalised my bench testing and will be putting it into a box and throwing the sensor in my tank this week I hope. I have read that for the first two days I should have the sensor out to get my ‘empty’ tank reading calibrated. My tank is a 22000 litre and is located about 30m head above my house.
I fully intend a proper write up as this project has taken me nearly 4 years. I kept getting sidetracked into other brilliant integrations in HA.
Pat
I got mine from core-electronics. It’s a bit pricier than just buying off ebay. I reckon they might both come from the same supplier. Here’s one on ebay that looks exactly the same AU Submersible 0-5mH2O Water Level Transmitter Liquid Transducer Sensor 6 | eBay
You’ll find the current to voltage converters cheaper on ebay as well.
Pat
That sounds a little weird. If I dive into a pool and go to 3m the pressure is ‘x’’. If I dive into an ocean and go to the same depth my pressure is ‘x’ also (discounting salt effects etc).
The amount of water surrounding the depth should have no influence on the vertical pressure.
Pat
I’ll try and help out, and understand your confusion (been there!).
For more accurate water level reading, depending on your sensor type your build would be:
Pressure sensor (4-20mA loop) > current/voltage converter (0-5V output) > ADS1115 (analogue in, digital out) > ESPxxxx. OR
Pressure sensor (0-5V) > ADS1115 (analogue in, digital out) > ESPxxxx.
As you note the majority of these pressure sensors have a 0-5V, or a subset of that range, as it’s the simplest to read. Note that often the “empty tank” reading is a non-zero voltage (like 0.5V) so it’s easy to differentiate from a “my sensor’s broken” reading. You fix the offset with a filter / offset in code.
A voltage output is easy to read on an ADC, but if you’ve got a long-ish cable run from the sensor then you’ll see some voltage loss and need to calibrate your readings. On a long cable the drop could be enough that your sensor doesn’t work, but I’ve tried my 5V sensor at 3.3V and it’s worked fine so I don’t think the supply voltage loss over a 5-10m cable run is a concern.
Switching to a current loop (4-20mA) gets over voltage loss issues - these loops are very common in household alarm circuits with lots of PIRs using a current loop for movement sensing. But ESPxxxx devices don’t have a current loop interface so you’ll need to convert back to 0-5V to read it. Dfrobot helpfully throw one of these boards in knowing most people will need them.
While the ESPxxxx is great at many things, it’s not so great (apparently) at reading an analogue voltage input. I’ve never plotted it but others have noted non-linearity in the ADC conversion - so you may need to add a filter or conversion table to code if you’re really concerned. The ESP32 (Wemos clone board) should read voltages up to around 3.2V but mine seems to unhelpfully max out at 1.04V for some reason.
For water head, I wouldn’t care about being out a few % but seeing my tank level go UP when I’m using water (due to ADC non-linearity) would really bug me!
To add extra ADC inputs or to get more accurate readings, as @Patraff noted above you can add an external ADC module like the ADS1115 which has a load of analogue inputs and is quite linear, with it’s digital output connected to the ESPxxxx.
It would be SO much simpler if you could buy a pressure sensor with a one-wire or I2C interface, and read a digital output. I gave up using analogue temperature/humidity sensors years ago and have never looked back.