The Assesement of LoRaWAN Protocol Operation Mode Impact on Average Power Consumption of End-Node Network Device Alexander B. Ilinukh Nikita V. Smirnov Konstantin I. Serebrennikov Sergey I. Kudinov Ural Federal University Ural Federal University Ural Federal University Ural Federal University Yekaterinburg, Russia, Yekaterinburg, Russia, Yekaterinburg, Russia, Yekaterinburg, Russia, obcessedman@gmail.com zigman.nikita@mail.ru s.kudinov@urfu.ru Abstract Information processing, storage, data reception and transmission technologies have penetrated almost all spheres of our lives. A broad range of devices dealing with information demand for some specific requirements such as low power consumption, the possibility of off-line operations for a prolonged period, and information transmission across long distances. The article touches upon the method that can be used to decrease the IoT devices power consumption. It is demonstrated that the power consumption of the IoT device can be reduced with the help of transmission data amount reduction. 1 Introduction The concept of the Internet of Things (IoT) as a system of interrelated network devices and sensors was first presented at MIT in 1999 where the application of radio frequency identification (RFID) sensors for Procter & Gamble corporation was discussed [1]. Since that time, the concept of IoT had been constantly evolving and was finally formed in the paper called “ITU Internet Report 2005: Internet of Things” [2]. From a technical point of view, the realization of IoT concept was reflected in many protocols, which are varied in their application sphere, range, power consumption and frequency band. LoRa network is the example of wideband network with low power consumption [3]. Sigfox network is the example of narrowband network [4]. Popular data exchange protocols such as LTE, GPRS, 3G can also be used to construct IoT networks. The examination of differences and comparison of the protocols mentioned above is not presented in this article and can be found in [5]. The duration of off-line operation is becoming more and more significant parameter for IoT. Various Low Power Wide Area Network (LPWAN) protocols are aimed at providing the best energy efficiency for sensor networks. Long Range Wide Area Network (LoRaWAN) protocol is one of the LPWAN protocols gaining popularity nowadays. LoRaWAN involves the use of network with star topology deployment, data transmission between base stations and end devices, where transmission from end devices to the base station is prevailing. The bit rate can vary from 0.25 kbit to 50 kbit per second to achieve the compromise between the range of communication and data package length. The article is focused on algorithms that allow the duration of off-line operation of IoT devices to be significantly increased with the help of frequency transmission session adaptation. 2 LoRaWAN Network Theoretical Foundations 2.1 Physical Layer Description LoRa is a network technology and modulation method at the same time. LoRa modulation method is patented by Semtech company and based on spread spectrum modulation and chirp spread spectrum (SCC), when data is coding by wide band impulses with the frequency which increases or decreases in some time interval. This solution unlike usually applied direct sequence spread spectrum (DSSS) makes a receiver more frequency deviation resistant. LoRa is also used for forward error correction working in sub gigahertz frequency band. LoRa allows signals with signal-to-noise ratio of 20dB to be demodulated, while the majority of systems with frequency shift keying (FSK) can work correctly with signal-to-noise ratio 8-10dB. LoRa modulation determines physical layer (PHY) which can be used in networks with various architecture such as mesh networks, star, dot-to-dot and others. Due to high sensitivity (-148dbm) LoRa is ideal for devices which require low power consumption and high communication stability. 2.2 LoRaWAN Network Mesh Description If LoRa is a physical layer, then LoRaWAN is a MAC protocol of canal level for long range low power consumption networks with many nodes. LoRaWAN network has a star-type architecture without retranslations and mesh connections. Network nodes are characterized by low power consumption (up to 10 years battery life, conventional batteries, size AA), low bit rate, long range (15 km in rural areas and 5 km in urban areas), and low cost of end-node devices. LoRaWAN protocol is optimized for power-constrained devices and includes various device classes, providing the best compromise between the bit rate and battery life time. The protocol ensures full bi-directional communication. LoRa end-nodes fulfill various functions such as measurement, administration and control. End-nodes do not constantly transmit data, they switch on the transmission only for some time (as a rule, for 1-5 seconds). Outside these hours the end-nodes transceivers are kept in the sleeping or receiving mode. 2.3 LoRaWAN Protococ Despription The structure of LoRaWAN message contains two mandatory parts called preamble and payload. The message begins with a preamble sequence, which is expressed in the impulses sequence, which covers the complete bandwidth. Then devices transmit the synchronized messages to determine LoRaWAN networks using the same frequency band. A payload header can be found between the preamble and the payload. At the end of the message an excess information code can be disposed. End-node devices can be divided into following categories [6]:  Class А. End-node device is an initiator of data exchange with the base station. After every transmission, class A device opens 2 special reception windows to get a confirmation message from the base station. Class A devices have the smallest power consumption  Class B. Class B devices have scheduled transmission of signals. The base station can also be the initiator of data exchange.  Class С. Reception window is almost always open. It closes only to transmit data to the base. Class B devices have the biggest power consumption. 3 Analysis of the Impact of Data Transmission Mode and Messages Format on Average Power Consumption of End-Node Device Monitoring device using LoRaWAN protocol was applied to investigate different algorithms and the modes of information exchange organization in LoRaWAN network 3.1 Monitoring Device Description The investigated device is used to monitor heating systems. It is designed on the base of microcontroller MKM14Z64CHH5 [7]. The software that implements LoRaWAN protocol is integrated in the microcontroller. The device calculates the data of two temperature sensors, two pressure sensors, and two water consumption counters. The device also contains two channels for connecting to the alarm system. The physical layer of protocol is implemented by SX1276 module [8], which communicates with microcontroller by serial peripheral interface (SPI). This device belongs to type A, and operates in a brief alternating mode to ensure a minimum current consumption. The questioning of pulse inputs condition is performed at 30 Hz. The measurement of analogue temperature and pressure signals is performed every minute during 2 ms. During the idle time, the device is in Deep Sleep mode. In this study, the calculations of consumption are made with the help of data taken from the device documentation modules [7,8], presented in the Tab. 1, 2. Table 1: MKM14Z64CHH5 power consumption in different work modes Statement I, mA All peripheral devices are on, the program is performed from Flash memory [1] 10.5 ADC-block consumption ,normal mode, amplifier switched on , f=6.144 MHz, OSR=2048 [1] 10.8 Deep Sleep [1] 0.001 RTC block consumption, VDD switched off and LFSR is set to 2 Hz, [1] 0.004 Table 2: SEMTECH SX1276 in different work modes Work mode I, mA Receiving [2] 12 Transmitting [2] 40 Sleep [2] 0.0001 The average current consumption on the quartz resonator equals 3 mA. The average current consumption of device in system monitoring mode, when it gets censors data, is 25.04 uА. 3.2 Message Format Description Temperature and pressure parameters are transmitted in floating format and have the length of 32 bit to provide required accuracy [9]. The structure of measurement is presented in the Tab. 3, where k is the length of message which contains 2 parameters of temperature, and 2 parameters of pressure. Table 3: Information message format Byte № k+8 k+7 k+6 k+5 k+4 k+3 k+2 k+1 16..k Data Alarm Status Cons. 1 Cons. 2 … Byte № 12..15 8..11 4..7 0..3 Data Pressure 1 Pressure 2 Temp. 1 Temp. 1 Thus, the message length without sensors data accumulation equals to 24 bytes. If there is data accumulation, the messenger length equals to 16⋅ M+8 bytes, where M is the number of measurements. The designed message format implies the caching of measured temperature and pressure parameters. Caching data size is 16 bytes. When using the cache, data is written into the ring buffer every minute depending on the frequency of their measurements. 3.3 Analysis of Transmission Mode Impact on the Average Consumption at the Time of Data Transmission Maximum bytes number of information message (N) and configuration depends on a chosen transmission mode (Tab. 4). It is derived from the constraints of the physical layer, depending on the effective modulation rate used in the view of possible sealing repeater. Table 4: Transmission parameter value and a maximum load, depending on the transmission mode DR Configuration Bit rate N 0 SF12/125 kHz 250 51 1 SF11/125 kHz 440 51 2 SF10/125 kHz 980 51 3 SF9 /125 kHz 1760 115 4 SF8 / 125 kHz 3125 222 5 SF7 / 125 kHz 5470 222 6 SF7 / 250 kHz 11000 222 Based on the above conditions, the average current consumption of the device at the time of transmission is calculated. We accept that both receiving windows are equal to 3 s. Based on the data from Tab. 1, 2, it is possible to calculate current consumption at the time of data transmission (1) and receiving (2). 𝐼𝑎_𝑡 = 40 + 10.5 + 3 = 53.5 mА (1) 𝐼𝑎_𝑟 = 12 + 10.5 + 3 = 25.5 mА (2) For further calculations we take the data message length in accordance with the condition that the length cannot be bigger then allowed by protocol. E.g., for DR1 we take the data message length equals to 40 byte, which corresponds to the data accumulation for 2 seconds. For transmission mode DR1 bit rate equals to 440 bps, therefore, 0.73 sec is required for the transmission of our messages (3). 40/440 ∙ 8 ≈ 0.73 𝑠𝑒𝑐 (3) Then, the average current consumption of the transmission-reception session (4) and the average current consumption of device are calculated (5): 53.5 mА∙0.73+25.5mA∙6 𝐼𝑎_𝑠 = ≈ 28.53 mА (4) 6.73 28.53∙6.73∙1000 𝐼𝑎_𝑑 = 25.04 + ≈ 1624 uА (5) 2∙60 Thus calculated average current consumption of the device for other transmission mode values is presented in Tab. 5, where k is the number of measurements in the package. Table 5: The results of calculation of the average current consumption of the device depending on the selected transmission mode DR Bps Bit in packet Transmission time, sec Awerage current, mА 1 250 40 1.28 - 2 440 40 0.73 1624 3 980 40 0.33 1446 4 1760 104 0.47 520 5 3125 216 0.55 259 6 5470 216 0.32 243 7 11000 216 0.16 232 According to the ERC-REC 70-03 standard [10], which regulates the duty cycle of transmission time, after the transmission of the signal whose duration is 1.41 seconds there must be silence time equals to at least 2.376 minutes. It is not permissible, since the signals must be sent every 2 minutes. 1.44 ∙ 99/60 ≈ 2.376 𝑚𝑖𝑛 (6) As seen from Tab. 5, the increasing of the data rate makes it possible to transmit a larger number of bytes, but it has a negative impact on the current consumption. Thus, it obligatory to reduce the transmission rate in order to reduce current consumption. 3.4 Description of the Proposed Data Transmission Algorithm in the LoRaWAN Data Network It is proposed to use the following interaction algorithm to ensure the best current consumption characteristics. The measured parameters are stored in the ring buffer. Each parameter is defined by the range of values that the user configures. The message contains the average value of each parameter for the period of time between the transmission and the 2-byte status, which, in turn, contain the information about the presence of threshold, exceeding by each parameter and the time when this parameter exceeds a threshold. In this case, the message will be composed of 26 bytes that can be transmitted in one communication session. The message is transmitted with a user-specified frequency. If the user needs to instantaneous values of the parameters for a specified period of time he may request them any time. In this case the informative remains the same as in the method described in Sec. 3-3. The transmission of our messages with the length equals to 26 bytes requires 0.832 sec. in DR0 mode (7). 26/250 ∙ 8 ≈ 0.832 𝑠𝑒𝑐 (7) Assume that the sensors data is averaged for two hours. Suppose a user requests a full measurement data for the last two hours once per day. With this information, one makes it possible to calculate the average value of the device current consumption during a session data exchange (8), and the mean value of the total current consumption of the device during a two-hour operation with a single transmission averaged parameters (9). 53.5 mА∙0.832+25.5mA∙6 𝐼𝑎_𝑠𝑙 = ≈ 28.9 mА (8) 6.832 28.9∙6.832∙1000 𝐼𝑎_𝑑_𝑎 = 25.04 + ≈ 77.51 uА (9) 2∙60∙60 This average current consumed by the device during a transmission interval 2 h. Average current consumption, when we transmit instantaneous values of measurement parameters, equals to the calculated consumption in the Tab. V. Sending a two-hour data archive using DR0 mode takes 1 hour as it is necessary to withstand the duty cycle of the transmission time. Thus, we find a day averaged value of the current consumed by the device during this operation (10): 1536.5∙1 𝐼𝑎_𝑑 = 77.51 ∙ ≈ 141.53 uА (10) 24 As can be seen, the average current consumption during operation of the device has been significantly decreased. This allows us to increase the battery life. Reducing the length of the transmitted message also allows us to send messages with the highest scattering factor. This will improve the reliability of data delivery. 4 Conclusion The study has showed that the frequency of transmission session has a major impact on energy efficiency. The proposed algorithm can reduce the consumption by at least two times and at the same time to transmit data at a maximum spread factor, which positively affects the reliability of data delivery. Since the algorithm seeks to reduce the time in the network, it also allows improving the coexistence of networks, and reducing the collisions within a network. References 1. Kevin Ashton. That ‘Internet of Things’ Thing. In the real world, things matter more than ideas. RFID Aveliable: http://www.rfidjournal.com/articles/pdf?4986 2. ITU, “The internet of things,” Tech. Rep., 2005 3. “Lora alliance,” http://lora-alliance.org, 2015. 4. “Sigfox,” http://www.sigfox.com/en, 2014 5. M. Centenaro, L. Vangelista, A. Zanella, and M. Zorzi, “Long-range communications in unlicensed bands: the rising stars in the iot and smart city scenarios,”arXiv preprint arXiv:1510.00620, 2015. 6. LoRa Alliance, Inc., LoRa specification, 2015. Aveliable:https://www.lora- alliance.org/portals/0/specs/LoRaWAN%20Specification%201R0.pdf 7. Freescale Semiconductor, KM Family Reference Manual, Rev. 5, Oct 2013 Aveliable:http://www.nxp.com/files/microcontrollers/doc/ref_manual/MKMxxZxxCxx5RM.pdf 8. Semtech, Corporation, SX1276/77/78/79 datasheet, Rev. 4 – March 2015 ©2015 Semtech Corporation Aveliable:http://www.semtech.com/images/datasheet/sx1276_77_78_79.pdf 9. 754-2008 - IEEE Standard for Floating-Point Arithmetic. Revision of ANSI/IEEE Std 754-1985 10. ERC Recommendation 70-03 Relating to the use of Short Range Devices (SRD) Tromsø 1997, Subsequent amendments, 21 October 2016