# Design of an Integrated Remote and Ground Sensing Monitor System for Assessing Farmland Quality
## 3 Data Transmission Optimization Routing Protocol
### Data Transmission Scheduling
```
1: Initialize: The complete list \(N\) of sensor nodes and the number of sensor nodes \(n\), the list \(D\) of demand nodes, the quantity of data \(DD\) that must be transmitted, and the number of demand nodes \(n_{dn}\), the list \(S\) of support nodes, the quantity of data transmission \(SD\) available for support, and the number of support nodes \(n_{sn}\). 2: While \(n_{dn}>0\) and \(n_{sn}>0\), do
3: Sort \(D\) according to \(DD\) and \(S\) according to \(SD\) in descending order
4: If \(DD_{l}\geq SD_{l}\), then
5:\(DD_{l}=DD_{l}-SD_{l}\)
6:\(SD_{l}=0\)
7:\(n_{sn}=n_{sn}-1\)
8: Else
9:\(DD_{l}=0\)
10:\(SD_{l}=SD_{l}-DD_{l}\)
11:\(n_{dn}=n_{dn}-1\)
12: End if
13: While \(S_{l}\) has not been found, then
14: For all nodes lying one more jump away from \(D_{l}\), do
15: If \(S_{l}\) is found in these nodes, then
16: Record the route
17: Break
18: End if
19: End for
20: End while
21: End while
```

**Algorithm 3** Maximum Data Greedy Scheduling and the Diffusion Route Finding Algorithm. ## 4 Simulations

The performance of the improved UAV-WSN system and the DTGRP proposed in this study was assessed for a WSN composed of a single cluster using Monte Carlo simulations for different spatial resolution images captured by a UAV based on comparisons with the performance obtained for a conventional UAV-WSN system employing the LEACH protocol. ### Simulation Setup

We used the C# programming language and Visual Studio 2017 to program an emulator for the UAV-WSN system, using SQL Server 2017 to manage the emulator data. The area of the simulated region was \(500\times 500\) m. The number of sensor nodes in the cluster was 10. The parameters of the sensor nodes and the sink node were based on those of the CC2530 (Texas Instruments, Inc., Dallas, TX, USA) second generation system-on-chip (SoC) solution for Low Rate Wireless Personal Area Network (LR-WPAN), Zigbee, and RF4 CE applications, which is one of the most commonly employed communication modules in WSNs. To ensure accuracy, numerous node parameters were considered, such as the communication rate, sending current, and receiving current. Each sensor node was set to record four values as a single unit of data and save 12 units of data every day. All the heights of the nodes were set to be 0 m. The aircraft and camera parameters of the simulated UAV were based on the DJI Phantom 3 Advanced drone, which is a quadcopter with a complementary metal oxide semiconductor (CMOS) sensor for vertical photograph capture. The primary parameters include a maximum UAV speed of 16 m/s, a maximum flight time of about 23 min, and an image size of \(4000\times 3000\) pixels. The side overlap of the images captured by the drone was 60%. The speed of the drone was held at a constant 8 m/s and the flight height of the drone was held when in the planned flight path. The spatial resolutions of the images varied from \(0.5\times 0.5\) cm to \(4\times 4\) cm in increments of 0.5 cm. The altitude of the drone and the density of the flight lines were determined according to the spatial resolutions of the images and other parameters. We conducted 1000 simulations with the 10 sensor nodes of the WSN randomly deployed in the simulated region for each spatial image resolution considered. The sensor node deployment was constrained to ensure that every sensor node was able to communicate with at least one other sensor node in the WSN. In addition, the total coverage area of UAV imaging is always greater than the area of the farmland, and various flight paths can be adopted to effectively image the selected region. Therefore, 10 flight paths that appropriately imaged the farmland area were randomly configured within the simulations. Accordingly, \(1000\times 10\) simulations were conducted for each spatial resolution considered. Three performance indicators were adopted for evaluating system performance. These included the total volume of data transmitted by the ground cluster of the WSN and the sink node of the UAV, the energy efficiency, and the maximum revisit period.