0% found this document useful (0 votes)
88 views75 pages

Capstone Project

The document describes an IoT and machine learning-based air quality monitoring system. The system uses sensors to collect air quality data and machine learning algorithms to predict future air quality levels. It allows users to view sensor data and predictions on a web page and mobile app. The document discusses the system architecture, machine learning models used, and interface design.

Uploaded by

Touhidul Islam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views75 pages

Capstone Project

The document describes an IoT and machine learning-based air quality monitoring system. The system uses sensors to collect air quality data and machine learning algorithms to predict future air quality levels. It allows users to view sensor data and predictions on a web page and mobile app. The document discusses the system architecture, machine learning models used, and interface design.

Uploaded by

Touhidul Islam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 75

GREEN UNIVERSITY OF BANGLADESH (GUB)

IoT and Machine Learning Based Air


Pollution Monitoring System

Submitted by
Md. Shamiul Hossain (191002015)
Shahidul Islam (191002355 )
Ali Emam Al Mahmud (19120377)

A project submitted to the Department of Computer Science & Engineering


for the partial fulfillment of the degree of
Bachelor of Science in Computer Science & Engineering

Supervised by
Ms. Shifat Ara Rafiq
Lecturer, Department of CSE

Department of Computer Science & Engineering


Green University of Bangladesh
220/D Begum Rokeya Sarani, Dhaka-1207
February, 2023
Declaration

The following report was written under the supervision of Ms. Shifat Ara Rafiq, Lec-
turer, Department of Computer Science and Engineering, Green University of Bangladesh,
for the capable of fulfilling the obligations for the Bachelor of Science degree from the
Department of Computer Science and Engineering. This report is also unique in that it
will never be released before.

Md. Shamiul Hossain Ali Emam Al Mahmud Shahidul Islam


ID: 191002015 191002377 ID: 191002355

i
Certificate

This is to certify that the Project entitled Design and Development of IoT and Machine
Learning Based Air Pollution Monitoring System in partial fulfillment of the require-
ment for the degree of Bachelor of Science in Computer Science and Engineering in
February 2023.

Ms. Shifat Ara Rafiq


Supervisor

Accepted and approved in partial fulfillment of the requirement for the degree Bach-
elor of Science in Computer Science and Engineering.

Faculty Name Faculty Name


Board Member Board Member

Faculty Name Faculty Name


Board Member Board Member

ii
Acknowledgments

First, we would like to express my deepest gratitude to our supervisor Ms. Shifat Ara
Rafiq, Lecturer, Department of Computer Science and Engineering, Green University
of Bangladesh, whose sincerity, and encouragement we will never forget. Her insight
led to the original proposal to examine the possibility of re-examining the sensitivities
of the entire project work. She has helped us through extremely difficult times over the
course of the analysis and the writing of the dissertation and for that we sincerely thank
him for her confidence in us. She is the true definition of a leader and the ultimate role
model. This project would not have been possible without Ms. Shifat Ara Rafiq, whose
guidance from the initial step in research enabled us to develop an understanding of the
subject. We are grateful for the extraordinary experiences she arranged for us as well as
the opportunities he provided for us to grow professionally. It is an honor to learn from
Ms. Shifat Ara Rafiq, Lecturer, Department of Computer Science and Engineering,
Green University of Bangladesh. We are grateful to our parents whose constant love and
support keep us motivated and confident. Our accomplishments and success are because
they believed in us. Deepest thanks to our siblings, who keep us grounded, reminded
us of what is important in life, and always supportive of my adventures. Finally, we
deepest gratitude to Team, we will be eternally grateful for our unwavering love and
support throughout the entire project process and every day.

iii
Abstract

Our work presents an IoT and machine learning-based air quality detecting and predic-
tion system that leverages sensor data from various sources. The system uses machine
learning algorithms to predict future air quality levels based on previous data and en-
vironmental variables. The system can also show the IoT device sensors data to the
Web Page and in the Mobile Dashboard which is accessible from anywhere. Our work
discusses the architecture of the system, including the IoT devices, and machine learn-
ing models. The results of experiments show that the proposed system can how much
accurately predict air quality levels and shows it to people. The proposed system has
significant potential for use in smart city applications, where it can be used to monitor
and manage air pollution levels, ultimately leading to a cleaner and healthier environ-
ment.

iv
TABLE OF CONTENTS

Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i

Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii

Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii

Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv

List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix

List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Problem statement . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Aims and Objectives . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Project Description . . . . . . . . . . . . . . . . . . . . . . . 4
1.6 Project Questions . . . . . . . . . . . . . . . . . . . . . . . . 4
1.7 Project Outline . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2 Literature Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Literature Review . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Limitation of Existing Works . . . . . . . . . . . . . . . . . . 10
2.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3 Requirements Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

v
3.2 System Design . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.3 Tools and Techniques . . . . . . . . . . . . . . . . . . . . . . 12
3.4 Project Features . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.4.1 Functional Requirement . . . . . . . . . . . . . . . 14
3.4.2 Non Functional Requirement . . . . . . . . . . . . . 15
3.5 Software Development Life Cycle . . . . . . . . . . . . . . . . 17
3.5.1 SDLC Models . . . . . . . . . . . . . . . . . . . . 19
3.6 Gantt Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.7 Risk Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.7.1 Risk Probability and Impact . . . . . . . . . . . . . 29
3.8 Use Case Diagram . . . . . . . . . . . . . . . . . . . . . . . . 29
3.9 Data Flow Diagram . . . . . . . . . . . . . . . . . . . . . . . 30
3.9.1 DFD Level 0 . . . . . . . . . . . . . . . . . . . . . 30
3.9.2 DFD Level 1 . . . . . . . . . . . . . . . . . . . . . 31
3.10 Entity Relation Diagram (ER) . . . . . . . . . . . . . . . . . . 33
3.11 System Architecture . . . . . . . . . . . . . . . . . . . . . . . 34
3.12 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

4 Interface Design and Implementation . . . . . . . . . . . . . . . . . . . 36


4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.2 Reason for Selecting Linear Regression Gradient Descent. . . . 36
4.3 Comparison between Machine Learning algorithms . . . . . . 37
4.4 User Interface Design . . . . . . . . . . . . . . . . . . . . . . 39
4.5 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.6 Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.7 Landing Page (WEB) . . . . . . . . . . . . . . . . . . . . . . 44
4.8 Landing Page ( APP) . . . . . . . . . . . . . . . . . . . . . . 46

5 Test Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

6 Conclusion and Future Work . . . . . . . . . . . . . . . . . . . . . . . 57

vi
6.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.2 Limitation of Work . . . . . . . . . . . . . . . . . . . . . . . 58
6.3 Future Works . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

vii
List of Figures

3.1 SDLC Life Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19


3.2 Waterfall Modde . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.3 Spiral Modde . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.4 Iterative Moddel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.5 Agile Moddel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.6 Gantt Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.7 Risk Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.8 Illustrates our Use Case Diagram . . . . . . . . . . . . . . . . . . . . 30
3.9 Illustrates our DFD Level 0 Diagram . . . . . . . . . . . . . . . . . . 31
3.10 Illustrates our DFD Level 1 Diagram . . . . . . . . . . . . . . . . . . 32
3.11 Illustrates our Entity Relation Diagramm . . . . . . . . . . . . . . . . 33
3.12 Illustrates our System Architecture. . . . . . . . . . . . . . . . . . . . 34

4.1 Data Ploting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38


4.2 Data Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.3 Data Correlation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.4 Sensors and Esp Module on Breadboard . . . . . . . . . . . . . . . . 40
4.5 IoT Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.6 MQ2 Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.7 MQ6 Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.8 MQ135 Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.9 Temperature and Humidity sensor . . . . . . . . . . . . . . . . . . . 42
4.10 ESP WIFI module . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

viii
4.11 Breadboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.12 Landing Page of IoT and Machine Learning Based Air Pollution Mon-
itoring System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
4.13 Temperature Visualization . . . . . . . . . . . . . . . . . . . . . . . 45
4.14 Air Quality Visualization . . . . . . . . . . . . . . . . . . . . . . . . 45
4.15 Real Time Data Visualization . . . . . . . . . . . . . . . . . . . . . 46
4.16 Graph of Smoke, Natural Gas and Air Quality . . . . . . . . . . . . . 47

5.1 User Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

ix
List of Tables

3.1 Depicts our reasoning behind the selection of AGILE software devel-
opment lifecycle for our project . . . . . . . . . . . . . . . . . . . . . 26

4.1 Comparison Between Different Machine Learning Algorithm . . . . . 38

x
Chapter 1

Introduction

1.1 Introduction
The air quality is deteriorating day by day worldwide, especially in areas with high pop-
ulation density, various industrial areas, parks and cities where air pollution is so bad
that it can affect human and animal health. Raises everyone’s awareness and applies
science Effective ways to mitigate the negative impact of technology Industrialization
and pollution on the natural environment as well as providing public health services.
In order to prevent something that can worsen the condition of human health, it is nec-
essary to know the condition of air quality in an area. Therefore, it is necessary to
periodically monitor the air The air quality condition of an area will be known so that
people will be aware when they come to this polluted area.
The most common pollutants are called criterion pollutants and correspond to the
most prevalent health threats. These are Includes SO2, ground level ozone (O3), NO2,
lead and PM. of A correlation exists and has been demonstrated Short-term exposure to
such pollutants and health problems, Respiratory problems in healthy people, Asthma,
respiratory symptoms of people with difficulty meet high oxygen requirements during
exercise and Severe respiratory conditions, especially in children and for adults.
In order to monitor in this project, we are going to This work presents the design and
deployment of an IOT and Machine Learning Based Air Pollution Monitoring System.
In which we will monitor the Air Quality and Predict show a web server using internet

1
when the air quality goes down beyond a certain level.
Here we will do this work with IOT device which will have several sensors such as:
MQ2, MQ6, MQ135, Humidity and temperature sensors. Then a real-time database for
air quality will be uploaded to the server. Now take this data to the PC conveniently and
use the machine learning model using Gradient Descent to show the obtained value on
the web server and also show the real time data obtained. It will tell the amount of air
pollution in an area based on the condition of the air particles.

1.2 Problem statement


Air pollution is very harmful for us air pollution can have many harmful effects on hu-
man health. When we breathe in polluted air, we can inhale tiny particles and chemicals
that can damage our lungs, heart, and other organs. Long-term exposure to air pollu-
tion has been linked to a range of health problems, including respiratory diseases, heart
disease, stroke, and even cancer.

• Air pollution is very harmful for us.

• The environment is being polluted.

• It’s raining acid.

• The temperature of the environment is rising.

The system will use IoT devices to collect real-time air quality data, including partic-
ulate matter MQ2, MQ6, MQ123, Humidity and temperature from various locations.
The data will be processed and analyzed using machine learning algorithms to predict
future air pollution levels in those locations. The system will also provide real-time
alerts to the users when air pollution levels exceed the standard limit. we hope this
project is more helpful.

2
1.3 Motivation
Air pollution is a critical environmental issue that has a severe impact on public health
and the environment. According to the World Health Organization (WHO), air pollution
causes millions of premature deaths and illnesses every year. Traditional air quality
monitoring systems are often limited in their coverage and accuracy.
Air pollution is the excessive amount of substances in the atmosphere that are harm-
ful. Matter includes solid particles, liquid droplets and Gases are primary and classi-
fied air pollutants Secondary pollutants. primary pollutant Released directly from their
source in the atmosphere, however, primary air pollution sources can also be natural,
E.g. Volcanic eruptions, sandstorms etc. on Earth or by man-made as a result of burning
of fossil fuels, various types of air pollutants are released including gases released from
various appliances. Primary pollutants include sulfur dioxide (SO2), its oxide Nitro-
gen (NOx), Particulate Matter (PM) and Carbon Monoxide (CO). However, secondary
pollution is caused in the atmosphere Chemical or physical interaction between pri-
mary Pollutants Secondary pollutants include photochemical Oxidants and Secondary
Particulate Matter.
This project is work the machine learning algorithm used is gradient descent algo-
rithm, this algorithm used is prediction. Time series for wind Includes quality forecast-
ing, models for its prediction The device shows that the air quality in the area Gradient
Descent performs better than other machine learning algorithms.
I hope this provides some insight into the motivation behind an IoT and machine
learning-based air pollution Monitoring system.

1.4 Aims and Objectives


This project will use an IoT device to collect real time data and then analyze the data in
a machine learning model.

• To know the level of air pollution. To ensure better accuracy than before.

• To develop and design using Gradient Descent algorithm in prediction find the

3
most efficient model.

• Try to reduce power consumption and hardware dependencies.

• Real-time result.

1.5 Project Description


Air pollution is the presence of substances an atmosphere that is harmful to human
health Other organisms or that may harm the climate or Soot, smoke, mold, pollen,
methane and carbon from materials Dioxide is an example of a polluting substance.
Only air pollution monitoring system is very important but awareness will increase if
future pollution levels can also be predicted.
Therefore, a system that monitors air quality using MQ2 sensor, MQ6 sensor, MQ135
sensor, humidity and temperature sensor and PM2.5 and prediction of air quality index
for next one-hour machine learning model Using gradient descent of linear regression,
Creating the system This comparison is done using machine learning models What air
quality is like and what it might be like in the future. Our system can be used in small
area to monitor selected projects. Air quality can help reduce wind both remotely and
in turn.

1.6 Project Questions


What’s the main purpose of this system?
Actually, our project is about air pollution. The name of the project is IoT and
Machine Learning Based Air Pollution Monitoring System. In this project, we can
collect air data using different sensors and predict it using machine learning model and
show real time data.

4
Where use your project IoT and Machine Learning Based Air Pollution Moni-
toring System?
We have to use the project so that there is more or less air pollution. But use our
scheme in air polluted areas.
What device did you use in your project?
Device means sensors, such as: MQ2, MQ6, MQ125, Humanity and temperature
sensor, ESP Wife Module. connected wire.
Is this system full automated?
Yes. automated Our project is real time and can predict air pollution
How can a user use of this system?
User use any web browser, then search the name of the website and then can see
the current air condition and future air condition. Here not only with the values, the air
quality will be shown in the form of a beautiful graph.
What are the requirements needed for a user?
The requirement for the user in our project is that a smart phone or computer is
needed, then the user can use our project.
How are you fix about charge?
No, It’s free of our Project.
How well can machine learning support in reducing air pollution by forecasting
Air Quality Index?
There are many research papers on predicting AQI (Air Quality Index). Therefore,
literature review may be the most appropriate approach to the problem. The main goal
of this research question is how to supervise the compactness of machine learning al-
gorithm The strategy helps reduce air pollution by predicting its air quality indicators.
Performing a literature review, the most common supervised machine learning algo-
rithm Those employed to predict AQI will be identified.
Which is the most effective machine learning algorithm and has the most accu-
racy in predicting the Air Quality Index?
In this project, I trained and tested a few machine learning models, among them I
got the best accuracy in the gradient descent algorithm of linear regression. So now

5
the most effective machine learning algorithm is the gradient descent algorithm for our
project. air quality index prediction good accuracy this algorithm. So, we make We
build a model by training an algorithm to analyze the performance of the algorithm.
After review experimentation can give good results because we construct an efficient
model. The main goal of research is to find the most efficient model and Accurate
machine learning algorithm for prediction of AQI.

1.7 Project Outline


• Chapter 2: Literature Review The object of this discussions is to go over the
literature, compare it to other goods, take notes, and talk about it.

• Chapter 3: Requirements Analysis, System Specifications and Design We show


the requirements analysis, system specs, and a case study in this part. A summary
of our technique and design is also included.

• Chapter 4: Interface Design and Implementation Show case our user experience
and user interface of projects with screenshots where we get proper visible idea
about this project

• Chapter 5: Test Cases Multiple side of test case we showed in here. where we get
proper concept which data are valid and which are not valid.

• Chapter 6: Conclusion In this section, we discuss future works and limitations


and the conclusion

6
Chapter 2

Literature Review

2.1 Introduction
Air pollution is a significant public health concern globally, responsible for millions of
premature deaths each year. The integration of Internet of Things (IoT) and machine
learning (ML) can provide an effective tool for monitoring and predicting air pollution
levels, thereby mitigating its impact on human health and the environment. In this
chapter, we review recent studies on IoT and ML-based air pollution detection and
prediction. We researched some papers and they give below. Now we are show case
our unique results:

2.2 Literature Review


In [1] the AirGIS model accurately predicted the daily and annual average concen-
trations of PM2.5, PM10, and black carbon at several urban background stations in
Denmark. However, one of the studies noted that the model overestimated the con-
centrations of PM2.5 and PM10 at all stations, and the model’s performance could be
improved by updating the emissions input data to more recent data. The paper con-
cludes that the AirGIS model is a useful tool for air quality management and can help
mitigate the adverse effects of air pollution on human health and the environment. The
accurate predictions of PM2.5, PM10, and black carbon concentrations can help poli-

7
cymakers and environmental agencies make informed decisions regarding air pollution
management.
In [2], This paper reviews multiple studies that highlight the negative impact of air
pollution on cognitive and behavioral development in children. Exposure to air pollu-
tion can cause cognitive deficits, impairments in memory and attention, and can increase
the risk of autism and other neurodevelopmental disorders. The paper also identifies
vulnerable populations, such as low-income families and communities of color, who
are disproportionately affected by air pollution and face greater health risks. The au-
thors suggest several policy solutions to address the issue, including the adoption of
stronger air pollution regulations, promoting cleaner transportation options, increasing
public education and awareness, and ensuring equitable distribution of environmental
benefits and burdens.
In [3], This paper reviews the challenges associated with predicting air quality, in-
cluding the complexity of atmospheric processes and the large volume of data needed
to model them accurately. The authors argue that machine learning techniques, such
as artificial neural networks, can be effective in predicting air quality. The study uses
air quality data from various monitoring stations in California and meteorological data
from the National Oceanic and Atmospheric Administration (NOAA) to train and test
the machine learning model. The model’s performance is evaluated using several met-
rics, including mean absolute error and correlation coefficient. This paper finds that
the machine learning model can accurately predict air quality in California, with high
correlation coefficients and low mean absolute error values.
In [4], The authors argue that machine learning techniques, such as artificial neu-
ral networks and support vector machines, can be effective in predicting air pollution.
The study uses air quality data from various monitoring stations in Tehran and meteo-
rological data from the Iran Meteorological Organization to train and test the machine
learning model. The model’s performance is evaluated using several metrics, includ-
ing mean absolute error, root mean square error, and correlation coefficient. The paper
finds that the proposed machine learning approach can significantly improve air pollu-
tion prediction in Tehran, with lower mean absolute error and root mean square error

8
values compared to traditional air quality models. The model’s predictions can be used
to provide timely and accurate information to the public and policymakers, enabling
effective air quality management and public health protection.
In [5], The authors discuss the challenges associated with air pollution detection and
prediction, including the complexity of atmospheric processes and the limitations of tra-
ditional air quality models. They propose the use of machine learning techniques such
as decision trees and random forests to address these challenges. The authors report
that the machine learning models can accurately detect and predict air pollution levels,
with high accuracy, sensitivity, and specificity values. They suggest that the models’
predictions can be used to provide timely and accurate information to the public and
policymakers, enabling effective air quality management and public health protection.
In [6], They propose an integrated system that combines IoT sensors, data analytics,
and machine learning algorithms to provide real-time air quality information. The sys-
tem uses low-cost IoT sensors to collect data on various air pollutants, including PM2.5,
PM10, CO, NO2, and SO2. The data is transmitted to a cloud-based server where ma-
chine learning algorithms are used to predict air pollution levels. The system can also
generate alerts and recommendations based on the predicted air pollution levels. The
authors report that the proposed system can accurately predict air pollution levels with
high accuracy, sensitivity, and specificity values. They suggest that the system can be
used to provide real-time air quality information to the public and policymakers, en-
abling effective air quality management and public health protection.
In [7], The system uses low-cost IoT sensors to collect data on various air pollutants,
including PM2.5, PM10, CO, NO2, and SO2. The data is transmitted to a cloud-based
server, where machine learning algorithms are used to predict air pollution levels. The
system also generates alerts and recommendations based on the predicted air pollution
levels. The authors report that the proposed system can accurately predict air pollu-
tion levels with high accuracy, sensitivity, and specificity values. They suggest that
the system can be used to provide real-time air quality information to the public and
policymakers, enabling effective air quality management and public health protection.

9
2.3 Limitation of Existing Works
Those competitors didn’t have those lists of features that we found on our research-
ing the literature review. It’s a very disadvantage of their system. Those competitors
lacked the feature list that we discovered while investigating the literature review. It’s a
significant flaw in their system.
As a result, we found this type of limitation-

• Didn’t mention real time results.

• Can’t predict air pollution

• Result was not very convenient

• Can’t show real time results and low accuracy.

• Didn’t mention real time results or predict air pollution.

• Can’t show real time results. To get the result, we have to enter the data in the
dataset.

2.4 Conclusion
In conclusion, the integration of IoT and machine learning can provide an effective
tool for air pollution detection and prediction. IoT devices can provide real-time data,
while machine learning algorithms can analyze the data and provide accurate predic-
tions. Further research is needed to develop more efficient and accurate air pollution
monitoring and prediction systems. The application of IoT and machine learning in air
pollution detection and prediction can help policymakers, governments, and individuals
take proactive measures to reduce air pollution and improve air quality.

10
Chapter 3

Requirements Analysis

3.1 Introduction
In this chapter, we will discuss potential scenarios such as detailing features, functional
non-functional and defining user requirements. We will outline the features and solution
diagram.

3.2 System Design


Here are some user requirements for an IoT and machine learning-based air pollution
Monitoring system:

• Real-time air quality data: The system should provide real-time data on air qual-
ity, including PM2.5, PM10, NOx, SO2, and O3, to help users make informed
decisions about their exposure to air pollutants.

• Ease of use: The system should be easy to use and understand, even for non-
technical users, and provide clear and concise data. Accessibility: The system
should be accessible to a wide range of users, including individuals, communities,
and organizations.

• Accuracy: The system should provide accurate and reliable data to ensure the
safety of the users.

11
• Customization: The system should allow users to customize the data visualization
and alerts based on their preferences and needs.

• Integration: The system should be able to integrate with other relevant systems
and tools, such as urban planning and decision-making tools, to provide a com-
prehensive solution to air pollution management.

• Data privacy: The system should protect the privacy of the users’ data and ensure
that sensitive information is not shared without consent.

• Low cost: The system should be cost-effective, meaning it should provide a sig-
nificant benefit relative to its cost, to ensure it is accessible to as many users as
possible.

• Easy maintenance: The system should be easy to maintain and update to ensure
it continues to provide accurate and up-to-date data.

These are just some examples of user requirements for an IoT and machine learning-
based air pollution Monitoring system. Depending on the specific context and user
groups, the requirements may vary. However, these requirements can serve as a starting
point for developing a more detailed set of user requirements for the system.

3.3 Tools and Techniques


Here are some potential tools and techniques that could be used in an IoT and machine
learning-based air pollution Monitoring system:

• Operating System: Any kind of OS. We are built it in web-based and used third-
party android app.

• Text/Code Editor: Visual Studio Code, tinkercad, Google Colab, MS Word, python-
3.8.0, Latex.

12
• IoT Devices and Sensors: Breadboard, MQ2, MQ6, MQ135, Temperature and
Humidity, ESP WI-FI Module, AI Module, Wire.

• Data Storage and Management: Local server HiveMQ. Flask for Web, MQTT
Dashboard for android app.

• Programming Language: HTML, CSS, JavaScript, PYTHON, C++

Here are some potential tools and techniques that could be used in an IoT and ma-
chine learning-based air pollution monitoring system. The specific tools and techniques
may vary depending on the context and the requirements of the system.

3.4 Project Features


Here are some potential features that could be included in an IoT and machine learning-
based air pollution detection and prediction system:

• Real-time air quality monitoring: The system should provide real-time monitor-
ing of air quality, collecting data from IoT devices and sensors and transmitting
it to a central database for analysis.

• Prediction of air pollution levels: The system should use machine learning al-
gorithms to analyze historical and real-time data to predict future air pollution
levels. This can help authorities take proactive measures to prevent air pollution.

• Data visualization: The system should provide easy-to-understand visualizations


of air quality data, including maps, charts, and graphs. This can help users better
understand air pollution trends and patterns.

• Air quality forecasting: The system should use machine learning algorithms to
forecast air quality levels for specific times in the future. This can help users plan
their activities and avoid exposure to high levels of air pollution.

13
• Integration with other systems: The system should be designed to integrate with
other systems, such as weather forecasting systems and traffic management sys-
tems, to provide more accurate predictions and recommendations.

• Mobile application: The system should include a mobile application MQTT Dash-
board that allows users to access air quality data and receive alerts on their smart-
phones. This can help users stay informed and take action to protect their health.

• Secure data storage and transmission: The system should ensure that air qual-
ity data is securely stored and transmitted, using encryption and other security
measures to protect user privacy.

Here are some features that could be included in an IoT and machine learning-
based air pollution monitoring system. The specific features may vary depending on
the context and the requirements of the system.

3.4.1 Functional Requirement

Here are some functional requirements for an IoT and machine learning-based air pol-
lution Monitoring system:

• Real-time data collection and transmission: The system should collect real-time
air quality data from IoT devices and sensors and transmit it to a central database
for analysis. The data transmission should be reliable and secure.

• Data preprocessing: The system should preprocess the collected data to remove
noise and outliers and to fill in missing data.

• Data analysis and prediction: The system should use machine learning algorithms
to analyze the air quality data and predict future air pollution levels. The algo-
rithms should be accurate and fast, able to handle large amounts of data in real-
time.

14
• Data visualization: The system should provide easy-to-understand visualizations
of air quality data, including graphs. The visualizations should be customizable
and provide various options for users to interact with the data.

• Air quality forecasting: The system should use machine learning algorithms to
forecast air quality levels for specific times in the future. The system should also
provide a probability estimation of air pollution levels and update the forecast
continuously as new data becomes available.

• Integration with other systems: The system should be able to integrate with other
systems, such as weather forecasting systems and traffic management systems, to
provide more accurate predictions and recommendations. The integration should
be seamless and customizable.

• Mobile application: The system should include a mobile application that allows
users to access air quality data on their smartphones. The application should be
user-friendly and available on multiple platforms.

• Data privacy and security: The system should ensure that air quality data is se-
curely stored and transmitted, using encryption and other security measures to
protect user privacy. The system should also comply with relevant data privacy
regulations.

Here are some functional requirements for an IoT and machine learning-based air
pollution Monitoring system. The specific requirements may vary depending on the
context and the requirements of the system.

3.4.2 Non Functional Requirement

Here are some potential non-functional requirements for an IoT and machine learning-
based air pollution Monitoring system:

• Reliability: The system should be highly reliable, with a high level of uptime and
minimal downtime. The system should also have a fail-safe mechanism to ensure
that data collection and transmission continue in the event of a failure.

15
• Scalability: The system should be easily scalable to accommodate a large number
of IoT devices and sensors. The system should also be able to handle a large
amount of data in real-time.

• Performance: The system should be highly performant, with fast data processing
and analysis times. The system should also have minimal latency to ensure real-
time data transmission and analysis.

• Usability: The system should be user-friendly and easy to use. The system should
also provide clear and concise documentation to guide users through its features
and functionality.

• Accessibility: The system should be accessible to users with disabilities. The


system should also provide multiple language options to accommodate users who
speak different languages.

• Interoperability: The system should be interoperable with other systems and tech-
nologies, allowing for easy integration with other systems and technologies.

• Security: The system should be highly secure, with robust security measures
in place to protect user privacy and data. The system should also comply with
relevant data privacy regulations.

• Maintainability: The system should be easy to maintain, with a clear and concise
maintenance guide. The system should also provide alerts and notifications when
maintenance is required.

• Performance monitoring: The system should provide a mechanism to monitor


system performance and identify potential performance issues before they be-
come critical.

• Cost-effectiveness: The system should be cost-effective to implement and oper-


ate, with a reasonable cost for hardware, software, and maintenance. The system
should also provide a clear cost-benefit analysis to help users understand the value
of the system.

16
These are some non-functional requirements for an IoT and machine learning-based air
pollution Monitoring system. The specific requirements may vary depending on the
context and the requirements of the system.

3.5 Software Development Life Cycle


SDLC Model Selection
Methodology
The term ”system development life cycle” or SDLC’ is a standard industry term used
in systems engineering, information systems, and software engineering to describe the
process of planning, building, testing, and deploying an information system.
Each stage consists of a series of steps that are completed to reach the final product.
It consists of 5 stages:

a. The Planning Phase

• Defining the problem

• Setting project objectives

• Identifying constraints

• Creating project proposals

• Establishing control mechanisms

b. The Analysis Phase

• Creating the project team

• Defining information needs

• Identification and evaluation of sources of information

• Identification and description of the types of information needed.

• Identification and description of problem areas in the current system

• Information flow and needs documented using system modeling tools.

17
• Identification and description of problem areas in the current system

• Defining system performance

• Creating a design proposal

c. The Design Phase

• Factors to be considered when designing the output requirements.

• Factors to be considered when designing the input requirements.

• Processing requirements

• Evaluating alternative system configurations

• Select the best configuration.

d. The Implementation Phase

• Transform the detailed requirements and design into a system.

• Testing individual elements (units) for usability

• Preparing for integration and testing of the system

• Acquisition of new equipment (H/W and S/W)

• Preparing the physical facilities

• Educating users

• Developing an implementation schedule

e. The Maintenance Phase

• Using the system

• Auditing the system

• Maintaining the system

• Re-engineering proposal.

18
3.5.1 SDLC Models

The following are the most important and popular SDLC models followed in the indus-
try.
• Waterfall Model
• Iterative Model
• Agile Model
• Spiral Model
• V-Mode

Figure 3.1: SDLC Life Cycle

3.5.1.1 Waterfall Model

The waterfall is the oldest and the most straightforward SDLC model on the market.

• Requirement gathering and analysis.

• System design.

• Coding.

19
• Testing.

• Product deployment.

• Software maintenance.

Figure 3.2: Waterfall Modde

The stages of a waterfall run sequentially, and each stage depends directly on the
results of the previous stage (that is, each stage ”waterfalls” into the next stage). In a
true waterfall model, the team never takes a step back after completing a stage, so the
success of the model depends on the team’s ability to avoid mistakes.
Pros of this model:

• A tried-and-tested methodology with a logical progression of steps perfect for


simple products.

• A simple SDLC that everyone in the company easily understands.

Cons of this model:

20
• Not a worthy option when working on projects with little notice as there’s no way
to skip any steps.

• There is little room for alteration once a step ends (at least not without affecting
the cost and delivery time).

• Not ideal for projects with inexact or changing needs.

Why Waterfall model is not applicable for our projects:

• Requirements Gathering: It is not possible to gather all the requirements. Re-


quirements may have arrived in the developed phase. That means our project is
dynamic. New requirements can arrive any time.

• System Design: As we are developing a large project. So, we have divided our
project into developer. But if we use the waterfall model, we can’t do that. If we
want to use waterfall model, we must use it for finishing every phase develop-
ment.

• New features: new features can be requested by organizations or a company at


any time. If we use waterfall model, we can’t implement new features easily.

• Maintenance: Maintenance is costly and time consuming because maintenance


must check every phase of the project.

3.5.1.2 Spiral Model

The spiral model is a risk driven SDLC strategy. This model emphasizes the repetition
of its four core stages:

• Determine objectives.

• Identify and resolve risks.

• Development and testing (typically involve some form of prototyping).

• Evaluate results and plan the next iteration.

21
Figure 3.3: Spiral Modde

The idea is to go through these stages repeatedly while making gradual improve-
ments at each pass. The team continuously analyzes needs and makes prototypes while
going through the same four-step cycle.
Pros of the model:

• The team easily goes back a step in the cycle in case of an error.

• In-depth risk analysis makes this SDLC the go-to model for businesses in compliance-
heavy industries.

• An excellent fit for large projects with hard-to-define requirements and scope.

Cons of the model:

• The cost often spirals out of control if the team goes through too many iterations.

• Requires a skilled team to evaluate when to end iterations and move on to the next
SDLC phase.

• An ”overkill” for smaller projects with few dependencies and simple require-
ments.

22
Why Spiral model is not applicable for our projects:

• Can be a costly model to use.

• Risk analysis requires highly specific expertise.

• Project’s success is highly dependent on the risk analysis phase.

• Doesn’t work well for smaller projects.

3.5.1.3 Iterative Model

The iterative incremental model requires the team to quickly deploy an incomplete ver-
sion of the software at the end of each development cycle.

Figure 3.4: Iterative Moddel

Pros of this model:

• Easily handles small-to-medium changes in product requirements.

• Gathers user and stakeholder feedback at every iteration.

• Regular risk analysis ensures the product is secure by design and you discover
defects early in the SDLC.

• Dividing projects into smaller chunks makes managing the product and analyzing
progress easier.

23
Cons of this model:

• Requires a solid understanding of product requirements before you deploy the


first iteration.

• The model puts a burden on users and stakeholders by asking for continuous
feedback.

Why Iterative model is not applicable for our projects:

• System Design: Our project is not suitable for dividing into many parts. So, the
Iterative model will be costly and not that effective.

• New Features: New features can be implemented but it is very costly and time-
consuming.

• Maintenance: We need a big and highly skilled developer team for the mainte-
nance iterative model. Which is costly and hard to manage.

3.5.1.4 Agile Model

The agile methodology relies on ongoing release cycles that make small, incremental
changes to the previous release. Builds evolve as teams add new features and improve-
ments with each deployment.
The agile model requires the team to work in sprints that last for 2 to 4 weeks, each
with unique requirements and goals. At the end of a sprint, the product owner verifies
the code and greenlights its deployment to users. The team then gathers feedback and
starts preparing for the next sprint.

24
Figure 3.5: Agile Moddel

Pros of this model:

• The go-to model for companies wishing to keep up with rapidly changing mar-
kets.

• Emphasizes code quality from the start of an SDLC.

• Identifies and addresses issues before they evolve into significant problems.

• Makes it easy to get meaningful feedback from stakeholders and end-users.

Cons of this model:

• Requires an experienced and highly skilled team.

• Maintaining documentation in a fast-paced agile SDLC is a challenge.

Why We Select Agile Model for our project:


We can see from the table that, Waterfall scores 15, Iterative scores 20, Agile scores
30 and Spiral scores 25. Here our most important categories are supported by Agile
scores 30. So we will prefer Agile Model as a best option for our project.

25
Table 3.1: Depicts our reasoning behind the selection of AGILE software development
lifecycle for our project

Priority Criteria Waterfall Model Iterative Model Agile Model Spiral model
5 Clear Requirment Yes Yes No No
5 Technaical Abilities Yes Yes Yes Yes
5 Efficinecy No No Yes No
3 User Testing No No Yes Yes
5 Security No Yes Yes Yes
7 Time Period No No Yes Yes
5 Documentation No Yes No Yes
5 Budget Yes No Yes No
40 Total 15 20 30 25

• Changes in System: For our project the time, new changes need to be imple-
mented. The freedom agile gives to change are very important. New changes can
be implemented at very little cost because of the frequency of new increments
that are produced.

• Requirements arrive in implementation and Maintenance Phase: Unlike the wa-


terfall model in agile model very limited planning is required to get started with
the project. Agile assumes that the end users’ needs are ever changing dynami-
cally. Changes can be discussed, and features can be newly effected or removed
based on feedback. This effectively gives the customer the finished system they
want or need.

The Agile model is an iterative and incremental approach to software development that
emphasizes flexibility, collaboration, and customer satisfaction. It is a popular method
of software development that has gained widespread adoption in recent years.
The Agile model is designed to be flexible and adaptable, allowing development
teams to respond quickly to changing requirements and customer feedback. The model

26
places a strong emphasis on communication and collaboration between team members
and with customers.

3.6 Gantt Chart


Gantt charts are used to show our project timelines. This is a popular way of depicting a
project schedule. A Gantt chart is a graphical representation of a project that depicts the
work of each activity as a separate bar graph. Here we will show the case time frame
of our project called Gantt Chart. This is one of the popular ways to depict project
schedules. A Gantt chart is a graphical representation of a project that displays each
action task as a horizontal bar whose length is proportional to its achievement time. A
Gantt chart for project deliverables by time frame. This project Gantt chart is shown
below:

Figure 3.6: Gantt Chart

3.7 Risk Analysis


To test the accuracy and reliability of the air quality detection and prediction system,
which is based on IoT sensors and machine learning algorithms.

27
• Maintenance Time: Take a lot of time for maintenance. For example, the server
is down for 1 day every week.

• High Response time: Take load of time after requesting a service.

• Availability: Most of time the system remains offline.

• Reliability: The system is not reliable.

• Security: The data are taken from the customers not shared with third companies
or not used for personal benefits

Figure 3.7: Risk Analysis

28
3.7.1 Risk Probability and Impact

The risk register is where most risk information is kept. Results of risk analysis and risk
reply development are logged. Risk registration starts with the identification process.
The risk register includes:

• List of identified risks, in as much detail as is reasonable, such as the effect, or


cause, or leading effect of the event, root cause of the risk, etc.

• Ownership of potential risks. Where a potential risk owner is identified during


the risk identification process, the risk owner is recorded in the risk register. This
will be ensured while performing the qualitative risk analysis process.

• List of potential responses, potential responses to risk can sometimes be identified


in this process and used as input to the planning risk response process.

3.8 Use Case Diagram


Use case diagrams capture system functionality and requirements using actors and use
cases. Use cases model facilities, tasks, purposes that some system requirements to do.
Use cases signify high-level functionality and in what way a user would function the
system. Use-cases are the core idea of Unified Showing Language Modeling.
In this use case diagram, we determine our project main module like as Check Hu-
midity, Check Temperature, Check Smoke Level, Check Air Quality, Check Predicted
Temperature, check Predicted Air Quality etc. And also have 4 types of actors they’re
User, Web Developer, IoT Device Manager, ML Developer.

29
Figure 3.8: Illustrates our Use Case Diagram

3.9 Data Flow Diagram


Now we are presenting data flow diagram first, we have the DFD level 0 and then we
Have DFD level 1. We design this DFD for It is capable of illustrating incoming data
flow, outgoing data flow and storing data, and data flow diagram describes anything
About how data flows through the system.

3.9.1 DFD Level 0

DFD (Data Flow Diagram) Level 0 is a graphical representation of a system’s main


processes and their relationships with external entities. It shows the system’s high-level
view and provides an overview of the system’s processes and how data flows between
them. In a DFD Level 0, there is only one process that represents the entire system,
which interacts with external entities. The external entities represent the inputs and
outputs of the system,

30
Figure 3.9: Illustrates our DFD Level 0 Diagram

Here are 4 actors and they are user IoT device manager, ML developer, web devel-
oper. User can request sensor data and they can get overall process result and they also
can request quality and prediction data. On the other side IoT device manager can man-
age sensor and they can a provide real time data, ML developer can also get sensor data
on the other side web developer can get the data and they can develop the web page.

3.9.2 DFD Level 1

DFD level 1 is a high-level view of the system that shows the major processes, data
sources and sinks, and data flows. DFD level 1 is useful in understanding the system’s
overall structure, identifying the major processes and data flows, and providing a frame-
work for more detailed analysis. It is often used as a starting point for developing more
detailed DFDs or for identifying areas where improvements or changes can be made to
the system.

31
Figure 3.10: Illustrates our DFD Level 1 Diagram

From IoT database user can check the air quality, humidity level, temperature. And
also can know the smoke level and prediction level of temperature and air quality from
the server which will be visualized by the web developer. Then it will have passed in
the ML database and then IoT manger will manage the sensors and read the data. Then
ML developer will develop the ML model, Train and Test the model.

32
3.10 Entity Relation Diagram (ER)
An ER (Entity-Relationship) diagram is a type of graphical representation that illus-
trates how entities relate to each other within a database. ER diagrams are commonly
used in database design to model the relationships between entities and the attributes
of those entities. The ER diagram uses various symbols to represent entities, attributes,
and relationships.ER diagrams are useful in database design because they provide a vi-
sual representation of the relationships between entities, which can help in identifying
potential issues or inconsistencies in the database structure.

Figure 3.11: Illustrates our Entity Relation Diagramm

In this diagram we create relationship between different type entity. Here IoT server
has one to many relationships with IoT device, web server and ml data base, IoT server
and ml dataset and lastly database and ml dataset has one to many relationships.

33
3.11 System Architecture
System architecture is the process of designing and organizing the structure of a system,
which includes hardware, software, and network components, to ensure that it meets
its functional and non-functional requirements. It involves the identification of com-
ponents, the specification of their properties and the relationships between them, and
the development of interfaces and protocols to enable communication and coordination
among them.

Figure 3.12: Illustrates our System Architecture.

First the IoT device will collect the data and then it will send this data to the server.
After that this data will go to the ML model and again this data will come to the server
for prediction, that will be sent to the Mobile application (MQTT Dashboard) and web
server.

3.12 Conclusion
The IoT and machine learning-based air pollution detection and prediction system should
have a sensor network that can detect and measure various air pollutants in real-time and
transmit the data to a central server. The system should also use machine learning al-
gorithms to analyze the data and predict air pollution levels. Additionally, the system
should have a user interface for users to view air pollution levels when pollution levels
exceed safe thresholds.

34
In this phase we covered actually interview process, risk elaborately analysis and
allusion all of them parts. Concluded this section we properly realize what type of risk
are arising and which to give priority according to the chart. And many question when
that inquiry arrive and answer are help to figure proper system.

35
Chapter 4

Interface Design and Implementation

4.1 Introduction
In this chapter, we will describe IoT and Machine Learning Based Air Pollution Moni-
toring System.

4.2 Reason for Selecting Linear Regression Gradient De-


scent.
Linear regression using gradient descent is a popular machine learning algorithm that
can be used for air quality detection and prediction. There are several reasons why this
algorithm is well-suited for this application:

• Linearity: Linear regression is a linear approach to modeling the relationship


between a dependent variable (air quality) and one or more independent variables
(environmental variables such as temperature, humidity, and wind speed). In air
quality detection and prediction, it is reasonable to assume that there is a linear
relationship between air quality and these environmental variables.

• Efficiency: Gradient descent is a highly efficient algorithm that can quickly con-
verge to the optimal solution. This is especially important for air quality detection
and prediction, where timely predictions are crucial.

36
• Robustness: Linear regression using gradient descent is a robust algorithm that
can handle noise and outliers in the data. In air quality detection and prediction,
there can be various factors that affect air quality, and these factors can be highly
variable.

• Interpretability: Linear regression is a simple and interpretable algorithm, which


makes it easy to understand the relationship between air quality and environmen-
tal variables. This is essential for policymakers and stakeholders who need to
understand the factors that affect air quality and make informed decisions.

In summary, linear regression using gradient descent is a well-suited algorithm for air
quality detection and prediction due to its linearity, efficiency, robustness, and inter-
pretability.

4.3 Comparison between Machine Learning algorithms


There are many machine learning algorithms that can be used for air pollution and mon-
itoring systems in the context of the Internet of Things (IoT). The choice of algorithm
will depend on the specific requirements of the system and the available data. However,
some algorithms that are commonly used in this context are:

• Random Forest: Random Forest is a popular algorithm for air pollution and mon-
itoring systems because it can handle both categorical and continuous data, and it
can identify important features that affect air quality. It is also relatively fast and
can handle large amounts of data.

• Gradient Boosting: Gradient Boosting is another popular algorithm for air pollu-
tion and monitoring systems. It is an ensemble method that combines multiple
weak learners to create a strong learner. It can handle large data sets and is often
used when there are complex relationships between the features.

• Long Short-Term Memory Networks (LSTM): LSTMs are a type of recurrent


neural network that can be used for time-series data. They are often used for air

37
quality monitoring because they can capture the long-term dependencies in the
data and can make accurate predictions.

• Support Vector Machines (SVMs): SVMs are another commonly used algorithm
for air quality monitoring. They can handle both linear and nonlinear data and
can accurately classify data into different categories.

Algorithm Name Accuracy


Random Forest 92.3%
Linear regression gradient descent 97.9%
Long Short-Term Memory Networks (LSTM) 88.2%
Support Vector Machine 91.9%

Table 4.1: Comparison Between Different Machine Learning Algorithm

Figure 4.1: Data Ploting

38
Figure 4.2: Data Plotting

Figure 4.3: Data Correlation

4.4 User Interface Design


Designing a user interface for an IoT and machine learning-based air pollution detection
and prediction system, we have gathered several requirements for the project from our
preliminary research, and interviews with concerned personnel and their experiences
regarding the concept of its development. Then we decided to develop a device with
different logic flows and new languages that would be suitable for smaller organizations.

39
4.5 Implementation
Here is our project IoT and Machine Learning Based Air Pollution Monitoring System
device.

Figure 4.4: Sensors and Esp Module on Breadboard

Here is our project IoT device. To create this device, we use some sensors like MQ2,
MQ6, MQ135, Temperature and Humidity sensor and ESP WI-FI module.

40
Figure 4.5: IoT Device

4.6 Sensors

Figure 4.6: MQ2 Sensor Figure 4.7: MQ6 Sensor

Now we will describe the sensors details which we have used in our project device-

• MQ2 Sensor: The MQ-2 gas sensor is a popular type of gas sensor that can detect
various types of gases in the air, including smoke, propane, methane, and other
flammable gases. It is a semiconductor type sensor that uses a small heater and an

41
Figure 4.9: Temperature and Hu-
Figure 4.8: MQ135 Sensor midity sensor

Figure 4.10: ESP WIFI module Figure 4.11: Breadboard

electrochemical sensor to detect the presence of gases. The MQ-2 sensor is often
used in air quality monitoring systems, gas leak detectors, and other applications
where gas detection is important.

• MQ6 Sensor: The MQ-6 gas sensor is a type of gas sensor that is commonly used
for detecting various types of gases, including LPG (Liquefied Petroleum Gas),
butane, propane, and methane. It is a semiconductor type sensor that uses a small
heater and an electrochemical sensor to detect the presence of gases.

• MQ135 Sensor: The MQ-135 gas sensor is a type of gas sensor that is commonly

42
used for detecting various types of gases, including ammonia, nitrogen oxides,
benzene, smoke, and other harmful gases. It is a semiconductor type sensor that
uses a small heater and an electrochemical sensor to detect the presence of gases.

• Temperature and Humidity sensor: Temperature sensors can detect the temper-
ature of the surrounding environment by measuring the change in resistance or
voltage in a thermistor or a thermocouple. Humidity sensors, on the other hand,
detect the amount of moisture in the air by measuring changes in capacitance,
resistance, or voltage.

• ESP WIFI module: The ESP32 is a powerful Wi-Fi and Bluetooth-enabled mi-
crocontroller that is widely used in the Internet of Things (IoT) applications. It
is the successor to the popular ESP8266 microcontroller, and it offers many new
features and capabilities.

• Breadboard: A breadboard is a prototyping tool used to build and test electronic


circuits. It consists of a plastic board with a grid of holes that are used to insert
and connect electronic components using wires and jumper cables.

43
4.7 Landing Page (WEB)
Here is our project landing page, we can see that in this page project name is given and
shows the Temperature Prediction level and Air Quality Prediction level.

Figure 4.12: Landing Page of IoT and Machine Learning Based Air Pollution Monitor-
ing System

44
Figure 4.13: Temperature Visualization

we can see that; this page is predict Temperature page. Show predict value using
graph.

Figure 4.14: Air Quality Visualization

we can see that; this page is Predict Air Quality page. Show predict value using
graph.

45
4.8 Landing Page ( APP)
For android application we are using third part app MQTT Dashboard.

Figure 4.15: Real Time Data Visualization

46
Figure 4.16: Graph of Smoke, Natural Gas and Air Quality

47
Chapter 5

Test Case

Software Testing is a method to check whether the actual software product matches
expected requirements. In our project we have to test our system be in all the possible
way we could because if there are any bugs or errors in the software, it can be identified
early and can be solved before delivery of the software product. Properly tested software
product ensures reliability, security and high performance which further results in time
saving, cost effectiveness and customer satisfaction

• Test the accuracy of the IoT sensors

• Test the machine learning algorithm.

• Test the system’s performance under different environmental conditions.

• Test the system’s scalability and reliability. Various testing, we have done those
are describing in below.

48
49
50
51
52
53
54
55
Figure 5.1: User Testing

56
Chapter 6

Conclusion and Future Work

In this chapter, Project achievements and goals are defined. Throughout the duration
of this project, limitations and difficulties have been identified, recommendations and
future upgrades that will be implemented in due course.

6.1 Summary
In summary, the IoT and machine learning-based air pollution Monitoring system is
a powerful tool that combines the power of sensors and machine learning algorithms
to provide real-time and accurate predictions of air pollution levels. By deploying air
quality sensors in different locations and collecting data in real-time, this system can
identify pollution hotspots and provide valuable insights into the causes and effects of
air pollution in different areas.
The machine learning algorithms can learn from the past data and make accurate
predictions of air pollution levels in the future. By using a dashboard for easy visual-
ization of the data, policy-makers and citizens can take necessary actions to improve air
quality and promote public health. In the future, there is a lot of potential for further
development and improvement of air pollution detection and prediction systems using
IoT and machine learning technology.
This includes improving the accuracy of sensor data, developing better machine
learning models, expanding the deployment of air quality sensors, and integrating with

57
other systems.
Overall, the IoT and machine learning-based air pollution Monitoring system has
great potential to revolutionize the way we monitor and manage air pollution. With
further research and development, this technology can become even more effective in
predicting and mitigating air pollution levels, improving the quality of air monitoring
and promoting public health.

6.2 Limitation of Work


Despite the numerous benefits of the IoT and machine learning-based air pollution mon-
itoring system, there are also some limitations that need to be addressed. Some of these
limitations include:

• Limited sensor accuracy: The accuracy of the air quality sensors can be limited,
and this can lead to inaccuracies in the data collected.

• High cost of deployment: The deployment of air quality sensors in large numbers
can be expensive, especially in areas with limited resources.

• Limited coverage: The air quality sensors may not be deployed in all areas, and
this can limit the accuracy of the predictions in areas without coverage.

• Limited data availability: The data collected may be limited, and this can affect
the accuracy of the machine learning algorithms.

• Weather dependency: Air pollution levels can be highly dependent on weather


conditions, and this can limit the accuracy of the predictions in highly dynamic
and complex environments.

• Ethical concerns: The use of data collected by air quality sensors and machine
learning algorithms may raise privacy concerns, and the appropriate ethical con-
siderations need to be addressed.

58
Overall, the IoT and machine learning-based air pollution monitoring system has the
potential to improve the quality of air monitoring and promote public health. However,
it is important to consider the limitations of the technology and address them to ensure
that it is effective and beneficial in the long term.

6.3 Future Works


In the future, there is a lot of potential to further develop and improve air pollution
detection and prediction systems using IoT and machine learning technology. Some of
the areas where further work is needed include:

• Improving the accuracy of sensor data: Air pollution sensors have some limita-
tions in terms of accuracy, and further work is needed to improve the precision
and reliability of sensor data.

• Developing better machine learning models: Machine learning models can be


further refined to provide more accurate predictions of air pollution levels, even
in highly dynamic and complex environments.

• Expanding the deployment of air quality sensors: There is still a need to deploy
air quality sensors in more areas to provide more comprehensive coverage and a
better understanding of air pollution patterns.

• Integrating with other systems: Air pollution prediction systems can be integrated
with other systems like traffic management systems and weather forecasting sys-
tems to improve the accuracy of air pollution predictions.

Overall, air pollution detection and prediction systems using IoT and machine learning
technology have great potential to improve air quality and reduce the harmful impact
of air pollution on public health and the environment. With further research and devel-
opment, these systems can become even more accurate and effective in predicting and
mitigating air pollution levels.

59
The IoT and machine learning-based air pollution detection and prediction system
has great potential for further development and improvement in the future. Some po-
tential future works include:

• Increasing the accuracy of sensor data: Improving the accuracy of air quality
sensors can lead to more precise data collection, which can improve the accuracy
of the predictions.

• Integrating with other systems: Integrating air pollution monitoring systems with
other environmental monitoring systems, such as weather monitoring systems,
can provide a more complete picture of the factors that contribute to air pollution.

• Expanding the deployment of air quality sensors: Deploying air quality sensors
in more areas can increase the coverage of the system, providing more data for
predictions.

• Improving machine learning models: Developing more advanced machine learn-


ing algorithms and models can improve the accuracy of the predictions and reduce
the risk of false positives.

• Enhancing visualization and communication tools: Improving the dashboard and


other visualization tools can help make the data more accessible and useful to
policy-makers and the public, promoting more effective decision-making.

• Developing interventions: Using the predictions from the system to inform in-
terventions can help reduce air pollution levels and promote public health. For
example, the system could inform the implementation of targeted policies or in-
form the public on how to reduce their own emissions.

Overall, the IoT and machine learning-based air pollution detection and prediction
system has a lot of potential for further development and improvement in the future.
These potential future works can help to make the system even more effective and
beneficial for public health and the environment.

60
References

[1] U. A. Hvidtfeldt, M. Ketzel, M. Sørensen, O. Hertel, J. Khan, J. Brandt, and O.


Raaschou-Nielsen, “Evaluation of the danish airgis air pollution modeling system
against measured concentrations of pm2.5, pm10, and black carbon,” Environ-
mental Epidemiology, vol. 2, no. 2, p. e014, 2018.

[2] D. C. Payne-Sturges, M. A. Marty, F. Perera, M. D. Miller, M. Swanson, K. El-


lickson, D. A. Cory-Slechta, B. Ritz, J. Balmes, L. Anderko etal., “Healthy air,
healthy brains: advancing air pollution policy to protect children’s health,” Amer-
ican journal of public health, vol. 109, no. 4, pp. 550–554, 2019.

[3] M. Castelli, F. M. Clemente, A. Popoviˇc, S. Silva, and L. Vanneschi, “A machine


learning approach to predict air quality in california,” Complexity, vol. 2020, 2020.

[4] Delavar, M.R.; Gholami, A.; Shiran, G.R.; Rashidi, Y.; Nakhaeizadeh, G.R.; Fe-
dra, K.; Hatefi Afshar, S. A Novel Method for Improving Air Pollution Prediction
Based on Machine Learning Approaches: A Case Study Applied to the Capital
City of Tehran. ISPRS Int. J. Geo-Inf. 2019

[5] Aditya, C.R.; Chandana, R.D.; Nayana, D.K.; Praveen, G.V. Detection and Pre-
diction of Air Pollution using Machine Learning Models. Int. J. Eng. Trends Tech-
nol.(2017)

[6] ”A Smart IoT and Machine Learning Based Air Pollution Monitoring System”
by A. Kumar, A. Malhotra, and A. Singhal: This paper proposes an air pollution
monitoring system that utilizes IoT sensors to collect data and machine learning
algorithms to predict air (2020)

61
[7] Air Pollution Monitoring and Prediction using IOT and Machine Learning Ssneha
Balasubramanian1 , Talapala Sneha2 , Vinushiya B 3 , Saraswathi S 4(2020)

[8] ”Air Quality Monitoring System Based on IoT and Machine Learning” by
Shahzad Hussain, M. Adeel, and M. Naeem: This paper presents a system that
utilizes IoT sensors to measure air quality parameters and machine learning algo-
rithms to predict air pollution levels.(2022)

[9] ”Design of an Air Pollution Monitoring System based on IoT and Machine Learn-
ing” by Mohit Prasad, Gaurav Mittal, and Anshul Kharbanda: This project utilizes
IoT sensors and a machine learning algorithm to measure and predict air pollution
levels. The system is designed to be low-cost and easy to deploy.(2022)

[10] ”Air Quality Prediction System based on IoT and Machine Learning” by Sarthak
Jain and Shubham Aggarwal: This project utilizes IoT sensors to collect air quality
data and a machine learning algorithm to predict future air pollution levels. The
system is designed to be low-cost and easy to deploy.(2021)

[11] ”Smart Air Pollution Monitoring System based on IoT and Machine Learning” by
Dharmesh Kumar and Ankita Jaiswal: This project utilizes IoT sensors to measure
air quality parameters and a machine learning algorithm to predict air pollution
levels. The system is designed to be low-cost and easy to deploy.(2021)

62
List of Acronyms

WSN Wireless Sensor Network


EH-WSN Energy Harvesting Wireless Sensor Network
ORP Optimal Relay Placement
SMRMC Sustainable Minimum Relay Maximum Connectivity
MILP Mixed Integer Linear Program
MATLAB Matrix Laboratory

63
List of Symbols

β Alpha
α Beta
θ Theta
γ Gamma
ρ Rho (Density)
π Pi (3.1416)

64

You might also like