Capstone Project
Capstone Project
Submitted by
Md. Shamiul Hossain (191002015)
Shahidul Islam (191002355 )
Ali Emam Al Mahmud (19120377)
Supervised by
Ms. Shifat Ara Rafiq
Lecturer, Department of CSE
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.
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.
Accepted and approved in partial fulfillment of the requirement for the degree Bach-
elor of Science in Computer Science and Engineering.
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
5 Test Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
vi
6.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.2 Limitation of Work . . . . . . . . . . . . . . . . . . . . . . . 58
6.3 Future Works . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
vii
List of Figures
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
ix
List of Tables
3.1 Depicts our reasoning behind the selection of AGILE software devel-
opment lifecycle for our project . . . . . . . . . . . . . . . . . . . . . 26
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.
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.
• 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.
• Real-time result.
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.
• 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.
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:
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-
• 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.
• 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.
• 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.
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.
• 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.
• 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.
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.
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.
• 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.
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.
• Identifying constraints
17
• Identification and description of problem areas in the current system
• Processing requirements
• Educating users
• 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
The waterfall is the oldest and the most straightforward SDLC model on the market.
• System design.
• Coding.
19
• Testing.
• Product deployment.
• Software maintenance.
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:
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).
• 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.
The spiral model is a risk driven SDLC strategy. This model emphasizes the repetition
of its four core stages:
• Determine objectives.
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.
• 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:
The iterative incremental model requires the team to quickly deploy an incomplete ver-
sion of the software at the end of each development cycle.
• 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:
• The model puts a burden on users and stakeholders by asking for continuous
feedback.
• 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.
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
• The go-to model for companies wishing to keep up with rapidly changing mar-
kets.
• Identifies and addresses issues before they evolve into significant problems.
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.
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.
27
• Maintenance Time: Take a lot of time for maintenance. For example, the server
is down for 1 day every week.
• Security: The data are taken from the customers not shared with third companies
or not used for personal benefits
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:
29
Figure 3.8: Illustrates our Use Case Diagram
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.
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.
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.
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
4.1 Introduction
In this chapter, we will describe IoT and Machine Learning Based Air Pollution Moni-
toring System.
• 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.
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.
• 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.
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.
38
Figure 4.2: Data Plotting
39
4.5 Implementation
Here is our project IoT and Machine Learning Based Air Pollution Monitoring System
device.
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
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
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.
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.
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.
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 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
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.
• 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.
• 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.
• 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.
• 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.
• 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
[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
63
List of Symbols
β Alpha
α Beta
θ Theta
γ Gamma
ρ Rho (Density)
π Pi (3.1416)
64