LoRa Mesh Sensors
![Screen Shot 2019-11-28 at 8.19.59 pm.png](/proxy/?url=https://content.instructables.com/F6Q/GR14/K3IC3HWV/F6QGR14K3IC3HWV.png&filename=Screen Shot 2019-11-28 at 8.19.59 pm.png)
This is the third in the series on Ripple LoRa mesh networks, now showcasing sensor nodes.
See the previous articles for reference:
Supplies
Hardware components can be purchased here:
Adafruit Feather with LoRa module: https://www.adafruit.com/product/3178BN-180
dipole antenna: https://www.banggood.com/Beitian-Smallest-Mini-Du...
Background
![Screen Shot 2019-11-28 at 8.52.13 pm.png](/proxy/?url=https://content.instructables.com/F0O/MJ5W/K3IC3IIV/F0OMJ5WK3IC3IIV.png&filename=Screen Shot 2019-11-28 at 8.52.13 pm.png)
Most Arduino sensor modules, like temperature, humidity, etc, can be queried either via digital or analog GPIO pin. For this article I have tested on a flame sensor, which uses both a digital pin (for when the sensor value triggers from potentiometer setting) and an analog pin.
Sensor module: https://www.banggood.com/3pcs-KY-026-Flame-Sensor-...
The goal of this part of the project is bringing dedicated sensor nodes into the Ripple LoRa mesh networks. You can either just remotely monitor sensors, or get alert messages when a configurable trigger condition is reached, like a flame being detected, or motion being detected, etc.
Wiring
Currently there are only two board types supported, with the following pins that the sensor module must be connected to:
Adafruit Feather:
* Analog pin: A1 (gpio 15) -OR-
* Digital pin: 10
TTGO/HELTECH ESP32 LoRa module:
* Analog pin: 39 -OR-
* Digital pin: 34
Most sensor modules can accept 3.3Volt, so you just need to also wire up the GND and VCC pins to the board's GND and 3.3V pins.
Flashing the Firmware
For this you will need to have installed the Arduino IDE, and support for the target board type.
There are instructions on how to flash the firmware on this Github page:
https://github.com/spleenware/ripple
Choose one of the 'Sensor Node' targets. With the board connected via USB cable, test that the firmware is OK by opening the Serial Monitor in the Arduino IDE. Enter 'q' (without quotes) in the send line, and press enter. The serial monitor should reply with text starting with "Q: ..."
Configure the Sensor in the App
![device-2019-11-24-151859.png](/proxy/?url=https://content.instructables.com/FQ7/9P4F/K3IC3HXR/FQ79P4FK3IC3HXR.png&filename=device-2019-11-24-151859.png)
![Screenshot (28 Nov 2019 9_14_19 pm).png](/proxy/?url=https://content.instructables.com/F4D/HOK2/K3IC3IYG/F4DHOK2K3IC3IYG.png&filename=Screenshot (28 Nov 2019 9_14_19 pm).png)
To configure the sensor module and to monitor it, you need to install the Ripple Commander app. Currently only Android is supported. Download from Play: https://play.google.com/store/apps/details?id=com....
The app has two launcher icons. The 'Device Provision' one is just for when you are setting up your mesh network (repeaters, sensors, gateway, etc). The sensor nodes just need to be assigned a unique Id (between 2 and 254), and have their encryption keys generated. Just click on the 'NEW' menu on the toolbar, and enter the Id and name for the sensor, then click SAVE. The sensor should now be in the main list.
For sensor nodes, there are extra configuration parameters to be setup. Tap on the 'edit' (pencil) icon, and then tap on the '...' button in the next screen to see the Sensor Config screen. (first screen-shot above). This is for setting up sensor, how it should report its status, and how to generate alert messages. Once the config is complete, tap on the SAVE menu in the top toolbar.
Tap on the 'chip' icon to the right, to go the 'Programmer' screen. Connect the sensor board via USB-OTG cable to the Android, then tap on the 'PROGRAM' button. If all goes well, then there should be a message saying 'Done', and that you can now disconnect.
Exit back to the Android launcher, then tap on the main 'Ripple Commander' launcher icon. This is the main UI of the app, where you can chat with other 'pager' users in the network (who use the Ripple Messenger app), plus monitor your special nodes, like repeaters and the sensor nodes. Tap on a sensor node in the list, and you should see the device status screen (see second screen-shot above).
Demo
![Ripple LoRa Mesh sensor test](/proxy/?url=https://content.instructables.com/FWD/8L25/K3IC3J6F/FWD8L25K3IC3J6F.jpg&filename=Ripple LoRa Mesh sensor test)
Here is a demonstration of the flame sensor activating an alert status, and the home node receiving the alert.
Note that the alerts represent a state which are 'reset' either manually or automatically after an elapsed time. The screen shown here offers a "Reset Alert" button for manually resetting the alert status.
The alert messages generated will make the the home node board buzzer sound, and the message will be in the 'History' tab.
Feedback
This capability, having sensors report remote states, and having alerts generated represents an extremely useful feature for these long range IOT networks. I am quite excited to hear of what can be done with this new capability, and how it has worked out. And, as always, I'm keen to hear if there are any problems still needed to be ironed out.
regards,
Scott Powell.