Hi folks,
I need help again from my electronics friends over here...
In a desperate attempt to simplify my home automation setup, I have replaced all my electronics in the last 2 years by Shelly devices. I only need to replace the liquid (i.e. oil, water, ...) level measurements in my tanks my Shellies.
Did test some sensors in the past, and at the end I had decided to go for pressure measurement. Had some good accuracy with ultrasonic sensors, but they appeared to be useless in some of my use cases due to reflections of the signal (since these sensor have a wide angle). Anyway don't want to discuss all the sensor types, because I bought mine already....
The tanks are underground in the garden and out of reach for my WIFI network. So I decided to put these Shellies indoor inside my big IOT closet, where lots of other Shellies are installed. Which means the sensor needs to be connected to the Shelly, via a long cable:
The cable is quite long, and runs through a series of cable ducts together with other cables (running all kind of signals). To avoid distortions on my signal, I decided not to go for an output of 0-10V but instead 4-20mA. So the output current of the sensor changes (instead of the output voltage), which should be less influenced by distortions. It is an industry standard, so I assume it is also good enough for my purpose. It is not a 0-20mA sensor, because the first 4mA are used to power the sensor.
So I bought this sensor last year from Aliexpress:
Then I needed to be able to convert the output current to an output voltage (to be able to read it with an ADC), for which I bought this device (model HW-685):
This converter eliminates the 0-4mA part, because otherwise the lower part of my output voltage would be not relevant. Which would decrease the accuracy of my measurement (see further).
Then I had to select a Shelly, that has an embedded ADC converter to read the analog output voltage. There are 3 different Shelly devices available:
-
Shelly addon (datasheet):
Voltmeter range: 0 to 10 V
Voltmeter report threshold: 0.1 V -
Shelly Uni (datasheet): found on a forum discussion this info
“The Shelly UNI has no special ADC chip but uses the two ADC incorporated in the ESP32 processor. These ADC have a resolution of 12bit (4.096 steps) each” -
Shelly Uni Plus (datasheet):
I had build last autumn the Shelly addon with a test setup where I had a vertical pipe of 4 meters long filled with water. The results for that pressure sensors are very good:
- The accuracy of the sensor is very good (i.e. more than good enough for my use case).
- The output is linear (i.e. output current vs liquid height), which will simplify my calculations inside Node-RED.
However the Shelly addon only provided me a lousy accuracy of steps of 4 cm. Which afterwards seemed logical because I had set the output of my current to voltage converter board to 0-10V (other options are 0-3.3V or 0-5V), to match the analog input voltage range of the Shelly addon. As a result, the accuracy is 0,1V, which is 4 cm (while I had hoped to get an accuracy of 1 cm). Since this is useless for my purpose, I had to abort my test at the end
I would really like to get this up and running soon, but I have no idea how to continue with this. From the Shelly forums it looks to me that the Shelly Uni and Shelly Uni Plus devices have a much better ADC accuracy. And I want to keep the wiring as simple as possible:
-
I don't know if I need that converter board. Because it needs some calibration from time to time if I understand it correctly. Don't see my wife and kids do that if I would not be around here anymore... Perhaps I can replace the board by some simple resistors or something else?
-
There is also the powering. The pressure sensor needs 24VDC, while the converter board needs between 5 and 12 V (in contradiction to the voltage range mentioned in the chinese docs: otherwise it will burn...). And the Shelly Uni or Uni Plus also have other power ranges (which are not clear to me from their docs). Bit too much of different voltage ranges for me to see the entire picture
Would be nice to keep the number of power sources low, to keep the wiring as simple as possible...
Long story, lots of details. Thanks for reading, and for any help!!
Bart