1. Introduction
Air quality is a crucial factor in public health and human well-being, especially in urban environments where concentrations of atmospheric pollutants have reached alarming levels. The World Health Organization (WHO) states that breathing good-quality air daily is a fundamental right for everyone. However, almost 99% of the global population [
1] breathes air that exceeds WHO guideline limits and contains high levels of pollutants, with low and middle-income countries experiencing the highest exposures [
2].
Although extensive research has focused on outdoor air pollution, the importance of indoor air quality (IAQ) has been increasing, as the majority of people spend up to 90% of their time in environments such as homes, residences, offices, schools, and shopping centers [
3].
Indoor environments function as complex, ever-changing systems in which air quality is shaped by numerous influences, such as the infiltration of outdoor air, the characteristics of building materials, and everyday human activities. Extended exposure to indoor air pollutants can lead to adverse health effects. The effects can range from minor symptoms such as irritation of the eyes, nose, and throat, to chronic respiratory and cardiovascular diseases, including cancer [
4,
5]. In particular, recent studies underscore the significant impact of IAQ on respiratory health [
2,
3,
4]. Epidemiological research has consistently shown that exposure to some indoor air pollutants, such as fine particulate matter (PM
2.5), nitrogen dioxide (NO
2), and ozone (O
3), is associated with a higher incidence and severity of respiratory diseases such as chronic obstructive pulmonary disease (COPD) and asthma [
5].
Factors such as inadequate ventilation, the use of contaminated building materials, and the presence of sources of internal pollution, such as cleaning products or heating systems, contribute to the accumulation of pollutants in indoor spaces [
6]. Consequently, continuous monitoring of indoor environments is imperative to mitigate exposure to harmful pollutants.
IAQ assessment relies heavily on real-time monitoring technologies, particularly environmental sensors capable of continuously measuring key parameters. These include common indoor pollutants such as particulate matter of various sizes (PM
1, PM
2.5, PM
10), ozone (O
3), volatile organic compounds (VOCs), sulfur dioxide (SO
2), carbon dioxide (CO
2), and carbon monoxide (CO) [
7]. The data generated by these systems are crucial for quantifying pollution levels, evaluating their impact on respiratory health, and enabling timely mitigation strategies. Although IAQ can also be affected by other significant agents such as radon, aldehydes (e.g., formaldehyde emitted from furnishings), and biological contaminants like mold and dust mites, comprehensive monitoring of all these factors remains technologically challenging and economically demanding.
IAQ presents challenges that differ significantly from outdoor ambient assessment. Indoor environments are dynamic microclimates characterized by high spatial variability (e.g., kitchen vs. bedroom) and intermittent emission sources (e.g., cooking, cleaning, human occupancy). Furthermore, historically, IAQ assessment has relied upon costly, research-grade instrumentation or passive samplers, none of which are typically capable of capturing real-time dynamics. In this context, low-cost sensors (LCSs) have acquired paramount importance. Their affordability and compact size provide a great opportunity for indoor environments, enabling the identification of potential emission sources in various household areas, the management and mitigation of IAQ issues, real-time alert systems, personal exposure monitoring, and building control to optimize energy efficiency and assess health risks [
8].
The advantages of using LCSs are well-known in terms of cost, portability [
9], and spatio-temporal resolution. In addition, the use of LCSs opens the door to the application of artificial intelligence techniques, enabling the development of highly valuable predictive models for public health, building management, and environmental sustainability [
2]. However, some studies agree on their limitations regarding precision and accuracy [
10], and the lack of regulation in the certification process [
11]. Furthermore, they highlight the need for regular field calibrations and the importance of using reference-grade instruments for validation [
8].
Nonetheless, integrating Machine Learning (ML) and IAQ monitoring systems based on LCSs and IoT is of utmost importance, as it transforms raw data into proactive, actionable information. The main advantage of ML is its ability to predict and forecast future air quality conditions [
12,
13,
14,
15,
16]. ML leverages the large volume of quantitative data generated by low-cost IoT sensors to process, analyze, and build models that deliver reliable and cost-effective predictions to maintain optimal IAQ and occupant well-being. This forecast is crucial because it gives users more time to deliberate on how to improve air quality and prevent dangerous situations before they occur [
14,
15].
Although not compound-specific, VOC measurements can indirectly capture indoor activities involving chemical products, such as the use of disinfectants or cleaning agents. Similarly, increases in PM concentrations and in CO
2, often used as a proxy for ventilation, can indicate emissions from combustion sources, including heating and cooking, particularly when ventilation is limited. Moreover, quantifying IAQ can offer potential benefits for individuals with respiratory conditions [
12]. Lastly, the use of ML enables building managers to make informed decisions about ventilation and heating/cooling, which also contributes to improving the building’s energy efficiency [
14].
In addition, the importance of ML also lies in its ability to handle and analyze the complex and non-linear nature of air quality data [
13]. ML algorithms are ideal for forecasting IAQ data time series, as they overcome the limitations of traditional prediction models and achieve more accurate predictions. These complex models can be trained using historical IAQ data to determine future values. Furthermore, ML can be implemented in the back end of the system to detect anomalies or changes in trends through time series analysis, which is useful to modify occupant behavior [
12].
The state of the art in the prediction of PM (mainly PM
2.5) has evolved from initial mechanical models, which were inconvenient due to the need for many details of the building, such as the structures of the envelope [
17], to a data-driven approach dominated by ML. Algorithms such as Artificial Neural Networks (ANNs) [
18], Recurrent Neural Networks (RNNs) [
19], and especially Random Forests (RFs) [
20,
21] have been widely and successfully used to predict pollutant concentrations due to their capacity to capture non-linear interactions between environmental variables, to model the complex temporal dependencies inherent in air quality dynamics, and to handle measurement noise while mitigating overfitting. However, only a few approaches have specialized in analyzing differences in air quality in different rooms of a dwelling. Indoor CO
2 and VOCs models have also been developed using machine learning algorithms to forecast these pollutant concentrations [
22,
23,
24]
In this context, this study aims to design, implement, and evaluate a low-cost solution, from initial sensor characterization and selection to hardware integration, firmware programming, and IoT configuration. While IAQ is affected by a multitude of agents, this study focuses on PM, VOCs, CO
2, temperature, and humidity. These parameters were selected because they serve as effective real-time proxies for ventilation (CO
2), combustion and occupancy activities (PM, CO
2), and general chemical contamination (VOCs), while remaining compatible with the cost and size constraints of scalable IoT deployments. In addition, they have demonstrated to play a critical role in the management of chronic respiratory diseases, since they represent the primary environmental triggers for exacerbations in asthma and COPD patients that can be reliably monitored in real-time [
2]. This work explicitly addresses the primary weaknesses of common LCSs by validating the system’s performance and by a real-world deployment in residential rooms. Furthermore, we demonstrate the utility of high-quality data to develop predictive ML models to anticipate contaminant levels. The result is a scalable, accurate, and reliable monitoring solution that can contribute to data-driven insights needed for effective building management and personal exposure assessment.
The remainder of this paper is structured as follows:
Section 2 details the methodology used for sensor selection and evaluation, for building the IAQ unit, and for the field test, as well as the predictive machine learning approach.
Section 3 presents the results on the characterization and comparative evaluation of the IAQ sensors, the final IAQ prototype, the detailed analysis of the pollutant data gathered in the field test, and the results of the training and validation of the ML predictive models. These results are discussed in
Section 4. Finally,
Section 5 summarizes the conclusions.
2. Materials and Methods
2.1. Sensor Technology Background
The technology integrated into LCSs for IAQ monitoring varies by the target parameter. For gas detection (e.g., NO
x, VOCs, CO, O
3, SO
x, NH
3), the primary technologies are metal-oxide semiconductor (MOS) and electrochemical (EC) sensors. EC sensors generally offer higher sensitivity and selectivity, but at a higher cost, while MOS sensors are more affordable with long lifespans, although they can suffer from cross-sensitivity [
25]. It should be noted that many MOS sensors dedicated to measuring VOC also provide an equivalent value of CO
2 (eCO
2). This parameter is not a direct measurement; instead, it is algorithmically inferred from the correlation observed in indoor environments between certain VOCs and hydrogen with CO
2 exhaled through respiration. Other sensor types for VOCs include photo-ionization detectors (PIDs), which offer sensitivity higher than that of MOS sensors, although with limited selectivity [
26]. For CO
2 measurement, the advent of non-dispersive infrared (NDIR) technology has been a significant advancement, providing highly precise, selective, and long-term stability measurements [
27]. For PM (PM
1, PM
2.5, PM
4, and PM
10), the dominant LCS technology is laser scattering, also known as Optical Particle Counters (OPCs). The reliability and performance of these low-cost OPCs have been extensively evaluated and validated in numerous studies, confirming their utility for IAQ monitoring when properly calibrated [
28].
2.2. Sensor Identification
An experimental approach was used for the selection, evaluation, and calibration of LCSs intended for IAQ monitoring.
The target parameters, VOCs, PM, CO2, temperature, and humidity, were selected to balance cost and reliability, allowing a comprehensive assessment of IAQ and ventilation without incurring the high expenses of laboratory-grade, gas-specific analyzers. The selection process focused on commercially available off-the-shelf (COTS) sensors, which were evaluated against essential technical criteria: accuracy, measurement range, stability, cost, and calibration needs.
The experimental evaluation, summarized in
Table 1, involved a comparative benchmark of eight distinct sensor modules selected to cover the target parameters. Three VOCs MOX sensors were compared (the SGX Sensortech MICS-VZ-89TE, ScioSense ENS160, and Sensirion SGP40) against a high-precision, lab-calibrated EC sensor (the ECSense TB600B-TVOC-10). MOX sensors are typically factory-calibrated but are generally less precise. In contrast, EC sensors, while substantially more expensive, provide certified, traceable calibration derived from laboratory testing. For this reason, the EC sensor was used as the reference standard to evaluate the performance of the lower-cost MOX technologies.
For the CO2 measurement, three sensors based on NDIR technology were compared. This group included two NDIR photoacoustic sensors (the Sensirion SCD41 and Infineon XENSIV PAS CO2) factory calibrated up to 2000 ppm, and an NDIR optical sensor (Telaire T6793-5K) calibrated up to 5000 ppm. All three units have featured self-calibration capabilities, providing a robust basis for comparing the two NDIR sub-technologies (photoacoustic vs. optical). Additionally, the estimated eCO2 values provided by MOX-based VOC sensors were included in this evaluation to assess their viability as a potential proxy or substitute for a dedicated NDIR sensor.
Finally, the Sensirion SEN54 was included as an all-in-one multi-parameter module. It was the only sensor evaluated for PM (PM
1, PM
2.5, PM
4, PM
10), which it measures using laser scattering technology. The SEN54 operates from 0 to 1000
g/m
3 with a specified precision of
against its calibration reference (a TSI DRX 8533 aerosol monitor). Additionally, the SEN54 also integrates a MOX sensor to provide a VOCs index, along with sensors for temperature and relative humidity, offering a comprehensive and cost-effective solution [
29,
30,
31].
2.3. Sensors Evaluation
Sensor evaluation was carried out by means of experimental trials performed under controlled conditions. The block diagram of the test bench employed is shown in
Figure 1. The evaluation protocol comprised co-location experiments in an open-door room. For the sensors’ response dynamics and cross-sensitivity analysis, we employed controlled exposure to representative indoor emission sources rather than static standard gases, as our goal was to evaluate the sensors’ behavior under acute, transient events typical of residential settings. For VOCs, ethanol-based aerosols (commercial hairspray) were used to generate sudden, high-concentration spikes. This allowed us to assess the sensor’s rise time and recovery curve. For CO
2 to test for cross-sensitivity, we generated CO
2 pulses via the stoichiometric acid-base reaction of sodium bicarbonate (NaHCO
3) and acetic acid (vinegar). This method produces a clean CO
2 plume without significant VOCs, ideal for verifying sensor selectivity.
The prototype consisted of an Arduino MKR WiFi 1010 (Arduino, Monza, Italy) microcontroller board and each of the sensors in
Table 1, with the corresponding wiring schematic depicted in
Figure 1. For the prototype’s firmware, the data-read latency of the most restrictive sensor (i.e., the slowest) was considered, and a unified sampling frequency of 6 s was established for the simultaneous data acquisition from all sensors.
Upon completion of the experiments, the collected data were analyzed to select the sensors with the optimal cost-reliability ratio. The selected sensors were then targeted for integration into a custom-designed project-specific device. This final device was engineered for ultra-low power consumption, several hours of energy autonomy (battery life), and NB-IoT (Narrowband-IoT) connectivity for autonomous data transmission to a remote server. This design renders the device fully independent of any end-user intervention; it operates using its own SIM card and does not rely on the end-user’s local network infrastructure.
2.3.1. Evaluation of VOCs Measurement Performance
For the reliability analysis of VOCs sensors, the MKR WiFi 1010 device was used, and custom firmware was developed in C++ within the Arduino framework, following a modular architecture. It uses dedicated driver classes to poll the sensors via
. For the reliability analysis, the transmission layer was configured to send averaged data packets over Wi-Fi to the ThingSpeak platform [
32], enabling real-time remote validation. A sampling period of 6 s was set. The one-minute mean of the acquired values was calculated and transmitted.
To assess sensor response in a wide dynamic range of concentrations of VOCs, ambient conditions were altered by applying ethanol-based aerosols (commercial hairspray). Concurrently, ambient CO2 levels were also deliberately increased to observe whether the known cross-correlation between VOCs and CO2 would introduce adverse effects on the measurement process of the VOCs sensors. The increase in CO2 concentration was generated via the acid-base reaction of NaHCO3 and acetic acid.
The comparison protocol consisted of placing the candidate sensors and the reference instrument under identical conditions. Both systems were simultaneously exposed to controlled variations in ethanol vapor to evaluate linearity and response time. Sensor performance was assessed through correlation analysis between the reference device and the MOX sensors under test. In addition, we examined whether combining the outputs of multiple MOX sensors could yield an improved calibration fit relative to the reference standard [
33].
2.3.2. Evaluation of CO2 Measurement Performance
To perform a reliability analysis of the NDIR CO2 sensors, as well as the eCO2 values provided by the VOC sensors, data were collected through the serial port at intervals of 6 s. This data acquisition process was implemented without the application of minute-averaging techniques. The rationale for this methodological change was to more accurately capture the variation in ambient CO2 levels, as CO2 is more dynamic and dissipates more rapidly than VOCs during the generation process (mixing sodium bicarbonate and vinegar). For this new experiment, ambient levels of CO2 and VOCs were again altered for the purpose analogous to that of the previous experiment.
To validate the sensor response in concentration ranges representative of indoor spaces, specific tests were designed in two distinct scenarios. Scenario (a) involved the forced injection of CO2 to reach concentrations up to 5000 ppm. Scenario (b) involved restricted CO2 values, common in residential environments (<2000 ppm), reflecting expected real-world operating conditions.
Data evaluation was performed by calculating the coefficient of determination (R2), using a linear regression model between the candidate sensors and the reference instrument. In this assessment, it was assumed that the three NDIR sensors had high reliability and therefore could be considered reference standards against the eCO2 values provided by the VOCs sensors. The purpose of acquiring three different NDIR sensors, using different technologies and manufacturers, was twofold: first, to assess their degree of intercorrelation, and second, to provide a wider selection pool to identify the sensor that offered the best cost-performance ratio.
2.4. IAQ Unit
Following sensor selection, a printed circuit board (PCB) was designed to integrate the selected components into the final prototype (
Figure 2).
The use of NB-IoT for data transmission makes the device independent of the user. It was designed for “plug-and-play” self-installation. The data transmission frequency was set to 10 min. Internally, the device acquires sensor readings every 6 s, enabling high temporal resolution monitoring; it then computes the 10-min average for each parameter, which is subsequently transmitted to a remote web server using a RESTful API service. This standardized communication facilitated the centralized storage of all data in JSON format within a secure and accessible environment for subsequent analysis.
Open Hardware
The IAQ unit is available under open-source licenses: (a) the hardware design is under a CERN Open Hardware Licence v2—Strongly Reciprocal; the firmware is accessible under a GNU General Public License v3 or later; and the documentation, user manual, infographics, and others can be accessed under a GNU Free Documentation License v1.3 or later. Our project page is
https://atari-researchlab.github.io/cicerone-airlink (accessed on 27 October 2025) [
34].
2.5. Field Tests
For the evaluation of the unit in an operational environment, the devices were installed in various indoor spaces (kitchen, bedroom, and main living room) in nine independent dwellings located in the province of Cadiz (Spain). The deployment was conducted during the winter season, ensuring similar climatic conditions between the analyzed environments. A 7-day observation period was established for each dwelling, during which the devices performed continuous data collection of air quality and environmental variables, including PM (PM
1, PM
2.5, PM
4, PM
10), CO
2, VOCs, temperature, and relative humidity. This real-world deployment allowed for the analysis of pollutant variations in relation to occupant activity in each environment, as well as the evaluation of the highest concentrations reached [
35]. The resulting dataset was used to perform a statistical analysis of pollution patterns and develop ML algorithms to evaluate the predictive capacity of the system to forecast the variability of the contaminants.
2.6. Data Analysis
2.6.1. Exploratory Data Analysis
To evaluate the correlation and degree of agreement between the sensor measurements in the sensor evaluation step, the coefficient of determination (R2) was calculated using a univariate ordinary least squares (OLS) linear regression model (). This metric was used to quantify the proportion of variance in the measurements of one sensor that is predictable from the measurements of the other, thus indicating the strength of the linear association between the two instruments.
CO2 (ppm), PM1 (g/m3), PM2.5 (g/m3), PM4 (g/m3), PM10 (g/m3), VOCs (index), temperature and humidity were acquired during the field tests. The analysis of the data gathered in the field tests was conducted using a methodology that combined preprocessing, descriptive statistical analysis, and the identification of temporal patterns. Data preprocessing included detecting and eliminating outliers using the interquartile range (IQR) method, removing records below or above . Subsequently, the data were categorized into four time intervals to enable the study of the temporal evolution of pollutants: night (00:00–6:00), morning (06:00–12:00), afternoon (12:00–18:00), and evening (18:00–24:00). For each parameter, descriptive statistics (mean, standard deviation, minimum, maximum) were calculated both globally and segmented by time slot.
The daily evolution of pollutants in each room was represented against time (hours). The mean value and confidence bands (mean ± standard deviations) of the time series were depicted. Additionally, the data distribution by pollutant and time slot, including the density, and key statistical markers (mean and range), were presented as violin plots. To compare the distribution of concentrations between slots, the non-parametric Kruskal–Wallis test [
36] was applied, since it is appropriate when normality cannot be assumed.
2.6.2. Predictive Models
A supervised ML pipeline was implemented to predict pollutant concentrations of IAQ pollutants.
While deep learning architectures such as attention-based long short-term memory (LSTM) are powerful for vast sequential datasets, tree-based ensemble methods were selected for this study, given their proven high performance on complex, non-linear, high-dimensional tabular data, their lower computational requirements suitable for IoT edge-deployment, and their robustness against overfitting on moderate-sized datasets.
The Random Forest (RF) model [
16] was included as a fundamental and robust bagging (Bootstrap Aggregating) ensemble, and considered as the baseline. It is effective in reducing variance and mitigating overfitting, provides strong baseline performance, and is highly robust to noise, which is common in sensor data.
In addition, a suite of boosting algorithms was selected, as they represent the current state-of-the-art for regression tasks on tabular data. Unlike the parallel tree-building of RF, boosting models build trees sequentially, where each subsequent tree is trained to correct the residual errors of its predecessors. Extreme Gradient Boosting (XGBoost) [
37] was chosen for its well-established high performance and regularized learning for controlling model complexity and preventing overfitting, a critical risk in high-dimensional feature spaces like ours. Light Gradient Boosting Machine (LGBM) [
38] was included to evaluate computational efficiency alongside accuracy. The LGBM employs a leaf-wise tree growth strategy, as opposed to the level-wise growth of other models. This approach allows it to converge significantly faster on large datasets, making it a methodologically sound choice for assessing the trade-off between training time and performance. Finally, Categorical Boosting (CatBoost) [
39] was specifically selected for two unique methodological innovations that enhance robustness and combat overfitting. CatBoost implements an ordered boosting strategy, which reduces overfitting and improves the model’s ability to generalize, which is critical for noisy time-series sensor data.
To develop predictive models for 10 min ahead IAQ, a set of features was engineered from the raw time-series data.
Table 2 details these features.
The current-time measurements (time t) for the pollutant variables were explicitly excluded from the feature set. This ensured that the model only used environmental data available at time t (temperature, humidity) and historical data (all lagged and rolling features) to predict pollutant concentrations at time t + 10 min.
This set of features allowed the models to capture both structural variability and short-term dynamic fluctuations associated with occupancy patterns, ventilation, and the accumulation or dissipation of pollutants in indoor environments.
To identify the most impactful predictors, we implemented a model-dependent embedded feature selection methodology. This method was performed dynamically inside each fold of the 10-fold cross-validation loop. In each fold, the feature importance scores were extracted to quantify the contribution of each feature. The top-20 features of this ranked list were selected, thereby removing redundant predictors. The model for that specific fold was then trained only on this reduced subset of 20 features.
RF, XGBoost, LGBM, and CatBoost models were trained for each target pollutant. To ensure a robust and unbiased performance assessment, each model was evaluated using a 10-fold cross-validation strategy. The predictive performance of the models was quantified using a set of metrics which included the cross-validated mean and standard deviation of the root mean square error (RMSE), R-squared (R
2), symmetric mean absolute percentage error (SMAPE), and mean absolute error (MAE) [
40]:
The MAE measures the average error without penalizing for magnitude:
The Coefficient R
2 determines the proportion of explained variance:
The SMAPE was used because it is symmetric, robust to zero values, and enables a fair comparison of models across different parameters.
With being the actual value and the predicted value (model output).
2.7. Software
The PCB was designed using Autodesk Fusion 360 (Autodesk, CA, USA). The custom 3D printed enclosure was designed using SolidWorks 2020 (Dassault Systèmes, Suresnes, France). The firmware was developed in the Arduino IDE. The process required integrating and adapting official libraries from sensor manufacturers, as well as developing custom libraries from scratch for hardware modules that did not have them. Statistical analysis and ML model development were performed using Python 3.10.
3. Results
3.1. Sensors Evaluation Results
3.1.1. VOCs Measurement Performance
A dataset consisting of 328 records was built. It included minute average measurements of VOCs.
Table 3 presents the results of the correlation analysis carried out to compare the evaluated sensors and the reference device TB600B-TVOC-10.
A correlation greater than 83% with respect to the reference device can be observed in two of the sensors (SGP40 and SEN54). This suggests a high reliability of the factory pre-calibrated MOX detectors. Representative data collected during these co-location experiments, showing the linear regression between the SEN54 and SGP40 low-cost sensors and the reference device (TB600B-TVOC-10), is presented in
Figure 3. The SEN54 sensor was selected for its superior correlation with the reference measurements and its all-in-one capability, integrating sensors for VOCs, particulate matter, temperature, and relative humidity.
The evaluation of VOCs was conducted using the VOC index metric provided by the SEN54 module. This logarithmic scale serves as a qualitative indicator of the intensity of pollution events relative to the dynamic baseline of the environment. The VOC index was selected over absolute concentration estimation (e.g., ppb) because low-cost MOX sensors are subject to significant baseline drift over long-term deployments. The proprietary algorithm compensates for this drift and humidity variations, providing a robust, event-driven signal suitable for identifying activities such as cleaning or cooking without the need for frequent recalibration against reference gases. Although the VOC index is a relative unit, our co-location tests against a reference PID instrument demonstrated a high correlation ( R2 = 0.89), validating that the index accurately captures the temporal dynamics and magnitude of pollutant peaks.
3.1.2. CO2 Measurement Performance
A total of 2394 records were obtained during the tests conducted for the selection of the CO2 sensor.
The devices evaluated included three NDIR CO
2 sensors (SCD41, XENSIV PAS CO
2, and T6793-5K) and two VOCs sensors capable of estimating eCO
2 concentrations (MICS-VZ-89TE and ENS160).
Figure 4 presents the temporal evolution of the CO
2 and eCO
2 values during the tests. All sensors, excluding the MICS-VZ-89TE, showed proportional responses to the induced changes in ambient CO
2 concentration. The eCO
2 signals displayed abrupt fluctuations to the VOCs induced change, revealing a significant cross-sensitivity between them, which compromised the reliability for direct CO
2 estimation.
Table 4 shows the correlation analysis conducted on the CO
2 and eCO
2 sensors. As shown, the eCO
2 readings from the VOCs sensors (MICS-VZ-89TE and ENS160) exhibited a maximum correlation of 0.26 with the NDIR CO
2 sensor SCD41. In contrast, a strong correlation of 0.97 was observed between the two photoacoustic NDIR sensors (XENSIV PAS CO
2 and SCD41), and a correlation of 0.60 between the photoacoustic XENSIV PAS CO
2 and the optical NDIR sensor T6793-5K.
This lower correlation was attributed to a mismatch in calibration ranges. The photoacoustic sensors saturated above 2000 ppm, their pre-calibrated limit, whereas the optical T6793-5K sensor was calibrated up to 5000 ppm.
From these results, it can be concluded that eCO2 values provided by the MOX sensors are not suitable for direct CO2 measurement, as they exhibit low correlation levels with dedicated NDIR CO2 sensors. Therefore, the NDIR CO2 sensor was selected for the final prototype to ensure the accuracy and reliability of the measurements.
To ensure a fair and relevant comparison between the NDIR sensors, a second experiment was conducted. It focused exclusively on the operating range common to all devices, limiting the generated concentrations of CO
2 to values below 2000 ppm. This methodological decision was made for two key reasons. First, concentrations exceeding 2000 ppm are uncommon in typical residential or indoor environments. Second, this threshold aligns with the limit established by international standards such as ASHRAE 62.1 [
41], which begins to classify indoor air quality as degraded at this level.
This new experiment yielded 869 data points for each sensor, revealing a strong linear correlation among the three NDIR CO
2 sensors evaluated. This association was highly robust, as detailed in
Table 5, with a lowest R
2 of 0.88 (between the optical sensor and one of the photoacoustic sensors). The T6793-5K sensor was selected as it presented the best cost-effectiveness ratio.
3.2. IAQ Unit Results
Once the sensors were selected, the prototype of the IAQ unit was designed and implemented. The device was conceived to integrate multiple environmental sensors and autonomous connectivity capabilities, featuring the following main characteristics:
Sensors for the measurement of PM1, PM2.5, PM4, PM10, VOCs, CO2, temperature, and relative humidity.
An RTC for synchronizing sensor data acquisition and the configuration of transmitted data packets.
Autonomous data transmission through an NB-IoT communication module, enabling periodic transmission (every 10 min) of average sensor readings without user intervention.
Energy autonomy of up to five hours of continuous operation.
Figure 5 provides a 3D-rendered view of the device, which includes:
- 1.
Arduino Nano 33 BLE Sense 2, as the core microcontroller.
- 2.
T6793-5K CO2 NDIR carbon dioxide sensor.
- 3.
SEN54 multi-parameter module for the measurement of PM, VOCs, temperature, and relative humidity.
- 4.
M5Stack U111 NB-IoT Module, to handle all cellular data transmission through the NB-IoT protocol.
- 5.
LiPo Rider Plus Power Manager to handle charging and power delivery, a 900 mAh LiPo battery, and a 5V input for an external power supply.
- 6.
DRF0641 high-precision RTC.
The IAQ unit (Cicerone AirLink) was registered with open-source licenses and published on GitHub. Device specifications, hardware files (gerbers) for PCB manufacturing, the files for the case 3D-printing, the schematic and board designs, as well as the device firmware in full detail, can be openly accessed together with information for the manufacturing, assembly, and configuration of the device. The final prototype is shown in
Figure 6.
3.3. Field Tests Results
A field trial was conducted in nine residential dwellings to assess the performance of the IAQ unit in a practical environment. The units were strategically installed in various indoor locations for continuous monitoring for seven days. 2817, 3353, and 3083 samples of pollutants were gathered in the kitchens, living rooms, and bedrooms, respectively. A synthesis of the descriptive statistics derived from this analysis for all monitored dwellings is presented in
Table 6.
Figure 7 illustrates the daily evolution of some pollutants in kitchens. Substantial increases in PM
2.5, PM
10, and VOCs concentrations were observed, coinciding with peak cooking times. Evening PM
10 levels averaged 12.5
g/m
3, although peaks exceeded 25
g/m
3. At the same time, the average VOC index measured 149.6, with multiple instances exceeding the threshold for possible irritation [
42,
43]. CO
2 concentrations also exhibited nocturnal increases, frequently exceeding 1000 ppm, although the overall mean concentration remained approximately 597.8 ppm.
The results obtained for the monitoring of the living rooms are presented in
Figure 8. Peaks of CO
2 were recorded at up to 1277.7 ppm, primarily in the evening and at night, with a daily average concentration of approximately 629 ppm.
reached maximum values of 359 in the early morning (low-level pollution), while particle concentrations remained at low levels, with averages below 5
g/m
3 for all fractions evaluated.
Figure 9 illustrates the temporal evolution of various pollutants present in bedrooms. The levels of CO
2 were found to be significantly higher compared to other areas, reaching an overall average of 1300.5 ppm, with maximum values recorded at up to 2896 ppm during the morning period.
showed an average concentration of 146 at night, with peaks ranging to 354.5. Similarly, a significant accumulation of particles was detected during the night, with average concentrations of PM
10 of 8.7
g/m
3.
Figure 10,
Figure 11 and
Figure 12 show violin plots with the distributions of CO
2, PM, and VOCs in each room and for each time slot. Kruskal-Wallis tests confirmed the significant differences between time intervals in all rooms.
For kitchens, significant differences were observed in the concentrations of PM, CO2, and VOCs most of the time. For the living rooms, these variations were especially marked for VOCs and CO2. Regarding PM, significant differences were observed between the night and the remaining periods. In the bedrooms, PM, VOCs, CO2, temperature, and relative humidity exhibited significant variations over all time intervals.
Analysis of pollutant concentrations against established health guidelines revealed several key findings. Daily average concentrations for PM2.5 and PM10 remained below the respective WHO 24-h guidelines (15 g/m3 and 45 g/m3). However, transient PM2.5 peaks reached 29.8 g/m3 in kitchens and 20.1 g/m3 in bedrooms. These short-duration events, while not affecting the daily mean, can represent acute exposure risks, particularly for people with respiratory sensitivities.
In terms of CO2, the 1000 ppm threshold, a widely accepted indicator of inadequate ventilation, was systematically exceeded in the bedroom and frequently in the other rooms. These elevated concentrations demonstrated a strong correlation with prolonged occupancy periods and low air exchange rates. Regarding the VOC index, the threshold of 200 was exceeded at different times of the day in all rooms, with the kitchen and bedroom exhibiting the most frequent and pronounced exceedances.
Together, the results indicate that IAQ in residential settings exhibits highly variable dynamics, which are determined by the interaction between occupancy, activity, and ventilation. The differences found between rooms and time slots highlight the need for a differentiated and specific evaluation for each space, rather than a global assessment of the indoor environment.
3.4. Predictive Models Results
A comparative analysis of supervised machine learning regression models (RF, XGBoost, LGBM, and CatBoost) was conducted to evaluate their performance in predicting IAQ pollutant concentrations 10 min in advance in the three domestic environments: kitchen, living room, and bedroom.
The hyperparameter tuning was conducted using a hybrid two-stage optimization strategy. Initially, a systematic grid search was performed to explore the hyperparameter space and identify optimal regions. Subsequently, a manual fine-tuning stage was executed to adjust specific parameters. The parameters finally selected for each algorithm are detailed in
Table 7.
Table 8 shows the metrics estimated for each room and model. The results reveal two significant high-level trends. First, the predictive accuracy varied substantially by pollutant type.
Gaseous pollutants (CO2 and VOCs) were consistently more predictable in all models and locations than PM. For example, in the bedroom dataset, all models achieved an R2 value of 0.97-0.98 for CO2 predictions, while R2 scores for PM fractions in the same room ranged from 0.81 (RF) to 0.93 (CatBoost).
Second, the performance of the models was highly dependent on the spatial environment. The kitchen proved to be the most challenging environment for prediction, obtaining the lowest R2 scores for all models, particularly for PM. In this location, R2 values for PM10 were 0.66 (RF), 0.64 (XGBoost), 0.51 (LGBM), and 0.64 (CatBoost). Notably, the LGBM model performed weakest in this setting, with R2 scores ranging from 0.49 to 0.52 for PM. In contrast, the living room and bedroom environments yielded significantly more accurate predictions across all models.
When comparing model architectures, gradient-boosted models (XGBoost, LGBM, and CatBoost) generally outperformed the RF baseline, particularly in the living room and bedroom. XGBoost and CatBoost emerged as the top-performing models.
In the living room, CatBoost demonstrated superior performance for all fractions of PM, achieving an R2 of 0.97 for PM1, PM2.5, PM4, and PM10. XGBoost was also highly competitive, achieving R2 scores between 0.94 and 0.96 for PM. For the prediction of CO2 in the living room, all models performed exceptionally well, with R2 values of 0.95 for the RF model and 0.97 for models based on boosting gradients.
In the bedroom, CatBoost maintained its performance advantage for the prediction of PM, achieving the highest R2 scores for PM1 (0.93), PM2.5 (0.92), and PM10 (0.91). This was closely followed by XGBoost, with R2 scores of 0.89 for PM1 and 0.88 for PM10. All boosting models excelled at predicting CO2 in the bedroom, each achieving an R2 of 0.98.
5. Conclusions
This study demonstrates that daily mean pollutant concentrations are insufficient to assess IAQ. Although 24 h averages often remained below established limit values, our high-temporal-resolution analysis revealed significant acute concentration peaks. These transient episodes, directly correlated with events such as cooking and nocturnal occupancy in poorly ventilated rooms, are often missed by traditional assessments. Such high-intensity short-term exposures represent a relevant primary risk to respiratory health and occupant comfort.
A central finding is that high-fidelity predictive models can be successfully developed using data streams from custom-developed, low-cost prototypes. These devices, which integrate sensors with IoT transmission capabilities for remote home monitoring, provide the high-resolution data necessary to train ML algorithms. The resulting models proved highly accurate, although the performance was context-dependent. These findings reinforce the need for specific, data-driven preventive measures. The results support the implementation of sensor-assisted or controlled natural ventilation; automated, event-triggered extraction systems in kitchens; active CO2 and VOC alerts in bedrooms and living areas; and smart air purifiers adapted to identified risk schedules and occupancy patterns.
In summary, evaluating indoor pollutant exposure requires a paradigm shift from static daily averages to a dynamic, predictive perspective. The synergy between affordable and scalable data capture and predictive ML analytics represents a promising strategy for proactive air quality management, ultimately improving health, comfort, and energy efficiency in residential environments.