They are well known for their “capacity” to get corroded when constantly energized. To avoid this and extend their lifespan, some Arduino or RPi implementations use an interval reading (IE: every 20 minutes).
I’m using an ADS1115 DAC with a Wemos D1 mini to get the analog reading into HA. Like so (just reading the voltage for now):
There’s an option update_interval option for the ADS1115 component:
That’s interesting, but not sure if that will make the ESP module read the analog value every x seconds, while the probe is constantly energized (which I want to avoid) or both. Assuming this will not be the case, but well, I just wanted to make sure.
I used one of these a few years ago. What you need to do as power it from an output on the ESP so you can completely turn it off when not taking samples. Simply changing the update frequency doesn’t achieve the goal.
You can then create an internal ESPhome automation to cycle the output and power the probe on for say 60 seconds every 10 minutes or whatever timeframe you choose.
When the probe has no power you will get some crazy value as the analogue reading so need to include a filter to stop that coming through to ruin your readings.
While I wait for the capacitive sensors (which use a different method, but output an analog signal), I’m trying to convert the voltage reading from the probe to percentages.
0.36 is when I put the moisture meter in very water drenched soil.
0.8 when I had my meter in the air.
I used the internal adc on my d1. Which is very noisy so I filter it .
This is why you need to power them up only when taking readings. When I previously used one of those sensors I had the power coming from a digital output of the ESP. The output would be turned on only for 30 seconds every hour of whatever it was I had programmed. That was enough time for the sensor to stabilise and give a reading to HA, then turn off. Having them permanently energised destroys them very quickly as you have discovered.
They come already sealed with housing and batteries.
The chip is a ESP32 S2, so ESPHome and the like can be used.
I had to drill a hole in the housing to get access to the USB-C charging plug though, but I made it shaped so I could buy USB-A protection plugs and use them to “splashproof” it a bit.
I then bought a 5 port USB charger, so I could a group of plants at the same time. It takes a few minutes to be done.
I am currently looking into using ESP-Now instead of Wifi to lower the power usage.
Are you still using these sensors? If so I might have two follow up questions: how is your battery life, and how do you interpret the raw values coming from the sensor? (i was using this to get the raw values, wondering what your yaml is like)
I am still using mine, but I use MQTT to get them into HA.
I hard code the limit for the sensors into the code by reading the values for totally dry and then for dipped into a glass of water.
These are then used to calculate a percentage that is transmitted.battwry life is around 4-6 months, but I only transmit once a day and use ESP-now to get the power usage as low as possible. This prevents the use of ESPHome though.
A capacitive sensor is not that special, so I see no reason why it can’t be used with other single board computers.
The product I linked to contains the sensor and the ESP32 module on the same circuit board and comes with a case and battery that fit that case.