Summary and Next Steps
In this tutorial you have built and configured, end-to-end, a LoRa® device that broadcasts a reading from an analog soil moisture sensor. The device has been registered with the Semtech Network Server and the broadcast message, received by a configured gateway, appears in the events console.
You can improve the device you have built by configuring the message to broadcast only if certain threshold criteria are met for the sensor reading. For example, you might want to send a message only if the moisture sensor reading value is above a certain level, or if the value has changed from the previous reading.
You could attach multiple sensors to the same device; for instance, you might want to know the moisture reading as well as the temperature and lighting levels. The device could then be configured to broadcast a payload containing the current readings from all the sensors, or only broadcast if a series of criteria are met, e.g., only broadcast if the moisture level is below a certain threshold and the temperature and light levels are above some other thresholds. Update the Device Profile Payload codec so that each reading is decoded in the events console. Recalculate your broadcast delay time if you increase your payload size.
If you are planning to build multiple LoRa devices, the ESP32 microcontroller can be used to build devices in a very similar way. There are many manufacturers of ESP32 boards, some with LoRa devices built-in. These boards are considerably smaller and cheaper than Arduino boards, but often require some soldering to get started. The boards can be programmed using the same LMIC library, and should simply require the pin mapping to be updated. The ESP32 boards also have built-in deep-sleep methods, allowing you to easily set sleep time between broadcasts or have the device sleep until an interruption is triggered by one of the sensors. Putting the board to sleep between broadcasts is good practice and highly recommended for extending the battery life of the LoRa device.
Now that you have a LoRa device broadcasting messages to a third-party network server, you can design and develop your own dashboard or app.