## 2 Materials and Methods
### Sensors and the Beacon  
To monitor a set of sensors, we developed a beacon to provide the following tasks: handle different types of sensors, obtain reliable measurements, control the flow of information, temporarily store the data, and control communications to transfer all the information. As shown in Figure 2, the beacon was composed of an ATmega2560 MCU processor, an RFM95 LoRa communication device integrated into the Dragino LoRa v1.4 board, a microSD module to temporarily store the information, a DHT11 module to measure temperature and humidity, and a Bluetooth HC-05 communication module.  
Main sensors integrated into the beacon provide information about temperature and humidity because these variables are essential in a large variety of applications such as  
Figure 1: System scheme.  
Figure 2: Beacon components.  
precision agriculture, environmental control, climate monitoring, etc. The design of the beacon also allows the incorporation of other sensor devices through a Bluetooth connection. To verify the correct communication with external sensors, an electronic nose, capable of detecting compounds in the air, is connected to the beacon. This device has been applied in a wide variety of applications. For example, in precision agriculture, it has been used to monitor crops and detect diseases [27; 28]. In environmental monitoring, e-noses have been applied to monitor atmospheric pollution [29; 30]. Medical applications have also employed e-noses in diagnosing diseases [31].  
The electronic nose considered in this work was developed in a previous research work [32]. The electronic nose incorporated a Bluetooth communication system capable of transferring the data to and from the beacon. The components that made up this electronic nose were the following: a PIC18F46K80 microcontroller, an RN42 VX Bluetooth module, and 4 gas sensors: MiCS-4514, MiCS-4514, MiCS-5914, and MiCS-5526 from Sensirion (Stafa, Switzerland). The sensor MiCS-4514 included two sensing elements with independent heaters and sensing layers. One sensor detected oxidizing gases (OX), while the other sensor detected reducing gases (RED). The core of the device was a high-performance 8-bit microcontroller (PIC18F46K80) with 64 kB of program memory and 3648 bytes of RAM. The entire system was powered by a 3.7 V 600 mAh Li-polymer rechargeable external battery. The main advantage of connecting the e-nose with the beacon via Bluetooth was that they could be located at a certain distance, avoiding possible interference between them.  
The algorithm that controls the operation of the beacon begins detecting all sensors and initializes LoRa and Bluetooth communication parameters. Once this phase is finished, the microcontroller and the LoRa communication module enter a low consumption state. This mode allows the system to alternate activity and rest periods, increasing its autonomy. While the device is activated, sensor data and UAV messages can be received. Finally, when the beacon and the UAV are linked, data can be transferred through the LoRa connection.  
Figure 3 shows the beacon system. In Figure 3a, the beacon appears in the left part of the image, and the electronic nose is in the right part. In addition, to appreciate the small size of all components, a EUR 2 coin is shown between both devices. Beacon internal components and their connections are presented in Figure 3b.