We recently examined the use of the LoRa (Long Range) and LoRaWAN protocols to transmit and receive sensor data over a significant distance between an Internet of Things device with multiple embedded sensors and an IoT gateway in a post titled LoRa and LoRaWAN for IoT: Getting Started with LoRa and LoRaWAN Protocols for Low Power, Wide Area Networking of IoT. In this article, we’ll use AWS IoT, which offers a wide range of in-depth IoT services from the edge to the Cloud, to extend that design to the latter. We will use the AWS cloud platform to safely gather, send, and analyze IoT data.
LoRaWAN and LoRa
According to the LoRa Alliance, a significant fraction of the billions of devices anticipated for the Internet of Things will be supported by Low-Power, Wide-Area Networks (LPWAN) (IoT). To optimize LPWANs for battery life, capacity, range, and cost, LoRaWAN was created from the ground up. Long-range connection for IoT devices is made possible by LoRa and LoRaWAN across a variety of sectors. According to Wikipedia, LoRaWAN specifies the network’s system architecture and communication protocol, whereas the LoRa physical layer makes long-distance communication links possible.
According to AWS, AWS IoT is a collection of managed services that “allow applications in the cloud interface with internet-connected devices” and “enable internet-connected devices to connect to the AWS Cloud.” AWS IoT services include analytics, connectivity and control, and device software.
Three AWS IoT services—AWS IoT Device SDKs, AWS IoT Core, and AWS IoT Analytics—will be the subject of this post, one from each category. The AWS IoT Device SDKs, according to AWS, contain open-source libraries, development, and porting instructions with samples to assist you in creating innovative IoT products or solutions on your chosen hardware platforms. AWS IoT Core is a managed cloud solution that enables simple and secure communication between connected devices, hardware, and cloud-based software. To process and route messages securely and reliably to AWS endpoints and other devices, use AWS IoT Core. The last IoT analytics solution is AWS IoT Analytics, which gathers, pre-processes, enriches, stores, and analyses IoT device data at scale. It is a fully managed IoT analytics service tailored exclusively for IoT.
I suggest reading my most recent post, Getting Started with IoT Analytics on AWS, which was just published on Towards Data Science; if you want to understand more about AWS IoT, mainly the AWS IoT services, we will discuss this in this post.
The following hardware will be used in this article.
IoT gadgets with built-in sensors
Our Internet of Things gadget will be a single-board microcontroller from Arduino. The powerful nRF52840 processor from Nordic Semiconductors, a 32-bit ARM Cortex-M4 CPU operating at 64 MHz, 1MB of CPU Flash Memory, 256KB of SRAM, and a NINA-B306 stand-alone Bluetooth 5 low energy (BLE) module are all included on the 3.3V AI-enabled Arduino Nano 33 BLE Sense board (Amazon: USD 36.00), released in August 2019.
The Sense has a large number of embedded sensors:
- The 9-axis inertial sensor (LSM9DS1) has 3D digital linear acceleration, angular rate, and magnetic sensors.
- Temperature and Humidity Sensor (HTS221): a digital capacitive sensor for temperature and relative humidity
- Barometric Sensor (LPS22HB): 260–1260 hectopascal MEMS micro pressure sensor (hPa) digital output absolute barometer
- MEMS audio sensor omnidirectional digital microphone (MP34DT05).
- Advanced Gesture detection, Proximity detection, Digital Ambient Light Sense (ALS), and Color Sense are all features of the Gesture,
- Proximity, Light Color, and Light Intensity Sensor (APDS9960) (RGBC).
- Arduino Sense is a suitable, inexpensive single-board microcontroller for learning about the gathering and transmitting of IoT sensor data.
TechTarget defines an IoT gateway as a hardware or software component that connects controllers, sensors, and intelligent devices to the Cloud. The Gateway, which may either be a specialized hardware device or software application, is where all data traveling from the local network to the Cloud or vice versa passes.
The Things Network says that LoRa Gateways act as a connection between devices and the Cloud. While the Gateway connects to the Cloud using high bandwidth networks like WiFi, Ethernet, or cellular, devices connect to the Gateway using low-power networks like LoRaWAN.
Our LoRa IoT Gateway will be a third-generation Raspberry Pi 3 Model B+ single-board computer (SBC). A 1.4GHz Cortex-A53 (ARMv8) 64-bit quad-core System on a Chip (SoC), 1GB LPDDR2 SDRAM, dual-band wireless LAN, Bluetooth 4.2 BLE, and Gigabit Ethernet are included in this Raspberry Pi model (Amazon: USD 42.99).
Modules for LoRa transceivers
I utilized the REYAX RYLR896 LoRa transceiver module to transport data from the embedded IoT sensors between the IoT device and the IoT gateway (Amazon: USD 19.50 x 2). Commonly known as a global asynchronous receiver-transmitter, the transceiver modules (UART). A UART is computer hardware that enables asynchronous serial connection and allows for adjustable data formats and transfer rates.
The Semtech SX1276 long-range, low-power transceiver, according to the RYLR896’s maker REYAX, is within. The RYLR896 module minimizes current consumption while offering ultra-long-range spread spectrum communication and exceptional interference protection. A little helical antenna that is PCB integrated is included in each RYLR896 module. Operating in the 868 and 915 MHz frequency bands, this transceiver. We will be using 915 MHz for North America in this presentation.
Using one of the RYLR896 modules, the Arduino Sense (an Internet of Things device) communicates data (shown below). The other RYLR896 module (seen below rear), linked to the Raspberry Pi (IoT Gateway), gets the data.
Security for LoRaWAN
The RYLR896 has AES 128-bit data encryption capabilities. We will encrypt the data transferred from the IoT device to the IoT gateway using the Advanced Encryption Standard (AES) and a 32 hexadecimal password (128 bits / 4 bits/hex digit).