# UAV Path Optimization for Precision Agriculture Wireless Sensor Networks
## 5 Results
Figure 20 shows a comparison of the SNs average active time before and after the reconfiguration process for the scenario \(S_{1}\). After that, the UAV is able to position itself over the SN coordinates for a short time before the SN goes into active mode in order to collect sensory data. Once detecting that the SN is in active mode, the UAV collects the sensory data for a period--here called Reading  
Figure 17: Flight distance during the reconfiguration phase. Figure 18: Reduction in traveled distance of \(S_{1}\) compared to \(S_{4}\). Time (\(t_{R}\))--and then forces the SN to hibernate again until its next active timeslot. In all simulations, we adopt the value of \(t_{R}=3\) s, as shown in Table 1. For scenarios with 20 SNs and timeslot time (\(N_{\rm{T}}\)) = 22 s, we obtained a reduction of up to 89% in the SN active time after scenario reconfiguration, which is a fundamental factor to guarantee a longer lifetime of the SNs. Figure 19: Flight time with and without Prohibition List. Figure 20: Active transmission time before and after reconfiguration. Figure 21 presents an analysis of the hibernation and active states from a single SN, considering \(S_{1}\) with 10 SNs. The representation of other SNs was omitted to facilitate the analysis. On the left vertical axis, we have the SN states (active is represented as ON and hibernation is OFF). On the right vertical axis, we have the amount of pending SNs, waiting to be reconfigured by the UAV. Both axes are in function of the UAV flight time. For scenarios \(S_{1}\) to \(S_{4}\), we have a particularity, where the SN active time is configured for two consecutive timeslots, facilitating the rendezvous of an SN by the UAV. On the other hand, it means that there is a higher energy consumption from the SN. According to the analysis and the graphical representation generated by the logs in Figure 21, we can see that the SN transmitted for 29 s (two consecutive timeslots) in the first minute of UAV flight; however, it was not found by the UAV. Then, at 4 min, we can see that the SN active period is shorter than the first one; furthermore, according to the graph represented by the right vertical axis, we can see a reduction in the number of pending SNs at this moment (red circle indicated in the graph), which characterizes that this SN was located and reconfigured by the UAV, that is, one less pending SN. We recall that, when the UAV reconfigures or collects the sensory data from any SN, it forces them to hibernate until its next activation TS, shortening its active time, which is why the activation period was shorter. Between 6 and 7 min, the SN active period were two timeslots, it is because the UAV removed this SN from its reconfiguration route. After 10 min of flight, we can notice that there are no more SNs to reconfigure, since the number of pending SNs is zero--that is, all SNs are already transmitting according to the optimized UAV route. Therefore, the UAV will always be positioned over the SN when its state becomes active, collecting its sensory data for the configured period of Reading Time (\(t_{R}\)) configured for 3 s, then putting the SN to hibernate until its next activation round. Therefore, we can graphically observe a significant reduction in the SN active period, after the UAV finished to locate all SNs (pending SNs equal to zero). Figure 22 presents a similar analysis but for \(S_{5}\) with 10 SNs, the worst case scenario at the point of view of the SNs reconfiguration time, as they are active during a single timeslot (14s). In the figure, we can observe the activation periods of a single SN until it is located by the UAV. The periods of the other SNs are not shown, in order to facilitate the analysis. The highlighted circle in the graph represents the moment when the SN is finally located and reconfigured by the UAV. The SN went into an active state for 27 times until the UAV reconfigure it, while the process itself took approximately 95 min.