# Comparing Monitoring Networks to Assess Urban Heat Islands in Smart Cities
## 3 Choice of System Components and Programming
### Central processing unit or microcontroller  
In this case, the manufactured device has an MCU that centralizes all the acquisition, conversion, processing, and transmission functions of the monitored data. The MCU (ATMega328P [66]), with an Arduino UNO architecture, allows the different actions to be adjusted during the data capture and transmission processes. It is programmed using the IDE from Arduino. The firmware, based on an example from the manufacturer, has been adapted to comply with the requirements of the system concerning the communication protocol, dispatch frequency, sleep time, and the activation of the sensors connected to the MCU. The MCU is contained in a polycarbonate waterproof box measuring 84 \(\times\) 82 \(\times\) 55 mm that has an external, detachable antenna of +2.5 dBi [67], which improves signal coverage. The box is situated close to the sensor and is connected via a cable and a cable gland. For the transmission of sensor data to the MCU, it uses an I2C communication protocol and functions with an operating voltage of between 2.4 V and 5.5 V. As for its functions, they are as follows:  
* Initialization: The measuring functions are included in the base code, and the SHT library is modified to use the SHT35. * Sampling rate: A default sampling period of 15 min is established, which allows compliance with the Duty Cycle (Air Time) that requires the use of ISM bands, which avoids passing the emissions limit of 1% [68]. This can be modified up to a maximum of one minute if necessary. * Raw data conversion: The raw data are packaged in a message with the units converted to whole numbers, multiplying the values by 10 to eliminate the decimals. The server later carries out the inverse operation to obtain the decimal value. * Message coding: To be able to use the LoRaWAN protocol, a series of keywords and addresses have been included that allow the data from the device to be identified and decoded. The ABP method has been used. This programs a Device Address identifier and two keywords (NetworkSessionKey and ApplicationSessionKey) into each AWS that is necessary for connecting to the server that distributes the system's data, ChirpStack [69]. * Data quality control: This is carried out solely by the SHT35 sensor itself through the basic factory-programmed functions. In addition, although the SHT35 sensor is delivered already calibrated, the various registers of the AWSs have been compared before their definitive installation, placing them in a controlled site for a measurement period of 72 h (the devices registered maximum temperature differences of 0.2 \({}^{\circ}\)C and relative humidity differences of 5%, with data being registered every 15 min). On the other hand, as a digital communication bus is used, no loss of accuracy occurs in the data readings. Figure 2: (**a**) Typical tolerance of RH over T for SHT35. (**b**) Appearance of the AWS. (**c**) Inside the MCU box. * Local data storage: Data are temporarily stored in the dynamic memory of the MCU, where the unit conversion takes place and from where the data are sent. * Data transmission: The IoT connectivity is carried out via LoRa using the RFM95 transceiver [70] on the frequency band 868 MHz, integrated in the motherboard of the device for sending transmissions within the frequency range permitted by the European Union for LoRaWAN (863-870 MHz) [71]. In this case, the AWS does not have averaging functions, manual entry of observations, data reduction, local data visualization, or remote diagnostics and maintenance. These functions are performed through the centralized system, using alerts. 1. Peripheral equipment  
Continuous energy supply is provided through two long-life lithium LR6 batteries of 3000 mAh. The battery life is made even longer by activating the \"deep sleep\" mode, which reduces the functions of the AWS to a minimum between readings. The quartz clock inside the MCU is used to ensure accuracy in the timing and the established periodicity of the sampling.