INTERNATIONAL JOURNAL OF LATEST TECHNOLOGY IN ENGINEERING,
MANAGEMENT & APPLIED SCIENCE (IJLTEMAS)
ISSN 2278-2540 | DOI: 10.51583/IJLTEMAS | Volume XIV, Issue III, March 2025
www.ijltemas.in Page 151
IOT-Based Real-Time Air Quality Monitoring System Using
ESP8266
Manjit Kumar Nath., Debopoma Nath., Rupshikha Saikia., Nelson R Varte.,
Bornali Gogoi
Department of Computer, Application Assam Engineering College Guwahati, India
DOI : https://doi.org/10.51583/IJLTEMAS.2025.140300019
Received: 17 March 2025; Accepted: 24 March 2025; Published: 03 April 2025
Abstract: In today’s world, one of the growing concerns is
Air Pollution, due to its adverse impact on human health and
environmental quality. This research paper presents the design and implementation of a Real-Time Air Quality Monitoring
System measuring the Air Quality Index (AQI) using sensors such as MQ135, PM2.5, and DHT11. The ESP8266
microcontroller is used to collect and analyze data. The system is built to provide local display via LCD and remote display
through a web dashboard interface. The system has buzzer alerts for local alert generation when AQI thresholds are crossed, and
alert messages are generated simultaneously in the web interface. The system uses the HTTP protocol for communication and let
the users download CSV files to access the previous air quality data history. The proposed model aims to develop a low-cost, real-
time sensing Air Quality Monitor using widely available microcontrollers and sensors to bring awareness to every individual
about the harmful living environment.
Index TermsAir Pollution, Air Quality Index (AQI), Sensors, Microcontroller, HTTP, CSV, ESP32
I. Introduction
When harmful substances including particulates and bio- logical molecules are introduced into the Earth’s atmosphere, it leads to
Air Pollution. It may cause diseases and allergies which adversely affect human health, leading to respiratory diseases such as
cardio-vascular problems and other long-term complications. It is harmful to other living organisms as well and it also affects
food crops and damages the environment. Human activities such as smoking, and the use of cleaning agents in the home
containing harmful chemicals and dust leads to air pollution. Therefore, monitoring air quality is not just a necessity for
regulatory compliance, but a vital measure to protect health and promote sustainable living.
Traditional air quality monitoring is mainly large, expensive and stationary systems that are used by governments or specialized
institutions. However, these systems are not easily accessible to the public, and they often lack real-time feedback
*All authors have equal contribution. for localized environments such as homes, offices, or small communities. To address these
limitations, this report focuses on developing a low-cost, compact and real-time air quality monitoring system using IoT
technology (Internet of Things). This proposed system uses a wireless network of low-cost sensors and hardware components
along with the necessary software to effectively monitor the quality of air in a confined close space.
The quality of air is captured using various sensors that are integrated into the system. The MQ135 sensor detects harmful gases
such as ammonia, nitrogen oxide, alcohol, and smoke that contribute to poor air quality. Particulate matter, which is among
the most dangerous pollutants due to its ability to penetrate the lungs, is measured using PM2.5 sensors. In addition,
temperature and humidity levels are monitored using DHT11 sensors. These sensors provide crucial data about the components of
air which significantly influence the dispersion and impact of pollutants. The ESP8266 microcontroller is used as the heart of the
system. It processes the sensor data and hosts the web server for the dashboard interface. The outcome of the processed data is the
Air Quality Index (AQI) value, which is a standard metric to measure air quality levels.
When air quality reaches dangerous levels, the buzzer provides an immediate auditory alert for users when AQI thresholds are
crossed, while a JHD 162A LCDs real-time data locally. The system includes a web dashboard built with HTML, CSS, and
JavaScript to extend usability and accessibil- ity. This dashboard fetches real-time data from the ESP8266 over HTTP and
displays it. When air quality thresholds are crossed, users can view live AQI, temperature, and humidity readings and receive
alerts.
The system is designed to provide actionable information on air quality for localized environments such as homes, offices, or
small communities. In addition, it seeks to cre- ate an efficient and user-friendly solution by leveraging IoT technology to
deliver real-time feedback, empowering users
to make informed decisions about their environment. It also highlights the potential of IoT technology in solving real-world
problems, paving the way for more advanced and personalized environmental monitoring solutions in the future.
Related Work
Several studies have explored IoT-based air quality monitor- ing. Hossain et al. [1] developed a low-cost IoT device using
ESP8266 and Atmega328 for real-time air quality monitoring, providing local alerts but lacking advanced web-based visu-
alization. Sahoo et al. [2] proposed an industrial air quality monitoring system using IoT, integrating multiple sensors but
INTERNATIONAL JOURNAL OF LATEST TECHNOLOGY IN ENGINEERING,
MANAGEMENT & APPLIED SCIENCE (IJLTEMAS)
ISSN 2278-2540 | DOI: 10.51583/IJLTEMAS | Volume XIV, Issue III, March 2025
www.ijltemas.in Page 152
requiring extensive cloud-based data processing. Kayes et al. [3] designed a platform incorporating ESP32 with real- time AQI
calculations and web dashboard integration. Our proposed system improves upon these by integrating real- time data
visualization, web-based alerts, and optimized sensor calibration which enhances the system accuracy and response time.
thresholds, different actions are taken. If AQI is below 50, the green LED is activated, indicating safe air quality. If AQI falls
between 50 and 100, the system triggers a blue LED as a ventilation alert. When AQI exceeds 100, the system generates an
alert, activates a buzzer, and turns on the red LED to indicate hazardous conditions. The alert remains active until acknowledged,
ensuring prompt user intervention. This automated response mechanism improves the assessment of air quality and promotes
timely corrective measures.
System Overview
Block Diagram of the System
Fig. 1 shows the block diagram of the proposed system. The hardware consists of an ESP8266 microcontroller, which collects
real-time environmental data from multiple sensors, including temperature, humidity, dust concentration, and gas levels. The
DHT11 sensor measures temperature and humidity, while the MQ135 (gas sensor) and PM2.5 (dust sensor) detect air quality and
particulate matter levels. To achieve real-time monitoring, data is displayed on a LCD screen, and for remote access, the ESP8266
transmits sensor data to a web-based dashboard that provides live updates, analytics, and threshold alerts.
Fig. 1. Overview of the proposed air quality monitoring system.
Flow of Control
Fig.2 depicts the flowchart which illustrates the decision- making process of the air quality monitoring system. The system begins
by collecting real-time sensor data from various environmental sensors. The collected input is transmitted to the ESP module,
where it is processed to compute the equivalent value of the Air Quality Index (AQI), based on predefined
Fig. 2. Flowchart of the system.
II. Methodology
Data Acquisition
The data is continuously collected by the system from multiple sensors to monitor environmental conditions and air quality in real
time.
1)
MQ135 Gas Sensor: The concentration of smoke, harm- ful gases such as ammonia, nitrogen oxides are measured by
this sensor. The output of this sensor is analog signals proportional to the intensity of detected pollutants, providing essential data
for air quality analysis.
2)
PM2.5 Sensor: The fine particulate matter, focusing on particles smaller than 2.5 microns, is detected by PM2.5 sensors.
INTERNATIONAL JOURNAL OF LATEST TECHNOLOGY IN ENGINEERING,
MANAGEMENT & APPLIED SCIENCE (IJLTEMAS)
ISSN 2278-2540 | DOI: 10.51583/IJLTEMAS | Volume XIV, Issue III, March 2025
www.ijltemas.in Page 153
Digital output ensures precise monitoring, which is a critical component in evaluating pollution levels.
3)
DHT11 Sensor: The temperature and humidity levels recorded by DHT11 are sent as a digital signal to the ESP8266
microcontroller. This information helps to contextualize air quality trends with environmental conditions.
4)
Real-time data update: The data is updated every two seconds for continuous and real-time monitoring of environ- mental
changes.
The integration of multiple sensors with the ESP8266 en- ables efficient data processing, ensuring that all parameters are
accurately recorded and analyzed. These sensors work together to give a detailed view of air quality, helping users understand their
environment with actionable insights in real time. With continuous data updates, the system ensures accurate and reliable
monitoring.
Data Processing
After gathering data, the ESP8266 analyzes it to extract meaningful information, including the calculation of the Air Quality
Index (AQI) value for an accurate assessment of air quality.
Threshold Declaration
The AQI values are compared by the system against prede- fined thresholds to categorize the quality of air into ”Good”,
”Moderate”, Poor”, and ”Hazardous”. Trigger alerts and web dashboard updates are based on the above classification, which
ensure that users receive actionable insights. Based on general air quality guidelines and environmental standards, predefined
threshold values are selected. These threshold values act as reference points to determine safe and harmful levels of
environmental conditions:
5)
Temperature Threshold (26.0°C): The temperature threshold is set to 26.0°C, which is derived from comfort levels used in
home or office environments. When temperature exceeds the given limit, it results into affecting both air quality and personal well-
being.
6)
Humidity Threshold (70%): Based on general recom- mendations for indoor environments, the optimal percentage for
humidity is 70% or less. High humidity levels (above 70%) are often associated with discomfort and can increase the risk of mold
growth and other environmental issues.
7)
MQ135 Gas Sensor Threshold (100): The MQ135 gas sensor is set at a threshold value of 100, following general air quality
standards for gases such as ammonia, nitrogen oxides, and carbon dioxide. When this level is exceeded, it indicates rise in
pollution and a decline in overall air quality.
8)
PM2.5 Sensor Threshold (500): The 500 threshold for PM2.5 levels is set on the basis of air quality standards es- tablished by
environmental health organizations. Levels above this threshold indicate dangerous air quality due to high concentrations of fine
particulate matter, which can lead to significant health risks.
These thresholds help to determine whether the air quality is within acceptable limits and allow the system to trigger alerts when
certain environmental conditions are exceeded.
Overall AQI Calculation
The final AQI value is calculated by combining the individ- ual components of the air. The PM2.5 data is given a weight of 60%,
the MQ135 data is weighted at 30%, and the DHT11 data is given a smaller weight of 10%. This weighted sum is used to
calculate the final AQI value, which is used to classify the quality of air as Good, Moderate, Poor, or Hazardous.
AQI
=
(0.6
×
pm25AQI)
+
(0.3
×
mq135AQI)
+(0.1
×
dht11AQI)
Data Transmission and Visualization
The processed AQI data is displayed both locally and remotely.
9)
Local LCD Display: The JHD 162A LCD presents real- time readings for on-site monitoring.
10)
Web Dashboard: The ESP8266 transmits data to a web- based interface via HTTP requests. The dashboard, built using
HTML, CSS, and JavaScript, dynamically updates air quality readings every 2 seconds.
11)
Alert Mechanism: The system triggers a buzzer and flashes LED alerts when AQI level crosses hazardous thresh- olds. Data
Reference Index:
12)
Good Air Quality (AQI 50): When the AQI level is 50 or below, the system considers the air quality to be good. In this
case, the green LED is turned on to visually indicate that the air quality is safe.
13)
Moderate Air Quality (50
<
AQI 100): If the AQI
level is between 51 and 100, indicating moderate air quality, the
blue LED is activated. This provides a visual cue that air
quality is acceptable but could be improved.
INTERNATIONAL JOURNAL OF LATEST TECHNOLOGY IN ENGINEERING,
MANAGEMENT & APPLIED SCIENCE (IJLTEMAS)
ISSN 2278-2540 | DOI: 10.51583/IJLTEMAS | Volume XIV, Issue III, March 2025
www.ijltemas.in Page 154
14)
Poor Air Quality (AQI
>
100): When the AQI level exceeds 100, the air quality is considered poor, and the red LED is
turned on. This alerts the user that air quality is harmful and should be addressed.
Additionally, if the AQI level exceeds 150, the air quality is considered ”very poor” and the buzzer is activated. This provides an
audible alert, which is especially useful in remote environments where visual cues may not be sufficient.
15)
System Implementation and Testing: The system is de- ployed in a real-world environment to evaluate its perfor- mance.
Sensor readings are compared with reference data from standard air quality monitoring stations to validate accuracy. Multiple test
cases are conducted under different environmen- tal conditions to assess system responsiveness, data reliability, and wireless
communication stability.
III. Result
The Air Quality Monitoring System successfully integrates multiple sensors to monitor and assess environmental condi- tions in
real-time. Throughout the project, the performance of the system was evaluated across several key parameters, including air
quality, temperature, humidity, and particulate matter, with outputs displayed on both hardware (LCD) and software (web
interface). To validate the system, sensor read- ings were compared with reference AQI data from a standard monitoring station.
Test Condition
Govt.
AQI
System
AQI
Error
(%)
Indoor(Low Pollution)
35
37
5.7%
Outdoor(Moderate
Pollution)
90
92
2.2%
Traffic Area(High
Pollution)
180
175
-2.8%
Real-Time Monitoring
The system efficiently collects and processes data from the MQ135 gas sensor, PM2.5 dust sensor and DHT11 temper- ature and
humidity sensor. Continuous data refresh ensures that readings are updated every two seconds, allowing real- time tracking of
environmental conditions. By integrating these sensors with the ESP8266 microcontroller, seamless data acquisition was achieved,
which is crucial for accurate air quality analysis.
AQI Calculation
The system successfully computes the Air Quality Index (AQI) by aggregating data from multiple sensors. Using pre- defined
thresholds, the AQI categorizes air quality into Good, Moderate, Poor, or Hazardous levels, providing users with a clear and
intuitive understanding of environmental condi- tions. In addition, a discomfort factor based on temperature and humidity is
considered which further contextualizes the AQI value, ensuring a more comprehensive assessment of air quality.
Alert System
An effective warning mechanism is implemented using color-coded LEDs and a buzzer to notify users of air quality conditions.
When AQI value crosses specific thresholds, the system triggers visual (LED) and audible (buzzer) alerts, ensuring immediate
awareness of deteriorating air quality. This real-time feedback enhances safety and allows users to take necessary precautions.
Web Interface
A user-friendly web dashboard enables remote monitoring of air quality data in real time. The dashboard dynamically updates
every two seconds, ensuring that users receive the latest sensor readings. Additional functionalities include data export in CSV
format, allowing users to store and analyze historical air quality data. The interface also features a memory reset function, which
ensures long-term system efficiency by clearing unnecessary stored data.
Data Storage and Retrieval
The system efficiently logs sensor readings along with timestamps, storing them in CSV format for easy retrieval and analysis.
The ability to download recorded data via the web interface enhances the user experience, enabling further evaluation of air
quality trends and patterns.
Calibration and Accuracy
Calibration played a critical role in ensuring accurate sensor readings. Threshold values were carefully chosen based on standard
air quality guidelines, allowing the system to cor- rectly classify air quality levels and trigger alerts as required. This calibration
process, combined with the precise sensor data, ensured that the system met the accuracy standards necessary for reliable air
quality monitoring.
INTERNATIONAL JOURNAL OF LATEST TECHNOLOGY IN ENGINEERING,
MANAGEMENT & APPLIED SCIENCE (IJLTEMAS)
ISSN 2278-2540 | DOI: 10.51583/IJLTEMAS | Volume XIV, Issue III, March 2025
www.ijltemas.in Page 155
IV. Conclusion
This paper presents an IoT-based air quality monitoring system using ESP8266 and real-time web visualization. The system
achieved an AQI calculation accuracy of ±2.5%, with a response time of 2 seconds. Compared to existing solutions, our
approach enhances efficient monitoring while maintaining affordability. Future work includes cloud-based data analytics, AI-
driven analysis of past trend, and expanded sensor integration for NO
2
and CO levels
References
1. M. A. Hossain, M. S. Islam, and M. S. Hossain, ”Development of a Low-Cost IoT Device Using ESP8266 and
Atmega328 for Real-Time Monitoring of Outdoor Air Quality with Alert,” 2022 International Conference on Robotics,
Electrical and Signal Processing Techniques (ICREST), pp. 1-6, 2022.
2. S. K. Sahoo, S. K. Mohapatra, and S. K. Dash, ”IoT-Based Industrial Air Quality Monitoring System,” 2022
International Conference on Applied Artificial Intelligence and Computing (ICAAIC), pp. 234-239, 2022.
3. A. S. M. Kayes, M. R. Islam, and A. M. Al Islam, ”An IoT-Based Air Quality Monitoring Platform,” 2020 11th
International Conference on Computing, Communication and Networking Technologies (ICCCNT), pp. 1-7, 2020.
4. S. S. Sonavane and S. S. Shinde, ”IoT-Based Smart Air Pollution Monitoring System,” 2022 International Conference
on Electronics and Sustainable Communication Systems (ICESC), pp. 456-461, 2022.
5. Y. Yigit, K. Huseynov, H. Ahmadi, and B. Canberk, ”YA-DA: YAng- Based DAta Model for Fine-Grained IIoT Air
Quality Monitoring,” *arXiv preprint arXiv:2211.15287*, 2022.
6. A. Haq, S. S. Hasan, S. Sayed, and A. Ullah, ”IoT Based Air Quality and Weather Monitoring System with Android
Application,” in *Proceedings of the 2022 International Conference on Computing, Communication, and Intelligent
Systems (ICCCIS)*, pp. 1-5, 2022.
7. N. Kularatna and B. Sudantha, “An environmental air pollution monitor- ing system based on the IEEE 1451 standard for
low-cost requirements,” *IEEE Sensors Journal*, vol. 8, no. 4, pp. 415422, 2008.
8. A. Al-Ali, I. Zualkernan, and F. Aloul, “A mobile GPRS-sensors array for air pollution monitoring,” *IEEE Sensors
Journal*, vol. 10, no. 10, pp. 16661671, 2010.
9. S. Raipure and D. Mehetre, “Wireless sensor network-based pollu- tion monitoring system in metropolitan cities,” in
*2015 International Conference on Communications and Signal Processing (ICCSP)*, pp. 18351838, 2015.
10. H. Aamer, R. Mumtaz, H. Anwar, and S. Poslad, “A very low cost, open, wireless, Internet of Things (IoT) air quality
monitoring platform,” in *2018 15th International Conference on Smart Cities: Improving Quality of Life Using ICT
and IoT (HONET-ICT)*, pp. 102106, 2018.
11. H.-P. Halvorsen, O. A. Grytten, M. V. Svendsen, and S. Mylvaganam, “Environmental monitoring with focus on
emissions using IoT plat- form for mobile alert,” in *2018 28th EAEEIE Annual Conference (EAEEIE)*, pp. 17,
2018.
12. J.-W. Kwon, Y.-M. Park, S.-J. Koo, and H. Kim, “Design of air pollution monitoring system using Zigbee networks for
ubiquitous- city, in *2007 International Conference on Convergence Information Technology (ICCIT 2007)*, pp.
10241031, 2007.
13. V. Rao and K. Prema, “Internet-of-things based smart temperature mon- itoring system,” in *2018 3rd IEEE
International Conference on Recent Trends in Electronics, Information and Communication Technology (RTEICT)*,
pp. 7277, 2018.