Soil Moisture Sensor Powered by solar charged battery



  • A seemingly simple project that employs some challenging programming techniques: calibration, power failure recovery, low power usage, two way communication with Home Assistant, 3D enclosure and more ...

    See Remote, Solar Powered (with battery backup) on github for more details

    This device is a soil moisture sensor that determines a relative number between 0 and 100 indicating completely dry to entirely wet. The number is sent to a controller for further analysis and/or action. It is battery powered and the battery is recharged using a small solar panel. The device is required to be calibrated and the calibration routine is part of the software.

    The components are: a soil moisture sensor, an Arduino Nano with an nRF24 radio, an 18650 Li-Ion battery, a charge controller board and a solar panel. The housing is made up of 3D printed parts.

    This device is part of a system that also includes a gateway and a controller.



  • What components are you using for the charge controller and the battery?

    For the 3dprinted enclosure, what are you planning to do to keep it water tight?

    I had a similar project last year but instead of the soil moisture sensor, I was using it to turn the water on/off to water the garden. That one needed a little more juice to trigger the locking solenoid valve so I had to do a 2s 18650 setup.

    I see in your notes in the code that smartsleep didn't work for you?

    I actually thought smartsleep with home assistant worked pretty well. What did you run in to?



  • @CrankyCoder

    TP4056 Charge controller Not exactly designed for it, but it works.

    The sealant was liquid tape If I have to open it up, I just score it with and exacto knife and after reclosing, more liquid tape. Note also I use a clear lacquer spayed onto the electronic parts (after soldering) to minimize corrosion. I also put in one of those desiccants you find in vitamin bottles. Have a look at the spreadsheet Bill-of-Materials

    My sample period is 1 hour. If I'm sending a message from HA to the Arduino it takes two hours to get there, if it gets there at all. Fortunately, the only message I would ever send is to change the sample period.

    What is the locking solenoid valve you use?

    I've thought about putting smarts on my valves instead of the RPi and relay board. I have wires going to all of my 20 valves (non-trivial 5 x 5 "cross-bar", gravity fed, 9 terraces, 3 micro-climates) My environment is very sunny and corrosive (coastal) so I have 0 pressure brass valves.

    What I was thinking was a tasmotized ESP01 relay with a 24VAC to 5VDC power supply. Then only two wires for the power are needed. The device could also be used when that last spare irrigation wire breaks.

    I run HA in a VirtualBox in Ubuntu on a refurbished tower. Mosquitto is also running on that computer as well as my valve controller frontend SIP (Sustainable Irrigation Platform)



  • @OldSurferDude Yes, the TP4056 part works.



  • @OldSurferDude I use this. https://www.homedepot.com/p/Orbit-Solenoid-for-Battery-Operated-Timer-57861/203151515

    Instead of having to hold the valve open, i can just pulse it. I use a simple motor controller to pulse it and when i need to close it, pulse it in "reverse". That way I could use a battery and if it only opens once or twice a day it's only a half a second or so of draw off the battery.



Suggested Topics

35
Online

11.5k
Users

11.1k
Topics

112.9k
Posts