# An Application of a LPWAN for Upgrading Proximal Soil Sensing Systems
## 5 System Test and Analysis  
### Actual Energy Consumption Test and Analysis  
The physical object of the AHS and the encapsulated soil moisture sensor loaded with the AHS are shown in Figure 8.  
Figure 5: Overall system network structure.  
Figure 6: IoT platform architecture based on a PaaS.  
Energy consumption is a major problem for battery-powered devices. Once the power is exhausted, the device will \"strike\". Although the system minimized the energy consumption of device selection and algorithm design at the beginning of the design process, there needed to be a gap between the actual energy consumption and the theoretical value [29]. To analyze the actual energy consumption performance of the system, the energy consumption of the sensor device after loading the AHS was tested by connecting a high-precision multimeter in series in the system; the real current of the system in each state was measured, and its single service life was estimated according to the battery capacity. When designing the hardware circuit of the AHS system, a special current test interface was reserved so that the jumper would be used for the short circuit during operation, and the multimeter could be directly connected in series during measurement. In this experiment, the DC micro-ampere mode of a Fluke (18B+) multimeter was used. The interrupt timing cycle was set to 250 ms, the system was initialized within the initial 2 s, and the MCU entered the low power consumption mode after configuring the LoRa module. At the 4 th second, the MCU exited the low power consumption mode, the ADC started sampling the battery voltage, and the MCU entered low power consumption mode again after sampling. At the 10 th second (COUNT1), the MCU turned on the 12 V power supply of the sensor, the MCU exited low power consumption mode and woke up the LoRa. At the 13 th second (COUNT2), the sensor started working, the MCU acquired the sensor data, and LoRa started sending and receiving data. At 15 s (COUNT3), the sensor power supply was forcibly turned off, the MCU entered low power consumption mode, and the LoRa entered sleep mode.  
The energy consumption of each main state of the system is shown in Table 2. If the sampling period T was 2 h, i.e., 2 \(\times\) 3600 s, the energy consumption in one cycle can be expressed as E0 = 2.99 J. If the battery capacity P1 = 3500 mAh, then the single battery energy was E = P1 \(\times\) 3.6 V = 45,360 J, and the battery life was 2 \(\times\) E/E0 = 30,340 h; approximately 3.46 years. When working with ultralow power consumption, if effective data  
Figure 8: Hardware of the system. (**a**) Physical object of the AHS; (**b**) Soil moisture sensor after loading the AHS.  
Figure 7: Server application interface.  
were acquired every two hours, a single-battery power supply could work for more than 3 years without considering natural attenuation, thus meeting the requirements of general applications. Additionally, flame-retardant epoxy resin could be used for integral molding and pouring; this would make the system more compact as a whole, with high mechanical strength, strong heat resistance, and easy deployment, as well as being maintenance-free, waterproof, and anti-corrosion.