LowPowerLab Forum

Hardware support => General topics => Topic started by: noch on August 05, 2022, 10:17:18 PM

Title: Help with water leak sensor
Post by: noch on August 05, 2022, 10:17:18 PM
Hey,

I am working on some battery powered water leak sensors.  My plan is to hook moteinos to some regular "dumb" water leak detectors I already have, which is working out well to keep the build simple.  I am detecting a leak with two leads: One lead on an analog pin with a resistor bridged to a digital pin that is set high before reading.  The other lead is on another digital pin set low for a ground.  The analog reading drops when there is continuity.  I got the idea here: Arduino Wireless Water Leak Sensor : 7 Steps (with Pictures) - Instructables (https://www.instructables.com/Arduino-Wireless-Water-Leak-Sensor/).  Works great. 


My issue is, I didn't realize that 8sec is the max you can sleep and that is a lot of waking up to check for something that hopefully never happens.  I read some post about using different libraries to sleep longer, but I think using something like an interrupt would make way more sense if possible.  Any suggestions?  Thanks
Title: Re: Help with water leak sensor
Post by: Felix on August 08, 2022, 01:16:55 PM
If your Moteino runs with a RFM69, then see the ListenMode sleep example, sleep much longer than 8s and get an interrupt from the radio when done.
https://github.com/LowPowerLab/RFM69/tree/master/Examples/ListenModeSleep