journal article·2025-08-18Open access

Real-Time Intelligent Monitoring of Outdoor Air Quality in an Urban Environment Using IoT and Machine Learning Algorithms

Osama Alsamrai, Maria D. Redel-Macias, M. P. Dorado

Applied Sciences· Volume 15· Issue 16

Abstract

The monitoring and prediction of air quality (AQ) is key to minimizing the negative impact of air pollution, as it enables the implementation of corrective measures. An IoT-based multi-purpose monitoring system has therefore been designed. To develop a reliable remote system, this study addresses three challenges: (1) design of a low-cost compact, robust, multi-sensor system, (2) model validation over several months to ensure accurate detection, and (3) the application of machine learning (ML) techniques to classify and predict AQ. The developed system demonstrates a significant cost reduction for regular monitoring, including effective data management under harsh environmental conditions. The prototype integrates pollutant sensors, as well as the detection of liquified petroleum gas, humidity, and temperature. A dataset with more than 30,000 entries per month (data recorded approximately every minute) was saved on the platform. Results identified the three highest pollution categories, highlighting the urgency of addressing AQ in densely populated regions. The ML algorithms allowed us to predict AQ trends with 99.97% accuracy. To summarize, by reducing monitoring costs and enabling large-scale data management, this system offers an effective solution for real-time environmental monitoring. It also highlights the potential of artificial intelligence-based AQ predictions in supporting public health initiatives. This is particularly interesting for developing countries, where pollution control is limited. Future research will develop the models to include data from different environments and seasons, exploring its integration into mobile apps and cloud platforms for real-time monitoring.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Air Quality Monitoring and Forecasting

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

Department of Physical Chemistry and Applied Thermodynamics, Universidad de Córdoba, Campus de Rabanales, Campus de Excelencia Internacional Agroalimentario ceiA3, 14071 Córdoba, Spain

Doctoral Program Computación Avanzada, Energía y Plasmas, Universidad de Córdoba, 14071 Córdoba, Spain

Department of Rural Engineering, Universidad de Córdoba, Campus de Excelencia Internacional Agroalimentario ceiA3, 14071 Córdoba, Spain

Funding

Spanish Ministry of Science and Innovation

References (41)

Show source-provided references
1. Machine learning algorithms to forecast air quality: A survey10.1007/s10462-023-10424-4 ↗
2. Air Quality Monitoring and Disease Prediction Using IoT and Machine Learning10.21276/ijircst.2020.8.6.4 ↗
3. Nilesh, N., Patwardhan, I., Narang, J., and Chaudhari, S. (November, January 26). IoT-based AQI Estimation using Image Processing and Learning Methods. Proceedings of the 2022 IEEE 8th World Forum on Internet of Things, WF-IoT 2022, Yokohama, Japan.10.1109/WF-IoT54382.2022.10152272 ↗
4. Vasantha, S.V., Mageswari, R.U., Ramesh, K., and Vaishnavi, J. (2022, January 16–17). Air Quality Prediction System using ML and DL Techniques. Proceedings of the 2022 IEEE North Karnataka Subsection Flagship International Conference, NKCon 2022, Karnataka, India.10.1109/NKCon56289.2022.10126628 ↗
5. Low cost air pollution monitoring systems: A review of protocols and enabling technologies
6. Rajashekar, R.C. (2021). IoT-based Air Pollution Monitoring: Algorithms and Implementation. [Master’s Thesis, International Institute of Information Technology].
7. Witczak, D., and Szymoniak, S. (2024). Review of Monitoring and Control Systems Based on Internet of Things. Appl. Sci., 14.10.3390/app14198943 ↗
8. An IoT Implemented Dynamic Air Pollution Monitoring System10.4108/eetiot.v9i4.4316 ↗
9. Real-time Air Quality Index Monitoring and Alert System using IoT Technology
10. Ardebili, A.A., Martella, C., Longo, A., Rucco, C., Izzi, F., and Ficarella, A. (2025). IoT-Driven Resilience Monitoring: Case Study of a Cyber-Physical System. Appl. Sci., 15.10.3390/app15042092 ↗
11. Bai, Z., Hu, Z., Bian, K., and Song, L. (2019, January 12–17). Real-time Prediction for Fine-grained Air Quality Monitoring System with Asynchronous Sensing. Proceedings of the ICASSP, IEEE International Conference on Acoustics, Speech and Signal Processing—Proceedings, Brighton, UK.10.1109/ICASSP.2019.8682518 ↗
12. Hybrid triboelectric-piezoelectric nanogenerator assisted intelligent condition monitoring for aero-engine pipeline system10.1016/j.cej.2025.165121 ↗
13. Rosca, C.-M., and Stancu, A. (2025). Integration of AI in Self-Powered IoT Sensor Systems. Appl. Sci., 15.10.3390/app15137008 ↗
14. Air quality monitoring using statistical learning models for sustainable environment
15. Ghosh, H., Tusher, M.A., Rahat, I.S., Khasim, S., and Mohanty, S.N. (2023). Water Quality Assessment Through Predictive Machine Learning. Lecture Notes in Networks and Systems, Springer.10.1007/978-981-99-3177-4_6 ↗
16. (2024, July 05). Environmental concerns surround Dora refinery and power station in Baghdad » 964media. Available online: https://en.964media.com/7756/.
17. (2024, September 10). Smoke Al-Doura Chokes Baghdad’s Skies: An Investigation—Al-Aalem. Available online: https://al-aalem.com/%D8%A3%D8%AF%D8%AE%D9%86%D8%A9-%D8%A7%D9%84%D8%AF%D9%88%D8%B1%D8%A9-%D8%AA%D8%AE%D9%86%D9%82-%D8%B3%D9%85%D8%A7%D8%A1-%D8%A8%D8%BA%D8%AF%D8%A7%D8%AF-%D8%AA%D8%AD%D9%82%D9%8A%D9%82/#_ftn1.
18. Spatial assessment of PM10 hotspots using Random Forest, K-Nearest Neighbour and Naïve Bayes10.1016/j.apr.2021.101202 ↗
19. Development of an IoT-Enabled Air Pollution Monitoring and Air Purifier System
20. (2024, April 21). Micro AL2O3 Ceramic Tube, Tin Dioxide. Available online: https://www.hwsensor.com.
21. Application of zigbee-wsn technology for indoor environmental parameter monitoring system
22. Nandanwar, H., and Chauhan, A. (2021, January 27–29). IOT based Smart Environment Monitoring Systems: A Key to Smart and Clean Urban Living Spaces. Proceedings of the 2021 Asian Conference on Innovation in Technology, ASIANCON 2021, Pune, India.10.1109/ASIANCON51346.2021.9544596 ↗
23. Alsamrai, O., Redel-Macias, M.D., Pinzi, S., and Dorado, M.P. (2024). A Systematic Review for Indoor and Outdoor Air Pollution Monitoring Systems Based on Internet of Things. Sustainability, 16.10.3390/su16114353 ↗
24. Environmental monitoring system based on an Open Source Platform and the Internet of Things for a building energy retrofit10.1016/j.autcon.2017.12.017 ↗
25. (2024, September 02). ESP32 Series Datasheet Version 4.6 2.4 GHz Wi-Fi + Bluetooth® + Bluetooth LE SoC Including. Available online: www.espressif.com.
26. (2024, September 02). Programming and Uploading Code on the ESP32 Board with Arduino IDE. Available online: https://ai.thestempedia.com/docs/getting-started-with-esp32-on-arduino-ide/.
27. (2024, August 02). Conversor Analógico Digital ADS1015 12 Bits 4 Canais ADC I2C—Usinainfo. Available online: https://www.usinainfo.com.br/conversor-ad-da-arduino/conversor-analogico-digital-ads1015-12-bits-4-canais-adc-4713.html.
28. (2024, September 02). TXS0108E High Speed Full Duplex 8 Channel Logic Level Converter Buy Online at Low Price in India—ElectronicsComp.com. Available online: https://www.electronicscomp.com/txs0108e-high-speed-full-duplex-8-channel-logic-level-converter?srsltid=AfmBOooVRdh64nLeiAdo2zul3dU-zPZO40ORP7at_q6zMGaLEUJOviE_.
29. (2024, April 29). Arduino Integrated Development Environment (IDE) v1|Arduino Documentation. Available online: https://docs.arduino.cc/software/ide-v1/tutorials/arduino-ide-v1-basics/.
30. (2024, August 12). ABOUT|Thinger.io Documentation. Available online: https://docs.thinger.io/about.
31. (2024, September 02). Arduino IDE|Thinger.io Documentation. Available online: https://docs.thinger.io/sdk-setup/arduino-ide.
32. (2024, August 12). Welcome to Colab—Colab. Available online: https://colab.research.google.com/notebooks/intro.ipynb.
33. Goos, G., Bertino, E., Gao, W., Steffen, B., Woeginger, G., and Yung, M. (2024, May 27). Lecture Notes in Computer Science 13147 Founding Editors Editorial Board Members. Available online: https://link.springer.com/bookseries/7409.
34. (2024, September 04). Ardunic||Build Anything. Available online: https://www.ardunic.com/.
35. (2024, September 08). miguel5612/MQSensorsLib: We Present a Unified Library for MQ Sensors, this Library Allows to Read MQ Signals Easily from Arduino, Genuino, ESP8266, ESP-32 Boards Whose References are MQ2, MQ3, MQ4, MQ5, MQ6, MQ7, MQ8, MQ9, MQ131, MQ135, MQ136, MQ303A, MQ309A. Available online: https://github.com/miguel5612/MQSensorsLib.
36. (2025, July 22). ESPHome on ESP32 with DSM501: R/esp32. Available online: https://www.reddit.com/r/esp32/comments/18gcnvm/esphome_on_esp32_with_dsm501/.
37. Hassler, A.P., Menasalvas, E., García-García, F.J., Rodríguez-Mañas, L., and Holzinger, A. (2019). Importance of medical data preprocessing in predictive modeling and risk factor discovery for the frailty syndrome. BMC Med. Inform. Decis. Mak., 19.10.1186/s12911-019-0747-6 ↗
38. (2024, October 11). Carbon Monoxide (CO) Pollution in Outdoor Air|US EPA, Available online: https://www.epa.gov/co-pollution.
39. (2024, October 11). World Health Organization (WHO). Available online: https://www.who.int/home.
40. (2024, October 11). Home|Occupational Safety and Health Administration, Available online: https://www.osha.gov/.
41. (2024, October 11). Particulate Matter (PM) Pollution|US EPA, Available online: https://www.epa.gov/pm-pollution.