💬 Extremely Simple Arduino Pro-Mini LoRa Water Leak Detector
-
I further upgraded the demo script to demonstrate leak detection, as well as the TEST button being pressed.
You can easily adapt this test script to run your favorite brand of LoRa radio code. :)
-
Starting with MySensors Release 2.1.1, it appears this LoRa radio is now supported by MySensors:
"New transport layer: RFM95 (LoRa mode)" -
To get the most battery efficient operation, I recommend setting your atmega328p's fuses as follows:
BODLEVEL = DISABLED RSTDISBL = [ ] DWEN = [ ] SPIEN = [X] WDTON = [ ] EESAVE = [ ] BOOTSZ = 1024W_3C00 BOOTRST = [X] CKDIV8 = [ ] CKOUT = [ ] SUT_CKSEL = INTRCOSC_8MHZ_6CK_14CK_0MS EXTENDED = 0xFF (valid) HIGH = 0xDA (valid) LOW = 0xC2 (valid)Also, either use the mysensors bootloader, or else use optiboot_atmega328.hex as your bootloader: https://github.com/Optiboot/optiboot
-
Hardware works. Project completed. Insert your favorite brand of radio code, and you'll be good to go.
I uploaded version 11 of the TPL5010 test code. The way it works is this:
-
If you simply add the batteries, the unit will boot (giving two beeps when it does), and then it will wake up every 5 minutes after that. However, no LED will light, except during the initial boot.
-
So, to speed up the testing, hold down the "TEST1" button prior to (and during) inserting the batteries. Then release. This will wake up the pro mini every few seconds. However, the LED's still won't light to indicate each wakeup.
-
So, after step #2, press the "TEST2" button once. This will then flash the LED every time the pro mini wakes up. This confirms that the TPL5010 is correctly waking up the pro mini.
-
To confirm that the TPL5010 will reboot the pro mini if the pro mini becomes unresponsive, press the "TEST2" button again. This will put the pro mini into a tight infinite loop, making it unresponsive. Within a few seconds, the TPL5010 will reboot the pro mini.
That's it!
-
-
Photo of Version 16 posted:

-
To more easily conform to some of the existing LoRa libraries, I'm going to change some of the wiring....
-
Done! I'm very happy with Version 17. Files and photos are now uploaded.
-
For those of you who want an extremely simple build, I've reduced it to just 5 parts:
- one 1-megaohm resistor (0805 SMD)
- one Arduino Pro Mini
- one Ra-01 LoRa module
- Male header pins
- Battery clips
See photos.