The video is the reason why I love doing things from scratch, it is fun, and you can learn a lot, but also is there a similar cheap version already made that can be connected with an assistant? probably not, so you enjoyed doing it, and also you made a great gadget, nice job!
Hello again, ignore my last comment, I figured it out. For others who may need help, connect your VCC of the sensor, in my case, the Capacitive Soil Sensor V2.0, to one of the digital output pins of your ESP32 and then set it HIGH upon waking out of deep sleep mode and to LOW just before the ESP32 goes back to sleep. - Sleep for an hour - ESP32 wakes up - Activate the soil sensor - Read the level - Email or text if level is above ~580 - Deactivate soil sensor - Set ESP32 into deep sleep mode - Rinse and repeat every hour, day, month, whatever you set it to So far, my 3.7v 18650 li-ion, 400mAh has not even dropped and it's been running for a day, waking up every hour for now. Once I'm convinced it works, time to set it to a daily wakeup and put it all into a portable container. This video was awesome, btw !
Awesome, I'm glad you managed to figure it out, and yes, I haven't done this to mine yet but I will as it uses some power unnecessary. I was thinking about using a transistor to turn it on but your solution made me realize that I do not need to as it only uses a few milliamps. Do you maybe have the ESPHome configuration code to share?
yes, very good idea, do you have the yaml to manage the pin in ESPHome before sleep and after wake up ? i'm really not familiar with ESP-Home. Thank you.
I wanted to use it at first because I have plenty of them but the problem is that they do not have analog input. For things like I2C, they should be perfect.
The run time greatly depends on the duty cycle of the deep sleep. I'm still testing this but if it runs for 30 seconds every 3 hours, it should last for about 45 days.
A capacitive soil moisture sensor measures the dielectric permittivity of the soil, which is indirectly related to the volumetric water content. They use an oscillating electrical field to measure the dielectric permittivity of the soil. The presence of water affects the capacitance of the sensor, because water molecules align with the electric field, this changes the capacitance value. This change in capacitance is then correlated with the soil's moisture content, outputted as a change in voltage.
Hello all ! I have this running, however, the Capacitive sensor drains the battery even with the ESP32 is in deep sleep mode. Is there a way to "wake-up" the sensor when the ESP32 wakes up? (e.g. put both to sleep)
Hey, yes. What I end up doing is to power the sensor from a pin on the ESP. When the ESP wakes up, it powers the pin high thus powering the sensor only then. Once the measurement is taken, the pin is pulled low to turn off the sensor and it then goes to sleep.
Do yourself a favour and cover the pcb with hot glue or similar. Otherwise it will be destroyed by the humidity of the soil within 1-2 weeks. I "painted" them with hot glue and worked with a hot air gun to keep the layer thin :) Other than that - interesting project! p.s.: saw on second sight you covered the edge of the pcb. I coverd it completely including the smd components and drove it completely into the earth to have more accurate results.
Thanks, that is a nice suggestion. I've seen people using nail polish to cover PCBs. I guess I can add some hot glue to the board and spread it using my hot air gun. I'll see how it goes. As for the edge, yes, I covered it with epoxy so to prevent any ingress in the board itself. I was considering to cover the whole thing but I was worried that I might mess up the capacitance and the readings.
The video is the reason why I love doing things from scratch, it is fun, and you can learn a lot, but also is there a similar cheap version already made that can be connected with an assistant? probably not, so you enjoyed doing it, and also you made a great gadget, nice job!
Even if there is a commercial product thst is cheaper and better made, it won't provide the learning experience. Thanks for the great words! 👍👍👍
Hello again, ignore my last comment, I figured it out. For others who may need help, connect your VCC of the sensor, in my case, the Capacitive Soil Sensor V2.0, to one of the digital output pins of your ESP32 and then set it HIGH upon waking out of deep sleep mode and to LOW just before the ESP32 goes back to sleep.
- Sleep for an hour
- ESP32 wakes up
- Activate the soil sensor
- Read the level
- Email or text if level is above ~580
- Deactivate soil sensor
- Set ESP32 into deep sleep mode
- Rinse and repeat every hour, day, month, whatever you set it to
So far, my 3.7v 18650 li-ion, 400mAh has not even dropped and it's been running for a day, waking up every hour for now. Once I'm convinced it works, time to set it to a daily wakeup and put it all into a portable container.
This video was awesome, btw !
Awesome, I'm glad you managed to figure it out, and yes, I haven't done this to mine yet but I will as it uses some power unnecessary. I was thinking about using a transistor to turn it on but your solution made me realize that I do not need to as it only uses a few milliamps. Do you maybe have the ESPHome configuration code to share?
yes, very good idea, do you have the yaml to manage the pin in ESPHome before sleep and after wake up ?
i'm really not familiar with ESP-Home. Thank you.
Thank you !
You're welcome!
What do you think of using the ESP-01S with those expansion boards like RGB LED, DHT11, etc? I'm testing it with CR123A batteries.
I wanted to use it at first because I have plenty of them but the problem is that they do not have analog input. For things like I2C, they should be perfect.
How long does it run with one charge?
The run time greatly depends on the duty cycle of the deep sleep. I'm still testing this but if it runs for 30 seconds every 3 hours, it should last for about 45 days.
What does the moisture level correlate to? Is it volumetric water content?
A capacitive soil moisture sensor measures the dielectric permittivity of the soil, which is indirectly related to the volumetric water content. They use an oscillating electrical field to measure the dielectric permittivity of the soil. The presence of water affects the capacitance of the sensor, because water molecules align with the electric field, this changes the capacitance value. This change in capacitance is then correlated with the soil's moisture content, outputted as a change in voltage.
Hello all ! I have this running, however, the Capacitive sensor drains the battery even with the ESP32 is in deep sleep mode. Is there a way to "wake-up" the sensor when the ESP32 wakes up? (e.g. put both to sleep)
Hey, yes. What I end up doing is to power the sensor from a pin on the ESP. When the ESP wakes up, it powers the pin high thus powering the sensor only then. Once the measurement is taken, the pin is pulled low to turn off the sensor and it then goes to sleep.
Hi, have you tested it with espnow? Could it last longer since it doesn’t connect to wifi
No I haven't. It might be an interesting thing to explore but I guess it will also need a receiver.
Do yourself a favour and cover the pcb with hot glue or similar. Otherwise it will be destroyed by the humidity of the soil within 1-2 weeks. I "painted" them with hot glue and worked with a hot air gun to keep the layer thin :)
Other than that - interesting project!
p.s.: saw on second sight you covered the edge of the pcb. I coverd it completely including the smd components and drove it completely into the earth to have more accurate results.
Thanks, that is a nice suggestion. I've seen people using nail polish to cover PCBs. I guess I can add some hot glue to the board and spread it using my hot air gun. I'll see how it goes.
As for the edge, yes, I covered it with epoxy so to prevent any ingress in the board itself. I was considering to cover the whole thing but I was worried that I might mess up the capacitance and the readings.