# A Collaborative UAV-WSN Network for Monitoring Large Areas
## 2 Materials and Methods
### WSN Discovery and Clustering Support
Collision avoidance for the unicast message replies is handled natively at the IEEE802.15.4 compliant radio transceiver by means of CSMA/CA protocol (Carrier Sense Multiple Access/Collision Avoidance). In practice this leads to a random communication back-off time for each of the colliding nodes, bounded by the superframe duration of the protocol. As a design choice of the communication architecture, the UAV discovers the ground sensor node positions in the initialization phase Additional data is received by the UAV along with the unicast message that includes the RIME address, the RSSI value, the LQI value. We further discuss the routine called when the UAV node receives a unicast message from sensor nodes. First the algorithm (Algorithm 3) decides whether it has already been included in the node list or not. If the RIME address of the sender is not found in the list, a new entry is created and the node structure fields are initialized with the current info. Otherwise, if the node's address matches a position on the list, the values of interest are updated as follows:  
1. the energy level is updated;
2. LQI_Min value is updated if the current value is lower than the stored value;  
Figure 6: UAV-WSN survey dialog sequence. If the stored sequence number \(t\) is equal to the current broadcast sequence number, the RSSI_MAX value is updated if the current value is greater than the old one and if the \(U_{i}\) parameter is incremented. If \(t\) is different, then a RSSI comparison is carried out. If the current RSSI value is greater than the stored RSSI_MAX value, the \(t\) sequence number is updated and the value of the parameter \(U_{i}\) is assigned 1. RSSI is updated as well. On the other hand, if RSSI is lower, only the \(U_{i}\) parameter is updated. The captured data analysis starts with dividing the list of sensor nodes based on the ranges appearing in the sequence number \(t\). Intervals of such sequences are chosen by taking into account the network size. A cluster head is elected for each group of sensor nodes. The election method consists of a scoring system with different weights for the selection indicators. This process uses a combined weight \(S_{i}\) for each \(U_{i}\in\ M_{ij}\ i\ \in\ \{1,\ldots,n\}\), where \(M_{ij}\) is the set of sensor nodes with the sequence value \(t_{j}\), where \(t_{i}\ \in\ \{t,\ldots,t+m\}\) and \(m\) is chosen as according to the size of the network as well. We chose it empirically as to include in the node discovery process a minimum number of ground nodes for each broadcast instance relayed by the UAV. The number of sequences \(m\) is inverse proportional with the ground sensor network deployment density. \(S_{i}\) is defined as showing in (3):  
\[S_{i}=\omega_{1}\cdot B_{i}+\omega_{2}\cdot|RSSI_{MAX_{i}}|+\omega_{3}\cdot E _{i}+\omega_{4}\cdot 1/LQI_{MIN_{i}} \tag{3}\]  
Figure 7: UAV Probe Flight for ground WSN nodes revealing. where \(\omega_{1}\), \(\omega_{2}\), \(\omega_{3}\), \(\omega_{4}\) are the weights for each indicator, and \(B_{i}\) is a binary parameter associated with the sensor \(U_{i}\) taking the value \"1\" if the sensor responded to UAV and \"0\" else. Current experiments have used a larger value for \(\omega\) for the RSSI and energy levels of the nodes but the mechanism is flexible to allow dynamic reconfiguration of the cluster head scoring. The cluster heads are elected for each \(M_{ij}\), by choosing the sensor node with the maximum \(S_{i}\) value.