Next Article in Journal
Simulation and Experimental Validation of a Microfluidic Device Used for Cell Focusing and Sorting Based on an Inertial Microfluidics Technique
Previous Article in Journal
Statement of Peer Review
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

Multi-Sensor Indoor Air Quality Monitoring with Real-Time Logging and Air Purifier Integration †

by
Muhammad Afrial
,
Muneeza Rauf
,
Muhammad Nouman
,
Muhammad Talal Khan
,
Muhammad Arslan Rizwan
and
Naqash Ahmad
*
Department of Biomedical and Mechatronics Engineering, Air University, Islamabad 44000, Pakistan
*
Author to whom correspondence should be addressed.
Presented at the 3rd International Conference on Modern Technologies in Mechanical & Materials Engineering (MTME2025), Topi, Pakistan, 16–17 April 2025.
Mater. Proc. 2025, 23(1), 12; https://doi.org/10.3390/materproc2025023012
Published: 5 August 2025

Abstract

Most people utilize their time indoors, either at home or in the workplace. However, certain human interventions badly affect the indoor atmosphere, causing potential health problems for occupants. This study aims to propose an air monitoring device integrated with an air purifier that monitors the pollutants affecting the indoor environment and automatically turns on/off the air purifier based on the pollution level. In the system, MQ7, MQ2, DHT11, and GP2Y1010AU0F sensors are integrated with ESP32 to detect indoor air pollutants, e.g., carbon monoxide (CO), methane (CH4), temperature, humidity, and PM2.5. Data were collected for 30 days by mounting a proposed device in different indoor locations, including a poorly ventilated average living room, an indoor kitchen, and a crowded office space. The emission of carbon monoxide (CO) and methane (CH4) was at 29.4 ppm and 10.9 ppm, PM2.5 was detected as 3 µg/m3, and the temperature and humidity were at 23 °C and 28%, respectively. Utilizing the Wi-Fi ability of ESP32, the data were transferred to the ThingSpeak IoT platform for the live tracking and analysis of the indoor atmosphere. Observing the measured data, the proposed system’s accuracy was calculated by comparing the results against a known standard device, which was estimated to be 95%. To protect the designed system, a protective case was also designed.

1. Introduction

According to the World Health Organization (WHO), 3.8 million people lose their lives annually due to adverse effects of a polluted indoor atmosphere [1]. The increasing use of modern appliances, cooking, smoking, and no-ventilation spaces in offices and residential areas reduce indoor breathing quality, which greatly affects human well-being. Numerous systems have been proposed to measure air quality parameters. In India, a system [2] was designed to collect the composition of carbon monoxide (CO), temperature, and humidity in the air and predict if the air is safe to breathe. It utilized a 9 V battery and LM7805 regulator to power the MQ7 sensor. This paper also highlighted that the output voltage levels may fluctuate due to inadequate power supply when both sensors are active, potentially impacting the accuracy of the readings. Another air quality monitoring system was proposed in Indonesia in which the PMS5003 sensor was utilized to measure the PM2.5 levels in poorly ventilated village homes [3]. The research discusses the dependency on IoT, emphasizing that it requires a stable internet connection, which may be a challenge in rural areas. Moreover, poorly ventilated village homes may be affected by a range of air pollutants beyond just PM2.5. The paper cited in [4] developed an indoor monitoring system to detect PM2.5, PM10, and PM1. The research was conducted in a closed chamber with a space to permit the air for the system to detect the PM concentrations. A vacuum cleaner was also utilized if the concentrations exceeded the defined level. However, this chamber-based study reflects a more idealized setup rather than typical indoor environments, which often have varying ventilation rates and pollutant levels. Moreover, this study focuses solely on a vacuum cleaner, which may not represent the full range of available air purifiers. Another research study [5] was also conducted in Pekanbaru, Indonesia. An air monitoring system was introduced to measure the temperature, humidity, and carbon monoxide using DHT11 and MQ135 sensors, respectively. However, the research did not properly address the sensor’s placement and coverage for real-time data collection. The above-proposed mechanisms are developed to predict air quality based on the data collected from sensors. However, the reliability of these studies’ results is questionable due to the lack of sensor calibration before the data collection. Moreover, most of the proposed systems are only confined to measuring the concentrations of temperature, humidity, CO, and CO2 while ignoring the other harmful pollutants affecting human health.
Based upon the discussed research gaps and to fill them, this research is conducted to propose an air quality monitoring device that is efficient at displaying real-time results. The system is designed to detect the concentrations of temperature, humidity, carbon monoxide (CO), methane (CH4), and PM2.5 from the indoor atmosphere while displaying the results on the ThingSpeak IoT platform of MathWorks (Portola Valley, CA, USA). Unlike conventional air monitoring systems that merely collect and display pollutant data, the proposed system features a relay interface that enables seamless integration with any standard air purifier. When pollutant levels exceed the predefined safety thresholds, the system automatically activates the air purifier, providing an active response to improve indoor air quality while also consuming power through automatic operation. This proactive approach enhances indoor air quality by reducing harmful gases in real time, making the system more effective at preventing long-term health risks.

2. Materials and Methods

In the system, the Esp32, 30-pin by Espressif Systems, Shanghai, China, module was used, which comes with built-in Wi-Fi and Bluetooth capacity to ensure seamless cloud connections. As seen in Figure 1, the MQ-2 sensor by Zhengzhou Winsen Electronics Technology Co., Ltd, Zhengzhou, China is linked to pin-9, the MQ-7 sensor by Hanwei Electronics Group Corporation, Zhengzhou, China is attached to pin-11, the DHT11 by Aosong Electronics Co., Ltd, Guangzhou, China sensor is attached to pin-8, and the dust sensor GP2Y1010AU0F by Sharp Microelectronics, Osaka, Japan is connected to the number 2 pin of the ESP32 microcontroller by Espressif Systems, Shanghai, China. To power up the circuit, a 12v adaptor was used with a power jack; however, since ESP32 does not tolerate voltages exceeding 5v, the voltage was stepped down to 5v using an LM2596 buck converter by Texas Instruments, Dallas, TX, USA. The relay is connected to pin-13 of ESP32, which further incorporates a bulb as a space for an air purifier.
The MQ7 is primarily used for detecting carbon monoxide (CO), also considered a hidden danger to human health, under a specified range of 20 to 2000 parts per million (ppm) [6]. It also responds to some other gases in the environment, though to a lower extent, proving to only measure CO gas. To ensure accurate readings, all sensors were calibrated before deployment. The MQ7 and MQ2 sensors were calibrated using a reference gas chamber with known CO and CH4 concentrations. The GP2Y1010AU0F sensor was validated against a precision particle counter, while the DHT11 sensor was cross-checked with a digital hygrometer and thermometer. Multiple calibration tests ensured accuracy and minimal deviation from standard devices. When the data were collected by the MQ7 and MQ2 sensors, it was observed that the sensors were giving raw values. The raw analog values from the MQ7 and MQ2 sensors are read as a 12-bit ADC output (ranging from 0 to 4095) on the ESP32. Since the sensor’s response is proportional to the detected gas concentration, the conversion Formulas (1) and (2) scale the raw values to ppm based on sensor sensitivity. Factor 1000 aligns with the calibration data from the sensor’s datasheet, ensuring accurate readings.
f l o a t   c o P p m = ( f l o a t ) c o A n a l o g / 4095 × 1000 ;
f l o a t   c h 4 P p m = ( f l o a t ) c h 4 A n a l o g / 4095 × 1000 ;
For monitoring PM2.5, the GP2Y1010AU0F sensor was utilized. PM2.5 signifies the particulate matter with a 2.5 μm diameter or even smaller (≤2.5 µm) [7]. Being tiny, these particles enter the respiratory and cardiovascular systems, causing major health issues to people sensitive to these systems. To measure the temperature and humidity levels, the DHT11 sensor was used. It is designed to measure temperatures between 0 and 50 °C and humidity from 20% to 90%. The World Health Organization’s (WHO) comprehensive guidelines for acceptable concentrations of various indoor air pollutants were assisted to ensure the standard data collection of the proposed device [8]. According to the WHO, carbon monoxide (CO) should be between 25 and 35 ppm. If the level exceeds this range, it can cause headache and nausea; however, if not controlled, it can lead to reduced oxygen levels in the body, causing hypoxia [9]. The maximum allowable amount of PM2.5 is 15 µg/m3; otherwise, it can prove to be a major health risk to the elderly, children, and pregnant women, leading to premature deaths. Likewise, humidity for the indoor atmosphere must be less than 50%. The acceptance level of methane (CH4) for an enclosed space should be 10,000; exposure to more than this limit can cause headaches and loss of consciousness. When the sensors were integrated, the program was compiled containing the acceptance ranges of every sensor, as described above. The relay, a space for a standard air purifier, was set to change the states if any of the parameters’ concentrations exceed the defined level as an indication to turn on the air purifier and shut off automatically once the air is clean, hence consuming less power [10]. The SD card module was used to keep a record of the readings of every sensor [11]. The module enabled the efficient storage of real-time data to provide systematically recorded measurements for further analysis and improvement in the indoor environment. The system was further tested with strong, moderate, and weak Wi-Fi signals to ensure the reliability of Wi-Fi connectivity and data logging due to varying indoor locations. As the proposed device is designed to be mounted anywhere, a protective case was designed using SOLIDWORKS software of version 2023, shown in Figure 2, to minimize potential damage and provide incorporated features for convenient installation while ensuring the long-term data acquisition of the sensors [12].
The material chosen for the case was polylactic acid (PLA) due to its eco-friendly, fine finishing, and cost-effective properties. The PCB board was measured with the components inserted. The openings of the sensors, SD card module, buck converter, and power jack were cut to improve the engagement of the device with the environment. The ventilation slots prevent the overheating of the circuit. Figure 3 shows the final assembled and working hardware with the 3D-printed protective case.

3. Results

After ensuring the smooth connections of a complete circuit, the program was uploaded to ESP32 to enable the sensors to search for the data. ESP32 was further connected to the ThingSpeak IoT platform after feeding the provided API key to the code [13]. As stated before, to obtain a measurable amount of data from the atmosphere, different locations were selected depending on the primary source of the emission of every parameter. The first location was an average indoor living room. The device was mounted at a safe place in the room. The GP2Y1010AU0F sensor activated and detected 3 µg/m3 of PM2.5, while the incomplete combustion produced a large amount of carbon monoxide (CO) of 29.4 ppm, as shown in Figure 4. The system detected methane (CH4) at 10.9 ppm, as shown in Figure 5. Figure 6 illustrates the data of temperature and humidity as 35 °C and 48% from a crowded office space.
To evaluate the accuracy of the proposed system, a widely used air monitoring device from a trusted brand ASHIQI (Shenzhen, China) assisted. The trusted device detected PM2.5 of around 3.11 µg/m3, while the proposed system displayed 3 µg/m3. Similarly for other parameters, the trusted device detected CO, CH4, temperature, and humidity to be 30.2 ppm, 11.7 ppm, 38 °C, and 50%, respectively. When the data collected by both devices were analyzed and evaluated, the proposed air monitoring device was found to be 95% accurate in comparison with the trusted device. As the device was programmed to write the real-time data onto the SD card by creating a CSV file, the data were displayed in spreadsheet format with each parameter occupying a separate column and providing readings accordingly. The spreadsheet was converted into a column chart for better visualization, as illustrated in Figure 7; it represents the environmental data recorded and stored in the SD card. This figure highlights the system’s ability to log sensor data for offline analysis and long-term environmental monitoring. During testing, when the CO levels exceeded 35 ppm, the relay successfully triggered the air purifier, reducing the CO concentration to 20 ppm within 15 min. Similarly, the PM2.5 levels dropped from 18 µg/m3 to 10 µg/m3 within 30 min of activation. These results demonstrate that the relay interface significantly enhances the system’s effectiveness in maintaining safer indoor air conditions.

4. Discussion

To monitor air quality, recent studies have integrated the MQ7 sensor [2], PMS5003 (Nanchang Panteng Technology, Nanchang, China), to monitor PM2.5 [3]. If the concentration of harmful air pollutants exceeds a certain level, a vacuum cleaner is also used for air purification [4], and to keep track of temperature, humidity and carbon monoxide DHT11 and MQ135 are used in this study [5]. The monitoring of limited air pollutants with no standard integration of an air purifier with the system can lead to the incomplete monitoring of the indoor environment, leading to potential breathing hazards.
The proposed system is efficiently designed to capture the real-time concentrations of harmful air pollutants, e.g., carbon monoxide (CO), methane (CH4), and PM2.5, while also accounting for temperature and humidity. It utilizes calibrated MQ7, MQ2, GP2Y1010AU0F, and DHT11 sensors. To facilitate seamless air quality tracking, the system integrates with the ThingSpeak IoT platform. It is well designed to accommodate a standard air purifier to activate the air cleaning process when pollutant concentrations exceed safe limits. Further, to ensure consistent air tracking and safe mounting, the device comes with a protective case.
This study has few limitations, including that it primarily focuses on monitoring PM2.5 dust particles while not accounting for dust particles of other sizes, e.g., PM10 and PM1. The IoT platform is not supportive of improving user interaction by enabling mobile alerts when bad air is predicted. For future experiments, these limitations will be accounted for, along with a thought to monitor harmful air pollutants, e.g., VOCs. Introducing machine learning algorithms could also help to predict long-term air quality trends.

5. Conclusions

As analyzed and tested above, the proposed air monitoring device is able to detect the harmful concentrations of indoor air pollutants, including temperature, humidity, carbon monoxide (CO), methane (CH4), and PM2.5. This further adds the advantage of data logging using an SD card module to keep track of the indoor atmosphere. The ThingSpeak IoT platform is further used to analyze real-time monitoring from remote locations. Relay switching is helpful for the integration of an air purifier with the system. To ensure an efficient power supply, increased energy efficiency and conditioning the system save on electricity costs. The proposed system is low-cost and portable; it can be mounted anywhere indoors. When compared with a standard air monitoring device by ASHIQI, the proposed device proved to be 95% efficient at detecting the discussed parameters.

Author Contributions

Conceptualization, M.A.; methodology, M.A.; software, M.A.; validation, M.A. and M.N.; formal analysis, M.N.; investigation, M.A.; resources, N.A.; data curation, M.A.R.; writing—original draft preparation, M.T.K.; writing—review and editing, M.R.; visualization, M.R.; supervision, N.A.; project administration, N.A.; funding acquisition, M.A.R., M.N., and M.A. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available upon request from the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Tran, V.V.; Park, D.; Lee, Y.-C. Indoor Air Pollution, Related Human Diseases, and Recent Trends in the Control and Improvement of Indoor Air Quality. Int. J. Environ. Res. Public Health 2020, 17, 2927. [Google Scholar] [CrossRef] [PubMed]
  2. Sai, K.B.K.; Subbareddy, S.R.; Luhach, A.K. IOT based Air Quality Monitoring System Using MQ135 and MQ7 with Machine Learning Analysis. Scalable Comput. Pract. Exp. 2019, 20, 599–606. [Google Scholar] [CrossRef]
  3. Irbah, N.; Nurika, G.; Ramani, A. Implementation of Indoor Air Quality Monitoring Systems of Particulate Matter 2.5 Based on the Internet of Things. J. Kesehat. Lingkung. 2024, 16, 266–276. [Google Scholar] [CrossRef]
  4. Fermo, P.; Comite, V.; Falciola, L.; Guglielmi, V.; Miani, A. Efficiency of an Air Cleaner Device in Reducing Aerosol Particulate Matter (PM) in Indoor Environments. Int. J. Environ. Res. Public Health 2019, 17, 18. [Google Scholar] [CrossRef] [PubMed]
  5. Irawan, Y.; Wahyuni, R.; Muhardi; Fonda, H.; Hamzah, M.L.; Muzawi, R. Real Time System Monitoring and Analysis-Based Internet of Things (IoT) Technology in Measuring Outdoor Air Quality. Int. J. Interact. Mob. Technol. (IJIM) 2021, 15, 224. [Google Scholar] [CrossRef]
  6. Guerrero-Ulloa, G.; Andrango-Catota, A.; Abad-Alay, M.; Hornos, M.J.; Rodríguez-Domínguez, C. Development and Assessment of an Indoor Air Quality Control IoT-Based System. Electronics 2023, 12, 608. [Google Scholar] [CrossRef]
  7. Flowerday, C.E.; Lundrigan, P.; Kitras, C.; Nguyen, T.; Hansen, J.C. Utilizing Low-Cost Sensors to Monitor Indoor Air Quality in Mongolian Gers. Sensors 2023, 23, 7721. [Google Scholar] [CrossRef] [PubMed]
  8. Settimo, G.; Yu, Y.; Gola, M.; Buffoli, M.; Capolongo, S. Challenges in IAQ for Indoor Spaces: A Comparison of the Reference Guideline Values of Indoor Air Pollutants from the Governments and International Institutions. Atmosphere 2023, 14, 633. [Google Scholar] [CrossRef]
  9. Thiyaneswaran, B.; Elayaraja, P.; Srinivasan, P.; Kumarganesh, S.; Anguraj, K. IoT based air quality measurement and alert system for steel, material and copper processing industries. Mater. Today Proc. 2023, 81, 127–132. [Google Scholar] [CrossRef]
  10. Fermo, P.; Artíñano, B.; De Gennaro, G.; Pantaleo, A.M.; Parente, A.; Battaglia, F.; Colicino, E.; Di Tanna, G.; Goncalves da Silva Junior, A.; Pereira, I.G.; et al. Improving indoor air quality through an air purifier able to reduce aerosol particulate matter (PM) and volatile organic compounds (VOCs): Experimental results. Environ. Res. 2021, 197, 111131. [Google Scholar] [CrossRef] [PubMed]
  11. Kaivonen, S.; Ngai, E.C.-H. Real-time air pollution monitoring with sensors on city bus. Digit. Commun. Netw. 2020, 6, 23–30. [Google Scholar] [CrossRef]
  12. Collado, E.; Calderón, S.; Cedeño, B.; De León, O.; Centella, M.; García, A.; Sáez, Y. Open-source Internet of Things (IoT)-based air pollution monitoring system with protective case for tropical environments. HardwareX 2024, 19, e00560. [Google Scholar] [CrossRef] [PubMed]
  13. Banciu, C.; Florea, A.; Bogdan, R. Monitoring and Predicting Air Quality with IoT Devices. Processes 2024, 12, 1961. [Google Scholar] [CrossRef]
Figure 1. System diagram.
Figure 1. System diagram.
Materproc 23 00012 g001
Figure 2. Protective case.
Figure 2. Protective case.
Materproc 23 00012 g002
Figure 3. Assembled working of (a) electronics of the system and (b) hardware of the system.
Figure 3. Assembled working of (a) electronics of the system and (b) hardware of the system.
Materproc 23 00012 g003
Figure 4. Concentration of (a) dust particles PM2.5 and (b) carbon monoxide (CO).
Figure 4. Concentration of (a) dust particles PM2.5 and (b) carbon monoxide (CO).
Materproc 23 00012 g004
Figure 5. CH4 concentration.
Figure 5. CH4 concentration.
Materproc 23 00012 g005
Figure 6. Concentration of (a) temperature and (b) humidity.
Figure 6. Concentration of (a) temperature and (b) humidity.
Materproc 23 00012 g006
Figure 7. SD card data logging.
Figure 7. SD card data logging.
Materproc 23 00012 g007
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Afrial, M.; Rauf, M.; Nouman, M.; Talal Khan, M.; Rizwan, M.A.; Ahmad, N. Multi-Sensor Indoor Air Quality Monitoring with Real-Time Logging and Air Purifier Integration. Mater. Proc. 2025, 23, 12. https://doi.org/10.3390/materproc2025023012

AMA Style

Afrial M, Rauf M, Nouman M, Talal Khan M, Rizwan MA, Ahmad N. Multi-Sensor Indoor Air Quality Monitoring with Real-Time Logging and Air Purifier Integration. Materials Proceedings. 2025; 23(1):12. https://doi.org/10.3390/materproc2025023012

Chicago/Turabian Style

Afrial, Muhammad, Muneeza Rauf, Muhammad Nouman, Muhammad Talal Khan, Muhammad Arslan Rizwan, and Naqash Ahmad. 2025. "Multi-Sensor Indoor Air Quality Monitoring with Real-Time Logging and Air Purifier Integration" Materials Proceedings 23, no. 1: 12. https://doi.org/10.3390/materproc2025023012

APA Style

Afrial, M., Rauf, M., Nouman, M., Talal Khan, M., Rizwan, M. A., & Ahmad, N. (2025). Multi-Sensor Indoor Air Quality Monitoring with Real-Time Logging and Air Purifier Integration. Materials Proceedings, 23(1), 12. https://doi.org/10.3390/materproc2025023012

Article Metrics

Back to TopTop