Lora-WAN Powered by Renewable Energy, and Its Operation with Siri / Google Assistant

Abstract


Introduction
LoRa WAN is a ground-breaking technology based on spread spectrum modulation techniques derived from chirp spread spectrum technology which was developed by Cycleo of Grenoble, France and later acquired by Semtech which led to the development of the LoRa Alliance [1]. LoRa WAN technology had quit an impact on the WSN as it eased its application by creating a truly wireless system to send the collected data directly to the closest gateway wirelessly which made it possible to get rid of the node to node data transmission from source to destination in a WSN. LoRa WAN can be used with various sensors and devices like the Raspberry Pi, Node MCU and almost all Arduino supported devices. LoRa WAN was created to overcome the need of an internet connection or a physical connection and its hurdles for long distance transmission of sensor data, this doesn't mean that it wouldn't cause hurdles for laying and using physical electric power supply connections which may also be vulnerable to power failures. To overcome these convectional power supply issues we could make use of a reliable non-conventional energy source such as Piezoelectric and Solar power. To control the LoRa node ON and OFF Siri / Google Assistant is used. The frequency at which LoRa WAN communicates is different for each country, the frequency band that is bound to be used in India is IN865.

A. Ideas and Related Fields
As we know that LoRa WAN is a widely used trend in the wireless communication technology for sending small data packets of ~ 50 bytes or less up to a distance of 10 km without an internet connection and the connection works as a direct handshake from one device to another device using a specific radio frequency channel. In the year 2015, Kaur N and Balguvhar S proposed the use of an embedded Piezoelectric Transducer (PZT) patches in Structural Health Monitoring (SHM) which can also be made use of to harvest energy and can be stored to a capacitor or even a battery which can later be used for the purpose of SHM, the same PZT patch and a Concrete Vibration Sensor (CVS) was used as sensors, they also showed that the picoelectric activity from the vibrations caused by the bridge and the produced energy can be harnessed to power up tiny devices with or without a battery [2]. In the following year 2016, Francesco Orfei, Benedetta Mezzetti C and Francesco Cottone presented a way to power up a LoRa based device which can monitor the road condition by measuring the temperature of the asphalt and its water presence using an electromechanical energy harvester, three loggers were installed at the start, middle and end of the bridge, which works without the need of a battery or any kind of storage cell [3]. In the same year Andrew J Wixted, Peter Kinnaird, Hadi Larijani, Alan Tait, Ali Ahmadinia and Niall Strachan proposed that the LoRa WAN technology is a reliable link and a proper communication channel for remote sensing applications after conducting various tests and evaluations conducted over the Central Business District, Glasgow city in Scotland [4]. In the same year Dustin Pieper, Kristen M. Donnell, Omar Abdelkarim and Mohamed A ElGawady proposed a way to perform SHM (Structural Health Monitoring) using many test cases like microwave nondestructive testing (NDT) as those sensors which are based on the frequency selective surface (FSS) principles has an application for SHM [5]. In the following year 2017, Fabien Ferrero, Hoai-Nam-Son Truong and Huy Le-Quoc proposed a way for multiharvesting by using thermal, solar and piezoelectric energy for autonomous sensing applications which can also be used to power LoRa WAN and IOT [6]. In the same year, Alexandru Lavic and Valentin Popa conducted a few tests and a study on the LoRa WAN network, they were able to observe and conclude that if any change that is made on the bitrate and spread factor (SF) could change the ToA (Time on Air), when SF increases ToA increases and when the bandwidth of the communication is increased the ToA falls significantly [7]. Meanwhile, in the same year, Shailendra Kumar Dewangan and Abhas Dubey proposed a way to extract and store energy generated by making use of 12 piezoelectric plates embedded inside a shoe to store the energy into a battery which would effectively generate 6V using an amplifier, they also put up ideas to make use of a freewheel to produce reciprocating motion [8].

B. Integrity Behind the Motivation
In the following year 2018, Ravi Kishore Kodali, Mohan Sai Kuthada, Yatish Krishna and Yogi Borra proposed a new system using LoRa WAN for irrigation and soil monitoring system [9]. In the same year, Shilpa Devalal and A. Karthikeyan proposed an overview of the LoRa WAN technology which offers high security in its communication channel no matter what band is used, classes with receive delay, Different Activation Modes like OTAA (Over The Air Activation) and ABP (Activation By Personalization) [10]. In the same year, W.M. Jayarathne, W.A.T. Nimansala and S.U. Adikary proposed that by using PZT with FEA (Finite Element Analysis) and its development used Euler-Bernouli beam theory with a tip mass, we can design a Custom Mod PZT harvester with a maximum theoretical voltage as per the requirement [11]. In the same year, Sumit Balguvhar and Suresh Bhalla proposed a method in which they use PEH (Piezoelectric Harvester) which can monitor bridge vibration and harvest energy at the same time [12]. In the same year, Ravi Kishore Kodali, Krishna Yogi Borra, Sharan Sai G. N. and Jehova Honey Domma proposed a smart way to find and manage parking space using ESP32 LoRa and ultrasonic sensor which would detect a vehicle occupying the parking slot [13]. In the following year 2019, John Fox, Andrew Donnellan and Liam Doumen found that the LoRa WAN technology can be used for a wide range of IOT based applications and solutions, they also proposed a system to provide a fully functional LoRa WAN based IoT system as a local service to a region [14].

Lora Sx1276 Esp32 Lora Module
SX1276 ESP32 LoRa Module makes use of the Semtech's chip which is pre-loaded with a firmware It is incorporated with Semtech's SX1276 and STM32L which provide a way for users to interact with AT Commands (ATtention) [15][16]. ESP32 LoRa Module consists of a LoRa transmitter embedded on an ESP32, LoRa and ESP32 can interact with each other quit easily. It has an OLed display attached to display what process it is performing. Since it was basically an ESP32 module dedicated for LoRa, it can be used to trigger any Custom LoRa activity which can be based on time or any specific action. These custom activities can be instructions to collect and send sensor data at a particular instance and forward that data through the LoRa WAN communication channel. LoRa WAN communication has been found to have an SAR (Standard Absorption Rate) value and the value for Head and Body SAR(1g) is 1.6W/kg [17].

A. Lora WAN Peak Performances & Tests Carried Out
The LoRa Node is claimed to send a data packet of max 50 bytes at an instance of time until you want to play around with its data rate [18]. Hence, it was subjected to various tests, these tests were conducted to find the max size of the data packet that can be achieved by changing the LoRa Node's data rate (DR) to the most feasible one from the available data rate modes. Table I shows the results of all the possible data rate modes that can be achieve from a LoRa Node to a LoRa Gateway using a RAK811 Lora Module which was obtained as a result of an experiment conducted with a RAK7258 Micro (Indoor) Gateway. By making use of some simple data compression techniques we could limit a data packet's size to fall in the supported bytes as shown in the Table I. As we know that the data is forwarded as hexadecimal data, we can simply making use of some hexadecimal series to represent a format for the data. 0x 0(n) [0x stands for hexadecimal prefix] can be used to represent a data type, for e.g. 0x 01 could represent time and 0x 02 could represent Temperature in °C and so on as shown in Table II under Positive Data-type. 15. 0X 18 => ACCLERO Z 8. 0X 08 => ACCLERO Z These can be followed with other factors like payload length, payload value and so on, for e.g., 0000000101020A5F can represent the encoded Hex data that is being send where, 00 00 00 environment data) | 0x 01 is the temperature (data type) | 0x 02 represents 2bytes as the payload length | and 0x 0A|0x 5F represents 10.95 (℃) in HEX [Approximation can be used to reduce the payload data size, e.g., 10.9557867448 (℃)---> ~10.95 (℃)] which can be decoded on the receiver side.

• Node MCU / MQTT Bridge
Node MCU is used to interact with Adafruit IO's custom feeds, an interaction can be made by creating an MQTT bridge based on subscribe and publish technique [19,20], Adafruit IO feeds are secured by an AIO key, which is then integrated with Google Assistant using IFTTT (If This Then That). IFTTT helps us to make use of triggers which is activated over voice commands, triggers can also be made use of with the help of webhooks [21]. While using MQTT bridging with Google Assistant it is not required to use webhooks, also in case if you happen to make use of webhooks the webhook URL should never be shared with anyone as sharing it can become a potential security risk.

• Google Assistant Integration:-
Google Assistant is a popular virtual voice assistant which is used widely on most of the Android Powered Devices [22]. Google Assistant makes use of MQTT bridge which talks to Adafruit IO which then interacts directly with the custom feeds to trigger an activity or an event. Once the event is triggered it interacts with that particular feed which then interacts with the MQTT bridge and then it locally triggers an activity on the Node MCU which then passes a ground signal to the connected relay board and it turns ON the Relay switch which would power up the Remote LoRa Gateway. The Gateway then would search for a network so that the collected data from the node device can be pushed to the cloud. Fig. 1 shows the architecture diagram of the whole system in which Google assistant integrates with IFTTT which requires the use of a Google Account, both IFTTT and Google Assistant must use the same account.

Piezoelectric Power
The disadvantages of solar power systems are that energy can be generated only when sufficient sunlight is available and no energy is produced during the night whereas, a piezoelectric power system can generate energy round the clock but, relatively lower energy is produced.
By using (1) and (2) which is a combination of both the Solar Power and Piezoelectric Transducers, it was found to be an ideal combination for a good power supply resource for powering up LoRa WAN devices in remote areas where conventional power supply is not available or frequent power failure occurs due to impaired power supply systems.

Calculations
By observing TABLE II under Positive Data-type, the Total data packet size (obtained in the test cases conducted) was ~ 57 bytes = 114bits [with decimal and "-"]. Re-mapping "-" values as 0x 12 for -Temperature Value (e.g., -21.32℃), 0x 13 for -Gyro X value… etc. which could reduce 7 bytes used by the "-" hexadecimal value and as before removing decimal will reduce another 7 bytes => 14 bytes saved which reduces it to ~ 43 bytes which falls well below 50 bytes!! Also, as shown in TABLE I, the max to max bytes in a packet with Data-rate Mode 5 is 120 which is not stable. Choosing Data-rate Mode 3 was found to be more stable and feasible in the test cases conducted with an Indoor RAK7258 Micro Gateway.

Apple Shortcuts Coding and Siri Integration
The Workflow software later became the Shortcuts app that uses Siri shortcuts. Shortcuts is an iOS application that tags along and works with Apple's Siri [24]. The software was introduced at the WWDC during the Apple iOS 12 release on June 2018 [19]. By making use of Siri along with the well-known Siri Shortcuts App various scripts were created which has been integrated with IFTTT using Adafruit IO feeds which stitches them together, this process can be seen in Fig. 1. The scripts for the Shortcuts app was written to interact with Siri, and are not linked to any account or an Apple ID, it can easily be shared via Airdrop or any other means including any safe social-networking apps (probably end-to-end encrypted) or even by providing an encrypted link from your iCloud. The script programs can run smoothly on iOS 13 and iPadOS 13 or later. When a voice command is passed it runs a webhook URL to trigger an event which would interact with the MQTT bridge, hence both Google Assistant and Siri Shortcuts have a common point of interaction which is the IFTTT. IFTTT's interaction with Siri and Google Assistant is quite different. A detailed process can be seen in Fig. 2 which shows how both Google Assistant and Siri interacts with IFTTT before processing a trigger to the Adafruit IO feeds.

Encoding and Decoding the Packet Data
The data that is collected from the end node, in our case the GY-87 10 DOF sensor uses a Heltec's ESP32 LoRa SX1278 which wirelessly connects to another Heltec's ESP32 LoRa SX1278 (can be up to 10 km almost in the line of site) connected to the internet and can be powered ON or OFF using Siri or Google Assistant [25]. The data is compressed to fit the limited packet size and send as hex values and the data is received in hex while using The Things Network and Base 64 while using the Chirpstack Application Server (as default) [26][27]. The received data is captured and stored in a database and is converted back to original data using a decoder which is basically the reverse function of the encoder script created and deployed. Fig. 3 shows the compressed data being decoded back to its original form by deploying the developed decoder program. Fig. 4 shows the developed decoder program throwing an error when the received data is not in the proper expected format.

Conclusion and Future Work
It can be concluded that the receiving end could have a LoRa gateway or another Heltec's ESP32 LoRa SX1278 which can make use of the harnessed power which is stored in the storage cell. To help reduce the radiation emitted from LoRa devices, it can be limited by making use of an IoT based smart power management. Also, it can help provide a bit of security if someone tries to bug the receiving end though the data being forwarded to the gateway is encrypted and contains user defined data-types. The above work helps create a low-cost LoRa WAN for uses like smart farming, and remote monitoring systems using non-conventional energy. Future work may include creation of a smart programmable battery which is designed for harvesting non-conventional energy and can also connect to a wireless network which makes it possible to get rid of a few components which mainly includes Node MCU, Relay board, LED indicators, 0.96-inch OLED I2C Display and storage cell with one single smart programmable battery.