Institut Riset dan Publikasi Indonesia (IRPI) MALCOM: Indonesian Journal of Machine Learning and Computer Science Journal Homepage: https://journal. id/index. php/malcom Vol. 5 Iss. 3 July 2025, pp: 776-787 ISSN(P): 2797-2313 | ISSN(E): 2775-8575 Internet of Things Based Air Quality Monitoring System with Automatic Notification Devi Nur Azizah1*. Sri Heranurweni2. La Ode Muhamad Idris3 1,2,3 Program Studi Teknik Elektro. Fakultas Teknik. Universitas Semarang. Indonesia E-mail: 1devi77078@gmail. com, 2heranur@usm. id, 3laode@usm. Received Feb 18th 2025. Revised Apr 13th 2025. Accepted Apr 27th 2025. Available Online Jun 19th 2025. Published Jun 22th 2025 Corresponding Author: Devi Nur Azizah Copyright A2025 by Authors. Published by Institut Riset dan Publikasi Indonesia (IRPI) Abstract Internet of Things (IoT)-based air quality monitoring systems represent a significant advancement in urban environmental management. This research implements a system that integrates PM2. PM10. CO2, and NO2 sensors for real-time monitoring of pollutants. The results showed that the integration of IoT technology with cloud computing and machine learning algorithms successfully created a responsive and accurate monitoring system. The model achieved maximum accuracy during the training process, with promising predictive capabilities in real-world implementation. The main findings of the study confirmed that the Weighted Class (WC) approach significantly improved performance in the testing and prediction process by addressing class imbalance in the dataset, while the Data Augmentation (DA) technique did not show the expected improvement due to the intrinsic characteristics of air quality data. The automatic notification system successfully provides early warnings when air quality exceeds specified thresholds, enabling proactive responses from authorities and the public. The implementation of a web-based monitoring dashboard provides comprehensive visualization of data for long-term analysis. This research contributes to the development of smart cities by providing an effective framework for air quality management, supporting data-driven decision-making, and increasing public awareness of environmental conditions. Keywords: Air Quality Monitoring. Automatic Alerts. Cloud Computing. IoT Sensors. Machine Learning INTRODUCTION In cities, where air pollution significantly affects public health and living conditions, air quality is a critical issue that demands immediate attention. Hawari et al. in their research on an Internet of Things (IoT)-based air quality monitoring system asserted that modern technology is needed to collect and analyze real-time data to address the complexity of air pollution. The system allows authorities to provide early warnings to the public about dangerous air conditions. Karnati . emphasized the urgency of the research by pointing out that the rapid growth of urban populations requires more effective and innovative air quality management systems. This research aims to develop technological solutions capable of overcoming the limitations of conventional systems through a comprehensive IoT approach, with a primary focus on real-time monitoring and predictive analysis Martillano et al. underscored the importance of communication in air quality monitoring systems, showing how the integration of notifications can improve public response to changes in air quality. The developed system does not simply track pollutants, but also provides valuable information that helps people make quick decisions regarding activities and health. Patil and Waghmare . further strengthened the argument by showing that modern IoT systems should be capable of continuous monitoring and sending automated alerts. This proactive approach is especially important in complex urban areas, where air quality can change rapidly due to various factors such as traffic, industrial activities, and weather conditions. As such, this research contributes to the development of technological solutions that can reduce health risks due to air pollution through smarter and more responsive monitoring. The implementation of automatic alert mechanisms is crucial for effective air quality management. Patil and Waghmare . proposed a smart IoT-based air quality monitoring system that not only tracks pollution levels but also sends automatic alerts to users, thereby promoting proactive measures against air quality deterioration . This proactive approach is essential in urban areas where air quality can change rapidly due to various factors, including traffic, industrial activities, and weather conditions. Furthermore. DOI: https://doi. org/10. 57152/malcom. ISSN(P): 2797-2313 | ISSN(E): 2775-8575 Yadav and Verma . highlighted the role of smart alerting systems in enhancing community responsiveness to air quality issues, emphasizing that timely notifications can lead to behavioral changes that reduce exposure to harmful pollutants . Research on IoT based air quality monitoring systems has experienced significant developments in recent years. Jabbar et al. introduced an IoT implementation system for remote air quality monitoring, which opens up new opportunities in environmental monitoring using cutting-edge technology. Their contribution provides an important foundation for the development of systems capable of collecting air quality data in a comprehensive and continuous manner. Furthermore. Alvear-Puertas et al. expanded the scope of the research by designing a portable and cost-effective device for air quality monitoring in urban Their approach shows the great potential of IoT technology in creating monitoring solutions that are not only accurate, but also easy to implement in various strategic locations. This is especially important given the growing complexity of air pollution problems in urban areas. Abimannan et al. made an innovative contribution by integrating edge computing and distributed learning into the air quality monitoring system. They emphasized the importance of smart data analysis and distributed computing capabilities to gain deeper and more comprehensive insights into air quality conditions. The comprehensive integration of IoT sensors, cloud computing, and machine learning algorithms allows the system to go beyond mere data collection. Through this approach, the research was able to generate accurate predictions of changes in air quality, which is an innovative contribution to the field of urban environmental monitoring. The main focus of the research is to develop a more responsive automated notification system, capable of providing early warnings to the public and stakeholders. Thus, the contribution of this research is not only technological, but also has a direct impact on efforts to protect public health and manage a smarter and more sustainable urban environment. In conclusion, the development of IoT-based air quality monitoring systems represents a significant advancement in environmental management. By providing real-time data and automatic notifications, these systems empower individuals and communities to take informed actions to protect their health and wellbeing. The ongoing research and development in this field continue to pave the way for smarter, more sustainable urban environments, as evidenced by the comprehensive frameworks and innovative solutions proposed in recent literature . and when cities around the world start to have air problems, then air quality monitoring tools will be needed. MATERIALS AND METHOD This study takes an experimental approach to explore how IoT technology can improve air quality monitoring in cities. It looks at how collecting real-time data, using various sensors, and sending automatic alerts can help communities respond more effectively to air quality changes. The focus is on testing different parts of the system, like sensors that measure pollutants such as PM2. PM10. CO2, and NO2, communication modules that send data, and notification systems that alert users when pollution levels become unhealthy. Data will be gathered from these sensors placed around the city to track pollution at different times and locations. This information will then be analyzed in the cloud, with alerts sent automatically if pollution exceeds preset limits. The research involves using air quality sensors, cloud platforms for analysis, and mobile apps to notify users. Dataset This dataset offers valuable information on air quality by focusing on the detection of pulses commonly found in various urban locations. This data is collected from IoT sensors that continuously monitor pollutant levels in real-time. During a minimum 1-day experiment, this dataset can evaluate important air quality metrics, including PM2. PM10. CO2, and NO2. Each entry also includes an air quality index (AQI) classification based on PM2. 5 readings and indicates whether alerts were triggered when certain thresholds were exceeded and not within reasonable limits. AQI categories and their corresponding PM2. concentrations and global air quality frequency distribution . can be seen in Table 1 and Figure 1. Table 1. AQI Categories and Their Corresponding PM2. 5 Concentrations . AQI Category PM2. 5 Concentration (AAg/mA) Good PM2. 5 O 12 Moderate 1 - 35. Unhealthy for Sensitive Groups 5 - 55. Unhealthy 5 - 150. Air Quality Description Air quality is considered satisfactory, and air pollution poses little or no risk. Air quality is acceptable. however, some pollutants may be a concern for a few sensitive individuals. Members of sensitive groups . , children, elderly, those with respiratory condition. may experience health effects. Everyone may begin to experience health effects, and members of sensitive groups may experience more serious effects. MALCOM - Vol. 5 Iss. 3 July 2025, pp: 776-787 MALCOM-05. : 776-787 Very Unhealthy PM2. 5 Concentration (AAg/mA) 5 - 250. Hazardous PM2. 5 > 250. AQI Category Air Quality Description Health alert: everyone may experience more serious health effects. Health warning of emergency conditions: the entire population is more likely to be affected. Source: Adapted from . Figure 1. Global Air Quality Frequency Distribution . Source: . Proposed Method The experiment began with the deployment of air quality sensors at various locations to collect realtime data on pollutants such as PM2. PM10. CO2, and NO2. The data acquisition module collects this data and sends it to the data processing unit for initial filtering and preprocessing. Once the data is processed, it is stored in the cloud storage system, making it accessible for further analysis and long-term storage. This system ensures continuous collection of air quality data over time, thus creating a comprehensive data set for monitoring air pollution levels in the area. Once the data is stored in the cloud, a data analysis engine takes over to analyze the collected data. calculates the AQI and detects trends by applying machine learning algorithms that predict future air quality based on historical and current data. The system conducts regular air quality checks to compare pollutant levels with predetermined thresholds, determining whether the air quality is still within acceptable limits or is already dangerous. If the pollutant levels exceed these thresholds, the system will trigger an alert to notify relevant stakeholders and the public. The last stage of the system is the alert and notification process. When the pollutant level exceeds the safe threshold, the system updates the dashboard and sends notifications through various channels, including SMS, mobile app alerts, and email notifications. These alerts are displayed on a web dashboard, providing real-time air quality information to city officials, environmental agencies, and the public. The system ensures continuous monitoring and timely notifications, thus helping users take necessary precautions when air quality becomes hazardous. This methodology is presented as a comprehensive framework in the following flowchart in Figure 2. Real-time Air Quality Data Acquisition and Sensor Integration The integration of IoT sensors in real-time air quality monitoring systems plays an important role in ensuring accurate and continuous data collection. IoT sensors such as gas sensors ( CO2. NO2. O3. PM2. temperature, and humidity sensors are deployed at strategic locations to capture environmental data. The raw data obtained from these sensors is then transmitted to a cloud platform for processing and storage. This enables real-time monitoring of air quality over a wide geographical area, providing invaluable insights into air pollution levels and its impact on public health . The sensors used in these systems must have characteristics such as accuracy, response time, and optimal power consumption to ensure overall system performance. For example. MQ series gas sensors are often used to detect various gases such as carbon dioxide and nitrogen dioxide. These sensors convert chemical concentrations into measurable electrical signals . Likewise, the PMS5003 particle sensor is widely used to detect the concentration of PM2. 5 and PM10 particles in the air, which are important indicators of air quality in urban areas . The sensors need to be integrated seamlessly with microcontroller units (MCU. or single-board computers (SBC. , such as Raspberry Pi or Arduino, which facilitate the communication between the sensors and the cloud. This integration ensures that data is captured in real-time and transmitted using Internet of Things Based Air Quality Monitoring System with. (Azizah et al, 2. ISSN(P): 2797-2313 | ISSN(E): 2775-8575 communication protocols such as Wi-Fi. LoRa, or ZigBee. As seen in several implementations. MQTT (Message Queuing Telemetry Transpor. is commonly employed for lightweight, real-time messaging in IoT systems, allowing efficient data transmission with minimal delay . Figure 2. Real-Time Air Quality Monitoring and Alert System Workflow The quality of data acquisition is significantly influenced by the calibration of sensors to reduce drift and enhance measurement accuracy. In practice, the integration process involves multiple steps, including sensor calibration, data filtering, and pre-processing, before transmitting the data to the cloud. For example, the data may be processed through noise reduction algorithms to eliminate erroneous readings or irrelevant fluctuations that might arise from environmental factors such as wind or rain. This step ensures that the data sent to the cloud is both precise and reliable for further analysis. Once the data is pre-processed and cleaned, it is transmitted to a cloud platform for storage and further Cloud platforms like AWS. Microsoft Azure, or Google Cloud offer scalable solutions to store large amounts of environmental data. These platforms also allow the integration of machine learning models, which can process the data and predict future air quality levels. Time-series forecasting techniques, for example, can be used to predict air quality trends, helping anticipate pollution spikes and initiate necessary interventions . The key advantage of this real-time data acquisition approach is the continuous monitoring of air quality in multiple locations, providing accurate and up-to-date information to stakeholders. Additionally. IoT-based air quality monitoring allows for flexible deployment in urban areas, where air quality can fluctuate dynamically over time . Integration with mobile applications and web dashboards ensures stakeholders, including government agencies and the general public, stay informed about air quality conditions in real-time. Key components in this layer include: Sensor Calibration: Ensures that sensors provide accurate and reliable readings by calibrating sensors against known standards . Real-time Data Transmission: Uses communication protocols such as MQTT or HTTP to transmit data to the cloud . Data Pre-processing Methods: Filtering and cleaning data to remove noise or inconsistencies caused by environmental factors . MALCOM - Vol. 5 Iss. 3 July 2025, pp: 776-787 MALCOM-05. : 776-787 Cloud Integration: Storing data on a scalable cloud platform and using machine learning models to analyze and predict air quality levels . Power Management: Ensuring that sensor nodes are energy-efficient, especially when installed in remote areas that do not have direct electrical power sources . Table 2. Parameters for Sensor Integration and Data Acquisition Parameter Sensor Type Data Transmission Protocol Communication Frequency Data Preprocessing Method Cloud Platform Battery Life Power Consumption Sampling Rate Sensor Calibration Data Storage Communication Protocols Latency Machine Learning Integration Environmental Adaptability Setting MQ Series. PMS5003. DHT11 (Temperature and Humidit. MQTT. HTTP 1 minute, 5 minutes Noise Filtering. Calibration AWS. Azure. Google Cloud 1-2 years Low (Sensor Power: 5-10mA) 1 sample per minute Manual calibration against known gas concentrations Cloud (Scalable solutions for large dataset. Wi-Fi. LoRa. ZigBee Low (Real-time transmission with minimal dela. Time-Series Forecasting. Air Quality Prediction Models Ability to handle fluctuations from wind, rain, etc. Parameters in the table 2 ensure that the system operates efficiently and effectively, with minimal human intervention. By integrating multiple sensor types and employing real-time data processing techniques, the IoT-based air quality monitoring system provides a robust and scalable solution to track and analyze environmental pollutants. IoT-Based Air Quality Monitoring System The IoT-Based Air Quality Monitoring System is designed to tackle the growing issue of air pollution in urban environments. The system utilizes a network of IoT sensors placed at strategic locations throughout the city to measure various pollutants such as PM2. PM10. CO2, and NO2. The data collected from these sensors is transmitted to a cloud platform for processing and analysis, enabling real-time monitoring of air quality conditions. Data Collection Each data point collected by the IoT sensors is represented by the notation . cu1, yc1 ), where i = 1, 2, 3,. ,n indicates the total number of data points collected. The available data is denoted as ycuEycn A ycIycc , where ycuycn = { ycuycn1 , ycuycn2 , ycuycn3 ,. , ycuycnyc }represents the features for data point i, and the class label yc1 A . , . ,where 0 indicates unhealthy air quality and 1 indicateds acceptable air quality. yaycaycycaycaycoycuycycc = c (Sensor Dat. This equation represents the data collected by the sensors being transmitted to the cloud for further Data Processing AQI Once the data is received in the cloud, the next step is to calculate the AQI, which is based on the concentration of pollutants such as PM2. PM10. CO2, and NO2. This function computes the AQI based on the detected pollutant levels: Where g is the function that combines the pollutant values to produce the AQI, which reflects the air AQI Ae yci(PM2,5,PM10,CO2,NO. Alert Mechanism If the AQI exceeds a predefined threshold, an alert is triggered. This mechanism can be described by the following equation 3. 1 ycnyce yaycEya > ycNEaycyceycEaycuycoycc Alert = { 0 ycnyce yaycEya O ycNEaycyceycEaycuycoycc Internet of Things Based Air Quality Monitoring System with. (Azizah et al, 2. ISSN(P): 2797-2313 | ISSN(E): 2775-8575 Where the Threshold is the AQI value that has been set to determine whether the air quality is unhealthy and needs attention. To ensure the effectiveness of the IoT-based air quality monitoring system, several key components must be integrated. First, sensor calibration plays a crucial role in ensuring that the sensors provide accurate and reliable readings by calibrating them against known standards . Additionally, the system relies on real-time data transmission, using communication protocols such as MQTT or HTTP to transmit sensor data to the cloud . Once the data is collected, data pre-processing methods are employed to clean and filter the data, removing noise or inconsistencies caused by environmental factors . The processed data is then stored and analyzed on a cloud platform, which is scalable and supports the use of machine learning models to predict air quality levels. Furthermore, power management is essential to ensure that sensor nodes are energy-efficient, especially when deployed in remote locations without direct electrical power sources. With this architecture, the system can continuously monitor air quality across multiple locations, providing stakeholders such as government agencies and the general public with real-time updates through mobile applications and web dashboards. By integrating these components, the system can function effectively, providing timely and accurate data, while also enabling quick responses to changes in air quality conditions. Weighted Class (WC) The Weighted Class (WC) approach is a widely used technique to mitigate the issue of class imbalance, which is prevalent in many datasets, including those related to environmental monitoring, such as air quality assessment systems. This method involves assigning specific weights to each class, ensuring that the model accounts underrepresented classes. The weight for each class is determined by computing the median of the class frequency distribution and dividing it by the class frequency. The formula for the weight ycyca of class c is given by equation 4. ycyca = Ocycn1 ycuycnOe yca ycu ycu Oeyc. uycn1 ycn ycu Where ycyca is the wight for class c . Oc ycuycn is the sum of samples in class c and the median is applied ycn1 to the distribution of all class frequencies . This weighted approach helps to balance the influence of each class during training, making the model more robust to imbalanced class distributions, thus improving prediction accuracy for underrepresented classes in the context of air quality monitoring systems. Confusion Matrix To assess the performance of the classification model, the Confusion Matrix is used. It provides detailed insight into the modelAos ability to classify correctly and detect misclassifications. Accuracy is calculated using the formula 5. Acc = ycNycE ycNycA ycNycE ycNycA yaycA yaycE In the context of classification performance evaluation, various metrics can be calculated using four fundamental counts from a confusion matrix. True Positive (TP) represents the number of positive instances correctly identified as positive by the model, while True Negative (TN) counts the negative instances correctly classified as negative. False Positive (FP), also known as Type I error, occurs when the model incorrectly predicts a negative instance as positive. Conversely. False Negative (FN), or Type II error, happens when the model fails to identify a positive instance and classifies it as negative. This matrix helps evaluate how well the model differentiates between actual and predicted labels, particularly in cases of imbalanced data, which is common in environmental monitoring applications . The confusion matrix for air quality prediction might look like the Table 3. Table 3. Confusion Matrix for Air Quality Prediction Label/Class ACTUAL (Targe. Positive (P) Negative (N) PREDICTED (Outpu. Positive (P) True Positive (TP) False Positive (FP) Using the confusion matrix, we can understand model performance and identify potential areas for improvement, especially in terms of sensitivity and specificity for environmental data . By incorporating techniques like WC. DA, and using evaluation metrics such as the confusion matrix, this research improves MALCOM - Vol. 5 Iss. 3 July 2025, pp: 776-787 MALCOM-05. : 776-787 the accuracy and robustness of IoT-based air quality monitoring systems. These methods are fundamental in real-time applications, where sensor data can be noisy, imbalanced, and require constant adaptation to changing environmental conditions . RESULTS AND DISCUSSION This section consists of modeling, evaluation, comparison, and discussion. Modeling The modeling framework for the IoT-based air quality monitoring system is designed to effectively address the challenges of real-time air quality assessment in urban environments. This framework includes several critical components: data collection, data processing, alert mechanisms, and machine learning integration, all aimed at providing accurate and timely information to stakeholders for informed decisionmaking. Data Collection The first step in the modeling process is the collection of air quality data from a network of IoT sensors that are strategically deployed throughout the city. These sensors measure various pollutants such as PM2. PM10. CO2, and NO2, as well as environmental parameters like temperature and humidity. The data collected is time-stamped and location-based, which helps in continuous, real-time monitoring of air quality across urban areas. The sensors used in this system include at table 4. Table 4. Data Collection for IoT sensors Pollutant PM2. PM10 CO2 NO2 Temperature Humidity Measurement Unit AAg/mA AAg/mA AC Description Particulate matter with a diameter of 2. 5 micrometers or less. Particulate matter with a diameter of 10 micrometers or less. Carbon dioxide concentration in parts per million. Nitrogen dioxide concentration in parts per billion. Ambient temperature. Relative humidity percentage. The data collected in Table 4 is represented as a dataset D, where each data point consists of pollutant concentrations and environmental conditions at a specific time. This structured data allows for comprehensive monitoring of air quality across different locations and times, enabling accurate and up-todate analysis (Chen & Li, 2. Data Processing AQI Once the data is collected, it undergoes processing to calculate the AQI. The AQI serves as a standardized measure of air quality, reflecting the potential health impacts of various pollutants. The AQI calculation combines the concentrations of pollutants into a single numerical value, which can then be categorized into different air quality levels . Good. Moderate. Unhealth. The AQI calculation process can be expressed as a function yci,where: AQI Ae yci (Concentrations of Pollutant. The function g uses established formulas and thresholds to convert pollutant concentrations into an AQI value. Once the AQI value is computed, it is categorized into one of the levels can be seen in the Table Table 5. AQI Categories and Corresponding Health Impacts AQI Category Good AQI Range 0 - 50 Moderate 51 - 100 Unhealthy for Sensitive Groups Unhealthy Health Impacts Air quality is considered satisfactory. Air quality is acceptable. some pollutants may affect sensitive individuals. 101 - 150 Members of sensitive groups may experience health effects. 151 - 200 Everyone may begin to experience health effects. Health alert: everyone may experience more serious health Health warning of emergency conditions. Very Unhealthy 201 - 300 Hazardous 301 - 500 Internet of Things Based Air Quality Monitoring System with. (Azizah et al, 2. ISSN(P): 2797-2313 | ISSN(E): 2775-8575 Machine Learning Integration To enhance the predictive capabilities of the air quality monitoring system, machine learning algorithms are integrated into the modeling framework. These algorithms analyze both historical and realtime data to forecast future air quality levels. The machine learning models use historical pollutant data, environmental conditions, and AQI data to predict future AQI values, which can help in anticipating poor air quality conditions and taking proactive measures. By leveraging machine learning techniques, such as time-series forecasting and regression analysis, the system becomes more robust in predicting air quality trends and potential pollution spikes. This allows authorities and the public to take preventative actions ahead of time, especially during pollution events like industrial emissions, wildfires, or urban traffic congestion (Gupta & Sharma, 2. System Architecture The overall architecture of the IoT-based air quality monitoring system is structured to facilitate seamless data flow and processing. The system is composed of several layers, each of which plays a critical role in ensuring the efficiency and reliability of the monitoring process. Figure 3. Wiring Air Quality Monitoring System The wiring mechanism of the IoT-based air quality monitoring system in Figure 3 facilitates smooth communication and data flow among its components. Sensors, including PM2. PM10. CO2, and NO2, collect air quality data and send it to the microcontroller unit (MCU) via MQTT and HTTP protocols. The cloud processes this data for cleaning. AQI calculation, and machine learning prediction, and stores the results in a database. An alert mechanism monitors the AQI, triggering notifications when thresholds are Finally, user interfaces, including web dashboards and mobile apps, provide real-time access to air quality information, improving public health and safety in urban environments. Performance Evaluation and Comparison The IoT-based air quality monitoring system described in this program utilizes various sensors to measure key pollutants such as PM2. PM10. CO2, as well as environmental parameters such as temperature and humidity. The system calculates the AQI and publishes the data through an MQTT broker for remote Below is an evaluation of the system's performance, which includes key aspects such as sensor accuracy, system efficiency, data reliability, and communication performance. In addition, a comparison with similar existing systems is also provided to highlight strengths and areas for improvement. In Figure 4, it can be seen that air quality monitoring screen display. Figure 4. Air Quality Monitoring Screen Display MALCOM - Vol. 5 Iss. 3 July 2025, pp: 776-787 MALCOM-05. : 776-787 The DHT22 sensor, used for measuring temperature and humidity, provides reasonable accuracy with temperature readings accurate to A0. 5AC and humidity measurements accurate to A2-5%. It operates within a broad temperature range of -40 to 80AC and a humidity range of 0-100%. While the DHT22 is generally reliable within these specified limits, its performance can degrade when exposed to extreme environmental For maintaining long-term reliability, calibration and proper placement are essential, particularly in environments with rapid temperature changes or high humidity levels. The PMS sensor, which measures particulate matter concentrations like PM2. 5 and PM10, offers good accuracy with a resolution of 0. 1 AAg/mA for PM2. 5 and an operating range of 0-1000 AAg/mA. Its performance, however, is heavily dependent on regular calibration. Over time, sensor drift may occur, potentially affecting the accuracy of the readings. The PM25_CALIBRATION_FACTOR and PM10_CALIBRATION_FACTOR are used to correct for this drift, but they require periodic verification to ensure optimal performance and reliable data. In Figure 5, it can be seen that PM2. 5 and PM10 Accuracy Charts. The MH-Z19 CO2 sensor, measuring CO2 concentrations between 0 to 5000 ppm with an accuracy of A50 ppm or A5% of the reading, is suitable for most indoor air quality monitoring applications. However, like the PMS sensor, the MH-Z19 may experience calibration drift over time. This drift necessitates periodic recalibration to ensure accurate CO2 readings over extended periods, particularly in environments where the sensor is in continuous use. Figure 5. PM2. 5 and PM10 Accuracy Charts To enhance the reliability of sensor data, the system employs a moving average technique to smooth the raw readings, especially for PM2. 5 and PM10. This helps to reduce the impact of transient fluctuations and noise, leading to more stable and reliable air quality assessments. Calibration factors, including those for temperature, humidity. PM2. 5, and PM10, are applied to further improve the accuracy of the sensor readings. However, despite these measures, periodic manual calibration is still recommended to account for sensor aging and ensure the long-term accuracy of the system. In Figure 6, it can be seen that Air Quality Accumulation Chart. Figure 6. Air Quality Accumulation Chart The system uses sensor readings from PM2. 5 and PM10 sensors to calculate the AQI, which is categorized into levels such as Good. Moderate, and Unhealthy. The AQI calculation is based on EPA standards, ensuring that the results conform to globally recognized air quality classifications. The use of well- Internet of Things Based Air Quality Monitoring System with. (Azizah et al, 2. ISSN(P): 2797-2313 | ISSN(E): 2775-8575 defined thresholds for classification ensures that AQI values are meaningful and provide a reliable indicator of air quality. To further improve data accuracy, the system incorporates moving averages to smoothen sensor readings, preventing temporary spikes in particulate matter concentrations that could misrepresent AQI This makes AQI calculations more stable and reliable over time. Figure 7. Currents Reading of IoT Based Air Quality Monitoring System In Figure 7, the IoT-based air quality monitoring system uses the ESP32 microcontroller, which is energy efficient, especially in low-power mode, thus enabling long-term use. Although power consumption increases during Wi-Fi and MQTT data transmission, the system collects sensor readings every 2 seconds and sends data to the MQTT broker every 30 seconds, thus optimizing power usage and real-time updates. The system's 2-second data sampling interval provides detailed air quality monitoring, while the 30-second publication interval balances efficient data transmission and network load. Communication relies on Wi-Fi, offering sufficient bandwidth in urban environments, with the MQTT protocol providing lightweight and efficient data transmission. Reconnection logic ensures automatic recovery from connectivity interruptions. However. Wi-Fi may not be ideal for remote areas with limited access, and alternative technologies are available. The system's LCD display provides real-time air quality updates, with clear AQI categorization, making it easy for users to monitor air quality on site. This feature, together with cost-effective sensors such as DHT22. PMS, and MH-Z19, makes the system suitable for urban air quality monitoring. While it excels in accuracy and efficiency, its reliance on Wi-Fi may limit its use in regions with unreliable connectivity. Figure 8. Bar Chart of Prediction and Reality Comparison In Figure 8 maximum accuracy performance in the model training process can often reach 100% for all trial options or methods used. However, the accuracy performance in the prediction process . sing all dat. generally shows better results compared to the testing or evaluation process. This indicates that the training data is able to provide optimal results for the model training process, so that the model can predict well on different data. CONCLUSION The integration of IoT technologies in air quality monitoring systems represents a transformative advancement in urban environmental management. This research has successfully proven that the implementation of real-time data collection, automatic warning mechanisms, and machine learning MALCOM - Vol. 5 Iss. 3 July 2025, pp: 776-787 MALCOM-05. : 776-787 algorithms can significantly improve the effectiveness of air quality monitoring, in accordance with the main objectives of the research. The analysis results confirm that although optimal accuracy is achieved during the training process, the predictive capability of the model shows substantial potential, enabling relevant authorities and the public to respond quickly to air quality fluctuations. In the context of the second research objective, this study identified that the Weighted Class (WC) approach significantly contributed to the improvement of accuracy in the testing and prediction process, emphasizing the urgency of addressing class imbalance in environmental datasets. However, in contrast to the initial hypothesis. Data Augmentation (DA) techniques did not result in the projected accuracy improvement, possibly due to the intrinsic characteristics of air quality data. These findings provide an empirical foundation for algorithm selection in future implementations of similar environmental monitoring The IoT-based air quality monitoring system developed through this research not only provides a comprehensive perspective on pollutant concentrations, but also empowers the public to take proactive steps in response to air quality alerts, fulfilling the third research objective of creating public-oriented applicative Further research should be directed at improving the system by integrating more diversified sensor technologies, expanding the geographical coverage of the monitoring network, as well as developing more sophisticated predictive algorithms capable of accommodating seasonal variability and climate change In addition, exploration of methodologies for intensification of community engagement through optimized user interfaces and personalized notification systems will strengthen the practical implementation of these technologies. Longitudinal studies on the impact of the system on public health and policy formulation are also prospective directions for further research. REFERENCES