The Power of LoRaWAN

Saahil Barai
5 min readJan 22, 2021
LoRaWAN Node Connected to HC-SR04 ultrasonic sensor

At the beginning of winter break, I decided to focus my learning on the LoRaWAN Specification. What I came away with 5 weeks later was a fascination with the capability, potential, and current widespread usage of LoRaWAN. The LoRaWAN specification is a Low Power, Wide Area (LPWA) network, meaning the network is optimized for long range and low bit rate communications. The LPWA network enables efficient, battery operated nodes or “things” to connect to the internet. Most often these “things” collect data about the environment around them and relay the data back to a network server. What this architecture enables is a interconnected future where billions of nodes are collecting data and providing insight, efficiency and automation like never before.

The power of LoRaWAN lies in its potential to transform the way businesses of all sizes, and individuals interact with their environment. It allows for the creation of low cost, scalable, and easy to install networks whose use cases are only limited by ones imagination. Prior to starting my research, I was unbeknownst to the the countless creative use cases already being implemented. With a quick search in the LoRaWAN community, I came across an abundance of interesting use cases. LoRaWAN is being leveraged in industries such as Agriculture, Manufacturing, Security, Utilities, Waste Management, and Health Care. Particularly, I enjoyed reading about how LoRaWAN is being used in cattle tracking. This technology is enabling ranchers to track and detect anomalies in cattle behavior. By placing a LoRaWAN node on each cow, location and head motion data for each cow can be recorded and shared with the owner or a veterinarian. Upon detection of abnormal behavior through software analysis, the owner can locate and separate the cow, thus preventing infection amongst other cows.

Photo by Priscilla Du Preez on Unsplash

Another use case underscoring the adaptability and scalability of the network, came about in response to COVID-19. The current COVID-19 pandemic has created health and safety concerns that are being tackled and monitored through the use of Internet of Things (IoT) technologies and the LoRaWAN protocol. Companies are creating solutions to ensure social distancing, manage contact tracing, limit foot traffic, and to monitor temperature and air quality. This goes to show not only the range of problems being tackled by LoRaWAN and IoT, but how these technologies can be used as building blocks to solve problems of the future and optimize processes of the past. The potential is limitless.

LoRaWAN Architecture — Node (Arduino Uno), Gateways (The Things Network Indoor Gateway), Network Server (The Things Network), and Application Server (AWS IoT)

The final week of winter break, armed with my new learnings, I decided to build a node and connect it to a gateway. I began assembling my node using an Arduino Uno to collect data from my sensor and a LoRa module enabling my Arduino to send data packets to a nearby gateway. Using the Arduino IDE I programmed my node to send data packets at a specified interval. There is a helpful guide published on the LoRaWAN website that goes into further detail on this process. As there was not a gateway in my area already, I had to purchase and setup an indoor gateway. Setting up a gateway involves connecting your gateway to the internet so that the data packets it receives can be securely transmitted. To do this I used The Things Network. The Things Network allows gateways to connect to an open-source Network to exchange data with Applications. After getting both my node coded and gateway connected, I was ready to test my system. I was able to successfully transfer a pre-programmed packet of data from my wireless node to the gateway and eventually to a Console on the Things Network website. The console is setup to show data packets coming in and their respective payload. Now it was time to connect a sensor and have some fun. I decided to use an HC-SR04 ultrasonic sensor that measured distance. Over the next week, I utilized my system for a variety of use cases around the house. Using the distance measurement, I could check if our trash can was full, if the garage had a car parked inside of it or even how often I sit at my desk in a day. I enjoyed the ease with which I could setup the node and gateway. Additionally, this configuration was perfect for my house experimentation. I could connect a variety of sensors and integrate them into my system with minimal changes.

After getting the hang of things, I decided to integrate my current application with an external IoT platform. The primary reason behind this integration is so that I can permanently store the data packets and run analytics on the data I am receiving. I chose AWS IoT as my external platform because I wanted to get familiar with its features, but there are many others to choose from. A list of them and can be found on The Things Network’s website. Within AWS IoT, I setup my node as a “thing” using the appropriate keys. At this point, instead of using The Things Network console I was able to view the JSON payloads of my node through AWS. The next step was to store the data in a database so that each time I logged out of the console or AWS I could keep a copy of all the payloads I was receiving. DynamoDB was very useful for this purpose. I setup a rule that parsed my JSON payload for the fields I wanted to keep such as time, device ID, and the distance, and automatically stored them in a DynamoDB table. Each time my node now sent a packet, it was automatically logged into the table. Logging into the table, gives me the ability to act on the data, whether that be running analytics on the data or sending a text or email alert when a trigger condition is met.

The experience of learning about LoRaWAN and conducting my own experiments leaves me eager for an increasingly connected future. This mode of collecting information creates an influx of data that can be used to drive a more informed decision making approach or to create efficiencies within a specific process. Although my experiment was conducted on a small scale, I feel as though I am now equipped with the knowledge to tackle larger problems relying on the Internet of Things and the LoRaWAN protocol.

--

--