# An Internet of Things (IoT) Application on Volcano Monitoring
## 3 IoT Thermometers Network
### Control Unit  
The microcontroller to be used must meet one crucial requirement: the lowest possible power consumption. According to the minimum features needed, and also taking into account the size and price, different microcontrollers were tested in order to choose the most appropriate: the ATMEGA328 [81] from Microchip, the STM32 FI03C8T6 [82] from STMicroelectronics, and the PIC18 LF25K40 [83] and PIC16 LF1788 [84] from Microchip. Each of them was programmed for the temperature acquisition, and then, the total consumption was measured both during operation  
Figure 4: End device. Configuration (**a**) and general hardware scheme (**b**).  
mode (measuring) and sleep mode (waiting for the next acquisition) using a 3.7-V and 2600-mAh lithium battery. Table 2 shows the results obtained:  
Since a system with the longest battery life was desired, and taking into account the results shown in Table 2, the chosen microcontroller was PIC16 LF1788 (Table 3).  
Temperature Measurement  
Measurements are made by means of a platinum RTD, PT100B sensor [85], connected to a MAX31685 [86], which is in charge of the conversion of the RTD values into temperature values. The MAX31685 module is an amplifier designed to read the low RTD resistance and automatically compensate it for the resistance of the connecting wires. This module is powered from the GPIO pins of the microcontroller, using SPI protocol for communication between them (Figure 4b).  
Power Supply  
Two different types of lithium batteries were tested in order to choose the best option: a Li-ion rechargeable battery from Samsung [87], and a lithium-thionyl chloride non-rechargeable battery from Keeper [88]. The technical specifications are shown in Table 4.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Microcontroller** & **Sleep (\(\mu\)W)** & **ON (mW)** \\ \hline ATMEGA328 & 16.28 & 89.54 \\ \hline STM32F103C8T6 & 12.58 & 190.92 \\ \hline PIC18 LF25K40 & 45.88 & 69.93 \\ \hline PIC16 LF1788 & 2.96 & 70.3 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Microcontrollers’ power consumption.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**PIC16 LF1788 Features** \\ \hline Program Memory Size & 28 KB (Flash) \\ \hline CPU Speed/Internal oscillator & 8 MIPS/ 32 MHz \\ \hline SRAM & 2048 Bytes \\ \hline Data EEPROM & 256 Bytes \\ \hline Digital Communication Peripherals & 1-UART, 1-SPI, 1-l2C1 MSSP(SPI/I2C) \\ \hline Timers & \(2\times 8\)-bit \(1\times 16\)-bit \\ \hline ADC Input & 11 ch, 12-bit \\ \hline Temperature Range & \(-40\) to \(125\)\({}^{\circ}\)C \\ \hline Operating Voltage Range & 1.8 to 5.5 V \\ \hline Low Power & Yes \\ \hline \hline \end{tabular}
\end{table}
Table 3: The PIC16 LF1788 features.  
At first sight, it seemed that the rechargeable battery was the better option, since it had the highest capacity. However, taking into account: (i) the batteries' operating temperature range, (ii) the expected temperature range in the volcanic area (up to 85 \({}^{\circ}\)C), and (iii) the ease of purchase, the two batteries were used in order to test which one was the best option basing on field tests (see Section 4).  
The battery was connected to the microcontroller analog to digital converter through a voltage divider in order to monitor its voltage in real-time. In this way, a state of health (SOH) parameter of each thermometer is provided.