Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Air Quality - Report

Download as pdf or txt
Download as pdf or txt
You are on page 1of 62

A

PROJECT REPORT
on

IOT Based Air Quality Monitoring System


In partial fulfilment of the requirement of the Minor Project

Submitted by,
ANUSHKA PATIL
AKANKSHA ANUSE
ADITYA PANDAV

BACHELOR OF TECHNOLOGY
in
COMPUTER SCIENCE AND ENGINEERING
(Internet of Things and Cyber Security including Blockchain Technology)

ANNASAHEB DANGE COLLEGE OF ENGINEERING AND TECHNOLOGY

ASHTA

JULY 2024
A
Project Report
on
IOT Based Air Quality Monitoring System

Submitted to

Department of Computer Science and Engineering


(Internet of Things and Cyber Security including Blockchain Technology)
Annasaheb Dange College of Engineering and Technology
Ashta, Sangli
(An Autonomous Institute Afflited to Shivaji University Kolhapur)
by
Miss. Akanksha Anuse (URN – 21101026, Roll No– 3011)
Mr. Aditya Pandav (URN - 21101028, Roll No – 3013)
Miss. Anushka Patil (URN - 21101030, Roll No – 3015)

Under the Guidance of


Mrs. Prachi S. Pathak
Academic Year 2023-24
BONAFIDE CERTIFICATE

This is to certify that the project report entitled, “IOT BASED AIR QUALITY
MONITORING SYSTEM” is the bonafide work of Akanksha A Anuse
(21101024) and Aditya Y Pandav (21101028) Anushka V Patil (21101030)
who carried out the project work under my supervision.

SUPERVISOR HEAD OF THE DEPARTMENT

Department of Computer Science and Engineering


(Internet of Things and Cyber Security including Blockchain
Technology)
Annasaheb Dange College of Engineering and Technology
Ashta – 416301.

Submitted for the Annasaheb Dange College of Engineering and Technology project
viva – voice examination held on _________________________ and Minor Project
Lab at the Department of Computer Science and Engineering (Internet of Things and
Cyber Security including Blockchain Technology).

INTERNAL EXAMINER EXTERNAL EXAMINER


ACKNOWLEDGEMENT
At this pleasing moment of successful completion of my project, I thank God Almighty for his

blessings.

I convey our sincere thanks to our respected Founder Chairman Hon. Shri ANNASHEB DANGE,

Secretary Adv. RAJENDRA R DANGE who provided the facilities for us.

I express our deep gratitude to our beloved and Honorable Executive Director, Prof. R. A. KANAI,

and Director Dr. VIKRAM S PATIL for his valuable support.

I owe grateful and significant thanks to our Head of Department, Computer Science and Engineering

(Internet of Things and Cyber Security including Blockchain Technology), Dr. S. MANI, professor,

who has given constant support, constructive guidance, valuable suggestions, and encouragement

throughout the completion of our course and successful completion our innovation & prototype project

work.

I would like to express our sincere thanks to the all Supporting Faculty Members and guidance from

all the Technicians of Computer Science and Engineering (Internet of Things and Cyber Security

including Block-chain Technology), and our sincere thanks to Office Staff members for their timely

assistance.

Finally, I would like to express our gratitude to parents for their motivation and support which helped

us in the completion of this innovation and prototype project.

Akanksha Anuse (21101028)


Aditya Pandav (21101028)
Anushka Patil (21101030)

III
ABSTRACT
In today's technologically advanced world, automation and real-time monitoring systems have
become increasingly popular due to their ability to provide convenience and enhance safety.
This project aims to develop an IoT-based air quality monitoring system using ESP32,
PMS7003, MQ131, MQ135, ZP07, DHT22, CO2 sensor, OLED display, and ThingSpeak. The
objective of this project is to create a system that continuously monitors various air quality
parameters and provides real-time data, enabling users to make informed decisions about their
environment. The proposed system utilizes an ESP32 microcontroller to process data from
multiple sensors, including particulate matter (PM2.5 and PM10), ozone, carbon dioxide, and
other harmful gases. The OLED display offers an immediate visual representation of the air
quality levels, while the ThingSpeak platform allows for remote monitoring and data analysis.
This integration of sensors and IoT technology ensures comprehensive and accurate air quality
assessments.Furthermore, the system's modular design allows for easy expansion and
customization, making it adaptable for various applications such as smart homes, industrial
environments, and urban monitoring. By leveraging the capabilities of IoT technology, this
project aims to enhance our ability to monitor and respond to changes in air quality, thereby
contributing to a healthier and safer living environment. The real-time data and insights
provided by this system can help in identifying pollution sources, improving public health
policies, and raising awareness about air quality issues. In addition to its practical applications,
the project also serves as an educational tool, demonstrating the potential of IoT for
environmental monitoring. It offers a hands-on approach to learning about sensor integration,
data processing, and wireless communication. The system's open-source nature encourages
further research and development, fostering innovation in the field of environmental science
and technology. By empowering individuals and communities with the knowledge and tools to
monitor air quality, this project contributes to global efforts in combating air pollution and
promoting sustainable living.

IV
TABLE OF CONTENTS

TITLE PAGE NO.

ABSTRACT………………………………...............................................................IV

LIST OF FIGURES………………………………................................................IX

LIST OF SYMBOLS/ABBREVIATIONS………………………………...........X

LIST OF TABLES ………………………………................................................. XII

CHAPTER 1

1.1 INTRODUCTION………………………………………………………….…...1
1.2 PROJECT CATEGORY ……………………………………………………......2
1.3 PROJECT FORMUATION…………………………………………………......2
1.4 NEED OF PROJECT.……………………………………………………….......2
1.5 OBJECTIVE…………………………………………………………………….3
1.6 EXISTING SYSTEM …………………………………………………………..3

CHAPTER 2
2.1 FEASIBILITY STUDY ………………………………………………………..6
2.2 EXDECT HURDLES …………………………………………………………10
2.3 SDLC MODEL ……………………………………………………………......10
2.4 LITERATURE SURVY ………………………………………………………11
CHAPTER 3
3.1 PROPOSED SYSTEM ………………………………………………………..13
3.2 BLOCK DIAGRAM …………………………………………………………..15
3.3 MODULE DESCRIPTION …………………………………………………...15
3.4 PROJECT DESCRIPTION …………………………………………………...15
3.5 DATABASE DESCRIPTION ………………………………………………...16
CHAPTER 4
4.1 HARDWARE REQUIRMENT ……………………………………………….17
4.1.1 ESP32 ……………………………………………………………...…..17
4.1.2 PMS 7003 ……………………………………………………………..19
4.1.3 MH-Z19 ……………………………………………………………….20
4.1.4 MQ-131 ……………………………………………………….……….22

V
4.1.5 DHT22 ………………………………………………………………...23
4.1.6 WINSEN ZP07-MP503 ……………………………………………….24
4.1.7 NOICE SENSOR ……………………………………………………...25
4.1.8 MQ-135 ………………………………………………………………..26
4.1.9 OLED DISPLAY ……………………………………………………...27
4.1.10 POWER SUPPLAY ………………………………………………......28
4.2 SOFTWARE REQUIRMENT ………………………………………………….30
CHAPTER 5
5.1 RESULT AND DISCUSSION.....................................................................37
CHAPTER 6
6.1 CONCLUSION ………………………………...........................................41
REFERENCE
APPENDIX I
APPENDIX II
APPENDIX III
APPENDIX IV

VI
LIST OF FIGURES

FIGURE NO FIGURE NAME PAGE NO


1 Block Diagram 15
2 ESP32 18
3 PMS 7003 20
4 MH-Z19 21
5 OLED 28
6 Thingspeak 31
7 Arduino IDE 31
8 Experimental Result 36

VII
LIST OF SYMBOLS/ABBREVIATIONS

S.NO SYMBOLS/ EXPANSION


ABBREVIATIONS

1 LCD Liquid Crystal Display

2 EEPROM Erasable Programmable Read-Only Memory

3 Rx Receive

4 Tx Transmit

5 PWM Pulse Width Modulation

6 LED Light Emitting Diode

7 Ma MilliAmpere

8 RS Register Select

9 EN Enable

9 PTC Positive Temperature Coefficient

10 NTC Negative Temperature Coefficient

11 R/W Read/Write

12 M/S Meter/second

13 IOT Internet Of Things

14 IC Integrated Circuit

15 AC Alternating Current

16 DC Direct Current

17 V Voltage

18 KB Kilobyte

19 VIN Voltage Input

VIII
20 GND Ground

21 KHz Kilohertz

22 MHz Megahertz

23 GHz Gigahertz

24 IN/OUT Input/output

25 USB Universal Serial Bus

26 ASCII American Standard Code for Information


Interchange

27 IDE Integrated Development Environment

IX
LIST OF TABLES

TABLE NO TABLE NAME PAGE NO

1 Result 37
2 AQI Categories and Range 39
3 AQI categories and breakpoint 40

X
CHAPTER 1

1.1 INTRODUCTION
In recent years, the quality of the air we breathe has become a significant concern due to the
increasing levels of pollution caused by industrial activities, vehicular emissions, and various
other human activities. Poor air quality has been linked to numerous health problems, including
respiratory diseases, cardiovascular issues, and allergies, making it imperative to monitor and
manage air pollution effectively.

This project aims to address this critical issue by developing an IoT-based air quality
monitoring system that provides real-time data on various air pollutants. Our project leverages
the capabilities of the ESP32 microcontroller, which serves as the central processing unit,
interfacing with a suite of sensors including PMS7003, MQ131, MQ135, ZP07, DHT22, and a
CO2 sensor. These sensors are capable of measuring a wide range of air quality parameters,
such as particulate matter (PM2.5 and PM10), ozone, carbon dioxide, and other harmful gases.
The data collected by these sensors is then processed and transmitted to the ThingSpeak
platform for real-time monitoring and analysis.

The system also features an OLED display, which provides an immediate visual representation
of the air quality levels, allowing users to quickly assess the current air quality status. By
integrating these components, our project aims to create a comprehensive and accurate air
quality monitoring system that can be used in various settings, including homes, offices,
industrial environments, and urban areas. The significance of this project lies not only in its
practical applications but also in its potential to raise awareness about air pollution and its
impact on health. By providing real-time data and insights, the system can help identify
pollution sources, inform public health policies, and encourage individuals and communities
to take proactive measures to improve air quality. Furthermore, the project serves as a valuable
educational tool, demonstrating the potential of IoT technology in addressing environmental
challenges.

In summary, our IoT-based air quality monitoring system represents a significant step towards
enhancing our ability to monitor and manage air pollution. By leveraging advanced sensor
technology and IoT capabilities, this project aims to contribute to healthier living environments
and promote sustainable practices in air quality management.

1
1.2 PROJECT CATEGORY
The project falls under the Internet-based and Application/System Development categories.
This is because the project involves developing an IoT-based air quality monitoring system,
which leverages internet connectivity to collect, transmit, and analyze air quality data.

1.3 PROBLEM FORMULATION


Air pollution is a significant environmental issue affecting public health and quality of life.
Traditional methods of monitoring air quality often involve manual data collection and limited
coverage, making it difficult to obtain real-time and comprehensive data. There is a need for
an automated, real-time monitoring system that can provide accurate and up-to-date
information on air quality levels, helping individuals and authorities make informed decisions.

Key Problems Identified:


1. Lack of Real-Time Data: Traditional air quality monitoring methods do not provide
real-time data, leading to delays in identifying and responding to pollution events.
2. Limited Coverage: Existing monitoring systems often have limited spatial coverage,
failing to capture localized pollution sources and variations.
3. Manual Data Collection: Manual data collection is time-consuming, prone to errors,
and does not support continuous monitoring.
4. Public Awareness: There is a lack of accessible information for the general public to
understand and respond to air quality issues effectively.

1.4 NEED FOR THE PROJECT


The need for this project arises from the growing concern over air pollution and its impacts on
health and the environment. By developing an IoT-based air quality monitoring system, we can
address the above problems and provide a solution that offers several benefits:

1. Real-Time Monitoring: Continuous and automated data collection allows for real-time
monitoring of air quality, enabling prompt detection and response to pollution events.
2. Comprehensive Coverage: Deploying multiple sensors across different locations
provides a more comprehensive understanding of air quality variations and sources.
3. Data Accuracy and Reliability: Using advanced sensors and automated data processing
ensures high accuracy and reliability of the collected data.
4. Public Engagement: Providing real-time air quality information to the public increases
awareness and encourages proactive measures to reduce exposure to pollutants.

2
5. Decision Support: Authorities can use the data to implement and evaluate air quality
management strategies, improving public health outcomes.

1.5 OBJECTIVE
The objective is to develop and implement an advanced IoT-based air quality monitoring
system with the aim of providing real-time insights into pollution levels. This system will
continuously monitor key air quality parameters such as PM2.5, PM10, CO, NO2, SO2, and
O3, ensuring high accuracy and precision in data collection and analysis. Accessible via user-
friendly web or mobile interfaces, the system will offer intuitive visualizations and
customizable alerts for stakeholders

1.6 PROJECT OVERVIEW


An IoT-based air quality measurement system integrates advanced sensors and real-time
tracking technology. Strategically positioned sensor nodes communicate wirelessly to a central
server or cloud platform, enabling continuous data collection, processing, and analysis of key
pollutants like PM2.5, PM10, CO, NO2, SO2, and O3. Accessible via user-friendly web or
mobile applications, the system offers intuitive visualizations and customizable alerts. Its
scalability is ensured through modular hardware and software architecture, cloud-based
infrastructure, and compatibility with existing monitoring systems. Feasibility is established
through a comprehensive assessment covering technical, economic, environmental, regulatory,
legal, social, and ethical dimensions. This system aims to revolutionize air quality monitoring,
equipping stakeholders with timely, accurate, and actionable insights to mitigate pollution risks
and safeguard public health and the environment.

1.7 EXISTING SYSTEM


Currently, various voice assistants such as Amazon Alexa, Google Home, and Apple Siri can
be integrated with smart bulbs to control them using voice commands. However, the system
requires a compatible smart bulb and a hub that connects to the internet for remote access.

1.7.1 DISADVANTAGES
 Inconvenience
 Dependency on Wi-Fi
 Limited Accessibility
Privacy Concerns: Many voice-enabled bulbs require constant connection to the
internet and cloud servers to function properly. This can raise concerns about data

3
privacy and security, as the voice commands and usage patterns of users might be
collected and stored by the manufacturer or third-party services.
Dependency on Internet Connectivity: Voice commands for controlling these bulbs are
often processed in the cloud, which means that they require a stable internet connection.
If the internet connection is lost or disrupted, users might not be able to control their
bulbs via voice commands.
Complex Setup: Setting up voice-enabled bulbs can be more complex than traditional
bulbs. Users might need to install specific apps, connect to Wi-Fi networks, and link
accounts to different services. This can be intimidating for some users, especially those
who are not tech-savvy.
Compatibility Issues: Different smart bulb brands and models might use different
communication protocols and standards. This can lead to compatibility issues, where a
particular voice assistant or smart home system might not work with certain smart bulb
brands or might require additional setup steps.
Cost: Voice-enabled bulbs are generally more expensive than traditional light bulbs.
This cost includes not just the bulbs themselves, but also the infrastructure required to
support their functionality, such as smart home hubs or voice assistant devices.

COMPONENTS
To accomplish this project using
 ESP32 Dev Module
 Sensors
 OLED
 Arduino IDE software
Using the Arduino IDE to develop an air quality monitoring system involves several
steps and components. Firstly, you need an Arduino board (such as the Arduino Uno or
Nano), air quality sensors (like the MQ-135 for gases such as CO2 and NH3), and
possibly a temperature and humidity sensor (such as the DHT11 or DHT22). Optional
components include a display module (LCD or OLED) for visual output, a data logging
module (SD card module) for storing data, and communication modules (like the
ESP8266 for Wi-Fi or a Bluetooth module) for remote monitoring. Start by
downloading and setting up the Arduino IDE, then connect your sensors to the Arduino
board.

4
For instance, the MQ-135 connects its VCC and GND to the 5V and GND on the
Arduino, and its analog output to an analog pin (e.g., A0). Write and upload a sketch
that reads data from these sensors. For the DHT sensor, include the DHT library to
facilitate temperature and humidity readings, and for the MQ-135, read the analog
values directly. Use the Serial Monitor in the Arduino IDE to view the sensor outputs
in real time.

You can further enhance the system with a display module to show data directly on the
device, a data logging module to save data for later analysis, and communication
modules to send data to a remote server or cloud service for real-time monitoring and
alerts. This setup provides a robust framework for monitoring air quality effectively.A
lot of research has been done and many solutions have been proposed to remotely
access the appliances. Some of them used the internet, and wireless technology to
communicate and control home appliances, while others used Bluetooth and GSM
technology for controlling the home appliances.

5
CHAPTER 2

REQUIREMENT ANALYSIS AND SYSTEM SPECIFICATION

2.1 FEASIBILITY STUDY


Technical Feasibility
The technical feasibility of the IoT-based air quality monitoring system involves evaluating the
hardware and software components required for the project. This includes sensors for
measuring air quality parameters (e.g., PM2.5, PM10, CO, NO2, SO2, O3), communication
modules (e.g., ESP32), and data processing and visualization platforms.

Hardware Components:
 Sensors: Accurate sensors for detecting pollutants like PM2.5, PM10, CO, NO2, SO2, and O3.
 Microcontroller: ESP32 or Arduino boards for data collection and communication.
 Communication Modules: Wi-Fi, Bluetooth modules for data transmission.
 Power Supply: Reliable power sources to ensure continuous operation.

Software Components:
 Arduino IDE: For programming the microcontroller.
 Data Analysis Tools: Software for processing and visualizing the data, possibly integrated with
cloud platforms for remote access.

Economic Feasibility
The economic feasibility assesses the cost-effectiveness of the project, considering both the
initial investment and ongoing operational costs.

Initial Costs:
 Hardware: Sensors, microcontrollers, communication modules, and power supplies.
 Software: Development tools, possibly some licensed software for data analysis.

Operational Costs:
 Maintenance: Regular calibration and replacement of sensors.
 Data Storage: Costs associated with cloud storage and data processing.
A detailed cost-benefit analysis should be conducted to compare the costs with the potential
benefits, such as improved air quality management and public health benefits.

6
Environmental Feasibility
The environmental feasibility involves assessing the project's impact on the environment. The
project aims to monitor and improve air quality, which has a positive environmental impact.
The use of energy-efficient components and renewable power sources can further enhance
environmental sustainability.

Regulatory and Legal Feasibility


The project must comply with local, national, and international regulations on air quality
monitoring and data privacy. It is essential to ensure that the sensors and communication
devices meet the required standards and certifications.

Software Requirement Specification (SRS) Document


Project Title: IoT-Based Air Quality Monitoring System

The IoT-Based Air Quality Monitoring System is designed to provide real-time air quality
monitoring using a network of sensors. This system collects, transmits, processes, and
visualizes data on key air quality parameters, offering insights to individuals, communities, and
authorities for informed decision-making. The data requirements include sensor data such as
PM2.5, PM10, CO, NO2, SO2, O3 concentrations, temperature, and humidity, along with
metadata like sensor ID, location, and timestamp. Each sensor generates data at regular
intervals, necessitating efficient handling of large data volumes and structured storage in a
relational database for easy retrieval and analysis. Ensuring data integrity involves
implementing validation checks and regularly calibrating sensors.

The system's functional requirements encompass user management, sensor management, data
collection, data processing, data visualization, alerts and notifications, and reporting. Users can
register, log in, and manage profiles, with different roles such as Admin, Regular User, and
Guest. Admins can add, remove, and configure sensors, while regular users can view sensor
data. Sensors continuously collect air quality data and transmit it to the central server, where it
is processed to filter noise and calibrate readings, and aggregated for reports and visualizations.
Real-time dashboards display current air quality levels, and historical data visualizations enable
trend analysis. The system provides automatic alerts for predefined thresholds and notifications
via email, SMS, or mobile app, along with the capability to generate reports on air quality over
specified periods and export data in various formats.

7
Performance requirements include a response time of less than 2 seconds for real-time data
visualization and under 1 second for user interface interactions. The system should support the
addition of new sensors and handle at least 1000 simultaneous users without performance
issues, processing data from a minimum of 1000 sensors each sending data every minute.
Dependability requirements emphasize an uptime of 99.9%, reliable data collection with
redundancy in data transmission, and fault tolerance with failover mechanisms for critical
components.

Maintainability requirements highlight the need for modularity, comprehensive


documentation, logging for system activities and errors, real-time monitoring of system
performance, and user support mechanisms. Security requirements focus on secure login with
multi-factor authentication, role-based access control, data encryption in transit and at rest,
compliance with data privacy regulations, regular security audits, and an incident response plan
for handling security breaches. Look and feel requirements include an intuitive, user-friendly
interface with a modern and clean aesthetic, responsive design for various devices, accessibility
for users with disabilities following WCAG guidelines, and customization options for
dashboard layout and data display preferences.

2.2 EXPECTED HURDLES

The IoT-Based Air Quality Monitoring System faces several technical challenges, including
ensuring sensor accuracy and reliability over time, and integrating various hardware
components to ensure seamless communication. Economic constraints are also significant, with
high initial costs for high-quality sensors and communication modules, along with ongoing
maintenance and operational costs.

Environmental factors must be considered, particularly in terms of ensuring energy efficiency


and minimizing the environmental footprint of the monitoring system. Regulatory compliance
is critical, requiring the system to meet stringent regulations and standards for air quality
monitoring devices, and ensuring data privacy and security in compliance with legal
requirements.

Social acceptance is another important aspect, involving gaining public trust and acceptance of
the monitoring system, and addressing any ethical concerns related to data collection and usage.

8
2.3 SDLC MODEL TO BE USED
The System Development Life Cycle (SDLC) model suitable for this project is the Iterative
Model. This model allows for continuous improvement and refinement of the system through
repeated cycles (iterations), which is beneficial for incorporating feedback and making
necessary adjustments.
1. Planning: Define the project scope, objectives, and feasibility analysis.
2. Analysis: Gather detailed requirements and analyze them for system design.
3. Design: Develop the system architecture and design components.
4. Implementation: Develop and integrate the system components.
5. Testing: Conduct thorough testing to identify and fix issues.
6. Deployment: Deploy the system in the real-world environment.
7. Maintenance: Monitor and maintain the system, incorporating feedback and making
improvements.

2.4 LITERATURE SURVEY

TITLE: Multi-Points Indoor Air Quality Monitoring Based on Internet of Things


AUTHOR: Guangwen Wang , Liang Zhao

TIME: 16 April 2021


Indoor air quality monitoring is of great importance to human health as people typically spend
more than 90% of their time in indoor environments. An indoor air quality detector (IAQD)
enabling measurement of CO 2 , PM2.5, temperature, humidity, has been designed and tested
in residential buildings based on Internet of Things (IoT). The hardware and software design
of IAQD are described in detail, and seven IAQDs with Zigbee wireless module embedded
were deployed in the target building for a continuous period of one month in winter. The
gateway collects sensor data from each IAQD in turn at an interval of two minutes, and
transmits data to server in the cloud via GPRS/4G. The authorized users can access cloud
platform via mobile apps or the Web browser. Monitoring data analysis results reveal that the
maximum PM2.5 concentrations is 10 times than usual during cooking period, and
CO 2 concentrations with the door closed will rise to 2500 ppm compared to the door opened
at night, which threatens the health of occupants.

9
TITLE: Air Quality Monitoring System
AUTHOR: T Dineshkumar, Pachaivannan Partheeban

TIME: 11 April 2019


T Dineshkumar1*, V Suresh Babu2 , Pachaivannan Partheeban3 , and R Puviarasi4 1
Department of Electronics and Communication Engineering, Kongunadu College of
Engineering and Technology, Thottiam, Tamil Nadu, India
The system presented in this paper is an advanced real-time air quality reporting system
supported by the Internet of Things (IoT) architecture. Air quality in an environment heavily
affected by the community's state in a region may affect human, animal, and plant safety.
Therefore, air quality levels in a region should be tracked regularly.

TITLE: Air Quality Monitoring Based on Internet of Things


AUTHOR: Xiang Su, Lauri Lovén

TIME: 19 May 2021


Unmanned Aerial Vehicles for Air Pollution Monitoring: A Survey Naser Hossein Motlagh ,
Pranvera Kortoçi , Xiang Su , Member, IEEE, Lauri Lovén , Senior Member, IEEE, Hans
Kristian Hoel, Sindre Bjerkestrand Haugsvær, Varun Srivastava, Casper Fabian Gulbrandsen,
Petteri Nurmi , and Sasu Tarkoma , Senior Member, IEEE
Unmanned aerial vehicles (UAVs) equipped with air quality sensors offer a powerful solution
for increasing the spatial and temporal resolution of air quality data, searching and detecting
emission sources, and monitoring emissions from fixed and mobile sources. Despite the
numerous advantages of using UAVs, their use, however, presents several challenges that limit
their broader adoption. For example, UAVs require efficient algorithms and components to
minimize power consumption, the overall payload used on UAVs needs to be small to ensure
optimal portability which poses limitations on the sensors that can be integrated with UAVs,
and there is a need for specialized algorithms, e.g., for identifying and locating air pollution
sources

10
CHAPTER 3

SYSTEM DESIGN

3.1 PROPOSED SYSTEM


IoT (Internet of Things) has become an integral part of our lives and it has already made an
impact in various sectors, including the environment. Air pollution is a severe problem that has
been affecting our planet for years. Therefore, there is a need for a reliable and efficient air
pollution monitoring system to protect ourselves from its hazardous effects. An IoT-based air
pollution monitoring system is an ideal solution that can provide real-time data and insights
about the air quality in a particular area.

An IoT based air pollution monitoring system consists of several hardware and software
components that work together to collect and process data. The hardware components include
sensors, microcontrollers, and communication modules. The software components consist of a
mobile application, and a web-based dashboard.

IoT-based air pollution monitoring systems comprise several components that work together
to collect and analyze air quality data. The components include:
Sensors: Sensors are the primary components of IoT-based air pollution monitoring systems.
They measure various air quality parameters such as particulate matter, carbon monoxide,
sulfur dioxide, and nitrogen oxides , carbon dioxide. The sensors can be classified into two
categories: physical and chemical sensors. Physical sensors measure parameters such as
temperature, humidity, and pressure, while chemical sensors measure air pollutants.

Microcontroller: The microcontroller is the brain of IoT-based air pollution monitoring


systems. It receives data from the sensors, processes it, and sends it to the Web server. The
microcontroller is usually a microprocessor such as Arduino, Raspberry Pi, esp32 or similar
devices.

Communication Module: The communication module is responsible for transmitting data from
the microcontroller to the cloud server. Communication modules can use various wireless
technologies The cloud such as Wi-Fi, Bluetooth, or cellular networks. Cloud Server: server is
a centralized platform for storing, analyzing, and sharing air quality data. It collects data from
the communication module and stores it in a database. The cloud server also provides web and
mobile applications for users to access the data.

11
Power Supply: IoT-based air pollution monitoring systems require a power supply to operate.
In case of permanent installations external power supply is provided and batteries are provided
for portable devices.

3.1.1 ADVANTAGES
1. Comprehensive Environmental Monitoring
Multi-Sensor Integration: This system integrates multiple sensors (DHT11, MQ131, MQ135,
PMS7003, Sound Sensor, Winson ZP07), allowing for comprehensive monitoring of various
environmental parameters including temperature, humidity, ozone (O3), air quality index
(AQI), particulate matter (PM2.5 and PM10), and sound levels.

2. Real-Time Data Collection


Continuous Monitoring: The use of the ESP32 dev module enables continuous, real-time data
collection and transmission, providing up-to-date information on air quality and environmental
conditions.

3. Cost-Effectiveness
Affordable Components: Utilizing widely available and cost-effective sensors and the ESP32
dev module makes the system economically viable for large-scale deployment compared to
traditional air quality monitoring systems.

Sensor-Specific Advantages
DHT11: Provides reliable measurements of temperature and humidity, which are essential for
contextualizing air quality data.

MQ131 and MQ135: Capable of detecting specific gases like ozone (O3) and air quality
indices, crucial for monitoring harmful pollutants.

PMS7003: Highly accurate in measuring particulate matter (PM2.5 and PM10), which are
significant indicators of air quality and health impacts.

Sound Sensor: Monitors noise levels, adding an extra dimension to environmental quality
monitoring.

Winson ZP07: Enhances the system's ability to detect and quantify different pollutants with
high sensitivity.

12
3.2 BLOCK DIAGRAM

Fig 1: Block Diagram of Project

3.3 MODULE DESCRIPTION


The module description for the project "Air Quality Monitoring System using IoT" would
typically outline the specific components, sensors, and functionalities that will be integrated
into the system. This may include details such as the types of sensors used to measure air quality
parameters (e.g., particulate matter, carbon monoxide, ozone levels), the communication
protocols employed for data transmission, the data processing and analysis methods, and the
user interface for accessing and visualizing the collected data. Additionally, the module
description may also cover aspects related to power management, data storage and system
scalability.

3.4 PROJECT DESCRIPTION


The project description for "Air Quality Monitoring System using IoT" would delve deeper
into the technical aspects of the system, including the specific hardware and software
components being used, the architecture of the IoT network, the data collection and
transmission mechanisms, the data analysis algorithms, and the visualization techniques
employed. It would also detail the sensor calibration methods, quality assurance measures, and
data validation processes to ensure the accuracy and reliability of the air quality data collected.

13
Furthermore, the project description may discuss the potential challenges, risks, and mitigation
strategies associated with implementing an IoT-based air quality monitoring system, as well as
the potential future enhancements or applications of the system.

3.5 DATABASE DESIGN AND MANAGEMENT


Normalization:
Normalization is the process of organizing a database to reduce redundancy and improve data
integrity. It involves dividing large tables into smaller ones and defining relationships between
them. The following steps outline the normalization process for the IoT-Based Air Quality
Monitoring.
System database:
1. First Normal Form (1NF):
Ensure that each table has a primary key.
Eliminate repeating groups by creating separate tables for related data.
Each column should contain atomic values, and each record should be unique.

14
CHAPTER 4

IMPLEMENTATION
4.1 HARDWARE REQUIREMENT
The various hardware deployed in this project are as follows:
• ESP32- Dev Module
• PMS 5003
• MH-Z19
• MQ 131
• DHT 22
• Winsen ZP07-MP503
• Noise Sensor
• MQ 135
• Connecting Wires
4.1.1 ESP32
The ESP32 is a powerful microcontroller board based on the Tensilica Xtensa LX6 dual-core
processor. It has numerous digital input/output pins, with multiple pins capable of PWM
output, and numerous analog inputs. The board also features a 40 MHz crystal oscillator, Wi-
Fi and Bluetooth connectivity, a USB connection, a power jack, an integrated circuit serial
programming (ICSP) header, and a reset button. It contains everything needed to support the
microcontroller; simply connect it to a computer with a USB cable or power it with an AC-to-
DC adapter or battery to get started. The ESP32 differs from many previous boards by
integrating Wi-Fi and Bluetooth capabilities directly into the chip, eliminating the need for
additional modules. "ESP" stands for "Espressif," the company that manufactures the chip. The
ESP32 is part of a series of ESP boards, serving as a reference model for the ESP platform; for
a comparison with previous versions.

15
FIG 2: ESP32- DEV KIT

4.1.1.1 POWER
The ESP32 can be powered via a USB connection or with an external power supply. The power
source is selected automatically. External (non-USB) power can come either from an AC-to-
DC adapter (wall-wart) or a battery. The adapter can be connected by plugging a 2.1mm center-
positive plug into the board's power jack. Leads from a battery can be inserted in the Gnd and
VIN pin headers of the POWER connector. The board can operate on an external supply of 5
to 12 volts. If supplied with less than 5V, the 5V pin may supply less than five volts and the
board may be unstable. If using more than 12V, the voltage regulator may overheat and damage
the board. The recommended range is 5 to 12 volts.

16
4.1.2 PMS 7003
4.1.2.1 PMS5007 Specification
Measurement Principle: Laser scattering
Particle Range: PM1.0, PM2.5, PM10
Particle Size Range: 0.3 to 10 micrometers
Concentration Range: 0 to 500 µg/m³
Response Time: ≤ 10 seconds
Data Output: Serial communication (UART)
Power Supply: 5V DC

4.1.2.2 OVERVIEW
The PMS5007 is a compact and reliable particle matter sensor designed for measuring the
concentration of particulate matter in the air. It uses laser scattering to detect particles in the
air and outputs data in real-time via UART serial communication. The PMS5007 can measure
PM1.0, PM2.5, and PM10, making it a versatile tool for various air quality monitoring
applications. The PMS5007 is suitable for both indoor and outdoor environments and can be
integrated into air quality monitoring systems, HVAC systems, and IoT devices. Its high
sensitivity and fast response time ensure accurate and timely air quality readings. The sensor's
compact design and low power consumption make it ideal for portable and battery-operated
devices.

4.1.2.3 PINOUT
The PMS5007 sensor has a total of seven pins - VCC, GND, RX, TX, RESET, SET, and NC
(No Connection). VCC and GND are used for power supply, while RX and TX pins are used
for serial communication with a microcontroller. The RESET pin is used to reset the sensor,
and the SET pin is used to control the operating mode of the sensor.
VCC: Supply Voltage 5V DC
GND: Ground pin
RX: UART Receive pin
TX: UART Transmit pin
RESET: Reset pin (active low)

17
FIG 3: PMS 7003 –SENSOR

4.1.3 MH-Z19
4.1.2.1 MH-Z19 Specification
Measurement Range: 0-5000 ppm (parts per million)
Accuracy: ±50 ppm + 5% of reading
Response Time: < 60 seconds
Output Signal: PWM, UART (serial)
Preheating Time: 3 minutes
Power Supply: 4.5V to 5.5V DC
Current Consumption: < 60mA
Working Temperature: -10 ~ +50°C
Humidity Range: 0 ~ 95% RH (non-condensing)
Dimension: 33mm x 20mm x 9mm
4.1.2.2 OVERVIEW
The MH-Z19 is an easy-to-use CO2 (carbon dioxide) sensor module that uses non-dispersive
infrared (NDIR) technology to measure the concentration of CO2 in the air. It provides a
reliable and accurate way to monitor CO2 levels, making it ideal for air quality monitoring

18
systems. The MH-Z19 sensor outputs data via PWM and UART (serial) interfaces, allowing
for easy integration with various microcontrollers and systems.

The MH-Z19 sensor is widely used in HVAC systems, indoor air quality monitoring, smart
home applications, and other projects where CO2 levels need to be measured. It has a built-in
temperature compensation feature and is designed to operate in a wide range of environmental
conditions.

4.1.2.3 PINOUT
The MH-Z19 sensor has a total of six pins - VCC, GND, TX, RX, PWM, and NC (No
Connection). VCC and GND are used for power supply, while TX and RX pins are used for
serial communication with a microcontroller. The PWM pin provides a PWM signal output for
CO2 concentration, and the NC pin is not connected.
VCC: Supply Voltage 4.5V to 5.5V DC
GND: Ground pin
TX: UART Transmit pin
RX: UART Receive pin
PWM: PWM output pin for CO2 concentration
NC: No connection

FIG 4: MH-Z19–SENSOR

19
4.1.4 MQ 131
4.1.2.1 MQ131 Specification
Gas Detected: Ozone (O3)
Detection Range: 10 ppb to 1000 ppb (Low Concentration) / 0.01 ppm to 10 ppm (High
Concentration)
Heater Voltage: 5.0V ±0.2V
Load Resistance: Adjustable
Heater Resistance: 33Ω ± 5% (Room Temperature)
Sensitivity: ≥ 10 (R0 in clean air) / R (in O3 at 50 ppb)
Response Time: < 60 seconds
Recovery Time: < 60 seconds
Power Consumption: ≤ 800mW
Working Temperature: -10 ~ +50°C
Working Humidity: ≤ 95% RH
Dimension: 18mm x 17mm x 12mm

FIG 5: MQ 131–SENSOR

4.1.2.2 OVERVIEW
The MQ131 is a sensor module designed to detect ozone (O3) in the air. It is commonly used
for air quality monitoring systems, industrial safety, and environmental protection. The MQ131
module uses a semiconductor gas sensor and provides an analog output signal proportional to

20
the concentration of ozone detected. The module is easy to interface with various
microcontrollers and systems, making it suitable for a wide range of applications. The MQ131
sensor comes in two versions: one for low concentration detection and another for high
concentration detection. It has a built-in heater element that provides stable operating
conditions, ensuring accurate and reliable ozone detection.

4.1.5 DHT 22
4.1.2.1 DHT22 Specification
Sensor Type: Humidity and Temperature Sensor
Humidity Range: 0-100% RH
Humidity Accuracy: ±2% RH (25°C)
Temperature Range: -40 to 80°C
Temperature Accuracy: ±0.5°C (25°C)
Resolution: 0.1% RH and 0.1°C
Signal Output: Digital
Power Supply: 3.3V to 6V DC
Current Consumption: 1.5mA (average), 0.3mA (standby)
Sampling Period: 2 seconds
Working Temperature: -40 ~ +80°C
Working Humidity: 0-100% RH
Dimension: 15.1mm x 25mm x 7.7mm

FIG 6: DHT22–SENSOR

4.1.2.2 OVERVIEW
The DHT22 is a versatile and reliable sensor for measuring humidity and temperature. It offers
high accuracy and stable output for a wide range of environmental conditions. The DHT22 uses
a capacitive humidity sensor and a thermistor to measure the surrounding air and outputs a

21
digital signal on the data pin (single-bus interface). The sensor is factory calibrated, making it
easy to integrate into various projects without the need for extra components or calibration.
The DHT22 is suitable for applications such as weather stations, environmental monitoring
systems, and home automation. It provides accurate and reliable data, which is essential for
precise measurements in various applications.

4.1.6 Winsen ZP07-MP503


4.1.2.1 Winsen ZP07-MP503 Specification
Sensor Type: Air Quality Sensor
Detectable Gases: Carbon monoxide (CO), Methane (CH4), Hydrogen (H2), Alcohol, Smoke
Detection Range: 10-1000 ppm
Sensitivity: < 0.1 ppm
Response Time: ≤ 10 seconds
Recovery Time: ≤ 30 seconds
Signal Output: Analog voltage
Power Supply: 5V DC
Current Consumption: ≤ 150mA
Operating Temperature: -20 ~ +50°C
Operating Humidity: 15-90% RH (non-condensing)
Dimension: 40mm x 20mm x 10mm

FIG 7: ZP-07–SENSOR

4.1.2.2 OVERVIEW
The Winsen ZP07-MP503 is an air quality sensor module designed to detect a variety of gases,
including carbon monoxide (CO), methane (CH4), hydrogen (H2), alcohol, and smoke. This
sensor is suitable for applications that require monitoring air quality, such as indoor air quality
monitoring, HVAC systems, and environmental monitoring. The ZP07-MP503 uses a

22
semiconductor gas sensor for gas detection and outputs an analog voltage that corresponds to
the concentration of the detected gases. The ZP07-MP503 sensor module is factory calibrated
and easy to integrate into various projects, providing reliable and accurate gas concentration
readings. It is widely used in DIY electronics, home automation systems, and environmental
monitoring projects.

4.1.7 Noise Sensor


4.1.2.1 Noise Sensor Specification
Sensor Type: Analog sound sensor
Detection Range: 48dB to 90dB
Frequency Response: 100Hz to 10kHz
Output: Analog voltage
Sensitivity: Adjustable via onboard potentiometer
Operating Voltage: 3.3V to 5V DC
Current Consumption: ≤ 5mA
Operating Temperature: -40 ~ +85°C
Dimension: Varies based on the specific module

4.1.2.2 OVERVIEW
The noise sensor module is designed to detect sound levels in the environment. It can be used
in various applications, such as sound level monitoring, noise-activated systems, and voice
detection. This sensor converts sound levels into an analog voltage signal, which can be read
by a microcontroller or an analog-to-digital converter. The noise sensor module typically
includes a microphone, an amplifier, and an analog output. It is commonly used in DIY
projects, home automation systems, and sound level monitoring applications. The sensor's
sensitivity can often be adjusted using an onboard potentiometer, allowing it to be fine-tuned
for specific applications.

23
FIG 8: NOICE –SENSOR

4.1.8 MQ 135
4.1.2.1 MQ-135 Specification
Gas Detection: Ammonia, Sulfide, Benzene, Smoke, CO2, and other harmful gases
Operating Voltage: 5V DC
Consumption: ≤ 150mA
Detection Range: 10-1000 ppm
Heater Voltage (VH): 5.0V±0.2V AC or DC
Load Resistance (RL): Adjustable
Heating Resistance (RH): 31Ω±3Ω
Heating Consumption: ≤ 800mW
Sensitivity: Rs (in air)/Rs (100ppm NH3) ≥ 5
Response Time: ≤ 30s
Recovery Time: ≤ 60s
Operating Temperature: -20 ~ +50°C
Dimension: 22mm x 19mm x 17mm

24
FIG 9: MQ 135–SENSOR

4.1.2.2 OVERVIEW
The MQ-135 gas sensor is designed for monitoring air quality by detecting a wide range of
gases, including ammonia (NH3), sulfur (S), benzene (C6H6), smoke, and carbon dioxide
(CO2). It is commonly used in air quality monitoring systems, gas leak detection, and
environmental control applications. The sensor features a sensitive component (SnO2) which
has lower conductivity in clean air and higher conductivity when exposed to the target gases.
The MQ-135 sensor can be used with various microcontrollers, including Arduino, Raspberry
Pi, and other development boards. It provides an analog output signal proportional to the
concentration of the detected gases, making it easy to interface with an analog-to-digital
converter (ADC).

4.1.9 OLED DISPLAY


4.1.2.1 OLED Display Specification
Display Size: 0.96 inches
Resolution: 12b8x64 pixels
Color: White (monochrome)
Driver IC: SSD1306
Interface: I2C (Inter-Integrated Circuit) / SPI (Serial Peripheral Interface)
Operating Voltage: 3.3V - 5V DC
Current Consumption: 20mA (typical)
Viewing Angle: > 160°
Operating Temperature: -40 ~ +85°C

25
4.1.2.2 OVERVIEW
The 0.96 inch OLED Display is a compact and energy-efficient module commonly used for
displaying text and graphics in various electronic projects. It utilizes the SSD1306 driver IC,
providing a high contrast ratio and wide viewing angle. The display can be interfaced with
microcontrollers using either I2C or SPI protocols, making it versatile and easy to integrate
into different projects. The OLED display is widely used in Arduino projects, Raspberry Pi
setups, and other microcontroller-based applications. It is ideal for applications where space is
limited but a clear display is needed, such as wearable devices, portable instruments, and DIY
electronics.

FIG 10: OLED

4.1.10 POWER SUPPLY

A power supply is an essential component of any electronic device, including the voice-
controlled air quality detection system using ESP32 and various air quality sensors. In this
system, the power supply is responsible for supplying power to the various components of the
system. The ESP32 microcontroller, air quality sensors, and light indicator are the primary
components that require a power supply. The power supply for voice-controlled air quality
detection systems using ESP32 can be provided using a 5V DC power supply. The ESP32
microcontroller board can be powered via a USB cable connected to a computer or a USB
power supply. Alternatively, it can be powered using an external power supply connected to
the board's power input pins. The air quality sensors, such as MQ-135, can also be powered
using the 5V DC power supply. These sensors typically require a 5V operating voltage.
However, it is important to check the datasheet of each sensor to ensure the correct operating
voltage. If any sensor requires a different voltage, a voltage regulator or level converter can
be used to provide the appropriate power level. The light indicator used in this system may
require a higher voltage than the 5V DC power supply. In this case, a relay is used to switch

26
the power to the light indicator. The relay is connected to the ESP32 board and is controlled
by it. When the ESP32 receives a command based on the air quality data to turn on the light
indicator, it sends a signal to the relay to switch on the power to the light indicator.

27
4.2 SOFTWARE REQUIREMENTS

The software used in this project is listed below:

 ThingSpeak
 Arduino IDE

THINGSPEAK
ThingSpeak is an open-source software written in Ruby which allows users to communicate with
internet enabled devices. It facilitates data access, retrieval and logging of data by providing an API to
both the devices and social network websites. ThingSpeak was originally launched by ioBridge in 2010
as a service in support of IoT applications. ThingSpeak has integrated support from the numerical
computing software MATLAB from MathWorks, allowing ThingSpeak users to analyze and visualize
uploaded data using MATLAB without requiring the purchase of a MATLAB license from MathWorks.
ThingSpeak has been the subject of articles in specialized "Maker" websites like Instructables,
Codeproject, and Channel 9.

Send sensor data privately to the cloud.

There are sensors all around—in our homes, smart phones, automobiles, city infrastructure,
and industrial equipment. Sensors detect and measure information on all sorts of things like
temperature, humidity, and pressure. And they communicate that data in some form, such as a
numerical value or electrical signal.

Why would you want to collect data in ThingSpeak?

Sensors, or things, sense data and typically act locally. ThingSpeak enables sensors,
instruments, and websites to send data to the cloud where it is stored in either a private or a
public channel. ThingSpeak stores data in private channels by default, but public channels can
be used to share data with others. Once data is in a ThingSpeak channel, you can analyze and
visualize it, calculate new data, or interact with social media, web services, and other devices.
Analyze and visualize your data with MATLAB.

Storing data in the cloud provides easy access to your data. Using online analytical tools, you
can explore and visualize data. You can discover relationships, patterns, and trends in data.
You can calculate new data. And you can visualize it in plots, charts, and gauges.

28
FIG 11: THINGSPEAK CONNECTION

Arduino IDE:
Programs written using Arduino Software (IDE) are called sketches. These sketches
are written in the text editor and are saved with the file extension .ino. The editor has
features for cutting/pasting and searching/replacing text. The message area gives
feedback while saving and exporting and also displays errors. The console displays
text output by the Arduino Software (IDE), including complete error messages and
other information. The bottom righthand corner of the window displays the
configured board and serial port. The toolbar buttons allow you to verify and upload
programs, create, open, and save sketches, and open the serial monitor.

File:
 New Creates a new instance of the editor, with the bare minimum structure of a sketch
already in place.
 Open Allows to load a sketch file by browsing through the computer drives and
folders.
 Open Recent Provides a short list of the most recent sketches, ready to be opened.
 Sketchbook shows the current sketches within the sketchbook folder structure;
clicking on any name opens the corresponding sketch in a new editor instance.

29
 Examples any example provided by the Arduino Software (IDE) or library shows up
in this menu item. All the examples are structured in a tree that allows easy access by
topic or library.
 Close closes the instance of the Arduino Software from which it is clicked.
 Save saves the sketch with the current name. If the file hasn't been named before, a
name will be provided in a "Save as." window.
 Save as... Allows to save the current sketch with a different name.
 Page Setup It shows the Page Setup window for printing.
 Print Sends the current sketch to the printer according to the settings defined in Page
Setup.
 Preferences Open the Preferences window where some settings of the IDE may be
customized, as the language of the IDE interface.
 Quit Closes all IDE windows. The same sketches open when Quit was chosen will be
automatically reopened the next time you start the IDE.

Edit:
 Undo/Redo Goes back to one or more steps you did while editing; when you go back,
you may go forward with Redo.
 Cut Removes the selected text from the editor and places it into the clipboard.
 Copy Duplicates the selected text in the editor and places it into the clipboard.
 Copy for Forum Copies the code of your sketch to the clipboard in a form suitable for
posting to the forum, complete with syntax coloring.
 Copy as HTML Copies the code of your sketch to the clipboard as HTML, suitable
for embedding in web pages.
 Paste Puts the contents of the clipboard at the cursor position, in the editor.
 Select All Selects and highlights the whole content of the editor.
 Comment/Uncomment Put or removes the // comment marker at the beginning of each
selected line.
 Increase/Decrease Indent Adds or subtracts a space at the beginning of each selected
line, moving the text one space on the right or eliminating a space at the beginning.
 Find Opens the Find and Replace window where you can specify text to search inside
the current sketch according to several options.
 Find Next Highlights the next occurrence - if any - of the string specified as the search
item in the Find window, relative to the cursor position.

30
 Find Previous Highlights the previous occurrence - if any - of the string specified as
the search item in the Find window relative to the cursor position.

Sketch:

Verify/Compile Checks your sketch for errors compiling it; it will report memory
usage for code and variables in the console area.

Upload Compiles and loads the binary file onto the configured board through the
configured Port.

Upload Using Programmer This will overwrite the bootloader on the board; you will
need to use Tools > Burn Bootloader to restore it and be able to Upload to USB serial
port again. However, it allows you to use the full capacity of the Flash memory for
your sketch. Please note that this command will NOT burn the fuses. To do so a Tools
-> Burn Bootloader command must be executed.

Export Compiled Binary Saves a .hex file that may be kept as an archive or sent to
the board using other tools.

Show Sketch Folder Opens the current sketch folder.

Include Library Adds a library to your sketch by inserting #include statements at the
start of your code. For more details, see the libraries below. Additionally, from this
menu item, you can access the Library Manager and import new libraries from .zip
files.
Add File... Adds a supplemental file to the sketch (it will be copied from its current
location). The file is saved to the data subfolder of the sketch, which is intended for
assets such as documentation. The contents of the data folder are not compiled, so
they do not become part of the sketch program.

Tools:
 Auto Format this formats your code nicely: i.e. indents it so that opening and closing
curly braces line up, and that the statements inside curly braces are indented more.
 Archive Sketch Archives a copy of the current sketch in .zip format. The archive is
placed in the same directory as the sketch.

31
 Fix Encoding & Reload Fixes possible discrepancies between the editor char map
encoding and other operating system's char maps.
 Serial Monitor Opens the serial monitor window and initiates the exchange of data
with any connected board on the currently selected Port. This usually resets the board,
if the board supports Reset over serial port opening.
 Board selects the board that you're using. See below for descriptions of the various
boards.
 Port this menu contains all the serial devices (real or virtual) on your machine. It
should automatically refresh every time you open the top-level tools menu.
 Programmer for selecting a hardware programmer when programming a board or chip
and not using the onboard USB-serial connection. Normally you won't need this, but
if you're burning a bootloader to a new microcontroller, you will use this.
 Burn Bootloader the items in this menu allow you to burn a bootloader onto the
microcontroller on an Arduino board. This is not required for the normal use of an
Arduino board but is useful if you purchase a new ATmega microcontroller (which
normally comes without a bootloader). Ensure that you've selected the correct board
from the Boards menu before burning the bootloader on the target board. This
command also set the right fuses.

Sketchbook
The Arduino Software (IDE) uses the concept of a sketchbook: a standard place to store your
programs (or sketches). The sketches in your sketchbook can be opened from the File >
Sketchbook menu or the Open button on the toolbar. The first time you run the Arduino
software, it will automatically create a directory for your sketchbook. You can view or change
the location of the sketchbook location from with the Preferences dialog.
Beginning with version 1.0, files are saved with a .ino file extension. Previous versions use
the .pde extension. You may still open .pde named files in version 1.0 and later, the software
will automatically rename the extension to .ino.

Tabs, Multiple Files, and Compilation


Allows you to manage sketches with more than one file (each of which appears in its tab).
These can be normal Arduino code files (no visible extension), C files (.c extension), C++
files (.cpp), or header files (.h).

32
Before compiling the sketch, all the normal Arduino code files of the sketch (.ino, .pde) are
concatenated into a single file following the order the tabs are shown in. The other file types
are left as is.

33
CHAPTER 5

5.1 Results and Discussions


USER INTERFACE REPRESENTATION
Dashboard
Description: The main dashboard is the central hub where users can view real-time air quality
data, historical data, and alerts. It includes various widgets for data visualization and control.

Components:

1. Header:
o Logo: Displays the application logo.
o Navigation Menu: Links to different sections (Dashboard, Sensors, Reports,
Alerts, Settings, Profile).
o User Profile: Displays the logged-in user's name and role with a dropdown menu
for account settings and logout.
2. Sidebar:
o Navigation Links: Quick access links to different sections.
o Alerts: Displays recent alerts with a color-coded severity indicator (e.g., red for
high severity).
3. Main Content:
o Real-time Data Visualization:
 Graphs: Line charts showing real-time PM2.5, PM10, CO, NO2, SO2,
and O3 levels.
 Gauges: Real-time indicators for each pollutant.
 Map: Interactive map displaying sensor locations and their current
readings.
o Historical Data:
 Date Range Selector: Allows users to select a date range to view
historical data.
 Graphs: Line charts showing historical data trends for selected
pollutants.
o Alerts and Notifications:
 Table: Displays recent alerts with details (type, timestamp, severity).

34
 Filters: Options to filter alerts based on type, severity, and date.
4. Footer:
o Links: Quick links to privacy policy, terms of service, and contact information.
o Version: Displays the current version of the application.

Using ThingSpeak for Data Visualization


ThingSpeak is an IoT analytics platform that provides real-time data collection, analysis, and
visualization. The UI components described above can be integrated with ThingSpeak's
widgets and functionalities.

FIG12: DASHBOARD OF PROJECT

FIG13: AQI IN GRAPH FORMAT

35
FIG14: AQI IN METER (REAL TIME ONLY)

FIG15: AQI IN NUMRICAL FORMAT

FIG16: ALL SENSOR DATA REPRESENTATION


An IoT-based air quality monitoring system using ThingSpeak can be a compelling and
practical project. The expected outcome is a system that continuously monitors air quality

36
metrics like particulate matter (PM2.5 and PM10), carbon dioxide (CO2), temperature, and
humidity. These parameters are crucial for assessing indoor or outdoor air quality.
The system utilizes sensors such as the SDS011 for particulate matter, MH-Z19B for CO2, and
DHT series sensors for temperature and humidity. These sensors collect data which is then
processed by an Arduino or ESP8266/ESP32 microcontroller. The microcontroller is
programmed to transmit this data to ThingSpeak, an IoT platform that allows for real-time data
logging and visualization.

ThingSpeak provides features like data logging, time-series analysis, and integration with
MATLAB for advanced analytics. Users can access the air quality data remotely through a web
interface or mobile app. Alerts can be set up based on predefined thresholds, notifying users
when air quality parameters exceed safe limits.

The accuracy and reliability of the system depend on factors such as sensor calibration, data
transmission stability, and the integrity of the IoT platform. Choosing appropriate sensors with
adequate precision and reliability is crucial for obtaining accurate air quality measurements.
When planning your IoT air quality system, consider whether you need additional features like
GPS for location-based data, integration with other smart home devices, or historical data
analysis for long-term trends. Customizing the system to meet specific environmental
monitoring needs ensures it provides meaningful insights into air quality conditions. There is
a range of IoT platforms available, but ThingSpeak's versatility and ease of integration make it
a popular choice for projects requiring real-time data monitoring and analysis. Selecting the
right sensors and configuring them properly is essential for the success of your air quality
monitoring system.

AQI Categories and Range

Good Satisfactory Moderate Poor Very poor Severe


(0-50) (51-100) (101-200) (201-300) (301-400) (> 401)

37
AQI categories and breakpoint concentrations with averaging times

Pollutants Considered for AQI and Air


Quality Standards
200
150
100
50
0

AVERAGING TIME INDIAN STANDARD(µg/m3) Column1

The graph titled "Pollutants Considered for AQI and Air Quality Standards" presents data on
various air pollutants, including SO2 (Sulfur Dioxide), NO2 (Nitrogen Dioxide), PM2.5
(Particulate Matter less than 2.5 micrometers), PM10 (Particulate Matter less than 10

38
micrometers), O3 (Ozone), CO (Carbon Monoxide), PB (Lead), and NH3 (Ammonia). Each of
these pollutants is assessed based on two criteria: the averaging time and the Indian standards
for air quality.

The blue bars in the graph represent the averaging time, which is the period over which the
pollutant levels are averaged to calculate the Air Quality Index (AQI). This helps in
understanding the duration over which the measurements are taken to ensure a standardized
comparison. For instance, SO2, NO2, PM2.5, PM10, and NH3 have specific averaging times,
indicating that their levels are measured over those periods to determine the air quality.

The orange bars indicate the Indian standards for the maximum permissible concentration of
each pollutant, measured in micrograms per cubic meter (µg/m³), except for CO, which is
measured in milligrams per cubic meter (mg/m³). These standards set the allowable limits for
each pollutant to ensure air quality remains within safe levels. The graph shows that the
permissible limits for PM10 and NH3 are significantly higher than those for other pollutants.
O3 and CO also have high permissible limits, with CO being notably higher due to its
measurement unit being mg/m³.

Additionally, PB has a relatively small permissible limit according to Indian standards,


highlighting its potential toxicity at even low concentrations. The blue bars for PB and other
pollutants suggest the length of the averaging time used for their assessment, but it is not
explicitly stated in the graph.

The green line labeled "Column1" in the legend appears to be a placeholder and does not
correspond to any visible data in the chart. This might indicate a formatting or labeling error in
the graph.

39
CHAPTER 6
6.1 CONCLUSION
The Internet of Things (IoT) has gained wide popularity in recent days due to its various
streams of applications which have paved the way for a smooth, safe, and easier mode of living
style for human beings. The project of designing an IoT-based air quality monitoring system
using ESP32, PMS7003, MQ131, MQ135, ZP07, DHT22, CO2 sensor, OLED display, and
ThingSpeak demonstrates the significant impact IoT can have on environmental monitoring
and public health.By integrating these components, we created a system capable of accurately
measuring and reporting various air quality parameters, including particulate matter (PM2.5
and PM10), ozone, carbon dioxide, and other harmful gases. The ESP32 microcontroller plays
a crucial role in processing sensor data and transmitting it to the ThingSpeak cloud platform,
where it can be monitored and analyzed in real time.

The OLED display provides a user-friendly interface for displaying air quality readings locally,
allowing for immediate awareness and action. The use of the ThingSpeak platform not only
enables remote monitoring but also offers powerful data visualization and analysis tools,
making it easier to identify trends and anomalies in air quality over time.In summary, this
project is an excellent example of how IoT technology can be leveraged to address
environmental challenges. By understanding the essential components and how they work
together, this system can be replicated and further improved to include additional features such
as mobile notifications, integration with smart home systems, and advanced data analytics. This
project not only enhances our ability to monitor air quality but also contributes to the broader
goal of creating healthier and more sustainable living environments.

FUTURE WORK
To enhance the IoT-based air quality monitoring system, several improvements and expansions
are planned. Future work includes integrating additional sensors for broader pollutant detection
and upgrading to a more powerful microcontroller for better data processing capabilities.
Implementing machine learning algorithms will enable predictive analytics for air quality
trends. Expanding the network to include more sensor nodes will improve spatial coverage and
data accuracy. Enhancing the user interface with more interactive and customizable features
will provide a better user experience.

40
REFERENCES

[1].Savla, D. V., Parab, A. N., Kekre, K. Y., Gala, J. P., & Narvekar, M. (2020, August).
IoT and ML based Smart System for Efficient Garbage Monitoring: Real Time AQI
monitoring and Fire Detection for dump yards and Garbage Management System. In
2020 Third International Conference on Smart Systems and Inventive Technology
(ICSSIT) (pp. 315-321). IEEE.

[2].Kumar, Ajitesh, MonaaKumaari, and HarshaGuptaa. "Development & review of the


environmental quality control system based on IoT." In 2020 International Conference
on Power Electronics & IoT Applications in Renewable Energy and its Control
(PARC), pp. 242-245. IEEE, 2020.

[3].Bazurto, Jose, Willian Zamora, Johnny Larrea, Dolores Muñoaz, &DahianaAlviaa.


"Framework for controlling air quality in urban areas with close to zero solutions." In
2020 15th Iberian Conference on Information Systems and Technologies (CISTI), pp.
1-6. IEEE, 2020.

[4].Esfahani, Siavash, PiaersRolins, Jaan Peter Specht, MarinaaColae, and Jullian W.


Gardener. "Smart Urban Power IoT-based indoor air quality control system." In 2020
IEEE Sensors, pp. 1-4. IEEE, 2020.

[5].Bhattachariya, S., Sridaevi, S. and Pitchaiah, R., 2012, December. Monitoring of indoor
environmental quality using a WSN. In 2012 Sixth International Conference on Sensing
Technology (ICST) (pp. 422-427). IEEE.

[6].Phaala, K.S.E., Kumaar, A. and Haancke, G.P., 2016. Air quality management
systembased on ISO/IEC/IEEE 21451 standards. IEEE Sensors Journal, 16(12),
pp.5037-5045.

[7].Kwaon, J., Aahn, G., Kimm, G., Kimm, J.C. and Kimm, H., 2009, August. A research
on the NDIR-based CO2 sensor for local air pollution monitoring. In 2009 Iccas-Sice
(pp. 1683-1687). IEEE.

[8].Kumaar, S. and Jasujaa, A., 2017, May. IoT based air quality control system utilizing
Raspberry Pi. In 2017 International Conference on Computing, Communication and
Automation (ICCCA) (pp. 1341-1346). IEEE.

[9].Liuu, J.H., Chaen, Y.F., Liin, T.S., Chaen, C.P., Chaen, P.T., Waen, T.H., Sunn, C.H.,
Juaang, J.Y. and Jiaang, J.A., 2012. “air quality management system for urban centers
on the application of wireless sensor networks”. International Journal on Smart Sensing
& Intelligent Systems, 5(1).

41
[10].Faroq, M.U., Wasim, M., Mazhaar, S., Khaiiri, A. and Kamaal, T., 2015. Analysis of
stuff on the Internet (IoT). International Conference for Computer
Applications,113(1), pp.1-7.

[11].Nasution, TigorHamonangan, AinulHizriadi, KasmirTanjung, and FitraNurmayadi.


"Design of Indoor Air Quality Monitoring Systems." In 2020 4rd International
Conference on Electrical, Telecommunication and Computer Engineering
(ELTICOM), pp. 238-241. IEEE, 2020.

[12].Moharana, B. K., Anand, P., Kumar, S., & Kodali, P. (2020, July). Development of an
IoT-based Real-Time Air Quality Monitoring Device. In 2020 International
Conference on Communication and Signal Processing (ICCSP) (pp. 191-194). IEEE.

[13].Jha, R. K. (2020, July). Air Quality Sensing and Reporting System Using IoT. In 2020
Second International Conference on Inventive Research in Computing Applications
(ICIRCA) (pp. 790- 793). IEEE.

[14].Hofman, J., Nikolaou, M. E., Do, T. H., Qin, X., Rodrigo, E., Philips, W., ... & La
Manna, V. P. (2020, October). Mapping Air Quality in IoT Cities: Cloud Calibration
and Air Quality Inference of Sensor Data. In 2020 IEEE Sensors (pp. 1-4). IEEE.

[15].Marinov, MarinnBaerov, DimitaarIliaevIliev, Todor StoyanovDiamiykov,


IvaanVladimiroevRache, and KatyaaKonstanntinovaAspaaruhova. "Portable Air
Pressurizer with Air Quality Control Sensor."In 2019 IEEE XXVIII International
Scientific Conference Electronics (ET), pp. 1-4. IEEE, 2019.

42
APPENDIX-I
PROGRAM CODE
#include <WiFi.h>
#include <Arduino.h>
#include "DHT.h"
#include "PMS.h"
#include <SoftwareSerial.h>
#include "MHZ19.h"
#include "ThingSpeak.h"

#define RX_PIN 16
#define TX_PIN 17
#define PMS_RX_PIN 1 // Define RX pin for PMS7003
#define PMS_TX_PIN 3 // Define TX pin for PMS7003
#define DHTPIN 14
#define DHTTYPE DHT22
#define SOUND_PIN 32
#define MQ131_ANALOG_PIN 34
#define CO_SENSOR_PIN 33 // Assuming CO sensor is connected to analog pin A2

const char* WIFI_NAME = "Wayne";


const char* WIFI_PASSWORD = "aditya11";
const int myChannelNumber = 2475680;
const char* myApiKey = "CEUWT63V9ZA0XYVL";
const char* server = "api.thingspeak.com";
WiFiClient client;

DHT dht(DHTPIN, DHTTYPE);


PMS pms(Serial);
MHZ19 myMHZ19;
SoftwareSerial mySerial(RX_PIN, TX_PIN);
SoftwareSerial pmsSerial(PMS_RX_PIN, PMS_TX_PIN); // SoftwareSerial object for
PMS7003

float mq131_slope = 0.05; // Slope of the calibration curve


float mq131_intercept = 0.1; // Intercept of the calibration curve

unsigned long previousMillis = 0;


const long interval = 3000; // 3 second interval
long BAUDRATE;
void setup() {
Serial.begin(9600);

43
Serial.println(F("AQI Sensor Test"));
myMHZ19.begin(mySerial);
pmsSerial.begin(BAUDRATE);
dht.begin();
WiFi.begin(WIFI_NAME, WIFI_PASSWORD);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Wifi not connected");
}
Serial.println("Wifi connected !");
Serial.println("Local IP: " + String(WiFi.localIP()));
WiFi.mode(WIFI_STA);
ThingSpeak.begin(client);
}

void loop() {
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval) {
previousMillis = currentMillis;

// Read DHT sensor data


float h = dht.readHumidity();
float t = dht.readTemperature();

//if (isnan(h) || isnan(t)) {


// Serial.println(F("Failed to read from DHT sensor!"));
// return;
//}

// Read PMS sensor data


PMS::DATA data;
if (pms.read(data)) {
// Successfully read from PMS sensor
} else {
Serial.println("Failed to read from PMS sensor!");
return;
}

// Read CO2 sensor data from MH-Z19


float co2 = calculateCO2AQI(co2);

// Read CO sensor data


float co = analogRead(CO_SENSOR_PIN) * (10.0 / 1023.0); // Assuming a 10V reference
voltage

44
// Read O3 sensor data from MQ131
float o3 = calculateO3AQI(o3);
// Read sound sensor data
int soundLevel = analogRead(SOUND_PIN);

// Calculate AQI for each sensor


float pm25 = data.PM_AE_UG_2_5;
float pm10 = data.PM_AE_UG_10_0;
float aqi_pm25 = calculatePM25AQI(pm25);
float aqi_pm10 = calculatePM10AQI(pm10);
float aqi_co2 = calculateCO2AQI(co2);
float aqi_co = calculateCOAQI(co);
float aqi_o3 = calculateO3AQI(o3);

// Find maximum AQI


float max_aqi = max(max(max(aqi_pm25, aqi_pm10), max(aqi_co2, aqi_co)), aqi_o3);

// Print AQI values


Serial.print("Maximum AQI: ");
Serial.println(max_aqi);
Serial.print("AQI (PM2.5): ");
Serial.println(aqi_pm25);
Serial.print("AQI (PM10): ");
Serial.println(aqi_pm10);
Serial.print("AQI (CO2): ");
Serial.println(aqi_co2);
Serial.print("AQI (CO): ");
Serial.println(aqi_co);
Serial.print("AQI (O3): ");
Serial.println(aqi_o3);
Serial.print("Sound Level: ");
Serial.println(soundLevel);

// Send data to ThingSpeak


ThingSpeak.setField(1, max_aqi);
ThingSpeak.setField(2, pm25);
ThingSpeak.setField(3, pm10);
ThingSpeak.setField(4, co2);
ThingSpeak.setField(5, co);
ThingSpeak.setField(6, o3);
ThingSpeak.setField(7, soundLevel);

int x = ThingSpeak.writeFields(myChannelNumber, myApiKey);

45
Serial.println("AQI: " + String(1,max_aqi));
Serial.println("pms7003- pm25: " + String(2,pm25));
Serial.println("pms7003- pm10: " + String(3,pm10));
Serial.println("co2: " + String(4,co2));
Serial.println("co: " + String(5,co));
Serial.println("o3: " + String(6,o3));
Serial.println("NOISE: " + String(8,soundLevel)+ "dB");
if (x == 200) {
Serial.println("Data pushed successfully");
} else {
Serial.println("Push error: " + String(x));
}

Serial.println("---");
}
}

float calculateCO2AQI(float co2) {


uint8_t cmd[9] = {0xFF, 0x01, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x79};
uint8_t response[9];
mySerial.write(cmd, 9);
delay(100);
mySerial.readBytes(response, 9);
if (response[0] == 0xFF && response[1] == 0x86) {
int responseHigh = (int)response[2];
int responseLow = (int)response[3];
int ppm = (256 * responseHigh) + responseLow;
return ppm;
} else {
return -1;
}
}

// Function to read O3 level from MQ131 sensor


float calculateO3AQI(float o3) {
int sensorValue = analogRead(MQ131_ANALOG_PIN);
float voltage = sensorValue * (5.0 / 1023.0);
float o3_concentration = mq131_slope * voltage + mq131_intercept;
return o3_concentration;
}

float calculatePM25AQI(float pm25) {


// AQI breakpoints and corresponding AQI values for PM2.5
float breakpoints[6] = {0, 12, 35.4, 55.4, 150.4, 250.4};

46
float AQI_values[6] = {0, 50, 100, 150, 200, 300};

int i = 0;
while (i < 5 && pm25 > breakpoints[i + 1])
i++;

// Linear interpolation formula to calculate AQI


return ((AQI_values[i + 1] - AQI_values[i]) / (breakpoints[i + 1] - breakpoints[i])) * (pm25
- breakpoints[i]) + AQI_values[i];
}

float calculatePM10AQI(float pm10) {


// AQI breakpoints and corresponding AQI values for PM10
float breakpoints[6] = {0, 55, 155, 255, 355, 425};
float AQI_values[6] = {0, 50, 100, 150, 200, 300};

int i = 0;
while (i < 5 && pm10 > breakpoints[i + 1])
i++;

// Linear interpolation formula to calculate AQI


return ((AQI_values[i + 1] - AQI_values[i]) / (breakpoints[i + 1] - breakpoints[i])) * (pm10
-
float AQI_values[5] = {0, 50, 100, 150, 200};

int i = 0;
while (i < 4 && co > breakpoints[i + 1])
i++;

// Linear interpolation formula to calculate AQI


return ((AQI_values[i + 1] - AQI_values[i]) / (breakpoints[i + 1] - breakpoints[i])) * (co -
breakpoints[i]) + AQI_values[i];
}

47
APPENDIX-II

Fig. Dashboard of Project

Fig. AQI in graph Format

48
Fig. AQI in Meter (Real time only)

Fig. AQI in Numrical format

Fig. All sensor Data representation

49
APPENDIX IV
Authors Biography

Authors Details

Name : Anushka Vikas Patil

URN NO: 21101030

Roll No: 3015

Contact: 9665627570

E-mail: anushkapatil479@gmail.com

Qualification: B.Tech in Computer Science and Engineering(Internet


of things and Cyber security including Blockchain Technolgy) from
Annasaheb Dange College of Engineering and Technology , Ashta

Name : Akanksha Ashok Anuse

URN NO: 21101026

Roll No: 3011

Contact: 9021797982

E-mail: akankshaanuse77@gmail.com

Qualification: B.Tech in Computer Science and Engineering(Internet


of things and Cyber security including Blockchain Technolgy) from
Annasaheb Dange College of Engineering and Technology , Ashta

Name : Aditya Yashwant Pandav

URN NO: 211010428

Roll No: 3013

Contact: 9021839566

E-mail: adityapandav11@gmail.com

Qualification: B.Tech in Computer Science and Engineering(Internet


of things and Cyber security including Blockchain Technolgy) from
Annasaheb Dange College of Engineering and Technology , Ashta

50
APPENDIX: III
PLAGIARISM REPORT

51

You might also like