IoT Open-Source Architecture for the Maintenance of Building Facilities

: The introduction of the Internet of Things (IoT) in the construction industry is evolving facility maintenance (FM) towards predictive maintenance development. Predictive maintenance of building facilities requires continuously updated data on construction components to be acquired through integrated sensors. The main challenges in developing predictive maintenance tools for building facilities is IoT integration, IoT data visualization on the building 3D model and implementation of maintenance management system on the IoT and building information modeling (BIM). The current 3D building models do not fully interact with IoT building facilities data. Data integration in BIM is challenging. The research aims to integrate IoT alert systems with BIM models to monitor building facilities during the operational phase and to visualize building facilities’ conditions virtually. To provide efﬁcient maintenance services for building facilities this research proposes an integration of a digital framework based on IoT and BIM platforms. Sensors applied in the building systems and IoT technology on a cloud platform with opensource tools and standards enable monitoring of real-time operation and detecting of different kinds of faults in case of malfunction or failure, therefore sending alerts to facility managers and operators. Proposed preventive maintenance methodology applied on a proof-of-concept heating, ventilation and air conditioning (HVAC) plant adopts open source IoT sensor networks. The results show that the integrated IoT and BIM dashboard framework and implemented building structures preventive maintenance methodology are applicable and promising. The automated system architecture of building facilities is intended to provide a reliable and practical tool for real-time data acquisition. Analysis and 3D visualization to support intelligent monitoring of the indoor condition in buildings will enable the facility managers to make faster and better decisions and to improve building facilities’ real time monitoring with fallouts on the maintenance timeliness.


Introduction
Correctly managing the maintenance phase is the pivot to lower costs and energy waste [1] and to preserve the asset value over time and, above all, to maintain the level of performance required by users. Real Estate property managers are now realizing that investing in this activity brings tangible benefits in terms of investment preservation and a strong perception by customers/users. One of the early frameworks used to visualize the collected data was the building management system (BMS), developed in the 1980s [2]. The BMS is a system for controlling and monitoring a building's facilities, such as heating, lighting, electrical and mechanical services, safety and security [3]. Since the introduction managers can remotely monitor the thermal condition of fan coils and take necessary actions, e.g., if the operating temperature exceeds the pre-defined thresholds. As a result, this paper is organized as follows: a review of the literature related to the current research topic is reported in Section 2, the design architecture of the framework is presented in Section 3 together with the FM fault detection method. IoT and BIM application with data visualization within the case study is presented in Section 4, and finally the results of the IoT and BIM application for the considered case study are discussed.

Operation and Maintenance in Facility Management
Considering the whole life cycle, operation and maintenance (O&M) is the longest and most costly phase compared to others [27]. Therefore, the efficiency of control and monitoring systems is becoming increasingly important. An overall improvement in operational efficiency will be achieved due to improved technologies for data collection and inter-device communication, besides the decreasing cost of sensors with good data collection capabilities [28]. As the complexity and number of devices in HVAC systems increases, errors due to incorrect system configuration may increase; it is estimated that 40% of buildings have improperly configured devices [29] and there is a potential for 40% energy savings from correcting building errors [30]. This not only results in energy waste, but also in system malfunctions leading to discomfort indoors and also reduces air quality levels [31]. For this reason, fault detection and diagnosis (FDD) is becoming more and more important.
As FM is worth up to 85% of the building's entire life cycle cost [32], efficiency gains become crucial for cost containment and building quality preservation. Furthermore, facility management is a multidisciplinary topic involving many stakeholders and requires the collaboration and coordination of several different teams [33]. ISO 41011:2017 defines FM as an "organizational function which integrates people, place and process within the built environment with the purpose of improving the quality of life of people and the productivity of the core business" [34]. Most buildings currently do not operate efficiently due to standard procedures, fittings not customized for specific use, that generate a lack of information for operators [35]. In addition, there is habitually no historical data available to compare situations and to properly search for the cause for malfunctions or failures; the tools that come along with digital management are often still manually updated spreadsheets, making performance tracking challenging. Moreover, this mixed process is prone to error and confusion. Sometimes some important information is included in the digital models but they cannot describe the building systems' operation accurately. On the other hand, understanding and using real-time data is crucial nowadays, especially in high-performance buildings equipped with complex and multiple systems that require dynamic management to optimize their energy performance and provide adequate indoor environmental conditions for a large number of occupants [6].
HVAC systems are essential for efficient building operation and indoor air quality (IAQ) is critical to the habitability and comfort of spaces; many research efforts are now focusing on air quality monitoring for post-COVID-19 recovery [36]. HVAC systems also consume about 30% of primary energy in Europe [37], 14% of primary energy in the United States [38], and about 32% of the total amount of electricity generated in the United States [39]. Calculated energy waste as a result of defects in building HVAC systems is due to inappropriate operating procedures, equipment malfunctions, or design issues [40], while controlled and efficient management of HVAC systems is expected to save an average of 5-15% of total energy consumption if fully adopted in existing buildings [41,42].

BIM and IoT as Digital Twins
With the introduction of sensing and IoT in the construction industry, a new vision of building management tools has been emerging. In particular, a significant solution taken from the manufacturing sector has arisen: cyber-physical systems (CPS) [33]. CPS, better known as digital twins (DT), are a revolutionary digital vision, where the most innovative technologies come together to create a virtual model that performs exactly like its physical "twin". This continuous information exchange between the data collected in the real building and those processed by the virtual model through self-learning algorithms, makes it possible to mirror the life of the real twin and the corresponding building, to predict the building components' health, their useful life, failures [43] and, in general, the building performance [44]. In the Industry 4.0 era, physical and virtual worlds are really growing together [45].
Asghari, Rahmani, and Javadi [46] define IoT as "an ecosystem that contains smart objects equipped with sensors, networking and processing technologies integrating and working together to provide an environment in which smart services are taken to the end-users".
IoT is an unprecedented disruptive technology that has led to interconnection between people and objects on a scale and pace unimaginable even a decade ago [47]. It enables new strategies to improve the quality of life [48], allows autonomous decisions to connected devices through algorithms and machine learning, and can properly inform users to make the best decisions [49], for example, in case of emergencies or major failures. IoT and data networks have great potential in optimizing FM activities, including document management, historical data cataloging, logistics and material tracking, building component lifecycle monitoring, and building energy controls [20]. Several studies have been conducted on the use of data from IoT devices (e.g., [50]), although many of them do not include any BIM integration, and all smart buildings and homes [51] are examples of IoT technology integration.
Actually, the DT can be simply configured as a dashboard with critical performance indicators (KPIs), e.g., data on temperature, pressure, tilt, power, voltage, etc., representing inputs from sensors located on systems' components or in specific environments. This allows the DT to actively participate from the design to the functional phase of any product or process. According to [52], the first appearance of the DT was in NASA's Apollo program. In that case, DT was defined as "an integrated multi-physics, multi-scale, probabilistic simulation of a vehicle or system that uses the best available physical models, sensor updates, fleet history, etc., to mirror the life of its flying twin" [53].
In this situation, NASA needed to reproduce the useful life of its assets in a precise manner through the statistical analysis of the data collected by the sensors [54]. Thus, a DT consists of an entity composed of a physical space, a digital space, and a connection layer.
The digitization permeates across all sectors, including construction, and aims to build systems as well as approaches for helping operators not only in the conceptualization, prototyping, testing, and design optimization phase, but also during the operational phase. The importance of numerical simulation tools in the first phase is unquestionable, however, the potential of real-time data availability in the operational phase is opening new possibilities to monitor and improve operations throughout the life cycle of a product. Grieves [55], in his white-paper, called the presence of this virtual representation a "Digital Twin".
The digital twin arose from the integration of sensor networks and the digitization of machinery and manufacturing systems in the manufacturing industry [56]. The main difference between a design-phase simulation and a digital twin is that the latter requires a physical asset and sensor network, whereas simulation lives in a completely virtual environment [43]. Accordingly, the study in [56] presented an extended definition: "digital twins will facilitate the means to monitor, understand, and optimize the functions of all physical entities, living and non-living, by enabling seamless transmission of data between the physical and virtual worlds." Research in [57] described the simulation aspect of digital twins as the collection of relevant digital artifacts involving engineering and operational data, as well as the description of behavior using various simulation models. Digital twins use these specific simulation models based on their ability to solve problems, derive solutions relevant to real-life systems, and describe behavior. In general, the study in [57] defined the digital twin view as "a complete physical and functional description of a component, product, or system along with all available operational data." Hicks [58] differentiates a digital twin from a virtual prototype and redefines its concept as an appropriately synchronized object of useful information (structure, function, and behavior) of a physical entity in virtual space, with information flows enabling convergence between the physical and virtual states. According to the authors in [44], digital twins represent real objects or subjects with their data, functions, and communication capabilities in the digital world.
Researchers in [59] defined the digital twin of a building as "the interaction between the real-world indoor environment of the building and a digital but realistic virtual representation model of the building environment, which provides the opportunity for real-time monitoring and data acquisition." In their definition, an indoor environment indicates information about air temperature, airflow, relative humidity, and lighting conditions, while a digital virtual environment indicates computational fluid dynamics and luminance levels. Furthermore, based on the study presented in [59], some of the notable advantages of creating a building digital twin are as follows: (1) collection, generation, and visualization of the building environment; (2) analysis of data irregularities; and (3) optimization of building services. The digital twin is continuously updated with sensor data in near real-time, and the data can be reprocessed with algorithms that make the data concise and more usable, even for customers or users. In addition, the large amount of collected data makes decision-making more informed, giving the ability to make predictions about how the object will behave in the future [60].
The DT can be applied to an asset for a technical simulation, with the purpose of integrating different model components to simulate almost every aspect of a complex system [45]. In a manufacturing plant in the industrial sector, for example, a DT offers the ability to simulate and improve the production system, considering the logistical aspects and optimization of the production process.
According to an Oracle report [61], the digital twin has many application areas: real-time remote monitoring and control; increased efficiency and safety at work; risk assessment; synergy and collaboration among team members; informed decision support; customization of products and services; better documentation, data collection and communication; and, most importantly for us, predictive maintenance and scheduling. The IoT paradigm is paving the way for smart cities and smart buildings. The definition of a common model of web-based protocols for data exchange allows transferring this data between objects, making the various network parts interactive. This is where the digital twin concept was born, which is a candidate to revolutionize the building management model through predictive analysis and dynamic simulations based on real-time data [62].
A full digital twin will ensure sensors are collecting data and the onset of failures can be detected well in advance through intelligent analysis of that data. This will allow for better maintenance scheduling.
Digital twin is a concept that can be exported from manufacturing to many fields and technologies [63]. Moreover, digital twin is one of the top ten strategic technology trends, and, according to future research predictions, the digital twin market will reach USD 15 billion by 2023 [57,64].
Once DT has been introduced, a look at how it can be linked to BIM methodology is provided. The U.S. National Institute of Building Sciences (NIBS) defines BIM as "The digital representation of the physical and functional characteristics of a structure. As such, it serves as a shared knowledge resource for information about a structure, forming a re-liable basis for decisions throughout its life cycle from inception onward" [65].
BIM, up from DT is widely used in the construction industry. BIM models allow for integrated information management throughout the building life cycle, including the FM phase [66]. BIM provides a collaborative platform to manage not only the project and its components, but also the relationships between stakeholders [67]. The BIM model acts as a collector of all building information, thus for facility managers it is of great support, working on information that is always up-to-date and shared by all team members, overcoming the uncertainty of paper data and information fragmentation.
However, BIM is much more widely used in the design phase, while in the FM phase it is still underutilized.
The most significant causes hindering this integration are: (1) the use of BIM only as a three-dimensional model, which has no added value in the maintenance management phase [68]; (2) FM workers are not involved in the creation of the model so the information contained within the BIM system is not useful [69]; (3) the need for interoperability between BIM and FM technologies and the lack of open systems [70]; (4) the lack of clear roles, responsibilities, contract and accountability framework [70]; and (5) the information contained in BIM models is static and not dynamic, as FM requires. Data is provided during the design phase but is not updated during the building life cycle [71].
Currently, as reported above, the BIM process is mainly used for visualization, construction, coordination, quantity calculation, planning, and project cost evaluation [72]. BIM is basically a repository for project information, with the major limitation of not transferring all this information to the facility management phase [73] and not being able to handle real-time data.
However, the great potential of a three-dimensional BIM model is the integration with all the virtual reality (VR), augmented reality (AR) and mixed reality (MR) systems. Research can be found discussing the development of collaborative BIM approaches based on AR/MR/VR [74][75][76]. One example is the creation of a framework based on building information modeling, mixed reality, and a cloud platform to support information flow in facility management [77].

IoT and BIM System Architecture
Automated data acquisition (DAQ) technology has seen significant advancements in hardware and software in recent years, even if the majority of available technologies are still expensive and not open-source, namely, a sort of "black box" where users have no access to alter and modify the implemented algorithms. Furthermore, a free access to the data previously stored is frequently impossible without buying a specific software. To address the aforementioned issues and overcome the limits of commercial technologies, studies were recently carried out to investigate and develop customized design of automated DAQ systems. This chapter proposes an automated data acquisition system within the IoT and BIM integration methodology based on open-source technologies.
All the sensors for building facilities and rooms are hosted by Arduino based microcontrollers and a Raspberry Pi single board computer with integrated Wi-Fi module to acquire the planned data in real time and store them on the server. The collected data is then processed to monitor and detect anomalies in building facilities operation.
A digital twin is next implemented by linking the stored data with a dashboard for trend visualization; a BIM model is used to visualize the component position and to have an overall view of the building.
The general architecture of the IoT integrated into the BIM is shown in Figure 1. The architecture exhibits IoT building facilities' sensors continuously sending data to the sensor nodes. In the hardware and networking section, raw data coming from sensors are processed by the sensor nodes' microcontroller and raw data becomes human-readable data. The following sensor nodes send processed data to the server that is connected to the gateway. Users can gain access to the local and cloud sensor node dashboards through this gateway providing data visualization and fault detection features. In the last section of the architecture, IoT data is integrated into BIM and combined IoT-BIM data is visualized on the BIM dashboard. sensor nodes. In the hardware and networking section, raw data coming from sensors are processed by the sensor nodes' microcontroller and raw data becomes human-readable data. The following sensor nodes send processed data to the server that is connected to the gateway. Users can gain access to the local and cloud sensor node dashboards through this gateway providing data visualization and fault detection features. In the last section of the architecture, IoT data is integrated into BIM and combined IoT-BIM data is visualized on the BIM dashboard.

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.

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.
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. 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 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.
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. 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 singleboard 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. On the Rpi3B system, Node-Red [6] is installed providing the ability to access all the sensor variables through serial protocols and displaying them on its own local dashboard. For each sensor node, a topic is assigned that is responsible for sending (publishing) a message to the main server (Rpi3B) which will act as a receiver (subscriber) using Message Queue Telemetry Transport (MQTT) protocol. MQTT protocol is an OASIS standard messaging protocol for IoT; it is designed as an extremely lightweight publish/subscribe messaging transport that presents as being ideal for connecting remote devices with a small code footprint and minimal network bandwidth [27].
Moreover, DNSmasq free software is installed to use the Rpi3B as a router and to provide a communication bridge between internal (sensor nodes) and external (internet network) components using Internet Protocol (IP) addresses. By setting the SSID, password, and an IP address on the Rpi3B using DNSmasq, the system becomes visible on the network to the publisher and subscriber.
To store sensor data locally on the Rpi3B, MySQL database, PHP interpreter, and Apache web server are utilized. By powering the Rpi3B, MySQL gets the IP address with a configured port number and waits for Node-Red to send the data to be collected; then, MySQL allocates the received data to the linked tables.
Later MQTT, MySQL, and Node-Red utilize the same credentials to background run and connect to the network, getting the IP address from DSNmasq. Communication between sensor nodes being established, the MQTT protocol on the configured port of the server receives all the subscribed topic's data from publishers through TCP protocol and provides publishing devices access to the port. Simultaneously, Node-Red starts on port 1880 using the same IP address to manage and monitor the data flow to the server and also sends data to the BIM dashboard by using forge nodes in JSON format or using a data driven approach, in CSV format.
Thus, acquired data from sensors will be displayed on the dashboard of the Rpi3B and using MQTT on the internet, and MySQL can be monitored and viewed through any device connected to the same network by opening the IP address followed by the port number.

FC Fault Detection Methodology
In HVAC systems, FCs are used as heating/cooling elements of rooms, which are a very common systems, especially in office buildings, hospitals, and schools. In order to have precise control of the FC operation, sensors must be inserted in the various components of the FC. The choice of which elements to monitor was made in relation to the identification of anomalies through collected data. Figure 4 shows the methodology for detecting faults in the FC and subsequent maintenance planning according to the condition of the FC. The image also shows the possible failures of the FC linked to the collection of anomaly data of the FC parts. The most common anomalies of the FC system are blocked motor, insufficient air flow, dirty filters, capacitor failure, insufficient water flow, etc. Each of these anomalies require an appropriate action. Particularly, the maintenance actions to be executed by operators are to clean the filter and battery, to change bearings, to replace capacitors, and to check valve adjustment and presence of pipe sediments. Thus, based on the anomaly types and data collected by sensors, a FC condition monitoring system is implemented. In addition, centralized collected data can be used to inform FM about the condition of any FC and provide preventive maintenance services, if needed. Figure 5 demonstrates the anomaly detection algorithm and alarm system implemented on the RPIZCT4V3T2 sensor board. The maintenance alarming system is composed of three main sections: installed sensors on the FC, management and monitoring system of the FC components, and alarming FMs or end-users when an anomaly has occurred. In the sensors section, three voltage sensors, type EU: 77DE-06-09 are responsible for acquiring data from the three motor speeds (v1, v2, v3); three current sensors SCT-013-000 acquire data (i1, i2, i3) from the three speeds; and temperature sensors DS18B20 are responsible for monitoring T1 (delivery water temperature), T2 (return water temperature), and T4 (outlet air temperature) in the range 0-90 • C and T3 (inlet air temperature) in the range 0-50 • C. T5 (motor case temperature) is monitored with an PT100 temperature sensor in the range of 0-200 • C. On the controller of the RPIZCT4V3T2 sensor board, the management and monitoring algorithm of each component of the FC is implemented. The algorithm makes decisions depending on the sensors' signal values compared to the installation conditions. change bearings, to replace capacitors, and to check valve adjustment and presence of pipe sediments. Thus, based on the anomaly types and data collected by sensors, a FC condition monitoring system is implemented. In addition, centralized collected data can be used to inform FM about the condition of any FC and provide preventive maintenance services, if needed.  Figure 5 demonstrates the anomaly detection algorithm and alarm system implemented on the RPIZCT4V3T2 sensor board. The maintenance alarming system is composed of three main sections: installed sensors on the FC, management and monitoring system of the FC components, and alarming FMs or end-users when an anomaly has occurred. In the sensors section, three voltage sensors, type EU: 77DE-06-09 are responsible for acquiring data from the three motor speeds (v1, v2, v3); three current sensors SCT-013-000 acquire data (i1, i2, i3) from the three speeds; and temperature sensors DS18B20 are responsible for monitoring T1 (delivery water temperature), T2 (return water temperature), and T4 (outlet air temperature) in the range 0-90 °C and T3 (inlet air temperature) in the range 0-50 °C. T5 (motor case temperature) is monitored with an PT100 temperature sensor in the range of 0-200 °C. On the controller of the RPIZCT4V3T2 sensor board, the management and monitoring algorithm of each component of the FC is implemented. The algorithm makes decisions depending on the sensors' signal values compared to the installation conditions.  Likewise, Table 2 shows the sampling frequency for each FC component depending on the power condition. For example, on the server side, delivery pipe, return pipe, air inlet, and air outlet components temperatures are monitored every 30 min by sending average values when the voltage is at least 200 V, while the motor temperature must be monitored every 10 s and send average values of 30 min to the server. The motor voltage must be monitored more frequently and the sensor board must send average values to the server every 3 min if the voltage is in the range between 0 and 200 V. On the other side, electric power (current) shall be monitored in the first 10 s, when the voltage is above 200 V. More detailed sampling frequencies on the server-side of the system integrated on the microcontroller of the sensor board and sensor locations in the FC is given in Table 2. Likewise, Table 2 shows the sampling frequency for each FC component depending on the power condition. For example, on the server side, delivery pipe, return pipe, air inlet, and air outlet components temperatures are monitored every 30 min by sending average values when the voltage is at least 200 V, while the motor temperature must be monitored every 10 s and send average values of 30 min to the server. The motor voltage must be monitored more frequently and the sensor board must send average values to the server every 3 min if the voltage is in the range between 0 and 200 V. On the other side, electric power (current) shall be monitored in the first 10 s, when the voltage is above 200 V. More detailed sampling frequencies on the server-side of the system integrated on the microcontroller of the sensor board and sensor locations in the FC is given in Table 2.
The given measure ranges are implemented on the RPIZCT4V3T2 board using Node-Red flows and displayed on the dashboard too. The system also informs the end-user if any anomaly is detected on the FC. Table 2. Sampling frequency and FC sensor allocation.

Sensors
Frequency Sensor Allocation Note volts/send to the server the integral of i1 ×dt on the range where v1 is at least 200 volts (power consumption control)/send to alarm server if i1 > 1.5 × i1 rated for more than 6" i2 0.05"/3" motor current 0.05" for the first 10 from v2 equal to at least 200 volts (anti-unbalance)/3" in normal operation/no fields-on if v2 < 200 volts/send to the server the integral of i1 × dt on the range where v2 is at least 200 volts (power consumption control)/send to alarm server if i2 > 1.5 × i2 rated for more than 6" i3 0.05"/3" motor current 0.05" for the first 10 from v3 equal to at least 200 volts (anti-unbalance)/3" in normal operation/no fields-on if v3 < 200 volts/send to the server the integral of i3 × dt on the range where v3 is at least 200 volts (power consumption control)/send to alarm server if i3 > 1.5 × i1 rated for more than 6"

Data Transmission and Visualization 3D Model and IoT Data
The 2D and 3D models of the fan coil unit and the building model used for this research are both built in Autodesk Revit authoring tool. To connect IoT sensor data with BIM, the Autodesk Forge Platform is utilized: it is a cloud-based platform and provides application programming interface (API) services. A free trial of Forge APIs lasts 90 days and gives access to 100 cloud credits, 5 GB storage, and services such as authentication (two-legged authentication), data management, Model Derivative, Model Viewer, all of them necessary and sufficient to create the customized application. By registering on the Forge platform, the end-user receives a client ID, client password, and all the services necessary for application development. BIM-IoT integration and the visualization process using the Forge platform is described in Figure 6: the right column records the services used for the custom application on the Forge platform, while the left column shows the applications layer.

Case Study
This section explains the case study setup, the allocation of sensors, the algorithms to monitor and detect anomalies in building facilities, and summarize the achieved results.
The case study has been operated at the Politecnico di Torino in the DISEG Laboratory. The laboratory room is located below ground in the department. Figure 7 shows the case study building: (a) geolocation and (b) BIM model Revit software representation. In all the rooms, fan coils are located under the windows.  The 3D building model can be uploaded onto the Forge platform by inserting credentials provided by the authentication API and using the upload.html file. Afterwards, the Model Derivative API translates the uploaded 3D model using the viewer.html file, so the uploaded model can be accessed by typing a static address (e.g., localhost:9000) on any browser.
The middle column of Figure 6 displays the browser visualization on the Forge Viewer: it can be customized by inserting different extensions, buttons, or plots using the JavaScript programming language that supports the Open-source VS Code editor. Furthermore, IoT sensor data in JSON or in CSV formats can be added through plugins to the uploaded 3D building model. The model properties will appear in the viewer as soon the model itself is uploaded on the Forge Viewer.
A custom web application of Forge Viewer can be created by accessing the object's properties in the model and relying on the database identifier (DbId) for the model objects.

Case Study
This section explains the case study setup, the allocation of sensors, the algorithms to monitor and detect anomalies in building facilities, and summarize the achieved results.
The case study has been operated at the Politecnico di Torino in the DISEG Laboratory. The laboratory room is located below ground in the department. Figure 7 shows the case study building: (a) geolocation and (b) BIM model Revit software representation. In all the rooms, fan coils are located under the windows.

Case Study
This section explains the case study setup, the allocation of sensors, the algorithms to monitor and detect anomalies in building facilities, and summarize the achieved results.
The case study has been operated at the Politecnico di Torino in the DISEG Laboratory. The laboratory room is located below ground in the department. Figure 7 shows the case study building: (a) geolocation and (b) BIM model Revit software representation. In all the rooms, fan coils are located under the windows.  The case study fan-coil motor is made by EMI (EuroMotors Italia), type FC83M-2014/1 with a 4 possible speeds. The FC motor rotates in an anti-clockwise direction at 1100 revolutions per minute (RPM) at maximum speed. Moreover, FC has a cooling or heating battery and a filter that must often be monitored; to provide an automatic preventive maintenance system, the FC is equipped with sensors to acquire real-time data.
More technical details of the FC are provided in Table 3. The ESP8266 sensor node is placed on the FC together with sensors. All the collected data from the room facilities are sent to the BIM using the Forge API; Autodesk Forge API provides the client ID and client password to access the uploaded customized BIM on the cloud; using the callback URL everyone can access the IoT-integrated BIM dashboard. A general schematic diagram of sensors' locations of the FCs, sensor boards, and data acquisition system of the BIM model is showed in Figure 8.
The system is powered with simple USB cables and starts collecting data from the installed sensor nodes in the room. The Rpi3B mainboard then connects to the ESP8266 and RPIZCT4V3T2 sensor nodes and starts acquiring data from sensors and at the same time registers these data to the MySQL database. Using the developed extensions on the Visual Studio Code for Autodesk Forge Viewer, collected IoT data and the 3D building model of Revit can be visualized together on the Forge Viewer through a static URL and port provided by Forge API. The functional flowchart of the whole system is shown in Figure 9.
The ESP8266 sensor node is placed on the FC together with sensors. All the collected data from the room facilities are sent to the BIM using the Forge API; Autodesk Forge API provides the client ID and client password to access the uploaded customized BIM on the cloud; using the callback URL everyone can access the IoT-integrated BIM dashboard. A general schematic diagram of sensors' locations of the FCs, sensor boards, and data acquisition system of the BIM model is showed in Figure 8. The system is powered with simple USB cables and starts collecting data from the installed sensor nodes in the room. The Rpi3B mainboard then connects to the ESP8266 and RPIZCT4V3T2 sensor nodes and starts acquiring data from sensors and at the same time registers these data to the MySQL database. Using the developed extensions on the Visual Studio Code for Autodesk Forge Viewer, collected IoT data and the 3D building model of Revit can be visualized together on the Forge Viewer through a static URL and port provided by Forge API. The functional flowchart of the whole system is shown in Figure 9. FC with wireless sensor nodes (b), FC battery with installed temperature sensors (a), the motor with a temperature sensor (c), and room sensors with the sensor node (d) are shown in Figure 10. FC with wireless sensor nodes (b), FC battery with installed temperature sensors (a), the motor with a temperature sensor (c), and room sensors with the sensor node (d) are shown in Figure 10. FC with wireless sensor nodes (b), FC battery with installed temperature sensors (a), the motor with a temperature sensor (c), and room sensors with the sensor node (d) are shown in Figure 10.  Data are measured by fan coil and room sensors and then displayed on the dashboard of the Rpi3B server using Node-Red flows in Figure 11. Data are measured by fan coil and room sensors and then displayed on the dashboard of the Rpi3B server using Node-Red flows in Figure 11.  Table 4.   Table 4.
To verify the IoT and BIM integrated application dashboard, one voltage (V1) and one current (I1) sensors are connected to the first port of the sensor's board and all temperature sensors including RTD are allocated to the FC as shown in Figure 8.

Results
The proposed framework was tested on the fan coil in the room with connected sensors. The FC sensors were linked to the set-up speed and each time the speed was adjusted. The final result of the dashboard with the acquired data at speed 1 is shown in Figure 12a Figure 12d.
The Rpi3B server board memory was not sufficient for the big data storage To avoid overloading the local server memory, only daily maximum and minimum values were sent from the sensor board to the cloud and BIM server. The fault detection methodology described in the previous section was applied to the system. If the values supplied by sensors exceed the predictable ranges, the system sends alarm signals or real-time notifications to the facility managers and operators using Telegram or SMS.
On the Forge platform, IoT data are integrated into the BIM using the Forge reference application (https://github.com/Autodesk-Forge/forge-dataviz-iot-reference-app, accessed on 6 April 2021) and two NPM modules (React UI components and Client-Server Data-Module-Components): NPM is the packet manager for Node.js and it is an opensource project helping to support JavaScript developers.
Installation and running of the Forge reference application started by cloning the application from GitHub repository (git clone https://github.com/Autodesk-Forge/forgedataviz-iot-reference-app.git, accessed on 6 April 2021) to the VScode using lines in the console of the editor.
The project folder is composed of client-side codes, a guide on how to upload the Revit model, router configuration, and client-server configuration files that speed up work for developers on their custom applications. The structure of the folders and files of the reference application is shown in Figure 13.
In the reference application an .env file is created and added to Forge CLIENT_ID, CLIENT_SECRET, and Forge_BUCKET; in this way the custom 3D building model is added to the project ( Figure 14). By running the project, the custom 3D model is then uploaded in a static browser (http://localhost:9000/upload, accessed on 6 April 2021). described in the previous section was applied to the system. If the values supplied by sensors exceed the predictable ranges, the system sends alarm signals or real-time notifications to the facility managers and operators using Telegram or SMS. On the Forge platform, IoT data are integrated into the BIM using the Forge reference application (https://github.com/Autodesk-Forge/forge-dataviz-iot-reference-app, accessed on 6 April 2021) and two NPM modules (React UI components and Client-Server Data-Module-Components): NPM is the packet manager for Node.js and it is an opensource project helping to support JavaScript developers.
Installation and running of the Forge reference application started by cloning the application from GitHub repository (git clone https://github.com/Autodesk-Forge/forge- dataviz-iot-reference-app.git, accessed on 6 April 2021) to the VScode using lines in the console of the editor. The project folder is composed of client-side codes, a guide on how to upload the Revit model, router configuration, and client-server configuration files that speed up work for developers on their custom applications. The structure of the folders and files of the reference application is shown in Figure 13. In the reference application an .env file is created and added to Forge CLIENT_ID, CLIENT_SECRET, and Forge_BUCKET; in this way the custom 3D building model is added to the project (Figure 14). By running the project, the custom 3D model is then uploaded in a static browser (http://localhost:9000/upload, accessed on 6 April 2021).  In the reference application an .env file is created and added to Forge CLIENT_ID, CLIENT_SECRET, and Forge_BUCKET; in this way the custom 3D building model is added to the project ( Figure 14). By running the project, the custom 3D model is then uploaded in a static browser (http://localhost:9000/upload, accessed on 6 April 2021). To interact with uploaded model objects on the Forge Viewer, DbIds are required. This is because most API methods to manipulate entities require the argument DbId (or array), such as isolate, hide, highlight, etc.; knowing the DbId array, a map with the model hierarchy node, a unique ID can be built and then custom functions can be written to connect IoT sensor variables to the BIM model. The objects; dbIds can be acquired using functions getSelection() that returns a list of DbIds, and getProperties() expecting DbId as input, etc. The extraction process of DbIds from model objects is shown Figure 15. To interact with uploaded model objects on the Forge Viewer, DbIds are required. This is because most API methods to manipulate entities require the argument DbId (or array), such as isolate, hide, highlight, etc.; knowing the DbId array, a map with the model hierarchy node, a unique ID can be built and then custom functions can be written to connect IoT sensor variables to the BIM model. The objects; dbIds can be acquired using functions getSelection() that returns a list of DbIds, and getProperties() expecting DbId as input, etc. The extraction process of DbIds from model objects is shown Figure 15. To identify each fan coil DbId's was added as a list in customized JavaScript code. It included sensor parameters such as position, type, etc. The added custom IoT sensor data were implemented through additional functions as shown in Figure 15.
Finally, Figure 16 shows IoT and BIM applications developed on the Forge platform. In the application, the fan coil color changes according to data coming from the sensor nodes. The color is "green" if the fan coil is in a good condition, "red" if overheated, and "blue" if the FC is cooling. To identify each fan coil DbId's was added as a list in customized JavaScript code. It included sensor parameters such as position, type, etc. The added custom IoT sensor data were implemented through additional functions as shown in Figure 15.
Finally, Figure 16 shows IoT and BIM applications developed on the Forge platform. In the application, the fan coil color changes according to data coming from the sensor nodes. The color is "green" if the fan coil is in a good condition, "red" if overheated, and "blue" if the FC is cooling.
To identify each fan coil DbId's was added as a list in customized JavaScript code. It included sensor parameters such as position, type, etc. The added custom IoT sensor data were implemented through additional functions as shown in Figure 15.
Finally, Figure 16 shows IoT and BIM applications developed on the Forge platform. In the application, the fan coil color changes according to data coming from the sensor nodes. The color is "green" if the fan coil is in a good condition, "red" if overheated, and "blue" if the FC is cooling.

Discussion and Conclusions
Cloud services for data analytics, including platforms for data visualization, are now available from providers like Microsoft Azure, Amazon Web Services and Google Cloud. These services can gather data and generate alerts, notifications, and graphs, but they are not flexible and cannot interact with the BIM model or sensor data. This paper introduced a fully automated integrated framework for the maintenance of building facilities using open source IoT technologies. The IoT part of the proposed framework is composed of sensors to be installed in building facilities and wireless sensor network nodes that continuously send received data through gateways to the local and cloud servers according to configured sampling frequencies. The proposed fault detection

Discussion and Conclusions
Cloud services for data analytics, including platforms for data visualization, are now available from providers like Microsoft Azure, Amazon Web Services and Google Cloud. These services can gather data and generate alerts, notifications, and graphs, but they are not flexible and cannot interact with the BIM model or sensor data. This paper introduced a fully automated integrated framework for the maintenance of building facilities using open source IoT technologies. The IoT part of the proposed framework is composed of sensors to be installed in building facilities and wireless sensor network nodes that continuously send received data through gateways to the local and cloud servers according to configured sampling frequencies. The proposed fault detection methodology was integrated into the server and sends alarms to the end user or managers when any anomaly occurs for it to be fixed effectively; BIM was utilized to view the monitored HVAC FC component's condition and the room's physical parameters such as temperature, humidity, and luminosity using wireless-connected remote devices. A case study was used to test the new framework implementation. The integration of an FC monitoring system into the BIM model would improve the building's maintenance plan by helping the facility managers to inspect the monitored building environments inside the 3D model. Thus, facility managers can profit from the proposed framework to resolve maintenance problems in the following aspects: (a) using building facility anomaly or failure signals, facility managers can plan and schedule maintenance work in advance; (b) conditional and real-time data coming from sensors allow for more accurate maintenance; (c) data visualization and real-time data on the dashboard create the possibility of avoiding the risk of disastrous breakdowns and reduce unplanned forced outages of building components; (d) IoT sensor data for building components within the BIM model makes maintenance work more convenient, e.g., it would be easy to find the location of the failure component in the real-time BIM model; and finally, (e) collected indoor and facility sensor data is the initial tool to perform predictive maintenance actions.
The study conducted in this paper aims to fill the gaps of the following researches: limited number of sensors [23], an absence of automation [24], and lack of data acquisition system [25]. The final results of the fully automated framework composed of IoT sensors, dashboard, IoT and BIM integrated application, and implemented preventive maintenance methodology of the building facilities on the server prove the proposed framework's applicability.
Nevertheless, this work has several limitations, which are as follows: • In terms of building monitored facilities, the study is fairly restricted. Additional research is needed to perform a large-scale inquiry by connecting more building facilities and evaluating the system's integration with facility managers and clients to assess its reliability, repeatability, robustness, and simplicity of use. • A small number of sensors were used to test the proposed framework in this study.
Other sensors, such as indoor air quality sensors (e.g., an oxide gas sensor, a particle dust sensor, etc.) and facility management sensors can be added to the system (e.g., motion sensor, occupancy sensor, etc.). The developed system should also be tested with a larger number and range of sensors.
Future research work will attempt to use collected data from the proposed system for predictive maintenance management of building facilities. Decision support systems for facility predictive maintenance management systems, artificial intelligence (AI), specifically machine learning (ML) tools, and algorithms should be used.
Time series sensor data, either historical failures, anomalies, or both, data can be used as ML inputs. For example, building facility anomalies or failures can be predicted using classification analyses. The use of regression analyses can utilize time series sensor data to forecast physical parameters of the building facilities' components. Thus, either predicted values, failures, anomalies, or combination, of building facilities offer the FM managers the ability to provide even more effective maintenance services before failures.