💬 Extremely Simple Arduino Pro-Mini LoRa Water Leak Detector
-
-
@NeverDie - Nice one! Like thats its lora radio if you want to use it in a remote shed or something!
-
@sundberg84 said in LoRa Pro-Mini Water Leak Detector:
@NeverDie - Nice one! Like thats its lora radio if you want to use it in a remote shed or something!
Yeah, the link budget is just incredible.
I'm surprised these Ra-01's never became popular on this website. It's the same Semtech chip that's in the HopeRF LoRa module, but at a fraction of the cost and with better shielding. In fact, it has a variant of the RFM69 FSK radio in it as well, so you could use just that even.
-
I just now uploaded Version 4. I decided to keep it simple, so this will (hopefully) be the final version.
-
I just now uploaded Version 6. I changed the board layout to avoid some physical clearance problems that manifested in the Version 4 board, and I added a test button and a buzzer. I also increased the size of the pads for the battery holders so that the soldered connections should now have greater mechanical strength.
-
Not sure, but it looks as though perhaps an ESP32 LoRa could be used as a gateway:
https://www.aliexpress.com/item/LoRa-ESP32-0-96-Inch-Blue-OLED-Display-SX1278-Bluetooth-WIFI-Lora-Kit-32-Module-Internet/32829056144.html?spm=2114.search0204.3.2.QrI4pf&ws_ab_test=searchweb0_0,searchweb201602_4_10152_10065_5000015_10151_10344_10068_10130_10345_10324_10342_10547_10325_10343_51102_10546_10340_10341_10548_10545_5130015_10541_10084_10083_10307_5690015_10539_5080015_10312_10059_10313_10314_10534_100031_10604_10603_10103_10605_10594_5060015_10596_10142_10107,searchweb201603_25,ppcSwitch_4_ppcChannel&algo_expid=f6591117-6a7c-473e-af12-bb606196f59c-0&algo_pvid=f6591117-6a7c-473e-af12-bb606196f59c&rmStoreLevelAB=0
-
I received the version 6 board today and assembled it. It is completely free of the clearance issues that were quite noticeable in the previous version.
-
Thanks for sharing. Is it possible that you post the schematic, and is it now useable with mysensors ?
-
@ranseyer said in Arduino Pro-Mini LoRa Water Leak Detector:
Thanks for sharing. Is it possible that you post the schematic, and is it now useable with mysensors ?
The board was so simple that I free-handed the PCB without doing a schematic first. Diptrace allows that. So, sorry, there's no separate schematic on this one.
I've been distracted with other things, so I haven't yet fully tested it. Once I've confirmed that it's working, then I'll remove the work-in-progress moniker.
-
I just now uploaded Version 7.
What changed: I rotated the buzzer 90 degrees to provide much better clearance between the pass-through of the buzzer leads and the batteries.
-
@ranseyer said in Arduino Pro-Mini LoRa Water Leak Detector:
Thanks for sharing. Is it possible that you post the schematic, and is it now useable with mysensors ?
I just now uploaded a schematic. I've made a few upgrades to the project, which are shown in the schematic but not yet reflected in the gerber files:
-
Uses a TPL5010 as an external watchdog timer. This chip consumes just 35na, so it is far more energy efficient than the atmega328p's built-in watchdog timer. Also, it will reset the pro mini if the pro mini ever becomes unresponsive.
-
Uses a TPS22860 to drive the buzzer. I've done some experiments, and the buzzer is louder if driven by a load switch than if the buzzer is driven by just a pin on the pro mini.
These changes should make the project both reliable and "bullet proof".
-
-
I just now uploaded the files for Version 12.
-
I just now updated the BOM so that it reflects the current design.
-
I just now uploaded version 14. Changes: added a 100K pullup resistor and a 0.1uF bypass capacitor, both used by the TPL5010.
-
I just now uploaded a demo sketch which demonstrates that the TPL5010 external watchdog is functioning correctly by:
- Showing that the TPL5010 can periodically awaken the sleeping Pro Mini, and
- Showing that the TPL5010 will hardware reset the Pro Mini if the Pro Mini becomes unresponsive.
-
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.
-
What a nice design you have created
-
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:
-
16 versions! Impressive iterative work to get the perfect result.
-
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.