Low - Power Agriculture IoT System with LoRa: Open Field Storage Observation

– The last decade has seen multiple research work on the use of LoRaWAN technology in smart agriculture. In open field storage, monitoring is crucial for increasing the logistics efficiency and improving crop quality. As battery maintenance is expensive in such areas, LoRa is a suitable technology that allows for low-power communications. Within the framework of the research, a prototype has been built for tracking goods in open field storage. The battery lifetime has been analysed through calculations and measurements using LoRa communications. Our findings indicate that although sleeping current has the smallest percentage, it has the greatest effect on increasing the battery life, for longer battery life LoRa node must have a low self-discharge battery, and finally, sensors are the main battery depleting factor on the LoRa node.


I. INTRODUCTION
Low-Power Wide-Area Network (LPWAN) technologies have been recently used in various areas such as health, agriculture, animal tracking, smart buildings and industrial logistics [1]- [3]. LoRa, Sigfox and NB-IoT are popular examples of LPWAN. While these low-power technologies have drawbacks such as range, data size and data rate, with accurate definition of needs and good architecture, the disadvantages can be eliminated.
In agriculture, having long battery life is crucial because of the high replacement costs due to nodes being distributed over large land areas. Compared to alternative technologies (such as GSM, 3G and LTE), LPWAN technologies provide battery savings which ensure that nodes are always online and sustain relatively high output power. LPWAN technologies are preferable since power consumption should be minimised due to high maintenance effort in the replacement of batteries [4]. In particular, LoRa is preferred since it is simple to deploy, able to carry data over large distances, and operates in a license-free environment.
Nowadays, agriculture IoT systems are used in closed, protected environments such as greenhouses [5] and are generally focused on the production process. Different studies indicate that a large portion of food waste occurs in the storage process [6]. In terms of cost and energy, current solutions such as ventilation systems and coolers are not compatible with all kinds of food [7]. For instance, while aeration systems are one of the methods that can prolong the lifetime of food, it is not reasonable to introduce aeration systems or even physical security structures for poorer countries and cheaper crops [8]. Studies report that, due to cost, approximately 60-70 % of food grains produced in poorer countries, such as India, are stored in indigenous storage structures [9]. It is therefore extremely necessary that the good stack is traced and analysed. By using scientific storage techniques, such losses can be reduced to as small as 2 % [6]. Improving the management of open field food storage can be accomplished by constantly monitoring the stock and deriving the status of spoilage using the data analysis. In this study, battery life has been examined to maximise the power usage and transmitting distance using LoRaWAN technology with the intention of combating food waste in cheaper crops stored in open field storage such as sugar beet. For each sensor node, our approach includes a waterproof case and an indicator balloon so that it can be easily identified in an open area. Online network providers and application server providers that are compliant with many protocols for IoT communication are used. The Things Network, which is an open community for users of LoRa, is such a service. It provides a Graphical User Interface (GUI) for network server development. Moreover, some of the application server providers for LoRaWAN are Cayenne MyDevices, ChirpStack and OpenSensors [10]. CayenneMyDevices is used in our study. Figure 1 shows the solution and the information flow to the application server from the sensor node. Using LoRa, CO2, temperature and humidity values obtained from the food stack are transmitted and concentrated on the gateway and transferred to the servers. This paper is an extension of our initial study [11]. The present study includes both theoretical analysis and the measurement-base assessment of battery life as well as introduces the use of LoRa technology. Besides, recommendations are made to reduce energy consumption based on inferences drawn by evaluating the variables t h a t have the most impact on battery life.
The remaining part of this paper is structured as follows. The use of IoT applications for smart agriculture is presented in Section II. The architecture used in the research is clarified in Section III. Section IV focuses on system power usage applying LoRaWAN technology, and Section V criticises the theoretical analysis and system measurements. Finally, Section VI draws conclusions.
RELATED WORK The recent years have seen several research efforts towards smart agriculture, only a few of which study post-harvest losses.
In this section, we briefly discuss previous models for smart agriculture using IoT and present the different types of battery that have been used in the prior art for smart agriculture.
In [12], the authors consider a smart irrigation system with machine learning which helps reduce food waste caused by improper irrigation during production. The authors used the LoRa network with TDM-based MAC protocol [12].
In [13], the authors propose a mobile LoRaWAN gateway system that can be used to increase the efficiency and precision of the operations in greenhouses. The technology presented includes Raspberry Pi 3 B+ powered Mini LoRa Gateway from Heltec. It is operated by an external battery. Sensors monitor humidity and temperature, and send the collected data to the LoRaWAN gateway; the data are then processed and displayed by online platforms. This study does not focus on calculating lifetime in different scenarios or maximising the use life with a single charge.
In [14], the authors examine two use cases for smart agriculture. In one of the use cases, the authors place a sensor toolkit at a depth of 10 cm to 60 cm in order to analyse soil properties and measure the permeability of agricultural land. The analysis has been repeated using the different spreading factor (SF) and output power (dBm) values. It has been shown that the developed prototype is able to transmit reliably at a depth of up to 60 cm, at a distance of 350 m from the gateway; this way, the whole region has been covered. The study shows that data transmission can be performed even if the spreading factor is reduced from SF8 to SF10 at lower measuring points and thus the transmission rate is lowered from 3125 bps to 980 bps. This study does not examine power consumption.
Due to its low power consumption, a majority of low-power IoT applications for agriculture employ the LoRa technology [13], [15], [16]. Apart from the power consumption of the LoRa module, other factors may also affect the power consumption in the overall system. Previous work on long-range communication shows that communication at a higher range than the projected distance is usually needed in order to compensate for obstacles affecting signal quality [14]. In these and similar cases, SF and output power should be adjusted correctly so that battery and range optimization can be performed. In addition, another dominant factor in power consumption is the sensor. There are a few factors for determining the power consumption of the sensor in the context of smart agriculture using LoRa [10].
There have also been prior efforts to study the effect of battery self-discharge. In [17], the authors show that selfdischarge increases with age and cycling. Their calculations reveal that, for the cells stored at 27 °C, the average selfdischarge rate is 7.8111 % in 10 years. In addition, it has also been shown that the Acceleration Factor (AF) delays the battery depletion.
In [18], the authors show that the reference storage time increases with AF at higher temperature; listed AF values for storage temperatures of 27 °C, 40 °C, 60 °C and 70 °C have been shown to take values of 1.0, 2.7, 12.5 and 26.8, respectively [18].
Given the existing studies described above, it is possible to summarise the novelty values of the present research. To the best of our knowledge, it is the first study that evaluates battery life both using battery calculations and measurements. Besides, unlike the existing research on smart agriculture with IoT, in this paper post-harvest storage with IoT is examined. Finally, selfdischarge results are compared with calculations and measurements in various types of batteries.

A. Components of the LoRa Network
In the system studied in this paper, the LoRa network consists of four main parts: a sensor node, a LoRa gateway, a network server and an application server.
At the sensor end, the microcontroller unit (MCU) reads the sensor value via I 2 C and sends the data via Serial Peripheral Interface (SPI) to the LoRa module.
LoRa transceiver takes data from the SPI and packages it into frames, which are then sent to the gateway. This flow can be seen in Fig. 2. Next, the data are received by the LoRa transceiver that is on the gateway. A Raspberry Pi 3 is used to relay the packets to the Internet over 802.11n 2.4 GHz WiFi. The gateway is shown in Fig. 3.  The Things Network server handles the incoming packets from the gateway and forwards them to related application servers (Fig. 4). Cayyenne MyDevices application server stores the collected data and presents them on its Graphical User Interface (GUI).

B. LoRaWAN Evaluation Boards
B-L072Z-LRWAN1 is used as a sensor node and it is powered by the CMWX1ZZABZ Murata module consisting of STM32L072CZ microcontroller and SX1276 transceiver.  The transceiver supports +14 dBm and +20 dBm selectable output power levels. NUCLEO-F746ZG is used as a gateway and it is based on a high-performance STM32F7-series ARM 32-bit microcontroller. ARM Cortex-M7 has an MCU operating at 216 MHz with 1 MB Flash memory and 320 kB SRAM. It has RisingHF ARDUINO expansion board (LRWAN GS HF1) that controls the LoRaWAN communication. It is compliant with the IEEE-802.  Ethernet specification.

C. Printed Circuit Board (PCB)
A PCB has been designed to organise the LoRaWAN evaluation board pins. This extension board contains a charging circuit, a switch circuit, connectors, an indicator LED, and a button for controlling the power on the board. MCP73831 is used to control battery charging; it provides 500 mA current. The battery is connected to the circuit via a jumper cap so t h a t it can be switched between charging and consuming.

D. Switching Circuit
The directly connected sensor remains open all the time. To fix that issue, a switch circuit is designed and integrated into the PCB. It has been observed that controlling the sensor through a switch reduces 19 mA of current. The switch circuit contains two active components: 2n2222 as BJT and IRF9530 as p-type MOSFET. The switching circuit yields 3.6 V output when 3.3 V is supplied from the digital output of the micro-controller GPIO. It allows us to control the sensor over the digital output of the microcontroller.

E. Raspberry Pi 3
It is a computer board powered by a 64-bit 1.2 GHz Broadcom BCM2837 CPU and 1 GB RAM. Raspberry Pi 3 has BCM43438 wireless LAN and Bluetooth Low Energy (BLE) network cards on board. The Raspberry Pi board is responsible for transmitting network packets received from the gateway on the eth0 interface to the Internet via WiFi.

F. Sensor Components
SCD30 is a Sensirion-manufactured portable carbon dioxide, temperature, and humidity sensor (Fig. 5). It is completely calibrated during manufacturing; however, depending on the atmospheric pressure it is also possible to set a custom compensation. The sensor can itself communicate with a master device via the I 2 C or the UART bus. Repeatability in the CO2 measurement is 10 ppm and the sensor consumes 19 mA average current at the measurement interval of 2 s.

III. BATTERY LIFE
There are several variables influencing the battery life of the sensor node, such as sleep time, sensor, radio settings, temperature, as well as only battery-related variables, such as usable energy, form, health and self-discharge. The subsequent sub-sections illustrate two methods for computing power usage in LoRa sensor nodes with self-discharging batteries.

A. Power Consumption
The present study primarily focuses on the best and worstcase battery life values using SF7 and SF12 with the output power of 14 dBm and 20 dBm. Calculations are made according to the sensor node that transmits 20 bytes of data in each transmission. Sensor nodes repeat the same cycle until the battery becomes depleted. One cycle of the device is determined based on the voltage measured by an oscilloscope over a 1 Ω resistor that is serial to the entire circuit, as shown in Fig. 6.

Electrical, Control and Communication Engineering
________________________________________________________________________________________2020, vol. 16, no. 2 91 Voltage values can be converted into current values using Ohm's Law. This approach is more accurate than using datasheet values for calculating the battery life of the end product. However, in this study the measured values are high due to the unnecessary elements on the evaluation board such as LEDs, debugger and regulator. To eliminate this effect, current values of the microcontroller and LoRa module are measured and used together with the values taken from the datasheets.  Table I shows the current and duration values with respect to the datasheets of CMWX1ZZABZ (MURATA module consists of STM32L072CZ+SX1276) and SCD30 (Sensirionmanufactured compact carbon dioxide, temperature and humidity sensor). These measurements have been carried out using an Owon XDS3202 Oscilloscope and an Owon OW18B Multimeter. Table II shows the constant current values of the board sleeping phase and external circuitry measured with the multimeter mentioned above. Available battery capacity divided by the power consumed the system in one cycle gives the maximum number of cycles that the device can continue on running.
where cycle T is the time passed in one cycle, N is maximum number of cycle that battery lasts, bat E is the capacity of the battery and cycle E is the electric charge consumed in one cycle. Power consumption of one cycle can also be interpreted as the area under the graph in Fig. 6. Therefore, which operation affects the battery lifetime more is not only related to the current values it takes, but also to the duration of the operation. Further explanation of power consumption is provided in Section V.

B. Self-Discharge
Self-discharge has a great weight in low-power applications. In batteries, a certain degree of self-discharge may be expected depending on the system electrochemistry, the purity of reagents and the temperature when batteries are charged and left on an open circuit. What is called the shelf-life of batteries is determined by the rate of self-discharge, which typically decreases over time.
In this study, a rechargeable Li-Ion battery has been preferred as it is more cost-effective and maximum current limit of Li/SOCI2 battery is insufficient for the use case. The selfdischarge of Li-ion is relatively steady during its service life under normal conditions; however, full state-of-charge and elevated temperature cause a rise. (Self-discharge of all battery chemistries increases at higher temperatures, and the intensity normally doubles every 10 °C [19].) Rechargeable Li-ion batteries have a self-discharge lower than 5 % per month [20]. Another reason to choose a Li-ion battery instead of Li/SOCI2 is that the rechargeable battery can be used to store power produced by renewable energy sources [21]. Non-rechargeable Li/SOCI2 batteries have been mostly preferred in many prior LoRa research efforts due to their low self-discharging characteristics [22]. In Table III, the selfdischarge characteristics of the Li-ion battery have been compared to the characteristics of Li/SOCI2 (lithium/thionyl chloride) battery as a reference model, as it has very low self-Electrical, Control and Communication Engineering ________________________________________________________________________________________2020, vol. 16, no. 2 92 discharge characteristics (studies show that it has nearly one percent self-discharge [23]). In [18], the acceleration factors of the self-discharge at different temperatures have been revealed. The calculations of Li/SOCI2 are made using the information provided by these authors. Figure 7 illustrates the power consumption of each phase for different LoRa configurations. The measurement phase consumes much greater energy compared to the other phases, due to both the time for the CO2 sensor to heat up and the high electric current it consumes. It may be concluded that there is a need for low-power compatible sensors for the CO2 measurements. In this section, sleep, measurement, send and receive features in a device cycle are verified with an oscilloscope. In addition, we individually analyse the effect of each operating mode on the battery life. During the battery calculations presented earlier, the impact of reducing the current consumption of each operation mode by 1 % on the battery life was calculated. Effect of 1 % current improvement during the sleeping phase is 80 %, during the measurement phase it is 20 %, during the sending and receiving phase it is close to 0 %. It implies that 1 % improvement on the sleeping current is equivalent to 4 % improvement on the measured current. Thus, although battery optimisation for LoRa configurations such as SF and output power is a popular subject, it has a smaller impact on the big picture for this sensor node.

A. Effects of LoRa Settings
Battery life calculation is made for four different configurations with SF and output power for 3500 mAh Li-ion battery capacity. As can be perceived from Fig. 8, output power has a greater negative impact in SF12 than in SF7 because of the consequent increase in transmission time.

B. Effects of the Sleep
In non-real-time applications such as those described in this paper, sleeping time highly affects the lifetime. For the sensors used in such applications, sleep frequency may differ based on the food being monitored post-harvest. As discussed earlier, the sleeping current is one of the most effective consumers of the battery. Measuring battery voltage, using regulator, LEDs always open sensors to increase the draw. To improve the current during sleep, a switching circuit is used for the sensor. Comparing 2 hours of sleep interval with the 1-hour case, the percentage of its role in power consumption is increased from 80 % to 89 %.

C. Effects of Self-Discharge
While the previously calculated values are derived by using a constant battery capacity (3500 mAh), battery self-discharge is another factor that extremely affects the battery life. In our system, a monthly 5 % of self-discharge causes 34 % of drop in the battery life. Therefore, batteries are not compatible with this application. For low-power sensor node applications, low selfdischarge LiFePO4, Li/SOCI2 and alkaline batteries can be preferred.

V. CONCLUSION
In this study, we have examined the battery lifetime using LoRaWAN technology for monitoring the storage process for open storage water-intensive goods such as sugar beets. Recommendations for reducing power use are identified by assessing variables that have a greater impact on the battery life. While the sleeping current is the smallest, it has the most important function to play in increasing the battery life. When developing a low-power sensor node, it is important to choose a low-power sensor and use a switching circuit to minimise the sleeping current. Another important aspect is choosing a battery that has low self-discharge. Further, to make efficient and affordable sensor nodes, sensor costs (both battery and price) should be decreased and new studies can be conducted on how to use sensors in the most battery efficient way. The key concept is to minimise post-harvest storage losses by designing a tool for improved monitoring and condition control of the goods. While it is a very basic method to estimate the battery life for the sensor nodes, there are other important factors affecting battery discharge such as elevated temperature, age, and state of charge. There is no feasible, easy to implement formula for calculating battery life based on these parameters. Furthermore, battery consumption can be observed using measurements made with more sophisticated equipment and a test setup can be prepared to validate the calculations.