AI‑Driven IoT Framework for Real‑Time Air Quality Monitoring
and Stress Correlation Analysis
R. Manikandan, Gobinath G., Gokul G. and Boobalan D.
Department of Computer Science and Engineering, Nandha Engineering College (Autonomous), Erode, Tamil Nadu, India
Keywords: PM2.5, CO2, IOT, Stress, AI‑driven.
Abstract: Burden, air pollution, and stress in homes, offices, and urban settings. This project strikes at the nexus between
environmental monitoring and mental health, given that air pollution is a significant global challenge, it has
far-reaching implications on physical and mental health. The negative effects of poor air quality on the
respiratory and cardiovascular systems are by now well established, but the same cannot be said for the impact
of its phytotoxicity on the psyche, especially in real-time, localized contexts. Here, we put forward an AI-
driven IoT framework for real-time air quality monitoring and stress prediction, which provides users with
actionable intelligence without requiring any manual input. The system is a combination of low-cost IoT
sensors (PM2. 5, CO2) using an ESP32 microcontroller to acquire data from the environment in real time and
transmit it to a backend hosted in the cloud for analysis. It uses a machine learning model trained on a dataset
with information linking air pollution and metrics of stress to predict stress, based on current pollution levels.
The anticipated stress levels, along with air quality data, are shown on a mobile app, which also provides
recommendations tailored to the user (for instance, “Open windows,” “Avoid outdoor activities”) and issues
alerts when air quality worsens or stress levels are expected to increase. Utilizing the advances in artificial
intelligence according to Internet of Things this system provides a scalable solution for monitoring the both
contributing towards smart health technologies and promote living in sustainable way.
1 INTRODUCTION
Air pollution is one of the biggest global challenges
we are facing nowadays and its adverse effects on
physical health have been well-studied 1(Neeraja et.,
al.2024). However, its psychological effects,
including increased stress, stress and cognitive decline
are largely ignored especially at real time context
studies of localized level 9. Air quality monitoring
with a focus on environmental parameters is not a new
concept, although its study from the point of view of
mental well- being is relatively unexplored 3. To
mitigate this gap, this project proposes an AI- driven
IoT framework that enables the continuous monitoring
of the air quality in real-time and cross-relates it with
the stress levels, providing insights without taking up
manual user efforts.
The proposed system uses inexpensive IoT sensors
(e.g., PM2. 3, (S. Subha et., al. 2024)) equipment and
ESP32 microcontroller to record your hyperlocal air
quality data 1[ 6. javascript:;]. This information is then
sent out to a cloud-based system which uses a machine
learning model that was previously fed historical
datasets connecting pollution levels and psychological
stress to predict user well-being 2. The system is built
with seamless usability by automating stress
detection, providing alerts and recommendations
through a mobile interface in real-time. For example,
declining air quality will send alerts such as “High
PM2. 5 detected air out,” while predictive stress
analytics encourage proactive measures such as “Take
a break stress likely to peak in 30 minutes” 7.’
Three Hurdles in Solutions Addressed by this
Innovation: Proactive Health Monitoring: An AI 2.
Scalable deployment 1: Uses easy to purchase
commercial hardware. Disciplinary Infraction:
Leverages environmental science with mental health
analytics for holistic well-being 3.
This framework not only enables seamless
integration of
IoT, AI, and user-centric design in
smart health technologies, but also sets a new
benchmark in various application domains, including
urban planning, workplace wellness, and community
health programs 4[2]. IoT Sensor and Cloud-Based
Analytics Fusion: for Hyper-Local Air Quality
Monitoring
1(Neeraja et., al.2024).
Manikandan, R., G., G., G., G. and D., B.
AI-Driven IoT Framework for Real-Time Air Quality Monitoring and Stress Correlation Analysis.
DOI: 10.5220/0013892200004919
Paper published under CC license (CC BY-NC-ND 4.0)
In Proceedings of the 1st International Conference on Research and Development in Information, Communication, and Computing Technologies (ICRDICCT‘25 2025) - Volume 3, pages
87-92
ISBN: 978-989-758-777-1
Proceedings Copyright © 2025 by SCITEPRESS Science and Technology Publications, Lda.
87
Stress Correlation Analysis: Predicts level of stress
based on pollution data using machine learning 2.
Actionable Insights: Provides tailored suggestions
and alerts through a mobile application 7.
2 RELATED WORKS
2.1 Real-Time Air Quality Monitoring:
A Smart IoT System Using Low-
Cost Sensors and 3D Printing
This work has designed a portable air quality station,
contained in a 3D-printed case, with the aim of
simplifying data collection and reducing material
usage in an experimental laboratory. As for air
contaminants and gases of concern, with implications
for susceptible populations (e.g., asthmatics and
children), this breakthrough holds great promise for
public health. Regarding the role of indoor
ventilation, as pointed out by the COVID-19
pandemic, which causes the infection through
airborne particles, the importance of effective
surveillance and preventive measures cannot be
overstated. The station is based on open-source
Python software, a Raspberry Pi core data
collection/storage platform interfacing through
GPIO, serial, and I2C interfaces with the sensors. The
device is structurally modular so that measurements
and target pollutant can be modified by the user.
Validation with end-user testing established the
effectiveness and usability of the system in real world
applications. The mobile infrastructure provides a
low-cost alternative for air quality network
development to meet the needs of
disadvantaged/vulnerable communities. The module
exhibited a high reliability of 95.30% in identifying
ubiquitous pollutants, confirmed by CO2 level
assessment in classrooms (90.47% reliability (Osa-
Sanchez and B. Garcia-Zapirain, 2025). in
comparison to commercially available devices) and
by air quality assessment in the air in the environment
(85.63% reliability (Osa-Sanchez and B. Garcia-
Zapirain, 2025).
2.2 Mental Fitness Tracker using
Regression Models
Mental health is of considerable importance in human
health, and it has implications across many areas of
life. Yet, assessment and enhancement of mental
well-being is not a trivial matter as there are
numerous complexes, heterogeneous aspects. In this
work, we use artificial intelligence (AI) technology,
as a means to suggest a new mental health cognitive
tracking and enhancement. As a solution, mental
fitness tracker (MF tracker) is a web-based tool that
monitors and analyzes a symptomatic user's
behaviors, emotions, and mental state providing
information to the user from social media, wearable
devices, electronic surveys, and natural language
processing. Based on the data analysis, the program
provides users with personalized suggestions, advice
and action items in order to improve their mental
health. (P. Malin Bruntha et., al. 2024).
3 METHODOLOGY
The suggested system is constructed with the ability
to track real-time air quality as well as stress level by
leveraging an AI-enabled IoT environment. The
methodology is subdivided into 5 major stages in
order to guarantee an harmonized integration of
hardware, software and analytics. Figure 1 shows the
workflow.
Figure 1: Workflow.
3.1 Data Collection and Preprocessing
3.1.1 Predefined Dataset
Air Quality Data: The historical air quality data such
as PM2. 5 and CO₂ levels, which were extracted
from U.S. EPA AirData and OpenAQ API
(Osa-
Sanchez and B. Garcia-Zapirain
, 2025). 4. The
dataset consists of hourly data from different
locations, grouped
into air quality categories (AQI)
ranging from Good, Moderate, and Unhealthy.
ICRDICCT‘25 2025 - INTERNATIONAL CONFERENCE ON RESEARCH AND DEVELOPMENT IN INFORMATION,
COMMUNICATION, AND COMPUTING TECHNOLOGIES
88
Stress Based Data: Based on Air Quality metrics
Fake data set was generated to simulate modifies
stress level 1-5. For instance, PM2. Levels higher
than 50 µg/m³ were correlated with stress levels
higher than 3, in accordance with the well-established
relationship between pollution and mental health
well-being 2.
3.1.2 Data Preprocessing
Normalization: PM2. The 5 and CO₂ values were
standardized with Min-Max scaling to be consistent
across the dataset 5.
Handling of outliers: Interpolating techniques
were used to fill missing values while trying to
maintain the integrity of the data (J. Pellegrino et., al.
2025).
Feature Engineering: Additional features were
created based on the time of day (average measured
values for each hour, peak pollution valleys– e.g.:
morning peaks, day highs, etc.) to increase models’
accuracy 3.
3.2 AI Model Development
3.2.1 Stress Prediction Model
Data, Models and Procedures: In order to identify the
best algorithms, we used a Random Forest Regressor,
as they can handle non-linear relationships as well as
assess feature importance 2.
Training: 80% of the data was used for training
and the other 20% was kept for testing.
Hyperparameters such as n_estimators and
max_depth was optimized using Grid Search 2.
Evaluation: The R² score for the model was 0.78,
demonstrating a high accuracy level for predicting
stress levels from the air quality data 2.
3.2.2 Air Quality Classification
Algorithm: A Long Short-Term Memory (LSTM)
network was used for time-series forecasting of
PM2.5 trends (J. Rosa-Bilbao et., Al. 2025). (Neeraja
et., al.2024). Architecture: The model included two
LSTM layers (64 units each) with a dropout rate of
0.3 to prevent overfitting (J. Rosa-Bilbao et., Al.
2025). (Neeraja et., al.2024).
Training: The model was trained on 7 days of
historical data and validated on the next 24 hours,
achieving a Mean Absolute Error (MAE) of 0.45 (J.
Rosa-Bilbao et., Al. 2025). (Neeraja et., al.2024).
3.3 IoT System Integration
3.3.1 Hardware Setup
Sensors: MQ135 (CO₂), PMS5003 (PM2.5), and
DHT22 (temperature/humidity) were connected to an
ESP32 microcontroller (Osa-Sanchez and B. Garcia-
Zapirain, 2025). (J. Pellegrino et., al. 2025) (Neeraja
et., al.2024). Data Transmission: The ESP32’s Wi-Fi
module sent JSON payloads to the Firebase Realtime
Database every 60 seconds (J. Pellegrino et., al.
2025). (Neeraja et., al.2024).
3.3.2 Firmware Development
The firmware, developed in the Arduino IDE,
included error- handling mechanisms such as
recalibration loops for the MQ135 sensor (Osa-
Sanchez and B. Garcia-Zapirain, 2025). (J. Pellegrino
et., al. 2025). A watchdog timer was implemented to
ensure system stability during prolonged operation (J.
Pellegrino et., al. 2025). (Neeraja et., al.2024).
3.4 Mobile App Development
3.4.1 Platform
The mobile app was built using Thunkable, a no-code
platform, and integrated with Firebase for real-time
data synchronization (Aubakirov et., al. 2024) (K.
Ramar et., al. 2022).
3.4.2 Features
Real-Time Dashboard: Displays PM2.5, CO₂, and
predicted stress levels using intuitive gauges and line
charts (Aubakirov et., al. 2024) (K. Ramar et., al.
2022).
Notifications: Firebase Cloud Messaging (FCM)
sends alerts when PM2.5 exceeds WHO thresholds
(25 µg/m³) or stress levels are predicted to rise
(Aubakirov et., al. 2024) (K. Ramar et., al. 2022).
Recommendations: Rule-based logic provides
actionable feedback, such as “PM2.5 > 30 → ‘Close
windows’(Aubakirov et., al. 2024) (K. Ramar et., al.
2022).
3.5 System Evaluation
3.5.1 Performance Metrics
AI Model: Achieved a MAE of 0.45 for stress
prediction (
P. Malin Bruntha et., al. 2024). (Aubakirov
et., al. 2024) . IoT System: Demonstrated a latency of
less than 2 seconds for data transmission
(J. Pellegrino
AI-Driven IoT Framework for Real-Time Air Quality Monitoring and Stress Correlation Analysis
89
et., al. 2025). (Neeraja et., al.2024). User Feedback: A
pilot test with 20 users achieved 90% accuracy in
actionable recommendations (Aubakirov et., al.
2024) (K. Ramar et., al. 2022).
3.5.2 Statistical Validation
Pearson Correlation: A strong correlation (r = 0.65, p
< 0.01) was found between PM2.5 levels and stress
levels (P. Malin Bruntha et., al. 2024). (Aubakirov et.,
al. 2024).
ANOVA Test: Significant differences in stress
levels across air quality categories were confirmed (F
= 12.7, p < 0.001) (P. Malin Bruntha et., al. 2024).
(Aubakirov et., al. 2024).
3.6 Key Contributions
Real-Time Monitoring: Combines IoT sensors and
cloud- based analytics for hyper-local air quality
tracking [1] (J. Pellegrino et., al. 2025). (Neeraja et.,
al.2024).
Stress Correlation Analysis: Uses machine
learning to predict stress levels based on pollution
data (P. Malin Bruntha et., al. 2024). (Aubakirov et.,
al. 2024).
Actionable Insights: Delivers personalized
recommendations and notifications via a mobile app
(Aubakirov et., al. 2024). (K. Ramar et., al. 2022).
Table 1 represents the air quality index.
Table 1: Air Quality Index.
AIR QUALITY
INDEX
CATEGORY
0-50 Good
51-100 Satisfactory
101-200 Moderate
201-300 Poor
301-400 Very Poor
401-500 Severe
3.7 Random Forest Accuracy
Figure 2: Accuracy of Random Forest.
Figure 2 shows the Performance analysis of
regression models through score (coefficient of
determination) If signifies the response variable
(e.g., levels of stress) and the independent variables
(e.g., PM2. 5, CO2 levels).
The R² score of 0.78 shows that 78% of the
changing stress level can be accounted for by
changing air quality metrics (PM2. 5 and CO2). The
model's ability to explain high percentage of balance
reflects a successful representation of the relationship
between these environmental variables and
components of psychological wellbeing. (78% of
variation explained) and the remaining 22% could be
attributed to the othermodel components.
The closer the value is to 1, the better the
predictive power and vice-versa. The appropriateness
of this model for predicting associations between air
quality and stress is reflected in the score of 0.78,
showing that this AI-model is applicable toward the
monitoring and -real-time intervention of stress
(Fazel, Liu et al. 2020).
3.8 LSTM Model Accuracy
Figure 3: Accuracy of LSTM Model.
Figure 3 shows the mean absolute error is mean
absolute error or mae is a common loss function for
ICRDICCT‘25 2025 - INTERNATIONAL CONFERENCE ON RESEARCH AND DEVELOPMENT IN INFORMATION,
COMMUNICATION, AND COMPUTING TECHNOLOGIES
90
regression models and by assuming the assumption
that 50 gm is the true pm2 5 level this error indicates
the error for each blazer or block 5 pm2 5 reading a
lower mae indicates more accurate models because
the error of predicting.
The predicted pm2 5 mean error of the models to
the true pm2 5 reading equals 045-unit 50 gm
specifically in lst air quality large systems to monitor
air quality the maen is 045 during pm2 forecasting
during lst 50 gm was defined as the true pm2 5 level
with 045 degree meaning this was a significant degree
of power in the simulation architecture trend
senabling instantaneous interventions.
Such as alerts or recommendations when
pollution levels spike while all of the above methods
are significant for robust basic readings the
disadvantage is that neither are quite-high enough and
so not perfect for real-time use where the answer must
be checked for immediate use and hence they all need
a confirmation or a different precision to prospect the
state of the human.
4 EXPERIMANTAL RESULT
Figure 4: Predicted Vs Actual Stress Level.
Figure 4 shows the predicted vs actual stress level.
X-axis: Actual Stress Levels (1–5 scale, collected
from synthetic/user data).
Y-axis: Predicted Stress Levels (1–5 scale, output
by the Random Forest model).
Trend Line: A diagonal line (y = x) represents
perfect predictions.
Data points cluster closely around the trend line
indicating strong alignment between predicted and
actual valuesr 078 confirms that 78 of stress
variability is explained by air quality metrics pm25 co
Data on air quality only the measured data from april
114 2016 are selected for further analysis for example
the air quality data which includes pm25 pm10 and
aqi are shown in figure 5 to confirm the accuracy of
this air quality monitoring system another set of data
is taken from a well-known pm25 historical database
namely the young-0com 13data on air quality only
the measured data from april 114 2016 are selected
for further analysis for example the air quality data
which includes pm25 pm10 and aqi are shown in fig
5 to confirm the accuracy of this air quality
monitoring system another set of data is taken from a
well-known pm25 historical database namely the
young-0com 13, i.e., the Young-0.com .. (K. Zheng
et., al. 2016).
Figure 5: Air Quality Data.
5 FUTURE ENHANCEMENTS
5.1 Multimodal Mental Health
Correlation
It combines the data with wearables EG heart rate
monitors EEG headbands to measure.
Physiological indicators of stress. eg heart rate
variability brainwave patterns and air quality data for
more holistic evidence of mental health impacts.
Expand dataset for socioeconomic factors, eg
income levels occupation and behavioral data, eg
sleep patterns physical activity to help refine
predictions of stress personalized.
5.2 Personalized Recommendations
Recommendations use reinforcement learning based
on user habits to personalize user feedback eg, jog in
low population routes gamify.eg, offer reward points
for reduced carbon footprints etc. sustainable
behavior.
6 CONCLUSIONS
By integrating various ai and IOT technologies this
AI-Driven IoT Framework for Real-Time Air Quality Monitoring and Stress Correlation Analysis
91
project demonstrates how to monitor your
environment and improve your mental health in real-
time. It helps evaluate air quality data and correlate it
with moments of stress or anxiety using inexpensive
sensors an accurate stress prediction model has been
created and machine learning has significantly
improved with machine learning r 078 mae 045
suggesting that it is feasible as a scalable user-
friendly tool for proactive health management by
offering prompt preventative advice. Such as
ventilation alert ambient stress prevention
recommendations it enables individuals and
communities to address the twin problems of air
pollution and mental stress. Supporting new behavior
this cross-sector integration can thus cement IOT ai
innovation but simultaneously find solutions to some
of the concerns raised by the un sustainable
development goals multimodal data crafting AI
model complexity and global expansion in future
works can increase the coverage of the system and
allow it to be a necessary help in smart city
infrastructure the study spotlights the importance of
multifaceted solutions to modern-day health
challenges especially SDG 3 good health and well-
being and SDG 11 sustainable cities by presenting on
both mental and environmental health on equal
footing.
REFERENCES
A. Osa-Sanchez and B. Garcia-Zapirain, "Real-Time Air
Quality Monitoring: A Smart IoT System Using Low-
Cost Sensors and 3D Printing," in IEEE Journal of
Radio Frequency Identification, doi: 10.1109/JRFID.
2025.35418
J. S. A R, P. Malin Bruntha, D. S, R. G, K. A and B. C.
Mary M, "Mental Fitness Tracker Using Regression
Models," 2024 3rd International Conference for
Innovation in Technology (INOCON), Bangalore,
India, 2024, pp. 1-5,
doi: 10.1109/INOCON60754.2024.10512049.
J. Rosa-Bilbao, F. S. Butt, D. Merkl, M. F. Wagner, J.
Schäfer and J. Boubeta-Puig, "IoT-Based Indoor Air
Quality Management System for Intelligent Education
Environments," in IEEE Internet of Things Journal,
doi: 10.1109/JIOT.2025.3539886.
J. Pellegrino, H. Aziza, M. Guerin, P. Taranto, W.
Rahajandraibe and B. Ravelo, "Development of a
Multi- Sensor Mobile Device for Urban Air Quality
Monitoring at the Street Corner: The SMILE Project,"
in IEEE Access, vol. 13, pp. 14857-14871, 2025
doi:10.1109/ACCESS.2025. 3530145.
R. Mckenzie et al., "A Cost-Effective Air Quality
Monitoring System for the Global South," 2024 IEEE
International Humanitarian Technologies Conference
(IHTC), Bari, Italy, 2024, pp. 1-7,
doi: 10.1109/IHTC61819.2024.10855074.
A. Neeraja, C. M. Begum, K. V. Reddy, T. V. Smitha and
N. Neelima, "Revolutionizing Air Quality Forecasting
in Bengaluru with Advanced Machine Learning
Techniques," 2024 First International Conference on
Innovations in Communications, Electrical and
Computer Engineering (ICICEC), Davangere, India,
2024, pp. 16,
doi:10.1109/ICICEC62498.2024. 10808771.
A. Aubakirov, K. Makhanov, A. Issainova, N. Glazyrina,
B. Razkhova and D. Satybaldina, "An IoT-Based Air
Pollution Monitoring System for Smart City," 2024 4th
International Conference on Computer Systems
(ICCS), Hangzhou, China, 2024, pp. 156-161,
doi:10.1109/ICCS62594.2024.10795835
S. Subha, N.Mohankumar, A. S. Rao, A. Ayub Khan, I. M.
V and S. Murugan, "IoT's Role in Personalized Dietary
Support for Mental Health using RNN Model," 2024
Third International Conference on Electrical,
Electronics, Information and Communication
Technologies (ICEEICT), Trichirappalli, India, 2024,
pp. 1-6, doi: 10.1109/ICEEICT61591.2024.10718428.
A. Aubakirov, K. Makhanov, A. Issainova, N. Glazyrina,
B. Razkhova and D. Satybaldina, "An IoT- Based Air
Pollution Monitoring System for Smart City," 2024 4th
International Conference on Computer Systems
(ICCS), Hangzhou, China, 2024, pp. 156-161, doi:
10.1109/ICCS62594.2024.10795835
S. A, S. R. LB, S. K. E, K. Ramar, H. S and B. A,"Mental
Health Tracker Using Machine Learning," 2022
International Conference on Disruptive Technologies
for Multi-Disciplinary Research and Applications
(CENTCON), Bengaluru, India, 2022, pp. 11-14, doi:
10.1109/CENTCON56610.2022.10051248.
R. S. S, V. S, P. R and A. Shiny, "Stress Relief and Anxiety
Therapy Using AI," 2024 International Conference on
Power, Energy, Control and Transmission Systems
(ICPECTS), Chennai, India,2024, pp.1-6,
doi:10.1109/ICPECTS62210. 2024. 10780170.
M. Venkatesan, S. Pawar and P. Thorat, "Depression Level
Detection Using AI,"
2024 International Conference on
Intelligent Systems and Advanced Applications
(ICISAA), Pune, India, 2024, pp. 1-5, doi:
10.1109/ICISAA62385.2024.10828795.
K. Zheng, S. Zhao, Z. Yang, X. Xiong and W. Xiang,
"Design and Implementation of LPWA-Based Air
Quality Monitoring System," in IEEE Access, vol. 4,
pp.32383245,2016,
doi:10.1109/ACCESS.2016.2582153.
ICRDICCT‘25 2025 - INTERNATIONAL CONFERENCE ON RESEARCH AND DEVELOPMENT IN INFORMATION,
COMMUNICATION, AND COMPUTING TECHNOLOGIES
92