Abstract—This study presents the design and implementation of a real-time air quality monitoring and alert system targeting Nitrogen Dioxide (NO₂) and Sulfur Dioxide (SO₂), two of the most critical pollutants affecting environmental sustainability and public health. The system integrates Internet of Things (IoT) technologies with machine learning, specifically a classification-based approach, to enable continuous monitoring and analysis of pollutant conditions. Data acquisition is carried out using electrochemical gas sensors interfaced with Arduino microcontrollers, which transmit the readings to a Raspberry Pi-based processing unit. A web-based interface provides real-time data visualization and system interaction. To enhance the system’s decision-support capability, a Random Forest classification model is employed to categorize pollution levels into predefined classes based on threshold values aligned with World Health Organization (WHO) guidelines. This ensures that the analytical component focuses on classifying pollutant concentrations into risk levels, rather than estimating continuous numerical values. Alerts are automatically triggered when classified categories indicate threshold exceedance, with notifications delivered via the user dashboard and automated email. The predictive performance of the models was assessed using confusion matrix analysis, demonstrating varied classification efficacy across air quality indices. For NO2, the model achieved classification accuracy of 82.61% for Safe levels and 86.96% for Dangerous levels, though performance was more moderate in the Moderate category at 69.57%. Evaluation of SO2 showed high consistency in distinguishing between the three safety thresholds within the study period. The use of ensemble learning methods, particularly Random Forest, demonstrates reliable handling of noisy sensor data. However, the evaluation is limited by the dataset’s size and geographic scope, and the results may vary under broader deployment conditions. Nevertheless, the system shows potential for applications in urban air quality monitoring and environmental risk assessment. A key insight from this study is the identified lack of localized air quality monitoring infrastructure in the study region, underscoring the need for scalable, low-cost, and intelligent monitoring solutions.
Keywords—real-time air quality monitoring, environmental sustainability, public health, machine learning algorithms, electrochemical gas sensors, random forest
Cite: Antoine Joseph E. Chua, Charles Adrian S. De Guzman, Reinhart Justine B. Suba, and Kristine Joyce P. Ortiz, "Real-Time Air Quality Monitoring and Prediction of Hazardous Gases Using Random Forest Algorithm for Environmental Risk Assessment," International Journal of Environmental Science and Development vol. 17, no. 3, pp. 271-280, 2026.
Copyright © 2026 by the authors. This is an open access article distributed under the Creative Commons Attribution License which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited (CC BY 4.0).
