Hey all - I got everything hooked up today for testing and I’m not sure I’m getting a correct reading. I have the sensor in a 3-gal jug and it reads the same voltage (0.09570v) fully out or fully submerged. Is that just not enough depth to get a proper reading? It’s evening here so I can’t go out and test at my water tank.
Also the current to voltage board that was provided gets very hot, has anyone else experienced this (@teich ?)
Also after reading the specs the sensor operates at 12-36v, so I nixed the 24v step-up and am just powering it with 12v.
Update: I dropped the sensor in my water tank and again the voltage was basically the same from top to bottom of the tank. I might have blown the current to voltage sensor when I momentarily hooked it up incorrectly so I have another one on the way.
there shouldn’t be any heat - that sounds like mixed up wiring. Double (triple?) check everything. I had the same symptoms at first - not getting variation. Turns out I had made a mistake (don’t remember anymore what).
I was afraid I had fried it, but it turns out OK.
Check where your 12V vs 5V is, make sure the wires are exactly as diagrammed, etc.
Turns out I had wired things incorrectly and in the process fried the current to voltage sensor. Thankfully that was my hunch and a new one arrived yesterday and now it’s reading correctly!
I got everything wired up and in a waterproof box. I want to post these details below for folks who want to run this off a battery. The sensor pulls current regardless if you’re taking a reading from it or not, so you can use a relay controlled by your ESPxx to give it power. I have my ESP8266 turn the relay on on_boot and it automatically turns off when I put the ESP8266 into deep_sleep I only take a reading every 2 hours but it could probably be every 6-hours, we’ll see what kind of data i get back.
Below are some photos and the code I’m running on my ESP:
@hummingbear, thank you for sharing your solution. If you cut-off the power from ESP to curent-valtage converter for power saving then I think (not sure) that this does not impact the current which flows through the sensor (4-20mA). If you read the data every 2 hours this means that for most of the time that current id not used. In order to “save” it your relay should connect/disconnect power to sensor. But then I am not sure how much time sensor need after getting power to give reliable readings. Looking forward for data you are getting…
I have installed mine and during test the current measured with multimeter was quite stable. After connecting the sensor to ESP8266 via simple 100 Ohm resistor measurements are not that stable and can vary even 10% - example below of 24 measurement:
Maybe it is related to the fact that noew the sensor is not in water ? Or maybe your current/voltage converter is better the simple resistor ?
Will do some more testing and we will see.
I was using very similar sensor VL53L0X and had the same challenge that water vapors from hotter liquid was condensing on the laser (which in my case is half the year always colder then the liquid) and measures were not correct.
@Maco65 hmmmm, I’m not quite sure I follow you. The relay most definitely does cut off the power going to the sensor. The sensor is wired up directly to the battery through the current to voltage convertor, but the positive goes through my relay. The only wire going to my ESP from the sensor is the analog wire which is not drawing power when the ESP is in deep sleep.
I’m glad to draw up a schematic if that’s helpful.
I run my ESP to take readings for 90 seconds - I take the median of every 10 readings. I’ve been getting very stable and consistent results.
Apologies - for some reason, looking at your picture, I have mixed sides of relay board… Yes, your connection looks as intended and cuts the power off the sensor.
I do not have issue with power so I am measuring every 2 minutes and averaging over 10 measurements. Still for last 24 hours it does not look super stable:
That setup looks great. I’m curious what size (AH) battery you have connected? With your relay controlling power to only come on intermittently I’m assuming it would last a very long time regardless. I am thinking about doing something like this but connecting a solar panel to keep the battery charged. Do you know or are you able to measure how much power your system uses if it were operating constantly? I figure if it was being charged by the solar panel there wouldn’t be much need for the relay switch. I am just trying to figure out what size battery/panel combination I might need.
I had a sealed lead acid battery a friend gave me for free, so I’m using that. It’s 6Ah@12v. The staff on DFRobot said the sensor consumes 30mA, so that + the ESP is how much you want to account for.
I think if you have an appropriately sized panel you’d be just fine. My water tank is in the shade so sadly it’s not an option for me.
A few things I’ve learned about power saving with the ESPs is that the versions with a USB Micro plug take up a lot of power even in deep sleep. So if you want one that’s going to last, get one without the USB plug and use your own serial adapter to flash it. Secondly that if you hookup any sensors so the VIN or 3V pins, it will still power them in Deep Sleep, so it’s best to use a GPIO pin as the lead for a sensor and program the ESP to turn it on when it wakes.
@teich I would like to have the ESP8266, the “Analog Current to Voltage Converter” and the power supplies indoors, to protect them from the elements and also to ensure WIFI signal. So basically only the pressure sensor would be outside (in the water tank that is).
I see the provided cable is only 5 meters long. Do you know whether it’s possible to extend that and how?
There might be some voltage drop depending how long you want to extend it, but I’m guessing the readings would all still be relative for the most part.
Why not just put it in some kind of waterproof box? That’s what I did, seems easier than extending but idk you’re setup.
Thanks for the tip! Well my outdoor wifi signal isn’t great, so by placing it inside I would not only protect it from the weather, but also ensure connectivity.
Alternatively I could buy one of those POE-capable ESP32 boards so that I can use an ethernet cable rather than wifi, but that seems a bit complex.
I used an ESP8266 that let me attached an external antenna. My ESP is about 800ft away from my Wifi through trees, with the antenna it works great. You can see it in my post here
You have to move a resistor on the chip to enable the external wifi which is annoying.
I believe there should be no problem with extending (or shortening) the cable. The readings are related to current (not voltage) so the voltage drop in the cable should not matter. To be 200% sure I would do the test before mounting in the final destination: With some tank or barrel without extension and with extension (on the same water level).
@nickrout, @Maco65, @hummingbear thanks for the helpfull advice! I think I’ll try with a sufficiently thick wire. I have a tube running from my garage to my water citern, but the thicker the wire the lower the chance I will be able to pull it through the tube. Unfortunately there thickness of the 5m cable attached to the sensor isn’t specified. Any clue about what geige those strands of wire are?