# Unmanned Aerial Vehicle Based Wireless Sensor Network for Marine-Coastal Environment Monitoring
## 3 SIMMA System Architecture
### Sensor Node  
For this part of the implementation, a custom designed PCB was employed. The main processing unit is a 16 bit PIC24 FJ128 GC006 microcontroller [38], which manages all the peripherals and communications. Given its architecture, it offers several low power configurations that can be used to increase the life span of the device. For the wireless communications the RN2483 transceiver was selected [39], as it offers the possibility of transmitting data in a wide range of frequencies with the LoRa modulation. Additionally, the board was suited with an 8 Mbit flash memory and a SIM928A GPS and GSM integrated circuit [40] (Figure 3). \begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline \hline
**Category** & **Name** & **Description** \\ \hline \multirow{6}{*}{Commands for slave nodes which are not in a network} & \multirow{2}{*}{Recruiting which are not in a network} & Message used by the master node to convey to the other nodes that they are allowed to join the newly created network \\ \cline{2-3}  & & \multirow{2}{*}{Request to join join join the network} \\ \cline{2-3}  & & \multirow{2}{*}{Response to a join request to join} \\ \cline{2-3}  & & \multirow{2}{*}{Slave nodes that are not in a network may send this message to transmit their location or data relevant to the application} \\ \hline \multirow{6}{*}{Commands associated to network maintenance} & \multirow{2}{*}{Ping Request to leave net} & The master node requests a slave node to leave the network \\ \cline{2-3}  & & \multirow{2}{*}{Event leave network} & Notification message of a node that left the network \\ \cline{2-3}  & & \multirow{2}{*}{Scan network} & The master node sends a scan network petition to the oxFFFF address (broadcast), to which any node in the network answers \\ \cline{2-3}  & & \multirow{2}{*}{Synchronism request the network} & The master node transmits its time (GPS) to all nodes in the network: \\ \hline Commands associated to messaging & MAC ACK & Message sent as a confirmation of message reception \\ \cline{2-3}  & & \multirow{2}{*}{Data message} & Main data message, with a maximum payload of 128 bytes \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Network device commands implemented in LoRaNET. Figure 3: Design of the PCB for the environmental sensing buoys. It is worth noting that these PCBs, as shown in Figure 3, have additional devices integrated in the board, such as a Bluetooth modules, accelerometers and SIM card ports for the GSM module. These ICs and modules, although not currently used, are intended for future use and other functional scenarios, providing additional functionality to the boards. Given that these PCBs are intended to be used as ambient sensor nodes, an external BME280 sensor for measuring air temperature, humidity, and pressure [41] was included. Additionally, they also incorporate a 1773 anemometer [42] and an insulated DS18B20 temperature sensor for water measurements [43]. These devices are all connected to the PCBs through the different terminal blocks present in the design, and are managed by the microcontroller through I2C, One-Wire, or digital communications (Figure 4). Moreover, the sensor nodes were coupled with a 433 MHz omnidirectional passive antenna with a 50 ohm impedance. The sensor node functionality can be summarized in two high level tasks: sensing data and handling requests. The first of the tasks is the simpler of the two and will be carried out periodically, depending on how the node is configured. The handling request task manages all the LoRa incoming messages, whether it is a data transmission or configuration activity (Figure 5). Figure 4: Block diagram of a sensor node’s peripheral connections. Figure 5: Sensor node’s task diagram. Within the configuration activities, the sensor node's LoRa RF settings and the device's operating configuration can be set by the master node through the LoRa communications.