## 4 System Description
### Algorithm
Choosing between using batteries or solar power would be determined by the type of crop or the desired size for the sensor node. Trees remain productive each year without needing to plant new ones, but other crops are not used after the harvest, where the field is left to rest until the planting season. Therefore, the nodes could be fixed or be removed and deployed again according to the type of crop and its characteristics. Most fields are far from populated areas, and interferences from other networks are lower than industrial or urban environments. However, testing the area for other networks is a good practice to choose the best settings and communication technology for the PA system. Lastly, extreme weather conditions are unavoidable, but some measures can be taken to reduce the damage that can be caused by the elements of the PA system. For example, if a weather station is incorporated into the PA system, the drone could decide whether it is safe or not to fly. The sensor nodes should have a protective encapsulation and be able to store the data of several days to ensure no data is lost. Furthermore, if the drone were to be lost due to extreme wind or rain, the SD cards in the sensor nodes would ensure that the data can be accessed manually. The information monitored in each one of the sensors is unique, and as we have previously commented, it must be forwarded to a remote location where the data center is deployed. Due to the limitations intrinsic to the deployed network which has a limited processing and storage capacity, limited power availability, and a short time interval for the communication between the node and the drone, we consider a system comprised of soil monitoring nodes. These remote sensing drones obtain video and photographs of the fields and gather the data from the nodes, the base station of the node that includes a gateway to send the data to the remote location, and the data center situated in a remote location where the data is stored and analyzed. The functioning algorithm of the drone is presented in Figure 6. Firstly, the drone loads the flight plan, which can be designed using the existing software for flight plan designs and considering crop requirements. After the setup, the drone asks for the weather information gathered by the weather station. If the wind speed is greater than the threshold value (wth), the flight is cancelled, and the drone waits until the next scheduled flight. If the wind speed is correct, the rain amount is then checked. If the threshold value (rth) is surpassed, the flight is cancelled as well. If everything is correct, the drone checks the available energy. If there is enough energy, the drone begins the route through the fields. If there is not enough energy, the drone cancels the flight. Then, the drone checks if a node is asking for a connection. If there is no node to connect with, a photo of the field is taken, and the available energy is re-evaluated. When a node is detected, a connection is established, and the drone receives the data. When all the data has been received, the drone sends a disconnect message to the node to indicate that the connection is terminated and that the node should go to sleep mode and should not try to connect to the drone for the time determined in the settings. By doing this, the possible interferences caused by other nodes deployed in the fields in the coverage range of the drone are avoided. Although interferences among the nodes for the configurations of node coverages for orchards of fruit-bearing trees, as contemplated in this scenario, would only be possible with the case of 1 node per 60 m\({}^{2}\) of node density. The detailed explanation of the different node densities considered for different types of crops is presented in Section 5.1. After that, an oblique photo of the field is retaken, and the drone looks for another node. When the route was finalized, the drone goes to the base station and forwards the data to the database at the remote location for further analysis.