# UAV Path Optimization for Precision Agriculture Wireless Sensor Networks
## 3 Proposed Strategy
### Timeslots as Time Base  
We adopt as a premise large territorial extensions where there is no signal coverage by a cellular network or even other internet service providers. Therefore, SNs may use GPS signals to adjust and synchronize their internal clocks, a viable alternative that is increasingly cheaper and has low energy consumption [31; 32]. As an alternative method, we consider an initial configuration of the slotframe and timeslot time for each SN before its deployment. However, in this approach, there is a problem of synchronism drift among the clocks of all SNs, which must be corrected during the UAV flight phase. This can be done  
Figure 3: Example of path created by the DDNN model for UAV. Figure 2: _Nearest point_ geometrical representation. by the UAV sending two rendezvous messages, one at the beginning and another in the middle of the timeslot period. This procedure ensures synchronization with jitter of up to half the duration of a timeslot [33]. If the UAV specifies, in these association messages, when it is the beginning and when it is the middle, the sensors will be able to align their timers in relation to the start of a timeslot. If the UAV also sends the number of that timeslot within the slotframe; then, both corrections are successful. Furthermore, we assume that, when starting the UAV flight, each SN finds itself in a random timeslot, unknown by the UAV. In other timeslots in which the SN is not in active mode, we consider that they are in hibernation mode. The total flight time to collect the data from the \(N\) SNs assigned to a specific UAV is  
\[T_{N}=\sum_{i=1}^{N}\left(\frac{d_{i-1,i}}{v_{a}}+t_{i}\right)=\frac{D_{N}}{v_{ a}}+\sum_{i=1}^{N}t_{i}=\frac{D_{N}}{v_{a}}+Nt_{R}, \tag{3}\]  
where \(D_{N}\) is the UAV total flight distance to cover the \(N\) SNs distributed throughout the total area assigned to the UAV, \(v_{a}\) is the average UAV speed, and \(t_{i}\) is the communication time between the \(i\)th SN and the UAV. We assume the same communication time between UAV and \(i\)th SN, denoted by \(t_{R}\). In individual scenarios, we assume that each SN has its own timeslot to become active, as presented in Figure 4. In shared timeslots' scenarios, we assume that two or more SNs can become active at the same timeslot, as presented in Figure 5. In both scenarios, the process is the same, described by flowchart 1, boxes 7, 8, and 11 to 14, in Figure 11a. The UAV flies over the SNs to locate and reconfigure them. When the UAV finally finds SN2 active over TS6, it reads its data during a period called Reading Time (\(t_{R}\)) here, reconfigure its activation timeslot according to its own route, and then shuts it down to hibernate again until its new timeslot. The main difference between the two scenarios is that with individual timeslots we assume one SN per timeslot and the UAV blocks that TS for a future fly in it Prohibition List. In scenarios with shared timeslots, the UAV keeps flying over other SNs. We can observe in both figures that the SN activation time becomes shorter when it was already found by the UAV, since it stays in sleep mode until the next UAV visit. Figure 4: Individual Timeslots scenario. Figure 6 illustrates the final result after all SNs have been properly reconfigured by the UAV. Each one is now transmitting on its scheduled timeslot, according to the UAV flight. The UAV that is in its initial position at the BS must follow its pre-defined route among all SNs, so that each SN has its own timeslot for starting their active state. As we can see in Figure 6, the UAV must travel to SN1 and the time for this displacement is one TS. Therefore, SN1 must start its active mode in TS1. After successfully connecting and reading the sensory data from it, the UAV shuts it down to hibernation state for a calculated time (in timeslots), so the UAV can fly to its next destination. After that, the UAV has more than one timeslot to fly from SN1 to SN2, which will be in active mode only in TS3.