Use of Low-Cost Devices for the Control and Monitoring of CO 2 Concentration in Existing Buildings after the COVID Era

: In the COVID-19 era, a direct relationship has been consolidated between the concentration of the pollutant carbon dioxide (CO 2 ) and indoor disease transmission. For reducing its spread, recommendations have been established among which air renewal is a key element to improve indoor air quality (IAQ). In this study, a low-cost CO 2 measurement device was designed, developed, assembled, prototyped, and openly programmed so that the IAQ can be monitored remotely. In addition, this clonic device was calibrated for correct data acquisition. In parallel, computational ﬂuid dynamics (CFD) modeling analysis was used to study the indoor air ﬂows to eliminate non-representative singular measurement points, providing possible locations. The results in four scenarios (cross ventilation, outdoor ventilation, indoor ventilation, and no ventilation) showed that the measurements provided by the clonic device are comparable to those obtained by laboratory instruments, with an average error of less than 3%. These data collected wirelessly for interpretation were evaluated on an Internet of Things (IoT) platform in real time or deferred. As a result, remaining lifespan of buildings can be exploited interconnecting IAQ devices with other systems (as HVAC systems) in an IoT environment. This can transform them into smart buildings, adding value to their refurbishment and modernization.


Introduction
The World Health Organisation (WHO) declared on 11 March 2020 that COVID-19 disease had become pandemic [1]. Since then, the WHO has been constantly reporting on the outbreak and providing global guidelines for its control [2]. This has been a global challenge in air quality (AQ) research [3][4][5], especially on its prevention modes, and detection and protection systems [6,7]. For example, research has been performed on barriers to transmission, infection, and vaccines [6,8]. Many researchers are still working on these and other issues. Among them, the importance of air renewal to achieve adequate IAQ and avoid health risks can be highlighted.
The WHO identified direct contact with people suffering from the disease as an obvious source of contagion. Therefore, the social distance was delimited, the use of masks was made compulsory, and other types of actions were taken such as eye protection and use of biohazard clothing for professionals directly exposed (for example, hospital workers) [9,10]. In addition, general applicable options that are not dependent on the decision of the individual were also sought during this pandemic. For instance, closing public spaces, restricting seating capacity in places of assembly [11], and increasing indoor air renewal in public buildings [12,13] stand out. Capolongo et al. [14] summarised a series • Physical parameters: Wet bulb temperature (T) and relative humidity (RH) to assess thermal comfort as well as ambient particulate matter concentration (PM 2.5 y PM 10 ). • Chemical parameters: Carbon dioxide (CO 2 ), carbon monoxide (CO), formaldehyde (HCHO), ozone (O 3 ) and volatile organic compounds (TVOCs). • Biological parameters: Bacteria and fungi. • Air renewals (based on metabolic CO 2 concentration).
It can be noted that these parameters are mostly assessed in outdoor environments using stations with specific instrumentation. The European Environment Agency (EEA) and the European Commission provide information on AQ [30] throughout Europe [31]. Clean air is a mixture of gases [32]. The percentage of CO 2 corresponds to 0.035% among the different elements. However, excess CO 2 is considered to be one of the main sources of environmental pollution. Unfortunately, measurement of CO 2 concentration is not available at all stations.
To reduce harmful emissions in outdoor and indoor environments [33], many countries have established strict policies to improve AQ and comfort. In the current context, they are also serving to identify areas with a potential danger of contagion in the COVID-19 pandemic. In indoor environments, CO 2 displaces oxygen and exposes users to the effects of hypoxia [34,35]. As proposed by Novakova and Kraus [36], the ideal indoor concentration can be established close to 350 parts per million (ppm) in environments with special requirements and 500 ppm in normal activity environments. Nevertheless, other reference values are provided in specific standards and regulations because it is considered an indicator that relates AQ and comfort level to CO 2 concentration [37,38]. It can be noted that in the context of COVID-19, CO 2 concentration [39][40][41][42] from occupant respiration has been used as an indicator of IAQ. As a baseline, the limit values set by the US Environmental Protection Agency (EPA) for CO 2 concentrations (in ppm) and the corresponding AQ are shown in Table 1. In the same vein, the Technical report "CEN/TR 16798-2" [43] indicates that a value of 400 ppm can be assumed as the average outdoor concentration. In living spaces, the main focus of CO 2 increase is of metabolic origin, which is related to the type of activity [44,45]. As a result, the more effort a person makes, the more exhalations are produced, and the more CO 2 is emitted. The WHO has classified activities according to the "intensity of physical activity", relating them to the metabolic equivalent unit (MET). Table 2 provides a classification of activities with the range of physical intensities in METs. In this regard, Soares et al. conducted research [46] using low-cost devices, concluding that an increase in activity results in an increase in MET concentration and exhaled metabolic CO 2 . Table 2. Activity classification according to metabolic equivalent level (MET).

Classification
Description MET

Soft
Activities that do not require excessive effort and are normally at rest (sleeping, watching TV, driving, eating, . . . ). <3 Moderate Activities that accelerate the heart rate in a sensitive way (housework, dancing, construction work and painting, . . . ).

3-6
Intensive Activities that require greater effort and cause rapid or accelerated breathing, involving activities that increase the heart rate (aerobics, sports, or moving weights of more than 20 kg, . . . ).

>6
COVID-19 is currently a major global concern. Peng and Jimenez confirmed that CO 2 co-exhaled with aerosols containing SARS-CoV-2 by COVID-19 can be used as an indicator of indoor SARS-CoV-2 concentrations [47]. Other researchers have pointed out that group immunity is expected by the end of 2024 [48] thanks to the vaccination process, but broader strategies must be put in place that can respond to future diseases. Therefore, buildings should aim to act smarter [49], renovating indoor air to achieve better quality. These activities are in accordance with the sustainable development goals (SDGs) of the 2030 Agenda [50]. Although the need for AQ control in public, residential, and business buildings has been analysed in many studies [36,51,52], the price of the systems required for this purpose has been a barrier to implementation. This applies mainly to low-income households [53] and socially disadvantaged environments [54].
The Center for Disease Control and Prevention (CDC) has published extensive research on aerosol concentrations in different situations. In unventilated shared-use spaces, CO 2 concentration is high [36] and infections are higher. This context is unchanged even if a social distance greater than two metres or six feet is maintained [11,55,56]. Although there are other methods to reduce pollutants such as filtration with HEPA filters [57], ultraviolet radiation treatments, or disinfection with ozone [58], they were not considered because they are beyond the scope of this research. In this context, ventilation has become a fundamental solution [59,60] for the reduction in indoor pollutant concentrations and for the improvement of IAQ [61]. In some cases, the way to achieve air renewal is by means of natural ventilation (cross, outdoor, indoor) [33,62,63]. In other cases, a forced ventilation system must be used [64]. In all cases, pollutant concentrations are reduced if air is renewed. These lead to a decrease in CO 2 concentration in indoor spaces [65]. It can be noted that the current trend for effective AQ control is to promote natural ventilation through strategies combining large external openings [66] with intelligent ventilation [67], which also allows optimizing energy consumption by increasing its efficiency [68,69].
Several studies have analysed methods and models to determine the air renewal required to achieve acceptable IAQ parameters [70][71][72][73]. In all of them, the amount of exhaled CO 2 has emerged as a critical factor in establishing the number of air renewals. In addition, different standards indicate the number of air renewals recommended in the diverse living spaces of buildings according to their use and occupancy. Among them, those set by ASHRAE [74,75] and the national legislation in Spain [76], which comes from the Directive 2010/31/EU of the European Parliament and of the Council of 19 May 2010 on the energy performance of buildings, stand out.
Monitoring IAQ, and more specifically CO 2 concentration in buildings, can be realised using professional (commercial) equipment or clonic devices. These clonic systems are increasingly being used due to their reliability and prestige in the electronics market. Villanueva et al. [77] carried out a research focused on commercial equipment and clonic devices used in Spain for the measurement of CO 2 during the COVID-19 pandemic. As a noteworthy result of this research, it must be noted that the price of commercial instruments on the market ranges from EUR 75 for the cheapest to EUR 400 for the most expensive, although they include other functionalities to measure relative humidity, temperature, and particle size. In addition, they also evaluated clonic devices. They showed that the measurement error varies over a spectrum ranging from 9% to 15% in environments with 500 ppm CO 2 and from 7% to 12% when concentrations are closed to 700 ppm CO 2 .
On the one hand, professional equipment are electronic devices designed and commercialised by manufacturers intended for a professional audience (laboratories and health and safety services), which can monitor any physical or chemical parameter of AQ. They can be classified according to their portability, autonomy, and number of parameters monitored. In addition, these systems have the advantage that their probes and sensors are calibrated in metrological laboratories with controlled atmospheres. They also allow data to be stored and sent instantly to other devices. However, the high weight of some of them, due to the high number of measuring sensors, is a disadvantage for their portability.
On the other hand, clonic measurement devices are composed of electronic components and open-sourced software. The scalable configuration of clonic devices makes it possible to customize and increase the number of features of professional equipment. To begin with, a motherboard must be selected. Raspberry Pi and Arduino are two of the manufacturers offering more competitiveness in this field. According to studies reviewed, 37.5% of clonic devices are based on Arduino microcontrollers and 35% on Raspberry Pi ones [78]. The use of a motherboard allows the connection of peripherals that help in capturing information on physical and chemical parameters of IAQ. Specifically, between 67% and 70% of the sensors that monitor IAQ are intended to measure CO 2 [78,79]. Measurement range, sensitivity, and response time are their key sensors features. In addition to the two elements described, a communication unit must be included. This enables data storage, processing, and further analysis to be performed [79].
The interconnection of clonic devices with other systems favors the use of the Internet of Things (IoT) and data storage in the cloud. These enabling technologies allow wirelessly collected data to be evaluated for interpretation, in real time or deferred, for a real monitoring and control of the IAQ [79,80]. This has the potential to transform an existing building to be renovated into a smart building [81]. Several researches have studied the application of IoT for IAQ control [82,83]. They stress the advantages of system integration with connections to smartphone applications, ease of installation and scalability as an element to achieve cost improvements [84]. In this regard, Marquez et al. [85] developed research on an IoT solution that monitors CO 2 concentration in smart buildings. In this way, the IAQ can be controlled and therefore, the health of the occupants be improved.
It can be noted that clonic devices present a series of limitations. These are related to the maintenance and calibration of the sensors assembled, the communication protocols, and their power consumption [86]. Fortunately, with the aim of creating devices that help to promote healthy, sustainable, and smart cities, considerable progress has been made in recent years dealing with these issues [79].
The first objective of this research was to design, develop, assemble, and prototype a low-cost clonic device to provide buildings [87] with smart functionalities in the IAQ field [88]. As indoor comfort is currently taking a back seat to the priority of maintaining safe CO 2 levels to protect from COVID-19, research focused on the use of CO 2 sensors. Another purpose addressed was the choice of the best location to place the clonic device. To this end, computational fluid dynamics (CFD) simulations [89] were carried out in different scenarios (ventilation options) for a living space that was used as case study. It can be noted that, to the best of our knowledge, this has not been addressed before. Once the best locations for the placement and distribution of the instruments were determined, an experimental study was performed. Data were obtained with a calibrated equipment that was used as a reference standard and also with the low-cost prototype device. Comparisons were then made to check if measurements were acceptable for IAQ monitoring and control. In summary, the three main objectives and their relationship are shown in Figure 1: • CFD analysis of the interior air flows of a living space to establish the location of measurement points. • Exhaustive analysis of the solution to design and develop the prototype. • Calibration of the cloning device for proper data acquisition. noted that, to the best of our knowledge, this has not been addressed before. Once the bes locations for the placement and distribution of the instruments were determined, an exper mental study was performed. Data were obtained with a calibrated equipment that was use as a reference standard and also with the low-cost prototype device. Comparisons were the made to check if measurements were acceptable for IAQ monitoring and control. In summary the three main objectives and their relationship are shown in Figure 1: • CFD analysis of the interior air flows of a living space to establish the location o measurement points.

•
Exhaustive analysis of the solution to design and develop the prototype.

•
Calibration of the cloning device for proper data acquisition.
. The main novel contributions of this paper can be summarised in the following fou elements: • Complete design, development, and prototyping of a clonic device for CO2 measure ment as a control and monitoring parameter for IAQ. This parameter relates to ai renewals for minimizing the spread of COVID. We showed all the physical compo nents (sensor, microprocessor board and connections) and the programming cod necessary for its operation. • Description in detail the calibration protocol. In this paper, we used the KIMO HQ 210 commercial instrument as a reference standard for the clonic device. However other instruments of similar characteristics with a calibration certificate from a labor atory legally accredited for this purpose could have been selected. In this context, w showed how to prepare a clonic device to properly measure CO2 concentration.

•
Process of all collected data in the cloud for further analysis and possible connectio to other smart systems in the building. Therefore, we showed the applicability of th device to control and monitor CO2 concentration and even act, if required, on HVAC systems.

•
Definition of a methodology to obtain the best location of sensors for data collection For this purpose, a CFD analysis was carried out in different scenarios of a case study In this way, we improved the layout suggested by the different standards, whic were limited to establishing separation values for the envelope (boundary) of th room without considering the air flows caused by the renewal of the interior air. The main novel contributions of this paper can be summarised in the following four elements:

•
Complete design, development, and prototyping of a clonic device for CO 2 measurement as a control and monitoring parameter for IAQ. This parameter relates to air renewals for minimizing the spread of COVID. We showed all the physical components (sensor, microprocessor board and connections) and the programming code necessary for its operation. • Description in detail the calibration protocol. In this paper, we used the KIMO HQ-210 commercial instrument as a reference standard for the clonic device. However, other instruments of similar characteristics with a calibration certificate from a laboratory legally accredited for this purpose could have been selected. In this context, we showed how to prepare a clonic device to properly measure CO 2 concentration.

•
Process of all collected data in the cloud for further analysis and possible connection to other smart systems in the building. Therefore, we showed the applicability of the device to control and monitor CO 2 concentration and even act, if required, on HVAC systems.

•
Definition of a methodology to obtain the best location of sensors for data collection. For this purpose, a CFD analysis was carried out in different scenarios of a case study.
In this way, we improved the layout suggested by the different standards, which were limited to establishing separation values for the envelope (boundary) of the room without considering the air flows caused by the renewal of the interior air.
In summary, we showed for the first time, to the best of our knowledge, all the details of the components of the clonic device so that it can be cloned by anyone interested in the "do it yourself" philosophy. It also incorporated open source programming code, allowing other researchers to replicate the research and generalize this contribution to the scientific community and society. Furthermore, the use of the CFD methodology provided the most suitable points to determine the CO 2 concentration in the space to be studied, eliminating points that could generate distortions in the control and monitoring systems. In addition, using an open-source system allowed the connection with other smart building systems, which in the COVID-19 era can be considered a preventive measure to analyze IAQ.

Materials and Methods
This section describes the methodology used in the research, including its application in a case study. The methodology is primarily based on the use of CFD to determine the positioning of the CO 2 measurement system, for which simulations were carried out to identify those places where there is no air renewal. Next, it is necessary to design, configure, and develop a programmable clonic device.
The starting point was to select the living space where the prototype will be tested. A single-family house was taken in which a single bedroom was to be used as a study room. In this space, the calibration of the clonic device was carried out using a high-precision and high-cost calibration instrument. For this purpose, different assumptions and scenarios were defined, which are described in detail further in the next sections. Furthermore, this room is the space used to perform the CFD simulations. For obtaining the main results, the geometry was modeled in CATIA V5, and the different boundary conditions defined in ANSYS Discovery 2021 R2. These results allowed us to identify the best location of the programmable clonic device inside the room.

CFD Analysis
CFD is an area of engineering knowledge that belongs to the computer aided engineering (CAE) simulation programs. These analyses allow the numerical and visual simulation of flows, heat transfer, and even chemical reactions. These simulations and analyses are increasingly used to characterise living spaces, determining how the ventilation is operating and therefore the level of existing pollution. In short, CFD analysis helps to detect where the air is fouled. Thanks to this, preventive measures can be taken to avoid air quality risks [90]. These rises may be due to an increase in the number of people inside living spaces or a lack of ventilation in them [86,90]. In this study, CFD simulations helped to detect CO 2 concentration.
For this research, two different software packages were used: ANSYS Fluent 2021 R2 and ANSYS Discovery 2021 R2 (available at www.ansys.com). ANSYS Fluent was used for static and dynamic simulations. In addition, ANSYS Discovery was used only for dynamic simulations. The main features that had to be selected are: To begin with the analysis, the geometry and boundary conditions had to be previously defined to establish the convergence of the solution [86]. These boundary conditions were related to CO 2 concentration and ventilation flow, helping to determine the location of the measurement instruments. The case study analyses the indoor atmosphere of a mediumsized room in a single-family house was simulated. In order to perform it, a series of conditions and restrictions had to be established:

•
The building is located in Medina Sidonia, a village in the province of Cadiz (southern Spain). Its height above the sea is 337 m. In addition, its coordinates are as follows: longitude 5 • 55 37.81 W and latitude 36 • 27 25.02 N.

•
The usual outdoor pollution levels are low, thanks to its location near Alcornocales Natural Park on the town periphery. In some previous measurements with the standard reference equipment, the CO 2 concentration ranged from 380 to 410 ppm under different conditions of traffic, industrial activity, and prevailing winds. It can be noted that although some of the values are even lower than those indicated by the technical report "CEN/TR 16798-2", a value of 400 ppm is assumed as the average outdoor concentration, as suggested by the report.

•
The characteristic wind in this area comes from the east. As the main opening is in the southeast direction, the room received an adequate amount of fresh air.

•
The room consists of a rectangular enclosure of average dimensions (3.9 × 2.4 × 2.5 m). The geometry allowed the simulations to be carried out easily. It can be noted that this is a factor that directly influences the meshing performed by ANSYS. In addition, the boundary conditions defined refer to the amount of air entering the room, which was considered constant in the defined scenarios.

•
Only one person lives in the room. No additional CO 2 emissions were considered that could have an impact on the defined boundary conditions. • The test room is not forced ventilated and has no HVAC systems to renew the air inside. Therefore, ventilation is natural, with air being renewed through the openings in the envelope. The room has an exterior sliding window (height 0.93 m and width 0.63 m by leaf) and an interior door (height 2.03 m and width 0.72 m) that communicates with the rest of the rooms in the building.

•
We intended to locate a clonic device inside the room. For this purpose, it was essential to determine the areas where there is no air renewal, as well as the presence of vortices that may affect data collection.
Four scenarios were defined for the CFD analysis. This made four situations possible: closed window and door (no ventilation), closed window but opened door (internal ventilation which is an indirect ventilation through other spaces that are also being renovated), opened window but closed door (external ventilation) and opened window and door (cross ventilation). In each of them, it was essential to guarantee the continuity of the simulation. For this purpose, an air inlet and outlet opening had to be established.
• Scenario 1 (cross-ventilation: Air renewal with opened window and door). Air enters through the window. At the same time, air exits through the door. • Scenario 2 (outdoor-ventilation: Air exchange with opened window and closed door). In this case, the door is closed. The air enters through the window and exists through the lower area of the door (due to its permeability). In this way, continuity is ensured. • Scenario 3 (indoor-ventilation: Air renewal with opened door and closed window). Opposite case to the previous one. • Scenario 4 (no-ventilation: door and window closed). No air is exchanged. In this case, only the concentration of CO 2 metabolically generated by the occupant is simulated.
To ensure continuity, it is necessary to define their permeability.
The boundary conditions refer to the mass flow of air and CO 2 entering and exiting the room. For the analysis of the renewal of IAQ in the presence of a CO 2 emission source, the geometry was created using DesignModeler, defining the inlets and outlets for each of the gases considered. A turbulent flow was modelled, specifically governed by the equations of the k-omega SST turbulence model. The physico-chemical characteristics of the gases involved were taken from the ANSYS database, activating the "Species" model. The composition of exhaled air is 78.6% N 2 , 1.8% H 2 O, 15.6% O 2 and 4% CO 2 . Accordingly, the mass flux of CO 2 emitted by a person breathing is small. For instance, the amount of air emitted by a person while performing activities at rest is approximately 0.0004 kg/s [91]. This emission was considered to be ideal and constant. Although a mesh with small elements would lead to a more precise solution, this increased the calculation time. This mesh was defined with small triangular elements which were between 0.05 and 0.1 m in size. In addition, the air inlet was considered to be the exterior window opened, and the air outlet was considered to be the interior door opened. To determine the mass flow, the following Equations (1) and (2) were used: where: where: D air is the density of the air at temperature of 25 Applying the values from the case study: In the first simulation, cross ventilation: A static analysis was performed in which the gas present in the indoor atmosphere was air. Similarly, for the inlet and outlet opened, the incoming and outgoing gas was also defined as air. For the inlet, the mass flow considered was 0.024 kg/s, which corresponds to three renewals per hour for the volumetric flow. The output of this simulation was defined by the "outflow", which allowed the law of conservation of mass to be satisfied: the entire mass flow of air entering through the window passes out the door. In addition, CO 2 was injected, simulating the constant exhalation of a person in a resting state.
In the second simulation, outdoor ventilation: The renewal airflow was performed through the window opened (one sliding leaf), the door being closed. A static analysis was carried out in which the gas present in the indoor atmosphere was air. Similarly, through the inlet opened, the incoming gas was air. The mass flow rate considered corresponded to one point five hourly renewals for the volumetric flow, then the mass flow was 0.012 kg/s. In this case, a slit at the bottom of the door (its clearance) was defined as the exit. This allowed for continuity within the room. The output of this simulation was defined by the "outflow", which allowed the law of conservation of mass to be satisfied: all the mass flow of air entering through the window opened passes out the door slit. Analogous to the previous simulation, CO 2 was injected, simulating the constant exhalation of a person in a resting state.
In the third simulation, indoor ventilation: The renewal air flow was performed through the door opened, the window being closed. A static analysis is carried out in which the gas present in the indoor atmosphere was air. Similarly, through the inlet opened, the incoming gas was air. The renewal air mass flow rate was 0.008 kg/s. In this case, a slit in the side window (its permeability) was defined as the exit. This allowed for continuity within the room. The output of this simulation was defined by the "outflow", which allowed the law of conservation of mass to be satisfied: all the mass flow of air entering through the door opened passes out the window slit. Analogous to previous simulations, CO 2 was injected, simulating the constant exhalation of a person in a resting state.

Professional Equipment
To select the professional equipment to be considered as a reference standard, a series of characteristics related to its weight, dimensions, and price were required. To begin with, the equipment must be certified by a recognised accredited agency. In addition, they must include human and battery autonomy, which allows measurements to be taken over long periods of time (greater than 50 h). A probe with infrared sensor for CO 2 measurement must be coupled. A wireless connection between the equipment and the probes available must be provided. The measurement modules must operate with different parameters and temperature ranges (from −20 • C to +80 • C). Finally, the professional equipment must measure in working environments with neutral gases. Among those available on the market, a KIMO HQ-210 was chosen. The equipment is supplied with a calibration certificate for the temperature, hygrometry, and CO 2 concentration probes (code NEM1700592 SCOH 112).

Low-Cost (Clonic) Device
Main advantages and disadvantages of the commercial equipment were considered as a reference to select the main components of the clonic device. In this regard, two elements were fundamental to create it: a sensor to monitor the concentration of CO 2 and an electronic motherboard that allows the processing of atmospheric data. In order to select the most suitable components, a series of criteria matrices were used to score the characteristics considered, which are detailed below.
Firstly, a CO 2 sensor was chosen, for which its main characteristics evaluated were: • Measurement range: it should be high (0-5000 ppm). • Accuracy: it should be less than ±0.1% • Capability of monitoring: it should measure one IAQ gas. In this case, CO 2 . • Sensitivity: it must provide high sensitivity and speed of response (in minutes).

•
Price: it should be less than EUR 30.
Four different sensors were considered: Amphenol Advanced Sensors Telaire T6713, Sensirion SCD30, DFRobot SEN0219, and Amphenol SGX Sensortech MiCS-VZ-89TE. The result of the criteria matrix is shown in Appendix A. After performing the criteria matrix (see Table A1), the most suitable sensor was the SEN0219. This is an analog sensor capable of monitoring CO 2 in an exclusive way by using non-dispersive infrared (NDIR) principle to detect the existence of CO 2 in the air. It features a long life, high resolution, accuracy and sensitivity, as well as a medium response speed. In addition, it is easy to install on any microcontroller and its price is relatively low (between EUR 30 and EUR 60).
Secondly, the selected motherboards included the Raspberry Pi Model B+ microcomputer and the Arduino MEGA 2560 R3 and ELEGOO MEGA 2560 R3 microcontrollers. Due to the similarities between the Arduino and ELEGOO microcontrollers, ELEGOO was considered because of its lower price. Their main factors evaluated were: The result of the criteria matrix is shown in Appendix A. Although both boards were suitable and had the right features for mounting the programmable device (see Table A2), ELEGOO MEGA 2560 Rev3 had a more intuitive and user-friendly software interface. The C++-based programming language allows fast programming of the SEN0219 sensor, as it is designed for implementation on microcontrollers. Although Raspberry Pi has many advantages, this project could not make full use of them. Additionally, the programming language (mainly Python, which is one of the base programming languages of Raspberry Pi) is complex and designed for expert programmers. After performing the criteria matrix (see Table A3), the most suitable motherboard was the ELEGOO MEGA 2560 Rev3.

Programming and Calibration of the Device
Once the motherboard and the sensor to be used were selected, they were assembled and programmed. The SEN0219 CO 2 sensor could be easily connected to the ELEGOO MEGA 2560 R3 microcontroller (see Appendix B, Figure A1). The software and programming language used was Arduino. The prototype is shown in Figure 2. Appl. Sci. 2022, 12, x FOR PEER REVIEW 10 of 37 Pi) is complex and designed for expert programmers. After performing the criteria matrix (see Table A3), the most suitable motherboard was the ELEGOO MEGA 2560 Rev3.

Programming and Calibration of the Device
Once the motherboard and the sensor to be used were selected, they were assembled and programmed. The SEN0219 CO2 sensor could be easily connected to the ELEGOO MEGA 2560 R3 microcontroller (see Appendix B, Figure A1). The software and programming language used was Arduino. The prototype is shown in Figure 2. Data captured by the sensor in the Arduino Serial Monitor were stored in a Microsoft Excel spreadsheet. For this purpose, additional programming code was carried out in the Visual Studio Code editor. This allowed the data stored to be analysed from time to time. This parameter was defined in the programming code depending on the monitoring needs. Once the system was ready, the next step consisted of the calibration of the zero point (which is based on the idea that if the sensor is placed into a 100% concentration of an alternate gas, the sensor reads absolute zero). This process was performed according to the datasheet of the manufacturer of the sensor, by shorting the circuit between the HD and GND pins for 7 s at least, but previously ensuring that the sensor was stable for more Data captured by the sensor in the Arduino Serial Monitor were stored in a Microsoft Excel spreadsheet. For this purpose, additional programming code was carried out in the Visual Studio Code editor. This allowed the data stored to be analysed from time to time. This parameter was defined in the programming code depending on the monitoring needs.
Once the system was ready, the next step consisted of the calibration of the zero point (which is based on the idea that if the sensor is placed into a 100% concentration of an alternate gas, the sensor reads absolute zero). This process was performed according to the datasheet of the manufacturer of the sensor, by shorting the circuit between the HD and GND pins for 7 s at least, but previously ensuring that the sensor was stable for more than 20 min at fresh air (400 ppm ambient environment). However, other alternative methods could have been used such as exposing the sensor to a gas with a known CO 2 concentration or to a gas with no CO 2 present. After that, since it was intended as a low-cost device, it was not required to correct the input voltage and gain (offset voltage) unless anomalies were detected in the readouts. Finally, if measurements were not within the tolerance range, then an adjustment inside the calibration was required. This was done by linear regression.
The calibration line was included in the programming code (see Appendix C). It relates the CO 2 concentration (in ppm) with the voltage values (in mV) captured by the sensor. Both parameters were related by two constants (C 1 and C 2 in Equation (3)), which were provided by the DataSheet of the analog sensor. These constants needed to be calculated in order to modify the regression line and achieve the adjustment within the calibration of the programmable device. The calibration line consisted of the following form: where: CO 2i is the concentration in ppm unit at "i" time. V i is the voltage in mV unit at "i" time. C 1 is the first constant in linear regression line. C 2 is the second constant in linear regression line.
The regression line obtained allowed the calibration process of the clonic device to be carried out. An analytical process of data collection is explained below. To achieve this, the data from the device was compared with a calibrated highly accurate and costly measuring instrument. To be precise, the KIMO HQ-210 equipment from KIMO Electronic Pvt. Ltd. (Mumbai, India), was selected. It consists of two probes capable of monitoring CO 2 , temperature, and humidity. The error of this measuring instrument was reflected in the calibration certificate provided by the manufacturer. This error was also considered in the error of the clonic device calibration. Prototype calibration was also possible thanks to the collection of a lot of data from both the sensor device and the KIMO equipment. To obtain the calibration line, the voltage measured by the sensor was related to the exact and real concentration value provided by the reference standard. This line changed every time a new calibration was performed. To be accurate, three rounds of calibration were needed to achieve a maximum target error of less than 10%.
All the calibrations were performed in the same location during a 9 h measurement interval. This location was the same as the one considered in the CFD simulations. The SEN0219 sensor device and the KIMO equipment were placed side-by-side. Only the characteristics considered were changed for obtaining the minimum error for each calibration. Data collection by the sensor device and the KIMO equipment was carried out at regular intervals of 5 min (which provided 108 measurement points each). A shorter time between measurements was beneficial to obtain more data, helping to obtain a more accurate and successful calibration line. Additionally, this time could be linked to the resolution of the IAQ monitoring device. A longer time between data collection meant that changes in CO 2 concentration were neglected.
Calibrations compare the experimental data from the KIMO equipment with the prototype estimates. To validate these comparisons, different error rates are used. This allows to observe how well the prototype device reproduces the behavior of the reference standard equipment. Several indices for validating models are reported in the literature, which can be classified according to their dependence on the scale of the compared signals. To begin with, errors that depend on the scale [92] such as the mean absolute error (MAE) used by [93] which measures the average magnitude of the error between the measured data by the equipment and the data estimated by the device, the mean error (ME) used by [94] which measures whether the device measures whether the device overestimates or underestimates the measured data, and the root mean square error (RMSE), used by [95] which weights the forecasts that are farthest away from the measured value by the equipment. Additional examples include the errors that do not depend on the scale [96] such as the mean absolute percentage error (MAPE) used by [97] which measures the average percentage error of the estimates and the best fit index (FIT) used by [98] which compares the measured and estimated data with respect to the average of the measured data.
It can be noted that the coefficient of determination (R 2 ) only measures the proportion of the variance in the dependent variable that is predictable from the independent one [99]. In addition, R 2 is invariant for linear transformations of the distribution of the independent variables [100], so that an output value close to one does not always produce a good prediction regardless of the scale on which these variables are measured. In this context, indicators as MAPE are recommended when it is more important being sensitive to relative variations than to absolute variations [101]. However, although scale-independent errors are widely used in the literature, since they are used when comparing data with different scales, the weighting of the larger-scale error causes adjustments with larger deviation the higher the CO 2 concentration to penalize against others. For instance, RMSE gives a relatively high weight to large errors since the errors are squared before they are averaged, so that it is useful when large errors are particularly undesirable [102].

First Round of Calibration
This was the first contact with the sensor. The upward and downward trend of the concentration recorded by the sensor corresponded to those obtained by the KIMO equipment. Even so, there was a large error that must be resolved by calibration. Figure 3 shows the first calibration line. This error became larger in case of high CO 2 concentrations. This is shown in Figure 4. However, after the adjustment, the error between the prototype device and the KIMO equipment decreased significantly, as shown in Table 3. Therefore, a further calibration had to be performed, taking into account these considerations:

1.
The atmosphere at the time of data acquisition must be as stable as possible. Sudden changes in temperature, humidity, or CO 2 must be avoided.

2.
The clonic device and the KIMO equipment are placed elsewhere. Areas close to the window or door of the room must be avoided. This makes it possible to ensure the previous point considered. 3.
The number of data collected (minimum 60) must be increased.  [97] which measures the average percentage error of the estimates and the best fit index (FIT) used by [98] which compares the measured and estimated data with respect to the average of the measured data.
It can be noted that the coefficient of determination (R 2 ) only measures the proportion of the variance in the dependent variable that is predictable from the independent one [99]. In addition, R 2 is invariant for linear transformations of the distribution of the independent variables [100], so that an output value close to one does not always produce a good prediction regardless of the scale on which these variables are measured. In this context, indicators as MAPE are recommended when it is more important being sensitive to relative variations than to absolute variations [101]. However, although scale-independent errors are widely used in the literature, since they are used when comparing data with different scales, the weighting of the larger-scale error causes adjustments with larger deviation the higher the CO2 concentration to penalize against others. For instance, RMSE gives a relatively high weight to large errors since the errors are squared before they are averaged, so that it is useful when large errors are particularly undesirable [102].

First Round of Calibration
This was the first contact with the sensor. The upward and downward trend of the concentration recorded by the sensor corresponded to those obtained by the KIMO equipment. Even so, there was a large error that must be resolved by calibration. Figure 3 shows the first calibration line. This error became larger in case of high CO2 concentrations. This is shown in Figure 4. However, after the adjustment, the error between the prototype device and the KIMO equipment decreased significantly, as shown in Table 3. Therefore, a further calibration had to be performed, taking into account these considerations: 1. The atmosphere at the time of data acquisition must be as stable as possible. Sudden changes in temperature, humidity, or CO2 must be avoided. 2. The clonic device and the KIMO equipment are placed elsewhere. Areas close to the window or door of the room must be avoided. This makes it possible to ensure the previous point considered. 3. The number of data collected (minimum 60) must be increased.    Since the errors after the first calibration were greater than 10%, a second calibration was performed. Although with the adjustment the errors could be lowered, there was no guarantee that under other conditions this adjustment could be contradictory. With the adjustment after the first calibration, the second calibration was performed. In the subsequent data, there was still a significant difference between the values monitored by the two instruments. Figure 5 shows the second calibration line. This still resulted in an average error of more than 10%, as shown in Table 4. Despite this, progress was favourable (when adjusting) and the graphs began to look similar in low and medium CO2 concentration, as shown in Figure 6. In addition, several conclusions could be drawn from this calibration: • The occupant of the living space must be far away from both instruments (prototype and equipment). This avoids falsification of data by possible direct exhalation on them.

Second Round of Calibration
Since the errors after the first calibration were greater than 10%, a second calibration was performed. Although with the adjustment the errors could be lowered, there was no guarantee that under other conditions this adjustment could be contradictory. With the adjustment after the first calibration, the second calibration was performed. In the subsequent data, there was still a significant difference between the values monitored by the two instruments. Figure 5 shows the second calibration line. This still resulted in an average error of more than 10%, as shown in Table 4. Despite this, progress was favourable (when adjusting) and the graphs began to look similar in low and medium CO 2 concentration, as shown in Figure 6. In addition, several conclusions could be drawn from this calibration:

•
The occupant of the living space must be far away from both instruments (prototype and equipment). This avoids falsification of data by possible direct exhalation on them.

Third Round of Calibration
All considerations from the two previous calibrations were made. With the adjustment after the second calibration, the third calibration was performed. The average error obtained was below 10% even before the adjustment, as shown in Table 5. Therefore, this calibration could already be considered suitable to start testing the different scenarios. Figure 7 shows the third regression line after calibration. As a result, the difference between the clonic device and the KIMO equipment was small, as shown in Figure 8. With this milestone, the calibration process was completed. However, to ensure that the clonic device measured constantly, regularly, and correctly, a preventive maintenance had to be scheduled. It is recommended to carry out calibrations every short period of time. This allows one to transform it into a predictive maintenance, since both absolute and relative error rates can be studied.

Third Round of Calibration
All considerations from the two previous calibrations were made. With the adjustment after the second calibration, the third calibration was performed. The average error obtained was below 10% even before the adjustment, as shown in Table 5. Therefore, this calibration could already be considered suitable to start testing the different scenarios. Figure 7 shows the third regression line after calibration. As a result, the difference between the clonic device and the KIMO equipment was small, as shown in Figure 8. With this milestone, the calibration process was completed. However, to ensure that the clonic device measured constantly, regularly, and correctly, a preventive maintenance had to be scheduled. It is recommended to carry out calibrations every short period of time. This allows one to transform it into a predictive maintenance, since both absolute and relative error rates can be studied.

Third Round of Calibration
All considerations from the two previous calibrations were made. With the adjustment after the second calibration, the third calibration was performed. The average error obtained was below 10% even before the adjustment, as shown in Table 5. Therefore, this calibration could already be considered suitable to start testing the different scenarios. Figure 7 shows the third regression line after calibration. As a result, the difference between the clonic device and the KIMO equipment was small, as shown in Figure 8. With this milestone, the calibration process was completed. However, to ensure that the clonic device measured constantly, regularly, and correctly, a preventive maintenance had to be scheduled. It is recommended to carry out calibrations every short period of time. This allows one to transform it into a predictive maintenance, since both absolute and relative error rates can be studied.

Results and Discussion
For presenting the results of the research and their discussion in an organised structure, the diagram presented in Figure 9 is followed. Then, the most relevant milestones involved in all phases of the research is summarised.

Results and Discussion
For presenting the results of the research and their discussion in an organised structure, the diagram presented in Figure 9 is followed. Then, the most relevant milestones involved in all phases of the research is summarised.

Phase 1: Perform CFD Simulations
As indicated in the previous section, the study was performed in four scenarios. They were those corresponding to the same living space of 9.4 m 2 with a unique occupant in soft sorting activities (minor than 6 MET), but in the following conditions: • Cross-ventilation: space with door and window opened.

Phase 1: Perform CFD Simulations
As indicated in the previous section, the study was performed in four scenarios. They were those corresponding to the same living space of 9.4 m 2 with a unique occupant in soft sorting activities (minor than 6 MET), but in the following conditions: • Cross-ventilation: space with door and window opened. The hygrometric comfort conditions were considered acceptable in all simulations, with temperature (T) ranging between 17 • C and 25 • C and relative humidity (RH) between 40% and 70%. The room faces southeast (taking the plane of the window as a reference). As the characteristic wind in this area comes from the east, ventilation with an open window was satisfactory. Figure 10 shows the working space employed in the research. The room was modelled with Ansys 2021 R2 version software. The hygrometric comfort conditions were considered acceptable in all simulations, with temperature (T) ranging between 17 °C and 25 °C and relative humidity (RH) between 40% and 70%. The room faces southeast (taking the plane of the window as a reference). As the characteristic wind in this area comes from the east, ventilation with an open window was satisfactory. Figure 10 shows the working space employed in the research. The room was modelled with Ansys 2021 R2 version software. The main parameters considered in the simulations was the mass flow of incoming and outgoing air through the different openings and the concentration (or mass flow) of CO2 from the metabolic exhalation of the occupant in the working space. Among four scenarios, cross-ventilation had the highest air renewal. This example could be extrapolated to public spaces that require a high air renewal rate to keep CO2 levels low. Therefore, the location of measurement points was based on this scenario, as it was the most unfavourable. In this scenario, static and transitional tests were performed. For this purpose, an inlet air mass flow rate of 0.008 kg/s for each hourly renewal considered, depending on the scenario, was defined. Figure 11 shows the zones in the space where vortices are formed. It must be noted that these points were not suitable for the placement of the CO2 sensors for IAQ control. The main parameters considered in the simulations was the mass flow of incoming and outgoing air through the different openings and the concentration (or mass flow) of CO 2 from the metabolic exhalation of the occupant in the working space. Among four scenarios, cross-ventilation had the highest air renewal. This example could be extrapolated to public spaces that require a high air renewal rate to keep CO 2 levels low. Therefore, the location of measurement points was based on this scenario, as it was the most unfavourable. In this scenario, static and transitional tests were performed. For this purpose, an inlet air mass flow rate of 0.008 kg/s for each hourly renewal considered, depending on the scenario, was defined. Figure 11 shows the zones in the space where vortices are formed. It must be noted that these points were not suitable for the placement of the CO 2 sensors for IAQ control.
On the other hand, in the case of no-ventilation (Scenario 4), the same mass flow of air was considered and there was an increase of exhaled metabolic CO 2 . The permeability of the door and window allowed for pressure balancing through minimal air renewal, which was considered. Figure 12 shows the simulation of this scenario for a period of 9 h. As can be observed, as time progressed, the CO 2 concentration in the working space became uniform, being higher in the areas close to the CO 2 emitter.
To decide a good sensor location in each of the four scenarios, the parameters for the mass flow of air from the concentration of CO 2 emitted by the people in the room measured and the ventilation were used. The amount of CO 2 reflected in all simulations performed was 0.0004 kg/s. However, the mass flow of air from the ventilation varied according to the scenario considered. Among all of them, the highest mass air flow came from the highest air renewal (Scenario 1, cross ventilation) with three renewals per hour, corresponding to a volumetric flow rate of 20 L/s per person. By studying the behavior of the turbulent flow by CFD, the vortices in the room were observed. These points were not suitable for sensor placement. On the contrary, in Scenario 4 (no ventilation), there was no air flow that caused vortices and the CO 2 concentration increased progressively, uniformly filling the volume tested. For this reason, the location of the sensors in Scenario 4 was the most demanding case for monitoring CO 2 . Appl On the other hand, in the case of no-ventilation (Scenario 4), the same mass flow of air was considered and there was an increase of exhaled metabolic CO2. The permeability of the door and window allowed for pressure balancing through minimal air renewal, which was considered. Figure 12 shows the simulation of this scenario for a period of 9 h. As can be observed, as time progressed, the CO2 concentration in the working space became uniform, being higher in the areas close to the CO2 emitter.
To decide a good sensor location in each of the four scenarios, the parameters for the mass flow of air from the concentration of CO2 emitted by the people in the room measured and the ventilation were used. The amount of CO2 reflected in all simulations performed was 0.0004 kg/s. However, the mass flow of air from the ventilation varied according to the scenario considered. Among all of them, the highest mass air flow came from the highest air renewal (Scenario 1, cross ventilation) with three renewals per hour, corresponding to a volumetric flow rate of 20 L/s per person. By studying the behavior of the turbulent flow by CFD, the vortices in the room were observed. These points were not suitable for sensor placement. On the contrary, in Scenario 4 (no ventilation), there was no air flow that caused vortices and the CO2 concentration increased progressively, uniformly filling the volume tested. For this reason, the location of the sensors in Scenario 4 was the most demanding case for monitoring CO2.  Figure 13 shows the three points selected among suitable ones for the CO 2 concentration measurement. They were placed in positions that do not correspond to the vortices nor currents of air, avoiding distorting measurement points. The red colour shows areas with high renewal, so that placing the sensors in these areas would distort the average level in the space. Despite the statements of previous research (to the best of our knowledge) and current legislation [103,104] which establish that measurements should be taken at 1.2 metres above the ground, equivalent measurements can be taken at higher or lower points, as they are not modified either by renovations or by CO 2 concentration in the most unfavourable scenarios. They are as follows:    As Location 1 complies with current legislation for all kind of activities that can be undertaken in the living space, this is the one selected for the series of measurements.

Phase 2: Study Low-Cost Elements for the Prototype
In this research, high-precision and high-cost instruments were used. However, other research with CO2 measuring devices allowing CO2 concentrations to be monitored less expensive were also analysed. The cheapest cost of these clonic devices, according to the latest research by Villanueva et al. [77], was EUR 75. The clonic device proposed has an open programming language, which is available in Appendix C. In addition, its price is approximately EUR 60, which is 20% cheaper. Therefore, users and construction companies can include it as an element for the transformation of buildings into smart buildings. Figure 13. Location of three the points selected for the CO 2 concentration measurement.
As Location 1 complies with current legislation for all kind of activities that can be undertaken in the living space, this is the one selected for the series of measurements.

Phase 2: Study Low-Cost Elements for the Prototype
In this research, high-precision and high-cost instruments were used. However, other research with CO 2 measuring devices allowing CO 2 concentrations to be monitored less expensive were also analysed. The cheapest cost of these clonic devices, according to the latest research by Villanueva et al. [77], was EUR 75. The clonic device proposed has an open programming language, which is available in Appendix C. In addition, its price is approximately EUR 60, which is 20% cheaper. Therefore, users and construction companies can include it as an element for the transformation of buildings into smart buildings.
Regarding the parametric considerations, the error of the prototype compared to equipment calibrated was in the range between 0 and 7.49%. This error was much lower for Scenario 1 and comparable to commercial equipment in Scenario 4, according to research by Villanueva et al. [77]. The connection between prototype and cloud allows the collection of data and its further management, which is not possible with static devices that only provide a point measurement of the CO 2 concentration.

Phase 3: Calibrate the Prototoype
As detailed in the previous section, the calibration of the prototype was performed through iterations with regression lines. In successive calibrations, better and better fits were obtained. The last calibration determined that the error between the measurements obtained by the calibrated equipment (KIMO) and the prototype sensor device was less than the principal milestone of the project: less than 10%. Absolute indicators as RMSE as well as relative ones as MAPE could be used to check this. Therefore, after this process, a reliable prototype was obtained whose performance is comparable to other commercial or even clonic devices on the market such as those studied by Villanueva et al. [77].

Phase 4: Evaluate the Scenarios and Determine the Measurement Error
In this phase, a comparative analysis of the measurements made by the prototype device compared to those from the calibrated instrument was carried out. This statistical analysis of the data obtained was performed for each of the four scenarios. It consisted of capturing data every 5 min over a period of 6 h. The data obtained for the measurements in the four scenarios are shown graphically. Figure 14 shows the data for Scenario 1 (cross-ventilation). It can be observed that the data corresponding to the measurement with the prototype coincided with those of the equipment calibrated. The minimum difference between the recopilated data (error) could be caused by cross-ventilation because the atmosphere was not completely steady. In addition, the CO 2 concentration was observed to remain at healthy levels, close to the IAQ values that can be achieved in outdoor environments. The amount exhaled by the occupant of the space had hardly any effect on the total concentration when the ventilation was cross-ventilation.
through iterations with regression lines. In successive calibrations, better and better fits were obtained. The last calibration determined that the error between the measurements obtained by the calibrated equipment (KIMO) and the prototype sensor device was less than the principal milestone of the project: less than 10%. Absolute indicators as RMSE as well as relative ones as MAPE could be used to check this. Therefore, after this process, a reliable prototype was obtained whose performance is comparable to other commercial or even clonic devices on the market such as those studied by Villanueva et al. [77].

Phase 4: Evaluate the Scenarios and Determine the Measurement Error
In this phase, a comparative analysis of the measurements made by the prototype device compared to those from the calibrated instrument was carried out. This statistical analysis of the data obtained was performed for each of the four scenarios. It consisted of capturing data every 5 min over a period of 6 h. The data obtained for the measurements in the four scenarios are shown graphically. Figure 14 shows the data for scenario 1 (cross-ventilation). It can be observed that the data corresponding to the measurement with the prototype coincided with those of the equipment calibrated. The minimum difference between the recopilated data (error) could be caused by cross-ventilation because the atmosphere was not completely steady. In addition, the CO2 concentration was observed to remain at healthy levels, close to the IAQ values that can be achieved in outdoor environments. The amount exhaled by the occupant of the space had hardly any effect on the total concentration when the ventilation was cross-ventilation.      Figure 16 shows the data for Scenario 3 (indoor-ventilation). The data from the measurement with the prototype match those of the equipment calibrated. Air renewal depends on the interior connection between the room and the rest of the building. Except for occasional measurements, the IAQ is considered to be adequate. In this case, in order to have more information, it would be necessary to perform the study of the entire building (including all the points where there could be air renewal).  Figure 16 shows the data for Scenario 3 (indoor-ventilation). The data from the measurement with the prototype match those of the equipment calibrated. Air renewal depends on the interior connection between the room and the rest of the building. Except for occasional measurements, the IAQ is considered to be adequate. In this case, in order to have more information, it would be necessary to perform the study of the entire building (including all the points where there could be air renewal). Figure 16 shows the data for Scenario 3 (indoor-ventilation). The data from the measurement with the prototype match those of the equipment calibrated. Air renewal depends on the interior connection between the room and the rest of the building. Except for occasional measurements, the IAQ is considered to be adequate. In this case, in order to have more information, it would be necessary to perform the study of the entire building (including all the points where there could be air renewal).    Figure 17 shows the data for Scenario 4 (no-ventilation). The data from the measurement with the prototype matched those of the equipment calibrated. It can be observed how the amount of CO 2 increased to levels considered unhealthy. After approximately 50 min, concentrations close to 1000 ppm of CO 2 were obtained.
The instantaneous error of each measurement corresponded to the difference between the measurement obtained by the low-cost clonic device and the commercial instrument calibrated (KIMO). This measurement already incorporated the corrected measurement uncertainty of the KIMO instrument. Details of all measurements are included in the Supplementary Materials.
Simultaneous measurements were obtained with both the low-cost clonic device and the instrument calibrated (KIMO), which was employed as a reference standard. As stated before, these device measurements already included both the correction and the measurement uncertainty of the KIMO instrument. The values of the mean, minimum, maximum, and standard deviation values were studied. Table 6 shows these values:   As explained before, an average outdoor concentration of 400 ppm was assumed, according to the technical report "CEN/TR 16798-2". Then, normality (with the Kolmogorov-Smirnov test) and homoscedasticity (with the Fisher F-test) was probed. Table 7 shows the values of the statistics for each of the scenarios. Then, an equivalence test (the two-one sided test (TOST test)) was used to determine whether the means for both equipment measurements were close enough to be considered equivalent. Finally, the concordance between both samples was checked with the Bland-Altman plot, identifying any systematic difference between the measurements (as fixed bias) or possible outliers. Table 8 shows the values of the statistics for each of the scenarios. All the statistical indices shown in Tables 7 and 8 as well as in Figure 18, indicate that there was normality and homoscedasticity between the values obtained by the prototype sensor device and the reference standard equipment. In addition, equivalence and concordance were also satisfactorily tested. Finally, the instantaneous error, which is the difference between the measurement of the low-cost prototype sensor device and the KIMO equipment, was calculated. This calculation was made for the 72 measurements taken every 5 min. The mean value was also considered. This study helped to determine the percentage error in each of the scenarios. Data are shown in Table 9. As can be observed, the comparative measurement error in all scenarios was less than 8%. If the experiment was performed in a case whose ventilation is maximum (cross-ventilation is 1 m/s), the values obtained were similar to the results of the study by Villanueva et al. [77] for other clonic devices. Appl. Sci. 2022, 12, x FOR PEER REVIEW 25 of 37 every 5 min. The mean value was also considered. This study helped to determine the percentage error in each of the scenarios. Data are shown in Table 9.  As can be observed, the comparative measurement error in all scenarios was less than 8%. If the experiment was performed in a case whose ventilation is maximum (cross-ventilation is 1 m/s), the values obtained were similar to the results of the study by Villanueva et al. [77] for other clonic devices.

Phase 5: Integrate into a Smart Building
Smart building infrastructures aim to maximise building efficiency in different fields of application. Specifically, this research focused on the assessment of IAQ to maintain a safe atmosphere for building occupants. However, given that the main issue at present day is the transmission of the COVID-19 disease, the parameter related to CO 2 concentration was used as a reference. For this purpose, a low-cost device was designed to transfer the captured data to the cloud. In this way, it is possible to retrieve the information for decision making or integration with other systems, such as those in charge of ventilation and air conditioning (HVAC) or even other systems for automatic opening and closing of elements for natural air renewal.
The other issue that has been addressed is the definition of a location for this equipment that allows it to be properly measured. In this regard, CFD studies have shown that, although the general recommendation of up to 1.2 m above the floor is correct, there are many more points where reliable data on CO 2 concentration averages can be obtained. In addition, vortices were determined and excluded from the potential location of the device, as its measurements would be distorted from the actual average. A functional scheme of the investigation is presented graphically in Figure 19. Integration with other systems in smart building was not addressed within the scope of this research, although this would allow better monitoring and control of these systems, promoting efficient energy use and helping to control indoor quality for disease prevention.
the captured data to the cloud. In this way, it is possible to retrieve the information for decision making or integration with other systems, such as those in charge of ventilation and air conditioning (HVAC) or even other systems for automatic opening and closing of elements for natural air renewal.
The other issue that has been addressed is the definition of a location for this equipment that allows it to be properly measured. In this regard, CFD studies have shown that, although the general recommendation of up to 1.2 m above the floor is correct, there are many more points where reliable data on CO2 concentration averages can be obtained. In addition, vortices were determined and excluded from the potential location of the device, as its measurements would be distorted from the actual average. A functional scheme of the investigation is presented graphically in Figure 19. Integration with other systems in smart building was not addressed within the scope of this research, although this would allow better monitoring and control of these systems, promoting efficient energy use and helping to control indoor quality for disease prevention.

Conclusions
In the COVID-19 era, CO2 concentration is the most important indicator related to IAQ to measure the degree of air pollution. This research addressed how to monitor and control CO2 concentration in order to implement a clonic device to help prevent disease transmission. From commercial components (sensor and motherboard), a low-cost device to measure the concentration of the pollutant CO2 was designed, developed, assembled, openly programmed, prototyped, and calibrated. The statistical analysis of normality, homoscedasticity, equivalence, and concordance performed determined that the measurements made by the equipment certified (KIMO) used as reference standard and the lowcost clonic device were equivalent, with a maximum error of less than 8% and an average of less than 3%. Therefore, these devices can be used to monitor IAQ by measuring CO2 concentration.

Conclusions
In the COVID-19 era, CO 2 concentration is the most important indicator related to IAQ to measure the degree of air pollution. This research addressed how to monitor and control CO 2 concentration in order to implement a clonic device to help prevent disease transmission. From commercial components (sensor and motherboard), a lowcost device to measure the concentration of the pollutant CO 2 was designed, developed, assembled, openly programmed, prototyped, and calibrated. The statistical analysis of normality, homoscedasticity, equivalence, and concordance performed determined that the measurements made by the equipment certified (KIMO) used as reference standard and the low-cost clonic device were equivalent, with a maximum error of less than 8% and an average of less than 3%. Therefore, these devices can be used to monitor IAQ by measuring CO 2 concentration.
To the best of our knowledge, they can do so at a lower price than other similar devices proposed by previous research, and much lower than those offered by existing commercial equipment on the market. In addition, it is worth noting that the open-source programming included is easily replicable by other researchers or even end users. This eliminates the economic barriers derived from the high prices of calibrated instruments and equipment that prevent their widespread use, as well as the technical barriers derived from the programming.
On the other hand, a CFD study was carried out to choose the most suitable locations for data collection, identifying and discarding locations that may provide nonrepresentative and unreliable measurements due to the existence of vortices in the air flows, depending on the ventilation scenarios proposed (cross, outdoor, indoor-indirect). The study enabled the selection of a series of points that respond to the needs of CO 2 monitoring and control which go beyond those established in the legislation or those collected in previous research, as far as we are aware. Therefore, a methodology was proposed that helps to select the CO 2 control points according to the existing conditions in the indoor spaces under study.
The data collected wirelessly for interpretation could be evaluated on an Internet of Things (IoT) platform, in real time or deferred. As a result, IAQ could be controlled, interfacing IAQ devices with other systems (such as HVAC). The integration of this type of low-cost clonic devices into existing buildings allows regulation of ventilation, balancing safety through air renewal with comfort and energy efficiency. This ensures adequate sanitary conditions for the occupants while also favoring the optimization of energy resources. In this way, a smarter building was achieved, adding value to its refurbishment and modernization.
Future lines of research should focus on cataloging and parameterizing the location and distribution of the devices according to the behavior of indoor air in other scenarios and measuring the influence of this control on the comfort and energy sustainability of the building, since ventilation, as a means of natural air renewal, can exert a negative influence on energy efficiency when spaces are conditioned. Finally, to facilitate the replicability and comparability of this research, data analysis organised by spreadsheets is included as Supplementary Materials.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A. Criteria Matrices for Components Selection
Appendix A. 1

. Sensor Selection
The factors considered for the choice of the sensor that suits the needs of the research are (which are weighted according to a scale from 0 (lowest score) to 2 (best score)):

•
Measuring range: This is the range of values (in ppm) capable of being detected by the sensor. • 2: Sensor capable of detecting any concentration of CO 2 , even exceeding by far the limit values established by the standards and regulations in force. Upper limit value of the measuring range greater than 5000 ppm. • 1: Sensor capable of detecting CO 2 concentrations below the limit values established by the standards and regulations in force. Upper limit value of the measuring range greater than 2000 ppm and smaller than 5000 ppm.
• 0: Sensor capable of detecting CO 2 concentration values of no more than 2000 ppm. • Accuracy: This is the error of the sensor. This value is shown in the sensor datasheet, defining the accuracy with which the sensor performs the measurements. A higher precision will result in higher accuracy in the data collected. • 2: Accuracy ≤ ±0.1 (percent) • 1: ±0.1 < Accuracy ≤ ±1 • 0: Accuracy ≥ ±1 • Number of parameters: Monitoring more than one parameter is not desirable. In multigas or multi-parameter sensors, a laboratory calibration must be performed (although self-calibration is mentioned in the datasheet, this is obtained with a regression line, which does not necessarily will coincide with measurements by conventional devices already calibrated), because of the presence of several gases or different parameters in the same enclosure may influence data acquisition and interpretation. • 2: Sensor capable of measuring a single gas. • 1: Sensor capable of measuring between 2 and 4 different gases. • 0: Sensor capable of measuring more than 5 gases.

•
Response speed: This is the capacity to display changes in the values of the sensor output without delays depending on the variations of the input. It is interesting that the sensitivity is high, as it will show greater flexibility to measure sudden changes in CO 2 . • 2: Response speed ≤ 1 min. • 1: 1 min < Response rate ≤ 2 min. • 0: Response speed > 2 min. • Warm-up time: This is the period of time during which the sensor does not take reliable measurements and adapts to the surrounding atmosphere. This is for ensuring the sensor takes measurements in accordance with its calibration line, waiting until the start of data acquisition. The shorter the warm-up time, the greater the autonomy, reliability and accuracy of the data collected. The results are shown in Table A1: Appendix A.

Motherboard Selection
The compilation of the different characteristics extracted, which are of interest for the elaboration of the corresponding criteria matrix, are shown in Table A2: The factors considered for the choice of the motherboard encompass its main characteristics (mentioned above). In addition, factors related to the functionality and intended uses of the programmable device have also been added (the importance is weighted with values from 0 to 2, the latter being the best score depending on the factor considered): • General characteristics of the board: Compact dimensions and low weight. Storage and autonomy. • Software and hardware: Hardware easy to use and open-sourced programming language. • Innovation: Although a completely new device is already being realised with both board options, it is desired that the device and programming platform provide functions that add value to the prototype. • Interconnection: Suitable for direct connection of the SEN0219 sensor and other devices. • Price: Competitive price/performance ratio.
The results are shown in Table A3: Appendix B. Sensor Connection ELEGOO Mega 2560 R3 motherboard is an open source ATMega2560-ATMEGA16U2 microcontroller board with 54 digital input and output pins, 16 analogue inputs, USB connection, RESET button and external power input. When purchasing the ELEGOO MEGA board, the USB cable for connection via serial port with the computer where the sensor programming is to be carried out is included.
As the SEN0219 sensor is analogue, one of the analogue inputs of the board must be used. Specifically, the analogue input A0 is selected. This input could be any other input as long as it is reflected in the programming code (from A1 to A7). In the same vein, the ground (GND) and voltage pins are essential to receive data from the sensor. The SEN0219 sensor works with a voltage between 4.5 and 5.5 V, so the connection will be made to the 5 V (Power) connection pin on the motherboard. the sensor programming is to be carried out is included.