## 2 Materials and Methods
### Environmental Measurements and Optimal IoT Design for Soil Health Monitoring  
In order to facilitate a comprehensive investigation of soil properties and environmental data, the authors integrated multiple sources of information to assess various aspects. As discussed in Section 2.2, UAVs were utilized, as depicted in Figure 3a. To enable comprehensive weather monitoring, a Vantage Pro2 weather station [32] from Davis Instruments Corporation, Diablo Avenue Hayward, CA, USA, as shown in Figure 3b, was employed. The Vantage Pro2 is an agriculture-focused weather station that includes outside temperature and humidity, wind speed, rainfall, and solar radiation, plus a solar radiation sensor for evapotranspiration measurement. The sensor provides accurate, reliable weather monitoring with real-time data updates every 0.5 seconds. Our sensor network is designed to collect a wide range of environmental parameters, including, but not limited to light intensity, humidity, temperature, and precipitation. By capturing these variables, we ensured that our dataset encompasses diverse meteorological conditions, ranging from bright and sunny days to overcast or rainy weather. Furthermore, a series of measurements including NPK nutrient levels, pH, and Electrical Conductivity (EC) were obtained using the Soil Analyzer from Weihai JXCT Electronic Technology Co., Ltd., Weihai, China [45], as illustrated in Figure 3c.  
The IoT devices specifically designed for measuring soil parameters such as pH, NPK levels, Electrical Conductivity (EC), moisture, and location were developed [46]. These devices utilize a low-power transmission technique known as Long-Range Wide-Area Network (LoRaWAN) to ensure efficient and reliable data transmission. The IoT-based soil monitoring system, as depicted in Figure 3d, incorporates these LoRaWAN-enabled devices. Additionally, the innovative smart trap for insect monitoring, showcased in Figure 3e, was proposed by the authors as a prototype system.  
The IoT-based system for soil monitoring consists of an Arduino Nano, soil sensors, a 3.7 V 3000 mAh battery, and a Tiny GPS [47]. To enable wireless communication and achieve seamless data transmission over a range of approximately 2 km, the system utilizes the Gravitech S767 microcontroller from CAT Telecom, National Telecom Public CompanyLimited, Lak Si, Bangkok, Thailand, produced in Thailand, which implements the LoRaWAN. The microcontroller Arduino Nano version 3.0 from Arduino LLC, Somerville, MA, USA interfaces with the soil sensors using RS485 communication. The IoT devices are programmed to send and retrieve data at five-minute intervals over a period of seven days.  
In this study, the authors primarily utilized the innovative smart trap for insect monitoring and insect counting. The smart trap employs a Raspberry Pi controller and advanced object-detection techniques, specifically YOLOv5. This integration enables real-time decision making in precision agriculture, with the aim of minimizing chemical usage, promoting sustainable crop protection, and optimizing crop yield and quality. This integration serves the purpose of fostering a future marked by sustainable and productive farming practices.