Analysis of LoRaWAN Transactions for TEG-Powered Environment-Monitoring Devices

1 Abstract —Long-Range (LoRa) transmission technology is potentially a suitable solution in abundant applications such as smart cities, smart industries, smart health, and others, although it is challenging and complex to implement. LoRa is a non-cellular modulation technology for Long-Range Wide-Area Networks (LoRaWAN) and is suitable for Internet of Things (IoT) solutions through its long-range and low-power consumption characteristics. The present paper provides a comprehensive analysis of LoRa wireless transactions through several measurements, which differ in LoRa parameter configuration. The results showed dependency of the power consumed by the transaction on the selected Effective Isotropic Radiated Power (EIRP). The quantity of energy consumed by the transaction also significantly depends on the selected data rate (combination of the spread factor and bandwidth) and payload. radiated power (EIRP), payload) configurations. Measurements were collected using a custom built hardware platform consisting of a simple switching mode power supply, microcontroller (MCU), and Semtech SX1261 transceiver. The hardware platform permits measurements with other transmission technologies (Sigfox, NB-IoT, etc.) through its modularity. The obtained results are suitable for use in other types of LoRaWAN simulation. The main scientific value of this paper lies in the research possibilities in optimization of the transmission payload. The acquired data could be used as input for various research experiments that focus on environmental monitoring device designs and LoRaWAN module energy consumption simulations.


I. INTRODUCTION
The Internet of Things (IoT) infrastructure employs an enormous number of wireless sensors connected to each other to collect information from various objects [1]. To power these sensors, energy is provided by energy harvesting methods based on ambient environmental temperature differences (e.g., thermoelectric generators (TEGs), wind (flow-based systems), etc. These methods are becoming more prevalent [2], [3]. Limited energy from energy harvesting sources is available for sensors to draw, therefore low-power wireless sensor networks (WSN) are required [4].
To satisfy low-power consumption, low cost and wide transmission range requirements, a significant number of IoT applications use transmission technologies, e.g., Low-Power Wide-Area Networks (LPWANs) [5], [6].  [10]. LoRa is a non-cellular modulation technology for Long-Range Wide-Area Networks (LoRaWAN) and is suitable for IoT solutions through its long-range and lowpower consumption characteristics [2].
For long-range radio communication between environmental monitoring applications, tools for rapid and secure sensor deployment are currently being investigated [11]. The tools are used to support the rapid deployment of large-scale distributed sensing systems based on LoRa technology [12] or to allow the prediction of radio coverage [11]. LoMM is a modular architecture developed as a novel platform for monitoring and managing LoRa-based IoT networks to bridge the gap between the research domain and the deployment domain and to allow rapid prototyping of state-of-the-art solutions [13].
LoRa transmission technology is a potentially suitable solution in abundant applications such as smart cities, smart industries, smart health, and others, although it is challenging and complex to implement [14]- [16]. Table I lists several applications of IoT devices that use LoRa communications and are powered by a particular energy harvesting method. Specifically, LoRa is used to provide continuous real-time data transmission in wireless sensor nodes that contain an energy harvesting system based on TEGs [17], [20], solar panel/photovoltaic modules [18], [21]- [24], or plant microbial fuel cells [14]. LoRa is also an energy-efficient solution for IoT devices without batteries [14], [17]- [19], [22]- [24].
The contribution of this paper is an analysis of wireless transaction features conducted with various LoRa parameter (spread factor, bandwidth, effective isotropic radiated power (EIRP), payload) configurations. Measurements were collected using a custom built hardware platform consisting of a simple switching mode power supply, microcontroller (MCU), and Semtech SX1261 transceiver. The hardware platform permits measurements with other transmission technologies (Sigfox, NB-IoT, etc.) through its modularity. The obtained results are suitable for use in other types of LoRaWAN simulation. The main scientific value of this paper lies in the research possibilities in optimization of the transmission payload. The acquired data could be used as input for various research experiments that focus on environmental monitoring device designs and LoRaWAN module energy consumption simulations. This paper is organized as follows. Section II provides a description of LoRaWAN. Section III describes the hardware used to perform experimental measurements. Section IV provides a description of a specific experimental setup. Section V provides the results of the experiment. Section VI discusses research challenges. Section VII provides conclusions and discusses future work options.

II. LORAWAN
LoRa is a modulation method [25], [26] for long-range wireless communication, especially in low-power IoT applications [27], [28]. It is a proprietary technology and the intellectual property of Semtech Inc., a company based in Camarillo, California. Taking into account the ISO model, LoRa is a physical layer technology. Numerous factors influence the energy efficiency of the particular LoRa infrastructure.
A regulatory authority determines the permitted transmission power settings and modulation attributes. There are multiple frequency bands, typically in the 400 MHz or 900 MHz range [28], where LoRa traffic occurs. Regarding the LoRa modulation, it is based on the chirp spread spectrum modulation technique [27], [28]. The allocated bandwidth and the chirp spread factor [29] are used together to determine a data rate (DR) value (Table II). As with frequency, the permitted DR is stipulated by a regulatory authority.
Another important parameter is the node transmission power (TX power). Typically, the transmission power is set at discrete levels, each level being mapped to a corresponding equivalent EIRP (Table III).
LoRaWAN is a data link/network layer technology that uses LoRa modulation as a physical layer. LoRaWAN defines three device classes: A, B, and C [27]- [29]. The difference between them is in the way downlink transmissions are performed. With class A, the receive window is opened only after uplink transmission. Class B includes the functionality of class A, but other receive windows are also opened according to a preset time [27]. This allows the node to receive data regardless of the uplink. With class C, the node listens continuously (while the node transmits data). This allows lower latency, but power consumption is greater, since the receiving circuits must be powered.
An entire LoRaWAN uplink-downlink transaction (without the asynchronous class B/C uplink) is depicted in Fig. 1. Power consumption is highest during uplink transmission. The first receive window is opened precisely 1000 ms after uplink is established [29]. If the node receives no data during the first window, another receive window is opened after a certain delay as a safety mechanism. The second window can use a different and more robust DR setting. In this manner, an unsuccessful downlink can be attempted again.

III. EXPERIMENTAL PLATFORM
Our tests were performed using a custom built specialized hardware platform. This platform consists of three parts.
The first part acts as a power supply. It is a simple switching mode power supply that powers the experimental platform. The power supply design is based on a hybrid circuit from Texas Instruments. The output voltage (either 1.8 V, 2.5 V or 3.3 V) is selected using an on-board switch.
The second part integrates a microcontroller and various support circuits, including EEPROM memory and humanmachine interface components (buttons, LEDs, and others).
The third part acts as a hardware interface between the microcontroller board and the Semtech SX1261MB2BAS board which contains the Semtech SX1261 transceiver. The main purpose of this interposer board is to allow for efficient signal measurement. A different wireless transceiver can be used if the wireless interposer board is redesigned. Note that due to the modular design, the microcontroller board did not need to be re-designed in this case. The connector for the wireless interposer board allows for various communication options for multiple wireless configurations in the future.
All three parts comprising the experimental platform are shown in Fig. 2. The selected microcontroller NXP KL25Z device contains a 32-bit ARM CPU core, 128 kB of flash memory and 16 kB of SRAM memory, and a range of peripherals which include communication interfaces and timers. The microcontroller runs software written in C language. The software can be allocated to both a LoRaWAN stack and the custom code designed to perform our experiments.
The LoRaWAN stack has two main options: LMIC by IBM and LoRaMac-node by Semtech. Both stacks are opensource solutions with publicly available source code. We opted for the LoRaMac-node since it is currently under active development. The stack source code was ported to the KL25Z MCU. The porting process included writing a new SPI driver and a timing subsystem. No modifications were made to the stack itself. The latest version of the stack available during the preparation phase of this article (version 4.5.2) was used.
The stack exposes its functionality through function calls. Asynchronous events are interfaced using callbacks. A function provides internal processing for the stack, but must be periodically called from the user code. LoRaMac-node integration with a real time operating system (RTOS) is feasible but was not attempted in this experiment.
We implemented a simple run-to-completion software design. Our program served both as a testbench for the stack port and as an experimental communications solution for test measurements. Both the Over-the-Air Activation (OTAA) and Activation by Personalization (ABP) provisioning mechanisms were successfully tested. Regulation domain requirements were managed by the stack. The permitted TX power settings, spread factors, and bandwidths were successfully tested.
The test application is driven by a simple algorithm (Fig.  3). After the application starts, a user trigger (a button is used in the current version of the application) initiates a frame transmission. This action is executed, provided that the stack is not busy. If a frame is received, it is stored in the CPU memory. The received frame can be examined in a debugger. More advanced instrumentation for receiving frames was considered, but it was not deemed necessary for our experiments.
Cass A was used in our tests. Although transmit and receive operations are in principle mutually asynchronous, a receive event can occur only after a previous transmit operation in our experiments through an approach based on class A. Program execution is halted using a breakpoint if an asynchronous error is encountered, and the nature of the error can be examined in a debugger. We opted for OTAA mainly because it manages the sequence number initialization. The OTAA process is executed during the setup phase of a test run; this step is not illustrated in Fig. 3 for the sake of simplicity. For a successful OTAA process, the device must be properly keyed and a device identifier must be set. With a LoRaMacnode, these data are entered using header files. We consider this method to be suboptimal, but it is usable for experimental purposes.

IV. MEASUREMENT SETUP
To test the individual attributes of the wireless transaction, we performed various experimental measurements. A block diagram for the measurement setup comprising a power supply, oscilloscope with a current probe, MCU, and Semtech transceiver is shown in Fig. 4.
The power supply block provides an output voltage (either 1.8 V, 2.5 V or 3.3 V) selected with an on-board switch. A two-channel current probe (Keysight 2820A) measuring current in two resolutions is connected to the oscilloscope (MSOS104A). Channel 1 (Ch1) is depicted in the block diagram in Fig. 4. Channel 3 (Ch3) is a trigger to measure the duration of the wireless transaction (T) through activation/deactivation of the GPIO signal. Channel 4 is a marker that displays the supply voltage (Vpwr). The transceiver (Semtech SX1261) board is connected to the MCU (KL25Z) through the SPI for data communication and via the GPIO for switching on/off the supply voltage of the transceiver. Experimental measurements are run in various configurations based on LoRa parameters (TX power, DR, payload, and power supply of transceiver). Czech radiocommunications were used as a LoRa provider [27]. The TX power parameter represents the amount of power radiated during the TX transmission phase. The DR parameter describes the rate of data transmission. The payload represents the amount of data that can be sent/received. Individual LoRa parameters were set as follows:  TX power -0, 3 or 7 (Table III),  DR -0 or 2 (Table II) Table V lists the results of the power supply set to 2.5 V with LoRa parameters configured in all the combinations mentioned in Section IV. These results indicate the same dependencies as the results in Table IV (power supply set Table VI lists the results of the power supply set to 1.8 V with LoRa parameters configured in all the combinations mentioned in Section IV. These results indicate the same dependencies as the results in Tables IV and V (power supply set to 3.3 V and 2.8 V, respectively). The largest amount consumed was 246.75 mJ for a configuration where TX power = 0, DR = 0, and payload = 32 B. The following figures show the results listed in Tables IV-VI.
The dependence of I avg on the Tx and Rx1 phases over time is depicted in Fig. 5. The graph illustrates the aforementioned dependence of I avg on the TX power: the lower the TX power, the more current flows. The dependence of I avg on the Tx and Rx1 phases is depicted in Fig. 6. The dependence of I avg on DR shows that the peaks of the current are the same for both DR configurations, but the durations of the transaction are different. DR 0 (blue line, T = 5.48 s) takes approximately twice as long as DR 2 (red line, T = 2.33 s). Three boxplots in Fig. 7 show the average consumed energy for each configuration of the specific LoRa parameter. The consumed energy value for Vpwr configurations falls in a narrow range (E = 94 mJ-94.8 mJ) because the switching power supply is contained within the transceiver, suggesting that it does not matter which voltage value the transceiver supplies. Analysis of the DR reveals a more significant difference in the values of the energy consumed. The difference in consumed energy between the DR = 0 and DR = 2 configurations was approximately 100 mJ.
The dependence of the average consumed energy on various payload configurations is shown in Fig. 7(c). It suggests that the smaller the data volume (payload), the lower the energy consumption.

VI. DISCUSSION
The results of the experiment provide many points of discussion. The results showed that the DR parameter, which is a combination of spread factor and bandwidth, strongly affected the duration of the transaction. This may be because the chip is slower and has a longer range once the DR is set to 0 (spread factor = 12 and bandwidth = 125 kHz). Another suitable discussion point is the reliability of the individual DR configurations. The transaction duration was shown to be longer and consumes more energy when DR = 0 than when DR = 2, but it should be considered whether the reliability is lower in terms of transmission certainty.
Another discussion point is the stability depending on the set payload value. We calculated the average energy consumed for each payload configuration (8 B, 20 B, and 32 B). The most energy was required for a payload of 32 B, and the least energy was required for 8 B. However, the efficiency of energy use should be considered in terms of payload size. For a payload of 8 B, 9.75 mJ/B of energy was used; for a payload of 20 B, 4.84 mJ/B was used; for a payload of 32 B, 3.40 mJ/B was used. The most economical use of energy therefore occurred with a larger payload.
We should also not overlook the power consumption of the MCU: the LoRa module consumes a lot of power, but the power consumption of the MCU may also be an important consideration if it is power-hungry.

VII. CONCLUSIONS AND FUTURE WORK
The article provided a comprehensive analysis of a wireless transaction that was configured according to various LoRa parameter (spread factor, bandwidth, effective isotropic radiated power (EIRP), payload) configurations. The measurements were performed using a custom built hardware platform consisting of a simple switching mode power supply, a microcontroller (MCU) and Semtech SX1261 transceiver.
The results of the experimental measurements demonstrated the dependence of the duration of the transaction on the DR, which is a combination of the spread factor and the bandwidth. The transaction indicated a dependence of TX power on energy consumed (E): the higher the TX power, the lower the quantity of energy consumed. The most energy was required for a payload of 32 B, and the least energy was required for 8 B. The results showed that the DR parameter strongly affected the duration of the transaction. It was demonstrated that the duration of the transaction is longer and consumes more energy when DR = 0 than when DR = 2.
The modularity of the hardware platform allows measurements to be performed with other transmission technologies (Sigfox, NB-IoT, etc.). The results obtained are also suitable for use with other LoRaWAN simulations. Another area of exploration is payload optimization, with reference to the suggestions in Section VI.
Future work could examine the power consumption of the MCU. The LoRa module consumes a large amount of power; however, verifying whether the MCU also consumes a lot of energy could be the subject of further experimental measurements.

CONFLICTS OF INTEREST
The authors declare that they have no conflicts of interest.