IOT enviromental quality monitoring in smart buildings in presence of measurement uncertainty: a decision making approach

The change of living concept from "traditional" to "smart” concerns how we live and relate in spaces that today, more than ever, are "sensitive" (i.e. spaces where digital technologies occupy a prominent place in the monitoring and control of buildings, with the aim of achieving high levels of quality of life). We are therefore witnessing the creation of new declinations of living and, in this context, the internet of things (IoT) represents the starting point for the creation of connected products that "share" the information they detect with other objects or people on the network. In this scenario, the authors propose an original approach to measurements for the assessment of comfort in living environments. The work consists in the design and implementation of a measurement station, which acquires and analyses data collected by the network of distributed sensors and activates forced ventilation if the level of comfort is below the desired threshold. In such situations where measurement data are compared with a threshold value, it is necessary to consider how measurement uncertainty affects the decision taken; in this particular context, since the activation of actuators involves energy consumption, the decision on the effective threshold crossing should be well thought. For this reason, the aim of this work is to propose a smart monitoring system that through the setup and calibration of two decision-making algorithms, can decide if the measured value is below or over the threshold set with a known probability. In this way, the end user can chose an appropriate strategy, calibrated on


INTRODUCTION
Going through the historical evolution of living, it emerges that the house, considered as a "safe place", has had to adapt to multiple cultural, economic-political, climatic changes, but also to the needs of individuals and family groups [1]. The changes do not only concern the construction process and the technologies used for the realization of spaces, which certainly, nowadays, are closer to very high-performance standards and able to lower environmental impact as much as possible. The determining factor for the development of the concept of living has always been the relationship between home and family structure [2]. The different patterns and family statuses introduced by modernity necessarily exceed the functionalist vision of the home as a pure "machine for living" [3], i.e. the "house" with minimum standards that guarantee a good quality of life for the occupants. In this scenario, it is important to intersect the digital and real world, so that digital is at the service of the user, in order to improve living comfort and well-being, understood as better living conditions [4]. The emergency to which we are called to respond today as a scientific community, professionals and technicians in the construction sector and beyond, is the fragility to which the vast majority of the Italian ABSTRACT The change of living concept from "traditional" to "smart" concerns how we live and relate in spaces that today, more than ever, are "sensitive" (i.e. spaces where digital technologies occupy a prominent place in the monitoring and control of buildings, with the aim of achieving high levels of quality of life). We are therefore witnessing the creation of new declinations of living and, in this context, the internet of things (IoT) represents the starting point for the creation of connected products that "share" the information they detect with other objects or people on the network. In this scenario, the authors propose an original approach to measurements for the assessment of comfort in living environments. The work consists in the design and implementation of a measurement station, which acquires and analyses data collected by the network of distributed sensors and activates forced ventilation if the level of comfort is below the desired threshold. In such situations where measurement data are compared with a threshold value, it is necessary to consider how measurement uncertainty affects the decision taken; in this particular context, since the activation of actuators involves energy consumption, the decision on the effective threshold crossing should be well thought. For this reason, the aim of this work is to propose a smart monitoring system that through the setup and calibration of two decision-making algorithms, can decide if the measured value is below or over the threshold set with a known probability. In this way, the end user can chose an appropriate strategy, calibrated on the specific living environment, which allows to maximize either environmental comfort or energy saving, depending on the specific needs.
building heritage is subjected. In fact, in the Italian territory, over time, the buildings have shown an insufficient degree of resilience from both a seismic and energetic point of view. In Italy, over 22% of buildings are in a mediocre or very bad state of conservation and the construction sector is the most energyintensive in terms of consumption, maintainability and habitability of built environments [5]. We define "fragile" a building that does not fit into an environmental context and compromises the life of its occupants because it is not very resistant or not very liveable, a space without the minimum services of smart living [6].
Smart living is a concept that in the last years is becoming even more important in the entire construction sector, covering the different phases: from design to the construction process, from monitoring and maintenance to management by end users. This concept is based on the idea that the use of technology allows to create environments that are able to substantially improve and simplify the quality of life of the occupants [7]. The current technical-scientific debate is focused on what tools, currently in use, can be considered reliable and capable of responding to important needs, such as: the use of renewable sources and strategies to contain energy consumption, the protection of human lives and last but not least the levels of indoor comfort.
Living, in this perspective is becoming "intelligent and sustainable", with continuous interrelation between human action and technology through increasingly digitized services aimed to considerably increase the levels of quality of life of the occupants. A statistic reported by Cisco [8] about the use of the IoT (Internet of Things) points out that in 2010 there were over 12.5 billion connected devices, with an increase of more than 400% in 2020 (about 50 billion). There are several experiments and applications currently underway in the construction sector [9], [10], including "dynamic facades with high-performance envelope for the energy efficiency of the building", "the optimization of IAQ (Indoor Air Quality) levels in buildings through intelligent ventilation systems", "systems for monitoring building safety and risk mitigation", etc.
Technology, connected to open source-hardware and sensing systems allows the detection of any changes in conditions and status [11]. This leads to meet the occupant comfort, energy consumption and cost efficiency needs. An important aspect concerns indoor air quality. According to the World Health Organization (WHO) the sick building syndrome (SBS) affects people who are subject to prolonged exposure to chemical, biological and / or physical agents in buildings with a low level of indoor air quality, generally due to poor ventilation. In fact, from literature, we know that IAQ levels are generally 2 to 5 times worse than outdoor [12], [13]. This means that the occupants of closed spaces that do not enjoy good natural ventilation (and/or mechanical), have an increased risk of developing psychophysical malaise that often over time, leads to devastating effects on the human body such as the onset of diseases related to the respiratory tract, the central nervous system and even cancer [14]. Since in recent years the lifestyle has changed considerably and people spend indoor much more time than before (about 90%), several research activities in the ICT (Information and Communication Technologies) sector, aim at investigating how multi-sensor IoT platforms can optimize IAQ levels in buildings [15], [16]. If we also consider the recent changes in people's lifestyle, who have increased the time spent at home, it is clear the importance of investing in IoT platforms, which allow to dialogue with the home and to adapt the environment to the user needs [17].
Among the different aspects of living, the present work aims to provide technological tools for efficient and effective monitoring of the living environment, in particular through the development of an automatic measurement and control station aimed at optimizing IEQ (Indoor Environmental Quality) levels. The proposed station is able to guarantee safety and living comfort through the continuous monitoring of IAQ levels, temperature and relative humidity and, controlling actuators, is capable to restore the baseline conditions. The implemented system considers the uncertainty associated to the measurement process in order to make appropriate decisions about the actual exceeding of the thresholds set.

METHODS AND APPLICATIONS
In this paragraph, we will describe the acquisition and processing system that using a sensors network is able to detect the quantities of interest to monitor the environmental quality, in particular the IAQ and the parameters related to thermal comfort, such as temperature and humidity. To make the system more usable, the monitoring station makes data easily accessible through the network.
With regard to the IAQ, the monitoring focuses on the assessment of the level of pollutants and the consequent management of the forced ventilation system. To maximize the flexibility, the system implements two different control strategies: one optimizes safety and activates the ventilation system more often, the other aims at obtaining maximum energy efficiency and, therefore, activates ventilation only in relevant cases. The system considers also the quality of the outdoor air, using a network of sensors placed outside the monitored environment, because in some cases it may be lower than the internal one. The comfort matching criteria described above are applied also to the monitoring of thermal quantities to decide whether it is the case to activate the ventilation system.

Monitored parameters
The level of indoor air quality refers to the concentration of pollutants, which can come both from sources inside the building, and outside, especially in urban contexts [18]. However, apart from temporary and exceptional situations, it is always possible to consider the air quality outside the building as a baseline, since the presence of polluting sources inside can only worsen the standard situation. In this context, it is of great importance to have real-time monitoring of these pollutants to guarantee timely air changes if air quality levels are no longer satisfactory.
The parameters for the evaluation of IAQ levels were selected from the state-of-the-art [19]- [26] and, in particular, the study was focused on three commonly studied air pollutants: carbon dioxide (CO2), and particulate matter PM2.5 and PM10, as shown in Table 1.
If the concentration of these pollutants exceeds the safety limits imposed by the Community standards, this would entail both immediate and long-term risks to the health of exposed people and, this is even more relevant the higher is their concentration. Focusing on the pollutants examined, CO2 can be considered as an indicator of the effectiveness of ventilation and excessive population density [27] and, in indoor environments with limited ventilation, should never exceed the limit of 1000 ppm [28] to guarantee adequate safety. The concentration of PM2.5 and PM10 particulate matter in the air has also been directly associated with respiratory tract diseases [29], [30]. Therefore, it is necessary, in closed spaces, to monitor these quantities in order to plan appropriate intervention strategies that aim to restore the most optimal air quality. It is possible, in fact, if their concentration exceeds the safety limits imposed by current regulations, or rather, limits that are more conservative and include a safety margin, even for long-term exposures, to intervene by activating a ventilation system to guarantee an adequate air change.
Both for the healthiness of the rooms and to optimize living comfort, it is also necessary to monitor quantities such as temperature and, above all, humidity. The presence of excessive humidity leads to the proliferation of mites and moulds, and the latter can be an important factor in the onset of rheumatic diseases and also increases the thermal perception of both heat and cold. On the other hand, excessive dryness of the air can cause breathing difficulties and increase the transmissibility of certain diseases [31]. Several studies have shown that a relative humidity between 40 % and 60% is optimal to maximize comfort [32], [33]. For what concerns the temperature, if it is too high it impacts both on the symptoms of SBS and on the productivity of the occupants. The ideal temperature should be between 21 and 25 °C [34].
To set the thresholds levels of pollutants present in the monitored environment, among the technical regulations, we considered the thresholds established by the World Health Organization (WHO). For what concerns thermal comfort, we have referred to the ISO 7730 standard [35], which also refers to the ISO 17772-1: 2017 standard [36], as shown in Table 2. To control the level of IAQ the proposed system regulates forced ventilation, reducing so the concentrations of pollutants and regulating temperature and humidity.

Monitoring and control system
The monitoring and control system, schematized in Figure 1, consists of a central unit that acquires information from the network of distributed wireless sensors (both indoor and outdoor) and if it is necessary, activates the ventilation system, in order to maintain a defined level of comfort in the living environment.
The sensor network consists of sensors placed both inside and outside the building, so to monitor indoor and outdoor environmental conditions. The parameters monitored indoor are CO2, PM2.5, PM10, temperature and humidity, while outdoor only PM, temperature and humidity.
The activation of the ventilation system, instead, is implemented through the control of a relay to bring power to the internal conditioning system. The technical characteristics of the sensors used are shown in Table 3.
The central control unit is implemented with a National Instruments Single-Board RIO, with its expansion board. Its function is to take measurement data from the different sensors in real time and to control the actuators of the ventilation system, through the opening of a relay, implementing the algorithm described in the flowchart of Figure 2. Using a graphical interface, users can view all measurement data and, according to personal needs, they can make changes to the configuration parameters of the smart management system. The system also allows to choose between two different operating strategies that aim respectively at maximizing safety related to the healthiness of the environments or at maximizing energy saving. Based on the selection, the system defines the thresholds and decision criteria.

Data analysis and decision-making
For each pollutant, we calculate a quality index, which depends on the concentration of the single parameter measured and the reference level taken from the legislation [37]

Sensor Range Accuracy
Temperature in °C -60 -+75 ± 0.5 Relative humidity in % 5 -95 ± 7 CO2 in ppm 0 -10000 ± 40 PM2.5 in µg/m 3 0 -1000 ± 10 PM10 in µg/m 3 0 -1000 ± 25 where X is the measured quantity of the single pollutant X, X|0 is the concentration of the same pollutant under ideal conditions and is a constant that considers the toxic levels of the pollutant defined by the standard. The value of  is therefore imposed by placing X = 0, when X = Xmax , where Xmax is the maximum concentration of the pollutant taken as a threshold. The overall IAQ level is equal to the minimum of the indices calculated for the single monitored parameters.
where CO 2 , PM10 and PM2.5 are the quality indexes of CO2, PM10 and PM2.5. This method lets to have a global and rapid information on the level of air quality in indoor environments and can be easily implemented without great computational efforts. The algorithm compares the estimated level of IAQ with the threshold taken as a reference and, if it does not meet the user needs, it activates the ventilation actuators. In the same way the system monitors the temperature and relative humidity in the environment and compares their measured values with the reference thresholds in order to maintain the desired quality standards.
As said in section 2.2, configuring the system, it is possible to choose between two different strategies, i.e. maximization of safety or energy saving and to set, consequently, the reference thresholds. In the second case, in fact, we consider as thresholds the levels indicated by the regulations, while in the first case we set thresholds that are more conservative, considering also the number of occupants. In particular, the new thresholds are: where is the level imposed by normative and depends on the number of occupants in relation to the size of the environment.
In situations like this, where there is a need to make decisions about exceeding a certain threshold, the algorithm has to analyse experimental data, considering not only the measured value, but also the uncertainty associated with the measurement process [38]- [41]. In this case we face to a particular class of problems that pertains to the field of decision-making. As known, in fact, the result of a measurement does not provide a single value, but an interval, centred in the measured value, inside which it is possible to find the value of the measurand with a given level of confidence. This means that, when the result of the measurement falls in a certain band around the threshold level identified: where is the measured value, is the value of the measurand and is the value of the extended uncertainty relating to the measurement, we cannot be certain about the result of the comparison with the reference threshold and therefore probabilistic assessments must be made to associate a known level of risk with the decision that will be taken. Taking from datasheet the type B uncertainty associated to each sensor and, considering a measurement error with a Gaussian distribution, the probability that the measured value falls within a band of ± 3  around the measurand, where  is the standard deviation, is 99.7 %. Clearly, taking into account the extended uncertainty, the wider the region of ambiguity, the more times the decision-making algorithm will intervene, as can be easily understood from Figure 3.
In the implementation of the decision-making algorithm, it is possible to consider a smaller band of uncertainty, cutting the tails of the Gaussian curve, but this means choosing a smaller coverage factor and therefore decreasing the correctness of the decision taken.
For what concerns the decision-making algorithms, among the various proposed in the literature, we decided to implement the Utility Cost test and the Fixed Risk [42], [43]. To address the decision problem by considering the impact of measurement uncertainty, the Utility Cost Test considers the potential consequences of the different possible decisions. The algorithm evaluates four possible situations and their associated costs, i.e. positive, false positive, false negative, negative. By suitably weighing these costs, the algorithm makes a decision on whether the threshold is actually exceeded; evaluating which of the two possibilities has the lower cost. The Fixed Risk algorithm, on the other hand, works by initially setting the maximum level of risk acceptable for a wrong decision. This means that the threshold is dynamically set, so that the decision made by the algorithm is right or wrong with a known probability Once an LTH threshold has been set, comparing the measurement result with it, if the measured value falls within the ambiguity band, there is a risk, highlighted in Figure 4 (blue area), of considering the measured value below the threshold when it is above. Since the probability density function associated with  Through a change of variable, the threshold is repositioned in order to match the following equation: where ( − ) is the probability density function centred in .
Knowing the measurement uncertainty of the sensor, if the process is characterized by a normal distribution, it is possible to set the parameters of the algorithm. The algorithm will then be able to make a decision on exceeding the threshold within the ambiguity zone and give an answer to the Decision-Making problem, together with a quantification of the risk associated with the decision taken. The implementation of a decisionmaking criterion is essential for those systems, such as the one described in this work, in which the incorrect evaluation of the operating conditions, i.e. considering the parameters within the safety zone when they are not, can affect people health and comfort.
The proposed system implements both decision-making algorithms, whose parameters are calibrated for the two different strategies, i.e. maximization of environmental quality and maximization of energy savings.

EVALUATION OF DECISION-MAKING ALGORITHMS PERFORMANCES
In this paragraph, we talk about the evaluation of the performances of the decision-making algorithms described above. With the simulations performed, we wanted to evaluate how they respond to the two different management strategies: -Highest air quality and healthiness -Maximum energy savings Once the operational strategy in the management system has been selected, the system calculates the cost functions for the application of the Utility Cost Test and sets the maximum percentage of risk allowed considering the reference threshold exceeded in the Fixed Risk. The two algorithms thus calibrated will make appropriate decisions in considering the results of measurements that fall within the ambiguity range, above or below the threshold set, based on the overall strategy chosen. To verify the correct functioning of the algorithms, we used simulated datasets, considering a generic sensor with its associated uncertainty and a fixed threshold level. Evaluating a region of ± 3 σ around the threshold level, the intervention of the algorithms was tested with different coverage factors and the number of interventions that considered the threshold exceeded was compared with the number of activations that would have occurred without the implementation of the decision-making algorithms.
The results obtained are summarized in Table 4 and Table 5. As we can see in the results reported, considering either a linear or a sinusoidal trend of the measurand, without decision-making algorithms, 50% of the comparisons result above the threshold. This because we perform a direct comparison between the measured value and the threshold, without considering the impact of measurement uncertainty. This means that in operative conditions, where the measured value is given by eq. 4, the result of the comparison can be alternately positive or negative with a probability that is the more similar, the more the measurand is near to the threshold. Using decision-making algorithms it is possible to adopt a more or less conservative approach to measurement uncertainty. If the strategy chosen aims at maximizing air quality and minimizing health risk, there is a greater number of activations, therefore a better ventilation of the rooms, compared to what would have happened with a direct comparison with the threshold. In the specific case examined, we can observe an increase in the number of activations of 15% and 10% with Utility Cost Test, respectively for linear and sinusoidal trend of the dataset, and 32% and 29.5% with Fixed Risk. With a coverage factor k = 1, using the Fixed-Risk algorithm, we observe 10% less activations than with the same algorithm and a greater coverage factor, this because in this case the decisionmaking band is narrower and therefore the algorithm intervenes fewer times. In the other case, which instead aims at maximizing energy savings by minimizing the number of activations of the ventilation system, we observe a strong reduction in interventions. In fact, using Utility Cost Test Algorithm, we have 16.5% and 10.5% less activations than in operation without decision-making algorithms, respectively for linear and sinusoidal trend of the dataset, and 22% and 20% less, using Fixed Risk. This is just a general case implemented to test the impact of the decision-making approach, since, in real applications, implementing a correct risk assessment during the system design phase, it is possible to re-calibrate the response of the algorithms to match the specific environments needs.

CONCLUSIONS
Technologies applied to living environments are significant to ensure their smart evolution. The Italian scenario still lacks of applications for the redevelopment of buildings (especially those for public use) aimed at improving the quality of life, through targeted actions, which let to contain energy consumption using IoT or smart systems. Designing and building according to these paradigms means that we seriously need to face with the requirements for balance between resources and environmental impact. The building is an artefact that changes and adapts itself according to user needs. The current challenge consists in considering the building through a multidisciplinary approach that manages the technological and digital system in order to obtain high performance responses in terms of both process control, product maintainability and liveability.
In this work, the authors proposed an automatic measurement system to be integrated into the context of smart homes, with the aim of improving aspects related to the safety and quality of living environments.
By monitoring air quality, ambient temperature, relative humidity and, consequently, managing the ventilation system, it is possible to optimize the level of IEQ in the observed environment. In these contexts where measured data are compared with a reference threshold, it is important to consider how measurement uncertainty affects the decision on threshold crossing. This is much more relevant in applications like the one described in this paper where a wrong decision implies a waste of energy. In fact, if the value of the measurand is near to the reference level, the contribution of measurement uncertainty can be determinant to assess if the measured value is above or below the threshold. For this reason, the measurement and control station proposed acquires and analyses the measurement data collected by the network of distributed sensors and, with the support of decision-making algorithms to verify the actual exceeding of the thresholds, activates the actuators of the system to optimize the IEQ levels. In this system, the decision-making approach covers a role of primary importance, since it let to be more or less conservative on measurement uncertainty, inherently to the choice on the activation of the ventilation system.
In fact, the proposed algorithm works on two levels: one related to the safety of indoor environments, and the other linked to the optimization of comfort. The first level is met within the safety thresholds imposed by the current regulations, for each monitored parameter. Environmental comfort, on the other hand, is guaranteed through careful monitoring of IEQ levels and the operation of actuators that allow to restore the desired quality levels, if the index falls below the desired comfort threshold. The system allows, through an interactive user interface, to record the user's preferences about the strategy to be adopted. In this way the algorithm will be able to dynamically move the thresholds adapting to the needs of the single households.
To verify the functioning of the comparison algorithm, two predefined datasets were used. The decision-making algorithms were calibrated on two different strategies: one aimed at maximizing the quality of the environments and the other aimed at maximizing energy savings. From the tests performed it was possible to observe an increase in activations of the actuators between 10 and 15% using the Utility Cost Test algorithm and between 29 and 32% using the Fixed Risk algorithm, with respect to direct comparison with the threshold, if the chosen strategy is to maximize quality. In the other case, however, we observed a reduction in the number of activations between 10.5 and 16.5% with the Utility Cost Test algorithm and between 20 and 22% with Fixed Risk compared to the reference case. The results obtained with these two strategies served to verify the functioning of the decision-making algorithm. In practice, the system, installed in a specific living environment, can be recalibrated to make smart decisions, which best fit the user needs.
Future developments will concern the integration of other aspects related to smart buildings design, such as the evaluation of the energy balance in a context in which electricity is produced on site from renewable sources. In this sense, it is possible to increase the efficiency and safety of living spaces through the measurement of energy flows and a consequent adaptation of the algorithms that should consider this aspect.