You are viewing a javascript disabled version of the site. Please enable Javascript for this site to function properly.

# A low-cost air quality monitoring system based on Internet of Things for smart homes

#### Abstract

Global climate change and COVID-19 have changed our social and business life. People spend most of their daily lives indoors. Low-cost devices can monitor indoor air quality (IAQ) and reduce health problems caused by air pollutants. This study proposes a real-time and low-cost air quality monitoring system for smart homes based on Internet of Things (IoT). The developed IoT-based monitoring system is portable and provides users with real-time data transfer about IAQ. During the COVID-19 period, air quality data were collected from the kitchen, bedroom and balcony of their home, where a family of 5 spend most of their time. As a result of the analyzes, it has been determined that indoor particulate matter is mainly caused by outdoor infiltration and cooking emissions, and the CO2 value can rise well above the permissible health limits in case of insufficient ventilation due to night sleep activity. The obtained results show that the developed measuring devices may be suitable for measurement-based indoor air quality management. In addition, the proposed low-cost measurement system compared to existing systems; It has advantages such as modularity, scalability, low cost, portability, easy installation and open-source technologies.

## 1.Introduction

Air pollution increases with the increasing population, urbanization, industry, transportation, and agricultural developments, is a significant health problem worldwide. Breathing healthy air represents a fundamental right for everyone. However, the report of states that the vast majority of the world’s population breathes polluted air and seven million people die annually from air pollution-related causes [63].

The United States Environmental Protection Agency (EPA) regulates both outdoor and IAQ. In accordance with the EPA, indoor pollutant levels can be two to five times and occasionally more than 100 times higher compared to outdoor pollutant levels, which is among the top five environmental risks to human health. IAQ constitutes a determinant of human health. People in modern societies spend more than 90% of their time at home, shopping malls, workplaces, schools, transport and public spaces [61]. Therefore, real-time monitoring of IAQ in buildings is crucial to detect unhealthy situations. IAQ is critical people spending most of their lives indoors, e.g., the elderly, disabled, infants, and chronic patients, and low air quality poses a major health threat to these individuals [6,21,37].

Due to indoor air pollution, people may have severe health problems, especially respiratory, cardiovascular, and skin diseases. The major indoor air pollutants are sulfur dioxide (SO2), ozone (O3), carbon monoxide (CO), CO2, nitrogen dioxide (NO2), PM, volatile and semi-volatile organic compounds (VOCs), radon, and microorganisms [20]. It is known that certain pollutants, including tobacco smoke, CO, NO2, formaldehyde, asbestos fibers, microorganisms, and allergens, are closely associated with health problems [47].

The European Respiratory Society (ERS) identified PMs (PM1, PM2.5, and PM10), VOCs and CO2 as major air pollutants [22].

Various low-cost sensors are available for PM2.5 detection [18]. All of these low-cost sensors use optical light scattering. They are compact, low weight, energy efficient and have a high sampling frequency [28].

Cleaning, smoking, and cooking are among indoor PM sources. Among these, smoking and cooking are indoor activities that have the most significant effect on indoor particle concentrations [19]. It is usually reported that the most significant cause of lung cancer among housewives is cooking [17]. These activities produce particles of small sizes due to burning. Field measurements were made for a cooking process to analyze the PM2.5 concentration. Three situations were designed according to the type of ventilation, which includes natural and mechanical ventilation. The PM2.5 concentration was measured during 16-30-minute cooking times. In accordance with the analysis, the PM2.5 concentration increased by 3 after cooking. The study also found that the PM2.5 concentration in the living room near the kitchen was the same as in the kitchen [26].

Another study showed that smoking and cooking activities reached peak values in indoor PM2.5 [38]. In addition, some studies show that the indoor PM value increases significantly through the infiltration of outdoor PMs during natural ventilation [2,27,65]. One of the methods of reducing the amount of indoor PM is the use of Home Air Purifiers. A study showed that the use of HAPs reduced PM2.5 concentrations in bedrooms by an average of 45% in 90 minutes [15].

CO2 significantly affects public health and is a key indicator of IAQ. The ventilation system, in which the CO2 level is taken into account, helps prevent many diseases, particularly respiratory infections. Hence, the real-time monitoring of the CO2 concentration level is a critical issue in controlling IAQ. CO2 levels above 1000 ppm indicate an IAQ potential problem [19]. IAQ monitoring represents an significant issue that would trigger the right chain of actions, either through real-time feedback or the direct activation of automatic control devices to encourage human actions [48].

Air quality monitoring systems have become indispensable for the detection of high concentrations of pollutants that may occur in indoor environments. Difficulties in data access, high cost and complexity are the biggest disadvantages of traditional devices developed for air quality monitoring. In the last decade, low-cost sensor technology has played a role in making important strides in air quality monitoring [67].

Low-cost air quality sensors can be utilized for the analysis of air quality in near real time and economically. The user-friendly interface and low maintenance requirement make them an easy-to-use and convenient device [42]. Interest in air quality measurement systems has recently increased with the production of low-cost sensors. The development of IoT-based and low-cost devices to monitor IAQ increases our awareness of indoor air pollutants, which are invisible to the eye but have adverse health effects [46].

IAQ monitoring is an essential element in creating a healthy indoor environment, enabling individuals to trigger the right actions with real-time feedback or direct activation of automatic control devices [16]. Internet of Things (IoT) represents a communication network in which physical objects are interconnected or connected with larger systems [64]. This network collects billions of data obtained from various devices we use in daily life and turns them into usable information [4]. Numerous applications have been developed in smart homes that change our living habits using IoT technology on issues such as comfort, healthcare services, security, and energy savings [36,50,58,60].

In this study, an IoT-based, real-time, low-cost, portable and easy-to-install air quality monitoring system for smart homes is proposed. The proposed system is an IAQ monitoring solution that measures temperature and humidity in real-time, as well as indoor pollutants such as PM1, PM2.5, PM10, and CO2, and can alert users of overconcentration. This system is a completely wireless solution developed by utilizing uses the ESP8266-12E chip that supports the IEEE 802.11 b/g/n network protocol developed by IEEE for WLANs. The Simple Linear Regression (SLR) was used for the calibration of the proposed measurement system. In addition, Pearson Correlation Coefficients (PCC), were calculated for the analysis of house occupants activities and the effects of outdoor pollutants on indoor air quality.

The remainder of the article is organized as follows. Section 2 is a review of existing methods for indoor air quality measurement. Section 3 presents the architecture of the measurement system and the calibration method. Section 4 presents the experimental results. Finally, Section 5 summarizes the results.

## 2.Related works

Most people are aware that outdoor air pollution can impact their health, but indoor air pollution can also have significant and harmful health effects. It is essential to monitor the factors affecting air quality to avoid health risks due to poor air quality [45]. However, at present, most of the devices developed to monitor air quality data are not very well calibrated. Moreover, they measure a limited number of air quality parameters. Therefore, to avoid possible health risks, it is necessary to develop a measurement and monitoring system that can efficiently collect and analyze data on the air we breathe.

The Internet is among the necessary and important technology that can be utilized for developing a system that can monitor and share information on environmental pollution. The reduction of hardware costs and the development of new technologies have recently made it possible to develop many high-tech devices to monitor the condition of the indoor and outdoor environment to support human life quality. Furthermore, new regulations and limits for PM and pollutant gas concentrations expressed by the WHO (World Health Organization) and the EU Committee have increased people’s interest in this issue.

In a study conducted in China, the relationship between air pollutant concentrations such as PM10, PM2.5, ozone, sulfur, carbon monoxide, carbon dioxide and nitrogen dioxide was examined. A statistically significant association was found between short-term exposure to high air pollution and increased risk of COVID-19 infection in 120 cities in China [52]. At the present day, thanks to the reduction of hardware costs, everyone at home has at least one high-tech device that supports the quality of life [51]. In general, exposure to air pollutants constitutes an important risk factor for health. Therefore, it is recommended to implement sustainable control policies such as population growth, urbanization, and traffic control in order to avoid the health effects and economic damages of air pollutants [29].

Traditional approaches to air pollution monitoring utilize costly, complex, fixed devices that put a limit on data access, application flexibility, and overall budget. In the last decade, low-cost sensor technology made significant steps in monitoring air pollution, giving it an opportunity to change the status quo [13]. Unlike the temperature that people perceive and can understand whether it is appropriate, the presence of pollutants in the air is not always perceived by humans, and in fact, humans cannot smell CO2, one of the most common self-produced indoor pollutants. As long as our living spaces are not equipped with sensors, the CO2 concentration can significantly exceed limit values without anyone knowing [50]. iAir, an IoT-based measurement system developed by for real-time IAQ monitoring [34]. It consists of an ESP8266 sensor as a communication and processing unit and a MICS-6814 sensor, which is a metal oxide semiconductor sensor that can detect various gases, e.g., carbon monoxide, nitrogen dioxide, ethanol, methane, and propane, as a sensing unit. This system also uses a smartphone application for data consultancy and real-time notifications.

In the study, the effect of different wood-burning methods on indoor pollutant concentrations in interior spaces where heating was provided by burning biomass was investigated [62]. The CO, CO2, and PM10 data obtained from rooms heated with open fireplaces and wood stoves indicated that the risk of cancer in the room where the open fireplace was used was approximately 7 times higher than the room heated by the woodstove, and the PM10 value was approximately 25 times higher.

A brief case study for a comprehensive air quality monitoring program in one of the student canteens where university students spent their extracurricular time is proposed in. It was observed that comfort parameters and average values obtained for regulated pollutants were generally within international ranges. However, CO2 and PM values created strong fluctuations depending on activities and occupancy rates, and more than 80% of PM concentrations were produced indoors.

People spend about 8 hours of their daily life in bedrooms. Therefore, it is important to ensure that the air quality is suitable in these areas where they are vulnerable. In bedrooms with low air quality, people have difficulty falling asleep, cannot rest enough during sleep and wake up tired. As a result of IAQ measurements carried out in the bedroom of a single-family house, it was observed by that the CO2 concentration increasing during the night exceeded the allowed standard of 1000 ppm [23].

##### Fig. 1.

The location of the house where the air quality measurements are made (from Google maps).

An IoT-based IAQ measurement system made by using a ESP8266-12E microcontroller and PMS5003 PM sensor provides the house occupants with an intervention opportunity for ambient and assisted living (AAL) [35]. In the prototype developed for IoT-based indoor air quality monitoring, Arduino UNO is used as the processing unit and an ESP8266 is used as the communication unit. Temperature, humidity, CO2, dust and light sensor data are stored in real time on a ThingSpeak platform. The system has smartphone compatibility, providing real-time access to data [33].

A low-cost system that measures parameters such as CO2, VOC, atmospheric pressure, humidity and temperature to deal with IAQ problems using IoT architecture is presented in the study [12]. In the proposed system, two Arduino UNO microcontrollers are used for data acquisition and preprocessing. This data is transmitted to the Raspberry Pi microcontroller, which is the main unit, by Arduino UNO via serial communication. The collected data can be accessed using a mobile application developed using the “Android Studio IDE” Java programming language. In the study [45], an IAQ monitoring system using MQ135 and MQ7 sensors is proposed for air quality measurement. The IAQ monitoring system includes an Arduino Uno and a Wi-Fi compatible ESP8266 microcontroller. The obtained data is stored on the ThingSpeak Platform and the ThingSpeak Cloud service is used for data visualization.

## 3.Methods

### 3.1.Home and location

The house where the measurements were taken is 50 m away from the forest area at 38°, 36′, 21′ N and 27°, 22, 55 E coordinates in the central Yunusemre district of Manisa. The house is located on the ground floor of a 3-storey apartment building and is surrounded by a garden on all four sides. The house where the air quality measurements were made, the location of which is shown in Fig. 1, is 190 m2 and the calibration measurements were made in a 25 m2 study room and on a table 1 m high from the ground.

##### Fig. 2.

House plan and sensor locations.

The house, the plan of which is shown in Fig. 2, is heated by a central heating system and a total of 5 people live in the house. Due to COVID-19, all of the house occupants were mostly at home during the time the measurements were made. There is no air cleaning system in the house, and the ventilation of the environment is performed naturally by opening doors or windows. The interior doors of other living areas in the house occupants were not closed while the measurement was made, thus ensuring that the air in the household was homogeneous. Kitchen ventilation was performed through a 1.8×2.1m sliding door, and bedroom ventilation was performed through a 1.5×1.5m window.

### 3.2.Architecture of the IAQ monitoring system

A reliable, cost-effective system that could be easily configured and installed by users was developed for monitoring IoT-based IAQ in smart homes. Low-cost and high-precision CO2 (MH-Z19A), PM (PMS7003), temperature and humidity (AHT10) sensors were used in the developed system. A microcontroller (ESP8266-12E) with native Wi-Fi support was selected to process the sensor data and transfer it to the IoT platform. In most commercially produced air quality measuring devices, data recording to the cloud server is usually limited to hourly averages and 1-week periods. Therefore, they cannot give precise information about the instantaneously changing pollutant concentrations. Since the data recording period is weekly, it is not possible to access data older than 1 week. Also, commercial products do not have an adjustable contaminant threshold and are generally designed for measurement. When the proposed measurement system is compared with the commercial versions; It is much cheaper, expandable, sensors for different pollutants can be added and long-term (over 1 year) data recording can be stored in the cloud server. In the measurement system, whose data recording frequency is 1 minute, this time can be reduced to 5 s if needed. Thanks to all these features, it shows that the proposed air quality measurement system is far superior to its commercial competitors.

In this section, the cost of the system will be examined together with the hardware and software that constitute the system. This proposed measurement system is an IAQ monitoring solution that measures both indoor pollutants and climate parameters in real time and informs users of their excess concentration via real-time notifications. The architectural structure of the proposed measurement system is presented in Fig. 3.

##### Fig. 3.

The architecture of the IoT-based IAQ monitoring system for smart homes.

In the proposed system, a completely wireless solution was obtained by utilizing the ESP8266-12E chip, which implements the IEEE 802.11 b/g/n network protocol. This microcontroller with built-in Wi-Fi features is utilized both as a processing and communication unit. In this study, Blynk (2.28.17v) IoT platform was used as a mobile interface development tool. Blynk supports a large number of controllers such as Arduino, ESP8266, ESP32, Raspberry Pi, Onion Omega, SparkFun, etc., which are widely used in IoT applications. Using this IoT platform, without the need to write codes, an iOS/Android mobile interface can be developed for IoT projects in a very short time using only Widgets [39,44,49,53,55].

MH-Z19 NDIR infrared gas module is widely used in the HVAC refrigeration and IAQ monitoring. Despite its low cost, the MH-Z19 is regarded as a reliable, stable and accurate sensor for CO2 measurement [8,31,35,43]. MH-Z19, used in the sensing unit of the IoT-based IAQ monitoring system presented in Fig. 3, is a non-dispersive infrared (NDIR) CO2 sensor. It has a built-in temperature sensor for temperature compensation and has no oxygen dependence. The ideal operating range of the sensor with digital and analog output is 0∼50 °C for temperature and 0∼95% rH for humidity. The measuring range is 0∼5000 ppm, the life is more than 5 years, and the average current consumption is less than 10 mA. MH-Z19 has a 3.3 V interface level and a PWM and UART output signal [1].

PMS7003, used to measure PM1, PM2.5, and PM10 values, is a sensitive sensor produced by Beijing Plantower that calculates the number of suspended particles in the air using the laser scattering principle. If the concentration change is small, the sensor is operating in steady mode with an interval of 2.3 sec; if the change is large, the sensor automatically switches to fast mode in the 0.2∼0.8 s interval. It is a sensor with the PM detection capability between 0.3 μm∼10 μm, 10+60°C temperature and 0∼99 rH% relative humidity operating range, 50×38×21mm size and a maximum output of 500 μg/m3. It is used in many commercially produced air quality measurement systems due to its stable and accurate measurement features [911].

AHT10 is a new-generation temperature and humidity sensor manufactured by Aosong Electronic. The sensor gives a calibrated digital output in the standard I2C format. It is equipped with an improved MEMS semiconductor capacitive humidity sensing element and a standard on-chip temperature sensing element. Its performance has been significantly enhanced beyond the reliability level of previous generation sensors. In production, each sensor is calibrated and tested with a product lot number printed on the product’s surface. These improved and miniaturized sensors are cost-effective and have low energy consumption. The sensor, which has a resolution of 0.024 rH % for humidity and 0.01°C for temperature, operates at 3.3 V DC voltage [5].

##### Fig. 4.

Air quality measurement device (a) 3D box model, (b) in-box sensor assembly, (c) full assembled state.

The 3D box model of the air quality measuring device is presented in Fig. 4(a), the placement and connections of the sensors in the box are presented in Fig. 4(b), and the finished assembly is presented in Fig. 4(c). The IoT-based devices convert the measurement data they receive at 5-sec intervals into 1-minute average values. The average minute data obtained is stored on the Blynk-cloud server.

These data stored in the Blynk Cloud server are sent to the registered e-mail address as a csv (Comma Separated Values) file when requested. The data of each air quality parameter also includes time-date information. Thus, all data can be synchronized perfectly. Internet outages occurred in some cases during data recording. This resulted in devices being disconnected and data lost. However, due to the 1-minute data logging frequency, a large amount of data has been recorded in the cloud server for analysis.

##### Fig. 5.

The user interface of the air quality measurement device (a) kitchen, (b) bedroom, (c) outdoor, (d) notification setup, (e) eventor setup, (f) mail notification.

The user interface of the air quality measurement devices is observed in Fig. 5(a), (b), (c). This interface allows data to be collected, visualized, and analyzed in the cloud. The graphs displaying air quality data in the mobile user interface created with the Blynk IoT platform ensure a better perception of the behavior of the monitored parameters than in the digital format. Moreover, the mobile user interface ensures easy and fast access to the collected data, as well as a more precise analysis of the temporal change in air quality parameters. Therefore, the system represents a powerful tool for IAQ analysis and supports decision-making on possible interventions to enhance a healthy indoor environment. The data collected by the sensors are analyzed by the microcontroller before being sent to the Blynk-could server. As seen in Fig. 5(d), the threshold values of the measured air quality parameters can be adjusted via the user interface. In case the threshold values determined for pollutant concentration and climate parameters are exceeded, real-time notifications are sent to users through 2 different channels, via e-mail and mobile device [53,54]. Figure 5(e) shows the event editor window for notifications to be sent to users for different events. In Event-1, in the event that the PM2.5 value sent from Virtual Pin-21 (V21) by the device in the kitchen is greater than the user set value (V22), a warning “Kitchen PM2.5 Level High” is sent to the mobile phone. In Event-2, if the CO2 value sent from V2 by the appliance in the kitchen is greater than the user set value V25, the “Kitchen CO2 Level High” warning is sent to the registered e-mail address. Figure 5(f) shows the mail sent to the user due to the occurrence of Event-2.

The real-time notifications of climate parameters and pollutant concentrations sent to residents provide precise and detailed data on the health of the living environment and assist them in planning interventions to enhance IAQ. Moreover, notification messages encourage behavioral changes and alert the user to act as soon as possible to enhance IAQ. In addition, these real-time notifications allow residents to take permanent and decisive measures to avoid these repeating unhealthy situations. The user-friendly interface settings by which users can configure the wireless network in a few steps are given in Fig. 6. When the system is first started, if the embedded Wi-Fi module on the ESP8266-12E chip-cannot connect to any of the wireless networks, it will switch to the hotspot mode. Then the user can configure the credentials of the Wi-Fi network to connect to the appropriate Wi-Fi network. Due to this feature, users make the IoT-based IAQ monitoring system easily installed and ready to use.

##### Fig. 6.

Devices Wi-Fi configurations.

Compared to state-of-the-art devices, the IoT-based IAQ monitoring system’s Wi-fi configuration settings are user-friendly and support an easy setup process. Another advantage of the system is the modularity of the system. The desired number of measurement points can be added as required. To this end, the new device can be connected to the Wi-Fi network without any additional settings.

### 3.3.Calibration of devices

Devices with the same features developed for the IoT-based air quality monitoring system are shown in Fig. 7(a). These devices and reference devices recorded data together for 1 week. A “Dienmern DM72B” Wi-fi air quality monitor was used for the PM1, PM2.5, PM10, and CO2 calibration of these devices, and a “Xiaomi Mijia” Bluetooth temperature-humidity sensor was used for temperature-humidity calibration. The “Dienmern DM72B” air quality monitor allows data monitoring and recording via a mobile application (Tuya Smart).

##### Fig. 7.

(a) Calibration of air quality measuring devices with reference devices, (b) Screenshots of the Dienmern DM72B air quality monitor and Tuya Smart.

The screenshots of the Dienmern DM72B air quality monitor and Tuya Smart are presented in Fig. 7(b). The data measurement frequency on the device is 5 sec, and data recording to the cloud server is made in the form of 1-hour averages. BLE wireless communication was used for the transfer of the data measured by the “Xiaomi Mijia” measurement device. The temperature and humidity data of this sensor were used by the ESP32 controller with the built-in BLE module and the Blynk IoT platform for recording data to the cloud.

Necessary explanations about calibration processes are given in Section 4.

### 3.4.Cost of the system

Creating the IoT-based IAQ monitoring system and sensor selection were made, taking into account the minimum cost and maximum measurement accuracy. Considering that the measurement system can also be used with batteries when necessary, attention was paid to selecting sensors with low power consumption. The cost per device of the proposed IoT-based IAQ monitoring system is presented in Table 1. The unit cost of the devices developed for IoT-based air quality measurement is $60 as seen in Table 1. ##### Table 1 Cost per device of the IoT-based IAQ monitoring system  Component Cost [$] ESP8266-12E Chip 5 MH-Z19A sensor 15 PMS7003 sensor 17 Blynk Platform Energy 5 5 V-2 A DC Power Supply 3 Power Supply Cable 1 5 V/10 Ah PowerBank 6 PCB, Box 8 Total $60 The price of some of the portable CO2 measurement systems in the market varies between €111–377. However, these devices with portability are not capable of analyzing the collected data and deciding on possible interventions to improve public health [32]. Therefore, the low-cost measurement system developed for air quality measurement, with its portability, scalability and modularity features, can offer a reliable and effective solution for air quality measurement systems compared to existing commercial solutions. ##### Table 2 Technical specifications of commercially available air quality sensors  Monitor/reporting interval Retail price Temperature range/sensor RH range PM size/sensor CO2 range/sensor Low-Cost AQ Sensor$60 −40–85°C 0–100% 0.3–10 μm 0–5.000 ppm 5 s AHT10 Plantower PMS 7003 MH-Z19B Foobot $199 15–45°C 30–85% 0.3–2.5 μm Estimation from TVOC 5 min. Sensirion SHT30 SHARP PY1010AU0F Kaiterra Laser Egg + CO2$199 −20–100°C 0–99% 0.3–2.5 μm 400–10.000 ppm 1 min. Sensirion SHT30 Plantower 3003 SenseAir S8 or LP8 Awair 2nd Edition $199 −40–125°C 0–100% 0.3–10 μm 0–5.000 ppm 10 s Sensirion SHT30 Honeywell HPMA115S0-XXX Amphenol Telaire T6703-5 K AirVisual Pro$269 0–40°C 0–95% 0.3–2.5 μm 400–10.000 ppm 10 s Sensirion SHT30 AirVisualM25b SenseAir S8 or LP8 uHoo $320 −40°C–85°C 0–100% 0.3–2.5 μm 0–5.000 ppm 1 min. Bosh BME280 Shinyei ppd42 ELT T110 Clarity Node$1000 15–45°C 30–85% 0.3–10 μm not specified 2.5 min. not specified Plantower PMS 6003

Table 2 shows the technical specifications of some commercial air quality sensors with prices ranging from $199 to$1000. It is seen that the proposed AQ measurement system has a very low cost compared to its commercial counterparts that make similar measurements.

## 4.Results and discussion

The proposed air quality measuring device has been developed to provide air quality detection in both indoor and outdoor environments. For the calibration process, between 6–13 November 2020, reference devices and 3 devices to be calibrated together collected data for 1 week. PM1, PM PM2.5, PM10 and CO2 values were obtained from the DM72B reference device as hourly averages from the “TUYA Smart” mobile application. Temperature and humidity values were collected from the Xiaomi Mijia reference device as minute averages and these data were converted to hourly averages. PM1, PM2.5, PM10, CO2, temperature and humidity data for the devices to be calibrated were obtained from the Blynk app. During 1 week, n = 10080 minutes of data were collected. These data were then converted to n = 168 hours of average data. For the analysis, n = 4320 minutes of data were collected between 8–10 December 2020 and these data were converted into n = 72 hourly average data. Calibration and analysis data were compiled using Microsoft Excel and all analyzes were made in this program.

Regression models allow the relationship between variables to be described by fitting a line to the observed data. Linear regression models use a straight line, while nonlinear regression models use a curved line. Regression allows you to predict how the dependent variable changes as the independent variable(s) change. SLR is used to model the relationship between two continuous variables. Often, the objective is to predict the value of an output variable (or response) based on the value of an input (or predictor) variable.

Current calibration models generally use a univariate SLR, assuming linearity between sensor and reference device response [24].

However, in field conditions where more than one variable influences the measurement result, the SLR is often not sufficient to achieve high measurement accuracy. In these cases, Multivariate Linear Regression (MLR) [66], high-dimensional models [57] or hybrid models are used for calibration [40,52,59]. Since there is a strong linearity between the raw and reference data of the measurements obtained in our study, it was calibrated with the SLR method.

The devices were calibrated with the curve-fitting equations obtained using SLR. Data were collected by placing the calibrated devices in the bedroom, kitchen and outside. PCC were calculated to determine the relationship between these collected data. PCC is often used to analyze the strength of the linear relationship between two variables. PCC is a statistical indicator that is active for correlation analysis between data. Most studies [25,30,41,56] use PCC to determine the relationship between air quality parameters. In the study [14], PCC was used to analyze the relationship of various air pollutants with temperature, humidity and wind speed. In the study [3], in which the exposure of the elderly to indoor air pollutants was determined, it was determined that the living rooms and bedrooms made the highest contribution. The results and the statistical analyzes performed (Pearson correlation and t-test) confirmed that indoor activities (cooking, smoking, and cleaning) can significantly affect the IAQ in living rooms and bedrooms. PCC was used to determine the relationship between CO2, air temperature, relative humidity, formaldehyde and PM values taken from the office, industrial kitchen and gym [7]. In the study [42] where the relationship between indoor and outdoor temperature and PM2.5 concentrations was analyzed by PCC, it was seen that the effect of high outdoor PM2.5 value on indoor PM2.5 was very large.

##### Fig. 8.

PM concentrations of the devices (a) PM1; (b) PM2.5; (c) PM10.

The data graphs of the hourly averages of PM concentrations taken from the air quality measurement devices for 1 week are shown in Fig. 8. During the measurement, the PM values in the environment were increased using natural ventilation and external PM sources in certain time periods.

##### Fig. 9.

Air quality parameters taken from the devices (a) temperature; (b) humidity; (c) CO2 concentration.

The hourly average values of temperature, humidity, and CO2 concentration taken from the air quality measurement devices for 1 week are observed in Fig. 9. Temperature, humidity, and CO2 values changed depending on indoor and natural ventilation conditions.

##### Fig. 10.

SLR graphs of the devices; (a) temperature; (b) humidity; (c) CO2 concentration.

R-squared (R2) is the coefficient of determination representing the prediction performance for linear regression models. This metric explains the percentile volume of cases where the independent variable affects the dependent variable, showing the strength of the relationship between the independent variable and the dependent variable on a 0–100% scale from 0–1.

SLR graphs for temperature, humidity and CO2 concentration of air quality measuring devices are shown in Fig. 10. When the SLR graphs are examined, it is seen that the devices have high determination coefficients (R2>0.981).

##### Fig. 11.

SLR graphics of the devices, (a) PM1, (b) PM2.5, (c) PM10.

Figure 11 shows SLR graphs of PM concentrations for air quality measuring devices and reference devices. Similarly, the coefficient of determination for PM1, PM2.5 and PM10 concentrations of the devices is high (R2>0.966).

The most significant difficulty in low-cost sensor technology is the reliability of the measurement data. The measurement data obtained from sensors that are not well calibrated will be insufficient for good IAQ planning. The calibration process was performed using the SLR equations obtained from the data of the reference and developed devices.

##### Fig. 12.

Calibrated PM concentrations of devices (a) PM1, (b) PM2.5, (c) PM10.

The PM1, PM2.5, and PM10 concentrations of the calibrated devices and the Dienmern DM72B reference device are given in Fig. 12.

##### Fig. 13.

Calibrated air quality parameters of the devices (a) temperature; (b) humidity; (c) CO2 concentration.

The temperature and humidity values of the calibrated devices and the Xiaomi Mijia temperature-humidity measurement device we used for reference are presented in Fig. 13(a), (b). Moreover, the CO2 concentration of the calibrated devices and the Dienmern DM72B reference device is observed in Fig. 13(c). Two of the calibrated devices were placed in the kitchen and bedroom inside the house, and the other was placed on the balcony of the house for outdoor measurements. The graphs of the data obtained from the devices for 3 days are shown in Figs 14, 15, 16, and Fig. 17.

##### Fig. 14.

Kitchen, bedroom, and outdoor PM2.5 concentrations.

The PM2.5 concentrations of the calibrated devices are presented in Fig. 14. As a result of the analysis of the 3-day data taken between December 8–10, 2020, it was observed that there was a very strong correlation at a value of r = 0.976 between the PM2.5 concentrations of the devices in the kitchen and bedroom. Likewise, there was a very strong correlation between the outdoor PM2.5 concentration and the kitchen concentration at r = 0.836, and between the outdoor environment and bedroom PM2.5 concentrations at r = 0.910.

As a result of the natural ventilation in the kitchen and bedroom performed simultaneously on December 8, at 10 o’clock, a high increase in the PM2.5 value occurred. While the PM2.5 concentration before ventilation was 39 μg.m3 in the kitchen and 34 μg.m3 in the bedroom, it increased after ventilation to 133 μg.m3 in the kitchen and 201 μg.m3 in the bedroom. The most important reason for this increase is that the outdoor PM2.5 concentration has 254 μg.m3 values when the ventilation starts. After the natural ventilation process lasting for 4 hours, there was a decrease in the indoor PM2.5 concentration of the kitchen and bedroom. The PM2.5 concentration of the kitchen before the natural ventilation, which started at 13:30 on December 9, was 41 μg.m3 and the PM2.5 concentration of the bedroom was 37 μg.m3. The outdoor PM2.5 concentration at the moment the ventilation started was 116 μg.m3. Consequently, the PM2.5 concentrations in the kitchen and bedroom increased to 82 μg.m3 and 51 μg.m3, respectively, within 3 hours. After the natural ventilation was completed at 16.30, the PM2.5 concentrations in the kitchen and bedroom decreased to 15 and 11 μg.m3. Due to the natural ventilation that started at 12.00 on December 10, since the outdoor PM2.5 value was 7 μg.m3, there was no increase in PM2.5 values in the indoor environment. A similar situation was obtained for PM1 and PM10. According to the results of the analysis obtained, it is observed that the indoor PM concentration changes directly depending on the outdoor PM concentration. Opening doors and windows for natural ventilation causes invaders that are invisible to the eye and cannot be noticed by the human senses to penetrate the interior. Therefore, it has become a necessity to measure air quality data in real time to prevent low air quality from affecting our living standards by using the opportunities offered by technology.

##### Fig. 15.

CO2 concentration changes in the kitchen, bedroom, and outdoor environment.

##### Fig. 16.

Temperature changes in the kitchen, bedroom, and outdoor environment.

The indoor and outdoor CO2 concentrations of the devices are observed in Fig. 15. It is observed that the indoor CO2 concentration values, which increased during the night on December 8, decreased as a result of the natural ventilation started at 11 o’clock. The CO2 concentrations, which were 1445 ppm in the bedroom and 1249 ppm in the kitchen before the natural ventilation, decreased to 218 ppm and 133 ppm, respectively, 2 hours after the start of the ventilation.

The indoor CO2 concentrations, which increased to 1096 ppm and 1078 ppm during the night in the bedroom and kitchen on December 9, decreased to 540 ppm and 500 ppm due to the natural ventilation in the morning. The CO2 concentration of the kitchen, which increased on the night of December 10, decreased from 1742 ppm to 41 ppm after the ventilation that started at 13 o’clock. The cooking activity in the kitchen directly affects CO2 concentration. The CO2 concentration in the kitchen, which was 322 ppm before the cooking activity started on December 8 at 18 o’clock, increased to 1236 ppm. Due to natural ventilation, the concentration decreased to 383 ppm. The CO2 concentration, which was 500 ppm before the cooking activity that started on December 9 at 19 o’clock, increased to 1357 ppm and decreased to 458 ppm at the end of the ventilation. Likewise, the CO2 concentration, which was 230 ppm before the cooking activity that started on December 10 at 18 o’clock, increased to 1294 ppm and decreased to 342 ppm at the end of the ventilation.

The CO2 concentration increasing due to the cooking activity in the kitchen directly affects other living spaces. On the evening of December 8, the bedroom CO2 concentration, which was 268 ppm before the cooking activity, increased to 696 ppm. Likewise, the CO2 concentration, which was 540 ppm before cooking on the evening of December 9, increased to 1595 ppm. As a result of the natural ventilation in the kitchen following the cooking activity, the CO2 concentration in the bedroom also decreased to 1122 ppm.

According to the results of the 3-day data analysis, it was determined that there was a strong correlation at r = 0.732 between the CO2 concentrations of the kitchen and bedroom. There is a strong correlation r = 0.626 between outdoor and kitchen CO2 concentrations, and a moderate correlation r = 0.537 between outdoor and bedroom. Due to natural ventilation, indoor CO2 concentration values decrease or increase directly depending on the outdoor CO2 concentration, similar to the indoor PM concentration. Therefore, we need to have information about outdoor PM and CO2 gas concentration before natural ventilation. Otherwise, instead of decreasing the indoor PM and CO2 gas concentration, we can inadvertently increase it.

The 3-day data graph of indoor and outdoor temperatures is observed in Fig. 16. The house where the data are collected is heated by a central heating system. There is a very strong positive correlation at r = 0.855 between kitchen and bedroom temperatures. Due to the cooking activity in the kitchen, the temperature is usually higher than in the bedroom. There is a low negative correlation at r=0.255 between the outdoor temperature and bedroom temperature, and at r=0.251 between the kitchen temperature. These values demonstrate that the indoor temperature is independent of the outdoor environment due to central heating.

##### Fig. 17.

Relative humidity changes in the kitchen, bedroom, and outdoor environment.

The graph of the indoor and outdoor relative humidity values is presented in Fig. 17. There is a strong positive correlation at (r = 0.748, p < 0.001) between the relative humidity values of the residential kitchen and bedroom where the data are collected. There is a strong correlation at r = 0.642 between the outdoor and bedroom relative humidity values and a moderate correlation at r = 0.429 between the outdoor and kitchen relative humidity values. It was observed that the relative humidity increased due to the cooking activity in the kitchen. The humidity value, which was 48.2 rH% in the kitchen before the cooking activity that started on December 8 at 18 o’clock, increased to 63.6 rH% during cooking, and as a result of the ventilation, the humidity value decreased to 50.4 rH%. The humidity value, which was 53.8 rH% in the kitchen before the cooking activity that started on December 9 at 19 o’clock, increased to 63.8 rH% during cooking, and as a result of the ventilation, the humidity decreased to 46.8 rH%. Likewise, the humidity value in the kitchen, which was 44.4 rH% before the cooking activity started on December 10 at 18 o’clock, increased to 62.2 rH% and decreased to 48.9 rH% as a result of the ventilation.

##### Table 3

Pearson correlation coefficient matrix of devices in indoor and outdoor environment (n = 72)

In Table 3, the PCC matrix of the data obtained from the devices placed in the kitchen, bedroom and balcony is given. The matrix obtained by bivariate Pearson analysis determines the strength of linear relationships between indoor and outdoor pollutant concentrations. The results in Table 3 show a very strong positive correlation of (r ⩾ 0.836, p < 0.001) between indoor and outdoor PM2.5 concentrations. There was a moderate correlation between temperature and CO2, and a strong positive correlation between humidity and CO2 in the bedroom and kitchen. However, there is a strong negative correlation with (r =-0.750, p < 0.001) between outdoor temperature and CO2. High positive correlation values of r = 0.686, r = 0.757 and r = 0.679 (p < 0.001) were observed between the CO2-relative humidity of the kitchen, bedroom and outdoor, respectively.

Analysis of indoor data revealed that the IAQ frequently exceeded the limits considered normal for healthy daily living. It would be more convenient to place a sensor in each room of the house to better understand the IAQ of the whole house. In this way, the air quality interaction between the rooms can be revealed more clearly.

The improved mobile interface provides users with greater awareness of the IAQ, allowing them to view the IAQ as numeric values or as a time series. This study presents a low-cost IoT approach to monitoring IAQ. The results shows that low-cost sensors and IoT components may be sufficient to monitor and improve IAQ.

## 5.Conclusion

The majority of the people who spend most of their daily life indoors have very limited knowledge about the air quality of their environment. It is necessary to measure IAQ, which is especially important for the health of children and the elderly, and accordingly, necessary ventilation measures must be taken.

In this study, a real-time IoT-based IAQ measurement system, consisting of hardware prototypes for collecting air quality data such as temperature, humidity, PM1, PM2.5, PM10 and CO2, and mobile device software for data consultancy, was proposed. The measurement system consists of open-source technologies and low-cost sensors, and the measurement data is saved in the Blynk-cloud server. As the measurement data can be monitored in real time by the Blynk mobile interface, in case of exceeding the limit values, the application sends notifications to the individuals living in the house to take the necessary measures. The devices were calibrated by operating together for 1 week. Afterward, the calibrated devices collected data from the kitchen, bedroom, and outdoor environment.

According to the analysis results obtained from the data, the inferences obtained from the proposed IoT-based IAQ monitoring system are as follows:

• IAQ directly depends on the number of people in the household and activities of the house occupants.

• Individual activities, e.g., cooking and sleeping, have a direct impact on PM and CO2 concentrations.

• Outdoor PM concentrations during natural ventilation directly affect indoor PM concentrations.

• In cases where outdoor PM concentration is high, professional ventilation systems should be preferred instead of natural ventilation in order to increase IAQ.

• Indoor PMs is mainly composed of outside infiltration and cooking.

• A very high positive correlation was observed between bedroom and kitchen PM2.5 values and outdoor PM2.5 values, with r = 0.900 (p < 0.001) and r = 0.836 (p < 0.001) values, respectively.

• Due to the fact that the doors and windows were kept closed during the night and there was no additional ventilation system, the nightly CO2 concentration reached 1445, 1200 and 1850 ppm, respectively. These values are above 1000 ppm, which is accepted as the upper limit by most health commissions.

• It has been observed that natural ventilation in the morning reduces indoor CO2 concentration by 2 to 6 times.

• Increasing PM2.5 and CO2 concentration values in the kitchen due to the cooking activity also increase the concentrations in the bedroom.

• There was a very strong correlation between kitchen and bedroom PM2.5 values (r = 0.976, p < 0.001) and a strong correlation between CO2 values (r = 0.732, p < 0.001).

• During natural ventilation, high outdoor PM concentration increased indoor PM concentration up to 5 times.

The developed IoT-based air quality measurement devices provides a significant advantage with its low cost of \$60, the use of open-source technologies, 1-minute measurement frequency and easy setup. Because of the usage of wireless technology for communication, the system provides ease of installation, configuration, and adding new devices. Furthermore, the proposed air quality measurement system contributes significantly to creating a healthy living environment. The poor air conditions detected by the measurement system are reported to users in real time, which enables them to create intervention plans. The results show that the proposed low-cost devices have sufficient potential to ensure indoor air quality.

Environmental factors such as temperature and humidity were not taken into account while calibrating the sensors. Measurements were taken only from the bedroom, kitchen and balcony. The effects of IAQ in other rooms to the kitchen and bedroom are not taken into account. IAQ measurement devices were not placed in the center of the rooms and the air was assumed to be homogeneous in the rooms.

The sensors used in the study were tested for values under normal conditions. A special environment has not been established where the minimum and maximum measurement limits will be tested. Since frying and baking processes were not carried out in the cooking activity, there was no significant increase in PM concentrations in the kitchen. Measurements were limited to only a few days and future work will cover longer time periods. Cleaning chemicals, vacuum cleaner, perfume and exercises significantly reduce indoor air quality. Measurement devices will be placed in each room and the effects of these personal activities on indoor air quality and other rooms will be analyzed. The sensors will be calibrated using MLR or high-dimensional models to increase measurement accuracy.

None to report.