# IoT Open-Source Architecture for the Maintenance of Building Facilities
## 3 Materials and Methods
### IoT System Components  
The proposed IoT system is based on open-source tools and market components. This system is flexible to set up, to add extra sensors and sensor nodes in real case-building facilities, as well as to add IoT sensors data into the 3D digital model of the building, according to any requirement of end-users. Coming to the specific application, physical parameters must be acquired to monitor the room's internal conditions and to control the FC operation. For that reason, sensors shown in Table 1 are placed in the room and connected to their sensor boards. To oversee the temperature, relative humidity, and illuminance of the room, the DHT22 sensor and a light-dependent resistor (LDR), are connected to the ESP8266 module. FC monitoring sensors are connected to the RPIZCT4V3T2 board. Furthermore, both sensor boards are connected to the server board Raspberry Pi 3B (Rpi3B) to store and display incoming data locally and remotely using wireless sensor nodes (WSN). The networking and hardware connectivity block diagram of the system is displayed in Figure 2. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Sensor Board** & **Sensor Name** & **Accuracy** & \begin{tabular}{c} **Measuring** \\ **Ranges** \\ \end{tabular} & **Units** \\ \hline \multirow{6}{*}{RPIZCT4V3T2} & Current & \multirow{2}{*}{\(\pm 3\)} & \multirow{2}{*}{0–100 A} & \multirow{2}{*}{Ampere (A)} \\  & (SCT-013-000) & & & \\ \cline{1-1} \cline{2-5}  & Voltage & & & \\ \cline{1-1} \cline{2-5}  & (EU: 77 DE-06-09) & & & \\ \cline{1-1} \cline{2-5}  & Temperature & & & \\ \cline{1-1} \cline{2-5}  & (DS18B20) & & & \\ \cline{1-1} \cline{2-5}  & Temperature & & & \\ \cline{1-1} \cline{2-5}  & (PT100) & & & \\ \hline \multirow{6}{*}{ESP8266} & Ambient & \multirow{2}{*}{\(\pm 2\)} & \multirow{2}{*}{0–100\% RH} & Relative Humidity (\%RH) \\ \cline{1-1} \cline{2-5}  & temperature & & & \\ \cline{1-1} \cline{2-5}  & (DHT22) & & & \\ \cline{1-1} \cline{2-5}  & \
\begin{tabular}{c} Photoresistor \\ (LDR) \\ \end{tabular} &
\begin{tabular}{c} Resistant \\ dependent \\ \end{tabular} & 0–1 M\(\Omega\) & \(\rm{lx}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Applied sensors with technical specifications. Figure 1: IoT and BIM integration system architecture. The ESP8266 module is powered by a simple universal serial bus (USB) cable and automatically connects to the Rpi3B by means of installed credentials. In case of wireless network failure or unavailability, the board tries to connect again every five seconds until a successful connection is established. After that, the ESP8266 starts to collect data from the deployed sensors through the defined pins and the acquired data are sent through a serial monitor to the server with a sampling frequency of 1 Hz. An RPIZCT4V3T2 sensor board is used to monitor the FC of the room; Figure 3 shows a simplified block diagram of the sensor board. The RPIZCT4V3T2 board hosts an Arduino microcontroller (MCU) that is connected to two types of temperature sensors and current/voltage sensors that are connected to the MCU through an amplifier and analog to digital converter (ADC). Additionally, the RPIZCT4V3T2 board is connected to the Raspberry Pi (Rpi) Zero W. The MCU collects all the raw data, computes necessary values, sending the final computation to the Rpi Zero W using the universal asynchronous receiver-transmitter (UART) serial port; Rpi Zero W supports Wi-Fi and the board connects to the server Rpi3B through IP address. The sampling frequency of each sensor is specific and explained later in the next section. The main component of the IoT and BIM system is the Rpi3B, which is a small single-board computer; it operates as server, networking router, middle communicator, hosts a dashboard, and a database. The Rpi3B system connects with other sensor nodes through the Wi-Fi network and logs the received data from the sensors to a database.