0% found this document useful (0 votes)
25 views162 pages

VPM Blackbook

The project report titled 'Vehicle Pollution Monitoring Using IoT' details a system designed to monitor vehicle emissions in real-time using IoT technology. The project aims to address air pollution caused by vehicular emissions, providing a solution that collects and analyzes data on pollutants, and alerts users when emissions exceed government-set thresholds. The report includes various sections such as system design, implementation, testing, and feasibility study, showcasing the project's comprehensive approach to tackling environmental issues.

Uploaded by

riyatorane1234
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)
25 views162 pages

VPM Blackbook

The project report titled 'Vehicle Pollution Monitoring Using IoT' details a system designed to monitor vehicle emissions in real-time using IoT technology. The project aims to address air pollution caused by vehicular emissions, providing a solution that collects and analyzes data on pollutants, and alerts users when emissions exceed government-set thresholds. The report includes various sections such as system design, implementation, testing, and feasibility study, showcasing the project's comprehensive approach to tackling environmental issues.

Uploaded by

riyatorane1234
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/ 162

MARATHA VIDYA PRASARAK

SAMAJ’S RAJARSHI SHAHU


MAHARAJ POLYTECHNIC NASHIK-
422013

PROJECT REPORT ON

“VEHICLE POLLUTION MONITORING USING IoT”


SUBMITTED BY

1. ADITYA BHALCHANDRA GHOTEKAR 445909


2. SUYASH GOPAL BIRAR 445903
3. AMAN SANJAY DHONDGE 445906
4. OM UTTAM KAME 445912
5. RAJ SACHIN RANKA 445947

UNDER THE GUIDANCE OF

Prof. R. V. SHINDE

DEPARTMENT OF
INFORMATION TECHNOLOGY

ACADEMIC YEAR
2023-2024
MARATHA VIDYA PRASARAK SAMAJ’S
RAJARSHI SHAHU MAHARAJ
POLYTECHNIC
NASHIK-422013

CERTIFICATE

This is to certify that the project report entitled “VEHICLE


POLLUTION MONITORING USING IoT” has been successfully completed
by
1. Aditya Ghotekar 445909

2. Suyash Birar 445903

3. Aman Dhondge 445906

4. Om Kame 445912
5. Raj Ranka 445947

As partial fulfillment of Diploma course in Information Technology under


the Maharashtra State Board of Technical Education, Mumbai during
the academic year 2023-2024.
The said work has been carried out under my guidance, assessed by us and
we are satisfied that, the same is up to the standard envisaged for the level of
the course.

Prof. R. V. Shinde Prof. M. B. Patil Prof. Prashant Patil


Project Guide Head of Department Principal

Institute
External Examiner Seal

i
SPONSORSHIP LETTER

ii
ACKNOWLEDGEMENT

With all respect and gratitude, I would like to thank all people who have helped me directly or indirectly
for the completion of this Project. I express my heartily gratitude towards Prof. R. V. Shinde for
guiding me to understand the work conceptually and also for her constant encouragement to complete
this project on “VEHICLE POLLUTION MONITORING USING IoT” My association with him as
a student has been extremely inspiring. I express my sincere thanks to him for kind help and guidance. I
would like to give my sincere thanks to Prof. A. P. Patil Project Coordinator & Prof. M. B. Patl Head
of Department of Information Technology Department for providing necessary help, providing facilities
and time to time valuable guidance. No words could be good enough to express my deep gratitude to our
honorable respected Principal Prof. Prashant Patil, and staff members of Information Technology
Department of Maratha Vidya Prasarak Samaj’s, Rajarshi Shahu Maharaj Polytechnic Nashik, for
providing all necessary facilities with their constant encouragement and support.

Finally, yet importantly, I would like to express my heartfelt thanks to my beloved parents for their
blessings, my friends and colleagues for their help and wishes for the successful completion of this
project.

1. Aditya Ghotekar 445909


2. Suyash Birar 445903
3. Aman Dhondge 445906
4. Om Kame 445912
5. Raj Ranka 445947

iii
CONTENT

Sr No. Chapter Page No.

Certificate i.
Sponsorship Letter ii.
Acknowledgement iii.
Content iv.
List Of Figures vi.
List Of Tables viii.
Abstract ix.
1 Introduction 1
2 Problem Statement & Scope Of Project 2
2.1 Objective 2
2.2 Scope 3
3 Literature Survey 4
4 Software Requirements Specifications 5
4.1 Assumption And Dependencies 5
4.2 Functional Requirements 5
4.3 External Interface Requirements 5
4.4 Non-Functional Requirements 6
4.5 System Requirements 6
4.6 Analysis Models: SDLC Model To Be Applied 6
5 System Design 9
5.1 System Architecture 9
5.2 Mathematical Module 9
5.3 Data Flow Diagram(Dfd) 10
5.4 Uml Diagram 12
6 Project Plan 17
6.1 Cost Estimate 17
6.2 Risk Management 19
6.3 Risk Management W.R.T Np Hard Analysis 20
6.4 Project Schedule 22

iv
7 Project Implementation 25
8 Cocomo Model 27
9 Testing 32
9.1 Black Box Testing 32
9.2 White Box Testing 34
10 Result And Performance Analysis 39
11 Source Code 46
11.1 User Application Code 46
11.2 Admin Side Application Code 72
12 Feasibility Study 102
12.1 Feasibility Study 102
12.2 Analysis 103
13 Advantages And Limitations 106
14 Applications 108
Future Scope 110
Conclusions 112
References 113
Bibliography

v
LIST OF FIGURES

Figure No. Particulars Page No.

4.6 Waterfall Model 7


5.1 Block Diagram 9
5.3.1 DFD Level 0 10
5.3.2 DFD Level 1 10
5.3.3 DFD Level 2 11
5.4.1 Use Case Diagram 12
5.4.2 Class Diagram 13
5.4.3 Object Diagram 13
5.4.4 Activity Diagram 14
5.4.5 Sequential Diagram 15
5.4.6 Deployment Diagram `15
5.4.7 Component Diagram 16
6.1.1 Cost Estimation Chart 17
6.1.2 Timeline Chart 18
6.4.1 Project Planning Chart 24
9.2.1.1 Testing Technique Part I 34
9.2.2.2 Branch Coverage 35
9.2.2.3 Flow Graph Notation 36
9.2.2.4 Cyclomatic Complexity 37
10.1 Sign In Page 39
10.2 Sign Up Page 39
10.3 Vehicle Registration Page 40
10.4 User App Home Page – Challan Pending 41

vi
10.5 User App Home Page – Challan Paid 41
10.6 Razor Pay Payment Gateway 42
10.7 Sign In Page 43
10.8 Admin Home Page 43
10.9 User Paid And Pending Challans 44
10.10 Area Module 45
10.11 Admin App Profile 45

vii
LIST OF TABLES

Table No. Particulars Page No.

3.1 Literature Survey 4

6.1.1 Cost Estimation 17

6.1.2 Time Estimate Chart 18

6.3.2.1 Risk analysis Part I 20

6.3.2.2 Risk analysis Part I 20

6.3.3.1 Monitoring 21

6.2.3.2 Management 21

6.4.1 Project Planning Chart 24

8.1 Cost Analysis using COCOMO MODEL 31

9.2.2.1 Test case Identification and execution 38

viii
ABSTRACT

Pollution has a significant part in the degradation of our planet. Quick industrialization, rapid
urbanisation, rapid population expansion, a dramatic increase in automobiles on the road, and other
human activities have disrupted the natural environment's balance. It alters the climate's quality, and
season change is caused by build-up of the greenhouse gases in the aerosphere. Global warming, which
is produced by the release of greenhouse gases, is one of the most serious environmental issues
confronting the globe today. CO2, which is a main component of the circumstances, is causing the
globe's surface to warm. Observing and regulating these seasonal changes is a major problem in saving
our ecosystem. The transportation sector is a main source of air pollution in urban cities, particularly in
growing countries such as India. This project uses multiple sensors, including a gas sensor located at the
vehicle's exhaust, to measure pollution limits in real time. The information collected checks the standard
limits and is sent to the vehicle operator via the Global System for Mobile Communication module
(GSM) and the cloud using Internet of Things (IoT)

Keywords: - IoT, Raspberry Pi 3, GPS, Gas Sensor, Temperature Sensor, etc.

ix
Chapter No. 01
INTRODUCTION

Air pollution, predominantly caused by vehicular emissions, has emerged as a major environmental
and public health concern worldwide. Exposure to pollutants such as carbon monoxide (CO), nitrogen
oxides (NOx), particulate matter (PM), and volatile organic compounds (VOCs) has been linked to a
variety of health problems, including respiratory diseases, cardiovascular disorders, and even cancer.
Furthermore, vehicle emissions are significant contributors to global warming and climate change,
exacerbating the already critical ecological challenges facing our planet. Traditional methods of monitoring
vehicle emissions, such as periodic vehicle inspections and stationary monitoring stations, have limitations
in terms of coverage, accuracy, and timeliness. These conventional approaches often fail to provide real-
time data on emissions levels across different locations and time periods, making it difficult to implement
timely interventions and policy measures.
With the escalating concerns surrounding environmental pollution, especially vehicular emissions,
there is a growing need for effective monitoring systems. This project introduces a solution that leverages
the NodeMCU IoT platform in conjunction with an Android application to create a robust vehicle pollution
monitoring system. By integrating sensors onto the NodeMCU, real-time data on pollutants is collected
and transmitted wirelessly to the Android app. This approach not only facilitates accurate monitoring but
also provides a user-friendly interface for individuals and authorities to assess and address pollution levels.
The amalgamation of NodeMCU and the Android app represents a significant stride toward sustainable
and technology-driven environmental management.
An increase in automobile vehicle leads to an increase in air pollution since automobiles are the
main source of environmental pollution. The smoke emitted from the vehicle consists of gases like
nitrogen oxides (NOx ), carbon monoxide (CO), and hydrocarbon (HC). approximately one-half of the
nitrogen oxide gases, carbon monoxide and one-fourth of hydrocarbon gases in our environment are
emitted from automobile vehicles, which leads to global warming. Due to poor vehicle maintenance and
ignition defect. the gases emitted from the exhaust may increase. In order to reduce environmental
pollution and to increase vehicles life, we can use this system. when the rate of gases emitted from the
vehicle exceeds the threshold limit set by the government, our system will alert to the user through LCD.
Using IOT, the emission level is also displayed and stored in the database of a vehicle owner. When the
vehicle owner ignores it, the report will send to the transport office with entire details. The entire system is
controlled by Node MCU microcontroller.

1
Chapter No. 2
PROBLEM STATEMENT & SCOPE OF PROJECT
"In today's increasingly urbanized world, vehicle emissions pose a significant threat to air quality, public
health, and the environment. As cities continue to grow, the problem of vehicle pollution becomes more
acute. Therefore, there is a pressing need for an IoT-based vehicle pollution monitoring system that can
accurately and efficiently measure emissions from vehicles in real-time. This system should leverage IoT
technologies to provide real-time data collection, analysis, and reporting, enabling authorities and
individuals to make informed decisions and take actions to mitigate pollution levels and improve overall
air quality in urban areas."
1. Real-time Data Collection: The system will continuously gather emissions data from vehicles on
the roads.
2. Access to real-time data will empower authorities and individuals to make informed decisions
regarding pollution mitigation strategies.
3. Timely interventions can be implemented to address pollution hotspots and improve air quality in
urban areas.
4. By reducing vehicle emissions, the system aims to mitigate health risks associated with air
pollution.
5. Efforts to curb pollution contribute to preserving the environment and mitigating climate change
impacts.
2.1 Objectives
The objectives are as follows:
3 Real-Time Monitoring: Develop a system capable of continuously monitoring vehicle emissions in
real-time to provide up-to-date information on pollution levels.
4 Accurate Data Collection: Ensure the accuracy and reliability of data collected from vehicles,
utilizing IoT sensors and devices to capture emissions data effectively.
5 Data Analysis and Insights: Implement algorithms and analytics to analyze collected data,
identifying trends, patterns, and pollution hotspots to provide actionable insights.
6 Remote Accessibility: Enable remote access to the monitoring system, allowing authorities and
stakeholders to view pollution data and reports from anywhere via web or mobile interfaces.
7 Integration with Existing Infrastructure: Integrate the IoT monitoring system with existing
transportation and environmental monitoring infrastructure for seamless data exchange and
collaboration.
8 Alerting and Notification Mechanisms: Develop alerting mechanisms to notify relevant authorities
and individuals in real-time when pollution levels exceed predefined thresholds, enabling prompt
response and intervention.
9 User-Friendly Interface: Design a user-friendly interface for easy interaction with the monitoring
system, catering to the needs of both technical and non-technical users.
10 Scalability and Flexibility: Build a scalable and flexible architecture that can accommodate the
growing number of monitored vehicles and adapt to evolving environmental regulations and
technological advancements.

2
2.2 Scope
1. System Architecture and Design: Designing the overall architecture of the IoT-based monitoring
system, including hardware components (sensors, devices), software platforms, and communication
protocols.
2. Sensor Deployment and Integration: Identifying suitable sensors for measuring various pollutants
emitted by vehicles (e.g., carbon monoxide, nitrogen oxides) and deploying them strategically across
road networks. Integrating sensors with IoT devices for data collection and transmission.
3. Data Collection and Transmission: Developing mechanisms for collecting emissions data from
vehicles in real-time, ensuring reliable transmission to centralized servers or cloud platforms for
storage and analysis. Implementing communication protocols (e.g., Wi-Fi, cellular, LoRa) to
facilitate data transmission.
4. Data Analysis and Insights: Implementing algorithms and analytics to process collected data,
identify trends, patterns, and pollution hotspots, and generate actionable insights. Visualizing data
through dashboards and reports to facilitate interpretation and decision-making.
5. Alerting and Notification Mechanisms: Designing alerting mechanisms to notify relevant
authorities and stakeholders when pollution levels exceed predefined thresholds, enabling timely
intervention and response.
6. User Interface Development: Developing user-friendly interfaces for interacting with the
monitoring system, including web-based portals, mobile applications, and administrative consoles.
Ensuring accessibility and usability for various user groups, including government agencies,
environmental organizations, and the general public.

3
Chapter No 03
LITERATURE SURVEY

Sr. No. Paper Title Publish Publish Confer- Remark


year ence/Journal
1 IOT based vehicle International In this paper In our environment
emission monitoring January, Research Journal of the pollution is mostly because of the
system at toll plaza 2023 Modernization in emission of harmful gases from the
using rfid and cloud Engineering automobiles. This can be reduced only by
Technology and strictly monitoring the concentrations of
services.
Science harmful pollutants like CO, NOX, smoke
etc. It is difficult to check that manually.
At that time this system is very useful to
calculate the concentrations of harmful
gases and to inform the vehicle owner and
the transport department which helps in
proper maintenance of the vehicles.

2 IOT Based Vehicle April, International Journal This paper RFID technology, as one of
Emission Monitoring 2022 of Advanced the enabling technologies of IoT (Internet
System and Pollution Research in Science, of Things), is employed to develop the
Detection Communication and information system. RFID reading can be
Technology interrogated along with the corresponding
(IJARSCT) tag ID through a wireless connection
among traffic lights and vehicles. This
will maintain the database and graph for
the data by monitoring the emissions data,
the engine health can be easily inspected
and Examine.

3 Vehicle Pollution January, International Journal Every 15 days, a pollution check is


Monitoring System of Engineering required, and just a few people follow
2022
using IoT Research & through. This project setup has been
Technology (IJERT) calibrated, and the system's performance
has been validated. The designed system
monitors the pollution level released by
automobiles, and if it exceeds a certain
threshold value, a warning message is
delivered to the vehicle owner via the
GSM module.

Table 3.1 – Literature Survey

4
Chapter No. 4
SOFTWARE REQUIREMENTS SPECIFICATIONS

4.1 Assumption and Dependencies


Platforms:
1. Operating System: Windows / Linux / CentOS/ Android
2. Programming Language: - (Android) .
3. IDE: - (Vs Code) .
4. Database: - (Sqlite) .

4.2 Functional Requirements


Around a vehicle, a black spot is an area, which cannot be seen by the driver. Black spot accidents and
crime are a frequently occurring problem. Annually, dozens of deaths are caused
by this phenomenon despite legally compulsory prevention tools and large investments in raising
awareness and developing prevention systems. Because this is not enough to reduce the
number of accidents, proactive solutions must be found. This article de- scribes the evaluation of a new
black spot system based on IoT.In this project we apply statistics analysis and data mining algorithms on
the Fatal Accident dataset as an attempt to address this problem.
Association rule mining is one of the popular data mining techniques that identify the causes of
road accident. In this project, admin can add to police. After that police can login on system and view
accident and crime spot apply algorithm on that spot and decide danger level of that spot. Level A, Level
B, Level C of accident and crime location. An DM Algorithm takes accident level count as a factor to
cluster the locations. Then we will use association rule mining to identify these locations using geofencing.
The rules show different factors associated
with road accidents at different locations.

4.3 External Interface Requirements

4.3.1 User Interfaces


The user of the system must have a device with working internet connection to access application.

4.3.2 Hardware Interface


No hardware interfaces needed except Device to use application.

4.3.3 Communication Interfaces


The system can be works only in online mode hence, communication interfaces are compulsory.

5
4.4 Non-Functional Requirements
4.4.1 Performance Requirements:
Performance requirements for proposed system are as follows:
1. Proper level and user information will provide proper and fast results.
2. Proper integration will generate proper results

4.4.2 Safety Requirements:


As our system is fully software oriented we don’t need any safety requirements.

4.5 System Requirements:

4.5.1 Software Requirements


1. Operating System: Windows / Linux / CentOS/ Android
2. Programming Language: - (Android) .
3. IDE: - (Vs code) .
4. Database: - (Sqllite) .

4.5.2 Hardware Requirements


1. Node MCU
2. RAM-8 GB
3. i3 Processor or AMD

4.6 Analysis Models: SDLC Model to be applied

SDLC -Waterfall Model


The Waterfall Model was the first Process Model to be introduced. It is also referred to as a linear-
sequential life cycle model. It is very simple to understand and use. In a waterfall model, each phase must
be completed before the next phase can begin and there is no overlapping in the phases. The Waterfall
model is the earliest SDLC approach that was used for software development. The waterfall Model
illustrates the software development process in a linear sequential flow. This means that any phase in the
development process begins only if the previous phase is complete. In this waterfall model, the phases do
not overlap

Waterfall Model -Design


Waterfall approach was first SDLC Model to be used widely in Software Engineering to ensure success of
the project. In "The Waterfall" approach, the whole process of software development is divided into
separate phases. In this Waterfall model, typically, the outcome of one phase acts as the input for the next
phase sequentially. The following illustration is a representation of the different phases of the Waterfall
Model.

6
Fig 4.6 waterfall model

The sequential phases in Waterfall model are −


• Requirement Gathering and analysis − All possible requirements of the system to be developed are
captured in this phase and documented in a requirement specification document.
• System Design − The requirement specifications from first phase are studied in this phase and the system
design is prepared. This system design helps in specifying hardware and system requirements and helps in
defining the overall system architecture.
• Implementation − With inputs from the system design, the system is first developed in small programs
called units, which are integrated in the next phase. Each unit is developed and tested for its functionality,
which is referred to as Unit Testing.
• Integration and Testing − All the units developed in the implementation phase are integrated into a
system after testing of each unit. Post integration the entire system is tested for any faults and failures.
• Deployment of system − Once the functional and non-functional testing is done; the product is deployed
in the customer environment or released into the market.
• Maintenance − There are some issues which come up in the client environment. To fix those issues,
patches are released. Also, to enhance the product some better versions are released. Maintenance is done
to deliver these changes in the customer environment. All these phases are cascaded to each other in which
progress is seen as flowing steadily downwards (like a waterfall) through the phases. The next phase is
started only after the defined set of goals are achieved for previous phase and it is signed off, so the name
"Waterfall Model". In this model, phases do not overlap.

7
Waterfall Model –Application
Every software developed is different and requires a suitable SDLC approach to be followed based on the
internal and external factors. Some situations where the use of Waterfall model is most appropriate are −
• Requirements are very well documented, clear and fixed. • Product definition is stable.
• Technology is understood and is not dynamic.
• There are no ambiguous requirements.
• Ample resources with required expertise are available to support the product.
• The project is short

8
Chapter No. 05
SYSTEM DESIGN

5.1 System Architecture

Fig. 5.1 Block Diagram

5.2.Mathematical Module
 S = Input, Output, Deterministic Data, Let S is the system; S = I, O, F, DD, NDD,
Success, Failure
 I = Input to the system
 I = username, password, order menu, order acknowledge
 O= Output of the system
 O= order placed, order accepted, email sent
 F= Function in System
 F=adminLogin(), CustomerLogin()
 DD = Deterministic data DD = Null
 ·NDD = Non Deterministic data NDD = I, O
 Success – Order Placed Successfully
 Failure - Failed to Placed Order

9
5.3 Data Flow Diagram(DFD)
5.3.1 DFD Level 0
A data flow diagram (DFD) is used to show a graphical representation of the flow of data through an
information system, modelling its process aspects. A DFD is also used as a preliminary step to create an
overview of the system, which can later be elaborated.

Fig. 5.3.1 DFD Level 0

5.3.2 DFD Level 1

Fig. 5.3.2 DFD Level 1

10
5.3.3 DFD Level 2

Fig. 5.3.3 DFD Level 2

11
5.4 UML Diagram
5.4.1 Use case diagram
Use case diagram is used for describe the function requirements of the system by using the use cases and
the actors. In the Figure user and database are the actors into the system. Use cases involved into the
system.

Fig. 5.4.1 Use Case diagram

12
5.4.2 Class diagram
The class diagram is the main building block of object-oriented modeling. It issued for general conceptual
modeling of the structure of the application, and for detailed modeling translating the mode ls into
programming code. Class diagram scan also be used for data modeling. The purpose of class diagram is to
model the static view of an application. Class diagrams are the only diagrams which can be directly
mapped with object- oriented languages and thus widely used at the time of construction

Fig 5.4.2 Class Diagram


5.4.3 Object diagram
Object is an instance of a class in a particular moment in runtime that can have its own state and data
values. Likewise a static UML object diagram is an instance of a class diagram; it shows a snapshot of the
detailed state of a system at a point in time, thus an object diagram encompasses objects and their
relationships which may be considered a special case of a class diagram or a communication diagram.

Fig 5.4.3 Object Diagram

13
5.4.4 Activity diagram
The basic purposes of activity diagram are similar to other four diagrams. It captures the dynamic behavior
of the system. Other four diagrams are used to show the message flow from one object to another, but
activity diagram is used to show message flow from one activity to another

Fig. 5.4.4 Activity Diagram

14
5.4.5 Sequence Diagram
The purpose of interaction diagrams is to visualize the interactive behavior of the system. Visualizing the
interaction is a difficult task. Hence, the solution is to use different types of models to capture the different
aspects of the interaction. The sequence diagram represents the flow of messages in the system and is also
termed as an event diagram. It helps in envisioning several dynamic scenarios.

Fig 5.4.5 Sequential Diagram


5.4.6 Deployment diagram
A deployment diagram in the Unified Modeling Language models the physical deployment of artifacts on
nodes. To describe a web site, for example, a deployment diagram would show what hardware components
exist, what software components run on each node, and how the different pieces are connected.

Fig. 5.4.6 Deployment Diagram

15
5.4.7 Component diagram
In Unified Modeling Language, a component diagram depicts how components are wired together to form
larger components or software systems. They are used to illustrate the structure of arbitrarily complex
systems.

Fig. 5.4.7 Component Diagram

16
Chapter No. 6
PROJECT PLAN

6.1 Cost estimate


It is the most frequently used technique for evaluating the effectiveness of the proposed system. More
commonly known as cost/benefit analysis. It determines the benefits and savings that are expected from the
proposed system and compares them with costs. The system is economically feasible since it would not
entail additional hardware, thereby saving on the costs of the manpower involved. In economic feasibility
study we do some calculations.
Phases Cost/Hour Hours Cost Estimation

Requirement gathering 30/- 20H 600

Design 50/- 30H 1500

Code development 50/- 20H 1250

Implementation 60/- 40H 2400

Testing 40/- 10H 400


Table 6.1.1 Cost Estimation

Fig. 6.1.1 Cost Estimation Chart

17
Phases Time in Hrs

Analysis 20

Design 30

Coding 20

Testing 30

Documentation 20

Maintenance 40

Total Time 160


Table 6.1.2 Time Estimate Chart

Fig. 6.1.2 Timeline Chart

18
6.2 Risk Management
 RISK ANALYSIS: There are quite different types of risk analysis that can be used. Basically, risk
analysis is used to identify the high-risk elements of a project in software engineering. Also, it
provides ways of detailing the impact of risk mitigation strategies. Risk analysis has also been found
to be most important in the software design phase to evaluate criticality of the system, where risks are
analyzed and necessary counter measures are introduced. The main purpose of risk analysis is to
understand risks in better ways and to verify and correct attributes. A successful risk analysis includes
important elements like problem definition, problem formulation, data collection. Risk analysis is
useful in many situations:
 When you're planning projects, to help you anticipate and neutralize possible problems.
 When you're deciding whether or not to move forward with a project.
 When you're improving safety, and managing potential risks in the workplace.
 When you're preparing for events such as equipment or technology failure, theft, staff sickness,
or natural disasters.
 When you're planning for changes in your environment, such as new competitors coming into
the market, or changes to government policy.

 RISK MANAGEMENT ANALYSIS: If there is a possibility that the achievement of a goal is


harmed, prevented from occurring or suffers negatively due to the occurrence of uncertain events, we
call it the risk. These so-called uncertain events can be caused by different factors. An efficient risk
management analysis should be able to attend to every one of them to be able to identify them
promptly in each of the listed cases:

Personnel risks: Caused by a lack of Knowledge about technology and training to perform
functions. There is a possibility that errors are intentional, this is the result of the dubious conduct.
The main risks from personal issues are:
 Unintentional; resulting in omission or negligence.
 Cannot perform task because lack of ability.
 Lack of time management.

Process Risks: The occurrence of internal process deficiencies like inadequate performance
indicators, inefficient controls, modeling failures and an inability to abide by the current laws.
Systems risks: Arising from inadequate, poorly structured or defective IT systems. Some examples:
 Intermittent networks
 Server crash
 Physical damage to data storage components
 System obsolescence
 Improper maintenance
 Power outage from internal causes
 System slowdown
 Security holes

19
6.3 RISK MANAGEMENT W.R.T NP HARD ANALYSIS:
1. In rural area most of the time Internet will not be available so our system may not work.
2. If reviews not available and false review are there then systems results will fail.
3. If provide wrong input then system will show wrong output or it may fail.

6.3.1 RISK IDENFICATION:


1. System may get fail during review database.
2. Results may get fail.

6.3.2. RISK ANALYSIS:


The risks for the Project can be analyzed within the constraints of time and quality
Risk Probability Impact
Description

Schedule Quality Overall

Internet Low Low High High


connection
not available

False review Low Low High High

Incorrect input Low Low High High

Table 6.3.2.1 Risk analysis Part I

Probability Value Description

High Probability of occurrence is >75%

Medium Medium Probability of occurrence is 26-75%

Low Low Probability of occurrence is <25%

Table 6.3.2.2 Risk analysis Part I

20
6.3.3 Monitoring, Management
Following are the details for each risk
Risk Id tak1

Risk Description Change of requirements

Category Software requirement risk

Probability Low

Impact High

Response Mitigate

Risk Status Occurred


Table 6.3.3.1 Monitoring

Risk Id 2

Risk Description Human Errors

Category Software Scheduling Risk

Probability Low

Response Identified

Table 6.2.3.2 Management

21
6.4 Project Schedule:
6.4.1 Project Planning Chart

Sr Lesson Topic What Students Will Do Objectives Addressed Technology Used


No.
1. Domain Selection Select an feasible domain To Search the IEEE explorer,
and discuss and Submit with Domain that students IJRP, Springer,
the Guide think Scholar
is Implementable and
have good future scope

2. Paper Search the The given To search


Selection IEEE papers of selected paper we on internet
year 2016-17 have to (IEEE explorer,
And submit understand the Springer)
To guide then concepts of this
select one paper
Paper from them.

3. Requirement Search for To get the To search


gathering different types Proper knowledge On internet via
of hardware/ of the paper. And Some browser.
software Its concept. And discuss with
information which Experts.
related to the
selected
paper

4. Literature We have to Find the 10 We have study Microsoft


Survey reference papers related to all these papers and Word,
this given topic compare Microsoft
them then we have to Excel
find new techniques
from them and make
literature survey

5. Problem To study the We have to References


Identification Concept which is given in Find the concept which From paper, base
paper. we have to develop. paper, web
Start working on this searching.
paper

6. Original To study the original Architecture is Studied Adobe Reader


Architecture architecture and understood

22
7. Modified To study the Original Adobe Reader
Architecture original architecture and Algorithm is Studied
modify the original and modified
architecture

8. Original To study the Original Adobe Reader


Algorithm original Algorithm find Algorithm Studied
out the and limitations are
limitations Found out

9. Modified Find Out the To achieve Adobe Reader


Algorithm Limitations and efficient algorithm
work on by
Them modifying
original algorithm.

10. Mathematical To Find out Mathematical Adobe Reader


Model the drawbacks of Model Various
Existing Equations Studied.
system
Mathematical model and
build new one

11. Analysis The whole Objective is Internet,


System get analyzed as Only to make the some related papers
per user need and changes system which gives and technology
is decided. best performance.

12. Planing According to Proper References


The different models and Schedule will make From paper, base
design schedule are plan. work easier and faster. paper, web
searching

13. Design As per One by one Html, css is used


schedule design phase Modules will get for design
get conducted. designed.

14. Coding Front end It is the At Front end


And back end coding is Important phase after html,css is used.
done here. designing. Django is used at
back end. Sqlite is
db.

15. Testing Testing To check whether all Various types of

23
is going well and each testing will be
Unit Testing and carried out in
every component is order to check the
Integration Testing working functioning of the
system
White box Testing

Black box Testing


Table 6.4.1 Project Planning Chart
6.4.2 Timeline Chart

Fig. 6.4.1 Project Planning Chart

24
Chapter No. 07
PROJECT IMPLEMENTATION

Implementing a vehicle pollution monitoring project involves several key steps, from planning and design
to deployment and maintenance. Below is a detailed project implementation plan for monitoring vehicle
pollution:

1. Project Planning and Requirements Analysis


Objective: Define the project scope, objectives, and requirements.

Tasks:
Define project goals (e.g., reducing vehicle emissions, improving air quality).
Identify stakeholders and their requirements (e.g., government agencies, environmental organizations,
general public).
Conduct a feasibility study to assess technical, financial, and operational aspects.

2. Research and Technology Selection


Objective: Identify the appropriate technologies and methodologies for monitoring vehicle pollution.

Tasks:
Research existing pollution monitoring technologies (e.g., portable emissions measurement systems,
remote sensing devices).
Evaluate the suitability, accuracy, and cost-effectiveness of different technologies.
Select the most appropriate technology based on project requirements and budget.

3. System Design and Development


Objective: Design and develop the vehicle pollution monitoring system.

Tasks:
Design the architecture of the monitoring system, including hardware and software components.
Develop or customize software for data collection, analysis, and reporting.
Integrate selected monitoring technologies into the system.
Conduct pilot testing to validate the system's functionality and performance.

4. Deployment and Installation


Objective: Install and deploy the monitoring system in target locations.

Tasks:
Identify suitable locations for installing monitoring stations (e.g., busy roads, intersections, toll booths).
Procure necessary equipment and materials for installation.
Install and configure monitoring stations according to design specifications.
Conduct initial calibration and testing of the monitoring system.

5. Data Collection and Analysis

25
Objective: Collect, analyze, and interpret vehicle pollution data.

Tasks:
Collect real-time or periodic data on vehicle emissions from monitoring stations.
Store collected data securely in a centralized database.
Analyze data to identify trends, patterns, and hotspots of pollution.
Generate reports and visualizations to communicate findings to stakeholders.

6. Reporting and Communication


Objective: Communicate findings and insights to stakeholders and the general public.

Tasks:
Prepare and distribute regular reports summarizing monitoring results and findings.
Organize stakeholder meetings, workshops, or webinars to discuss findings and solicit feedback.
Develop a public communication strategy to raise awareness about vehicle pollution and promote
behavioral change.

7. Maintenance and Upgrades


Objective: Ensure the ongoing operation, maintenance, and improvement of the monitoring system.

Tasks:
Establish a maintenance schedule for monitoring equipment and software.
Monitor system performance and troubleshoot any issues or malfunctions promptly.
Implement upgrades or enhancements to the system based on technological advancements or changing
requirements.

8. Evaluation and Continuous Improvement


Objective: Evaluate the effectiveness of the monitoring project and identify areas for improvement.

Tasks:

Conduct periodic evaluations to assess the impact of the monitoring project on reducing vehicle pollution.
Solicit feedback from stakeholders and the general public to identify strengths, weaknesses, and
opportunities for improvement.
Implement recommendations and adjustments to enhance the project's effectiveness and efficiency.

26
Chapter No. 08
COCOMO MODEL

COCOMO Model is a procedural cost estimate model for software projects and is often used
as a process of reliably predicting the various parameters associated with making a project such as
size, effort, cost, time, and quality. The costing of the project mainly depends on the Camera that we
use for developing this system. In our project we have used concept like AI, Machine Learning. The
total man work included for developing the software is about 15 hours per week and near about 20
weeks so the overall costing of this project is not so high.
1. Basic COCOMO Model
2. Intermediate COCOMO Model
3. Complete/Detailed COCOMO Model

 Basic COCOMO:
Computes software development effort and cost as a function of program size expressed in
estimated DSIs.
There are three modes within Basic COCOMO:

1. Organic Mode:
Development projects typically are uncomplicated and involve small experienced teams. The
planned software is not considered innovative and requires a relatively small amount of DSIs
(typically under 50,000).

2. Semidetached Mode:
Development projects typically are more complicated than in Organic Mode and involve teams of
people with mixed levels of experience. The software requires no more than 300,000 DSIs. The
project has characteristics of both projects for Organic Mode and projects for Embedded Mode.

3. Embedded Mode:
Development projects must fit into a rigid set of requirements because the software is to be
embedded in a strongly joined complex of hardware, software, regulations and operating procedures.

The basic COCOMO estimation model is given by the following expressions:

Effort = a1 x (KLOC)a2PM

27
Tdev=b1 x(Effort)b2 Months

Where,

 KLOC is the estimated size of the software product expressed in Kilo Lines of code

 a1, a2, b1, b2 are constants for each category of software products

 Tdev is the estimated time to develop the software, expressed in months

 Effort is the total effort required to develop the software product, expressed in person
months (PM’s)

 Intermediate COCOMO:
An extension of the Basic model that computes software development effort by adding a set of
"cost drivers," that will determine the effort and duration of the project, such as assessments of
personnel and hardware.

 Detailed COCOMO:
An extension of the Intermediate model that adds effort multipliers for each phase of the project to
determine the cost drivers impact on each step.
Example: A distributed Management Information System (MIS) product for an organization having
offices at several places across the country can have the following sub-components:

 Database part
 Graphical User Interface (GUI) part
 Communication part

 Estimation of development effort (Basic COCOMO Model):

For the three classes of software products, the formulas for estimating the effort based on the code
size are shown below:
Organic: Effort = 2.4(KLOC)1.05 PM
Semi-Detached: Effort = 3.0(KLOC)1.12 PM
Embedded: Effort = 3.6(KLOC)1.20 PM
PM: Person Months

28
 Estimation of development time (Basic COCOMO Model):

For the three classes of software products, the formulas for estimating the development time based on
the effort are given below:

Organic: Tdev = 2.5(Effort)0.38 Months


Semi-detached: Tdev = 2.5(Effort)0.35 Months
Embedded: Tdev = 2.5(Effort)0.32 Months

The effort estimation is expressed in units of person-months (PM). It is the area under the person-
month plot as shown in figure below. It should be carefully noted that an effort of 100 PM does not
imply that 100 persons should work for 1 month nor does it imply that 1 person should be employed
for 100 months, but it denotes the area under the person-month curve

 Estimation of development effort: (Intermediate COCOMO Model):

For the three classes of software products, the formulas for estimating the effort based on the code
size are shown below:

Organic: Effort = 3.2(KLOC)1.05 PM


Semi-Detached: Effort = 3.0(KLOC)1.12 PM
Embedded: Effort = 2.8(KLOC)1.20 PM
PM: Person Months

 Estimation of development time: : (Intermediate COCOMO Model):

For the three classes of software products, the formulas for estimating the development time based on
the effort are given below:

Organic: Tdev = 2.5(Effort)0.38 Months


Semi-detached: Tdev = 2.5(Effort)0.35 Months
Embedded: Tdev = 2.5(Effort)0.32 Months

29
 COST ESTIMATION

 For our project we have used Embedded Mode.

 Predefined values : a=3.6, b=1.20, c=2.5, d=0.35

 Line of Code(LOC) = 18887

 KLOC = 18.88

1. Effort = a*(KLOC)b PM( person-month)


=3.6*(18.88)1.20 PM
= 81.8496 PM

2. Total cost = 10000*81.8496 PM


=8,18,896

 NodeMCU = 600

 MQ135 = 400

 Circuit Board = 200

3. Time Estimates = c*(Efforts)d month


= 2.5 *(81.8496)0.32 month
= 10.91 month

30
VEHICLE POLLUTION MONITORING USING IoT

Sr.
Title Cost
No.

1. Work hour 30(per person)

2. MQ135 Sensor 800

3. NodeMCU 1200

4. Circuit Board 200

5. Group Members 5

150(per
6. Charges per hour person)
30x150 =4500(per
7.
Total work charge person)

8. Total Charges 4500x5 = 22500

9. Internet Hours 20

10. Cost per hour 30

11. Total internet charge 30x20=600

12. Survey charges 500

13. Printing and other costs 1000

14. Computer charges 1000

TOTAL COST Rs.27,800 -/-


Table 8.1 Cost Analysis using COCOMO MODEL

31
VEHICLE POLLUTION MONITORING USING IoT

Chapter No. 09
TESTING
9.1 Black Box Testing

Black Box Testing is a software testing method in which the functionalities of software applications
are tested without having knowledge of internal code structure, implementation details and internal
paths. Black Box Testing mainly focuses on input and output of software applications and it is entirely
based on software requirements and specifications. It is also known as Behavioral Testing.

The above Black-Box can be any software system you want to test. For Example, an operating system
like Windows, a website like Google, a database like Oracle or even your own custom application.
Under Black Box Testing, you can test these applications by just focusing on the inputs and outputs
without knowing their internal code implementation.
How to do BlackBox Testing

Here are the generic steps followed to carry out any type of Black Box Testing.

 Initially, the requirements and specifications of the system are examined.


 Tester chooses valid inputs (positive test scenario) to check whether SUT processes them
correctly. Also, some invalid inputs (negative test scenario) are chosen to verify that the SUT is
able to detect them.
 Tester determines expected outputs for all those inputs.
 Software tester constructs test cases with the selected inputs.
 The test cases are executed.
 Software tester compares the actual outputs with the expected outputs.
 Defects if any are fixed and re-tested.

9.1.1 Types of Black Box Testing


There are many types of Black Box Testing but the following are the prominent ones –

 Functional testing – This black box testing type is related to the functional requirements of a
system; it is done by software testers.
 Non-functional testing – This type of black box testing is not related to testing of specific
functionality, but non-functional requirements such as performance, scalability, usability.
 Regression testing – Regression Testing is done after code fixes, upgrades or any other system
maintenance to check the new code has not affected the existing code.

32
VEHICLE POLLUTION MONITORING USING IoT

9.1.2 Tools used for Black Box Testing:


Tools used for Black box testing largely depends on the type of black box testing you are doing.

 For Functional/ Regression Tests you can use – QTP, Selenium


 For Non-Functional Tests, you can use – LoadRunner, Jmeter

9.1.3 Black Box Testing Techniques


Following are the prominent Test Strategy amongst the many used in Black box Testing

 Equivalence Class Testing: It is used to minimize the number of possible test cases to an
optimum level while maintains reasonable test coverage.
 Boundary Value Testing: Boundary value testing is focused on the values at boundaries. This
technique determines whether a certain range of values are acceptable by the system or not. It is
very useful in reducing the number of test cases. It is most suitable for the systems where an
input is within certain ranges.
 Decision Table Testing: A decision table puts causes and their effects in a matrix. There is a
unique combination in each column.

33
VEHICLE POLLUTION MONITORING USING IoT

9.2 White box testing


White box testing techniques analyze the internal structures the used data structures, internal design,
code structure and the working of the software rather than just the functionality as in black box testing.
It is also called glass box testing or clear box testing or structural testing.

Working process of white box testing:

 Input: Requirements, Functional specifications, design documents, source code.


 Processing: Performing risk analysis for guiding through the entire process.
 Proper test planning: Designing test cases so as to cover entire code. Execute rinse-repeat until
error-free software is reached. Also, the results are communicated.
 Output: Preparing final report of the entire testing process.

9.2.1 Testing techniques:


Statement coverage: In this technique, the aim is to traverse all statement at least once. Hence, each
line of code is tested. In case of a flowchart, every node must be traversed at least once. Since all lines
of code are covered, helps in pointing out faulty code.

Fig.9.2.1.1 Testing Technique Part I

34
VEHICLE POLLUTION MONITORING USING IoT

Statement Coverage Example:-


Branch Coverage: In this technique, test cases are designed so that each branch from all decision
points are traversed at least once. In a flowchart, all edges must be traversed at least once.

Fig. 9.2.2.2 Branch Coverage

4 test cases required such that all branches of all decisions are covered, i.e, all edges of flowchart are
covered
 Condition Coverage: In this technique, all individual conditions must be covered as shown in
the following example:
1. READ X, Y
2. IF(X == 0 || Y == 0)
3. PRINT ‘0’
 In this example, there are 2 conditions: X == 0 and Y == 0. Now, test these conditions get
TRUE and FALSE as their values. One possible example would be:
1. #TC1 – X = 0, Y = 55
2. #TC2 – X = 5, Y = 0
 Multiple Condition Coverage: In this technique, all the possible combinations of the possible
outcomes of conditions are tested at least once. Let’s consider the following example:
1. READ X, Y
2. IF(X == 0 || Y == 0)
3. PRINT ‘0’
4. #TC1: X = 0, Y = 0
5. #TC2: X = 0, Y = 5
6. #TC3: X = 55, Y = 0
7. #TC4: X = 55, Y = 5

35
VEHICLE POLLUTION MONITORING USING IoT

 Hence, four test cases required for two individual conditions.


n
Similarly, if there are n conditions then 2 test cases would be required.
 Basis Path Testing: In this technique, control flow graphs are made from code or flowchart and
then Cyclomatic complexity is calculated which defines the number of independent paths so
that the minimal number of test cases can be designed for each independent path.
Steps:
1. Make the corresponding control flow graph
2. Calculate the cyclomatic complexity
3. Find the independent paths
4. Design test cases corresponding to each independent path
Flow graph notation: It is a directed graph consisting of nodes and edges. Each node represents a
sequence of statements, or a decision point. A predicate node is the one that represents a decision point
that contains a condition after which the graph splits. Regions are bounded by nodes and edges.

Fig 9.2.2.3 Flow Graph Notation

36
VEHICLE POLLUTION MONITORING USING IoT

Cyclomatic Complexity: It is a measure of the logical complexity of the software and is used to define
the number of independent paths. For a graph G, V(G) is its cyclomatic complexity.
Calculating V(G):
5. V(G) = P + 1, where P is the number of predicate nodes in the flow graph
6. V(G) = E – N + 2, where E is the number of edges and N is the total number of nodes
7. V(G) = Number of non-overlapping regions in the graph
 Example:

Fig. 9.2.2.4 Cyclomatic Complexity

V(G) = 4 (Using any of the above formulae)


No of independent paths = 4
1. #P1: 1 – 2 – 4 – 7 – 8
2. #P2: 1 – 2 – 3 – 5 – 7 – 8
3. #P3: 1 – 2 – 3 – 6 – 7 – 8
4. #P4: 1 – 2 – 4 – 7 – 1 – . . . – 7 – 8
 Loop Testing: Loops are widely used and these are fundamental to many algorithms hence,
their testing is very important. Errors often occur at the beginnings and ends of loops.
1. Simple loops: For simple loops of size n, test cases are designed that:
■ Skip the loop entirely
■ Only one pass through the loop

37
VEHICLE POLLUTION MONITORING USING IoT

■ 2 passes
■ m passes, where m < n
■ n-1 ans n+1 passes
2. Nested loops: For nested loops, all the loops are set to their minimum count and we start
from the innermost loop. Simple loop tests are conducted for the innermost loop and this
is worked outwards till all the loops have been tested.
3. Concatenated loops: Independent loops, one after another. Simple loop tests are applied
for each.
If they’re not independent, treat them like nesting.

Advantages:

1. White box testing is very thorough as the entire code and structures are tested.
2. It results in the optimization of code removing error and helps in removing extra lines of code.
3. It can start at an earlier stage as it doesn’t require any interface as in case of black box testing.
4. Easy to automate.

Disadvantages:

1. Main disadvantage is that it is very expensive.


2. Redesign of code and rewriting code needs test cases to be written again.
3. Testers are required to have in-depth knowledge of the code and programming language as
opposed to black box testing.
4. Missing functionalities cannot be detected as the code that exists is tested.
5. Very complex and at times not realistic.

Test case Identification and Execution (Project wise different)


Test cases Expected Input Expected Output Result

Data Preprocessing Image dataset Load Dataset Pass

Prediction Model Algorithm, dataset Prediction model Pass

Camera Open Camera Video Camera display Pass

Prediction Load prediction model Predict emotion Pass


Table 9.2.2.1 Test case Identification and execution

38
VEHICLE POLLUTION MONITORING USING IoT

Chapter No 10
RESULT AND PERFORMANCE ANALYSIS
User App:

Fig. 10.1 Sign In Page Fig. 10.2. Sign Up Page

39
VEHICLE POLLUTION MONITORING USING IoT

Fig. 10.3. Vehicle Registration Page

40
VEHICLE POLLUTION MONITORING USING IoT

Fig. 10.4. User App Home Page – Fig. 10.5. User App Home Page –
Challan Pending Challan Paid

41
VEHICLE POLLUTION MONITORING USING IoT

Fig. 10.6. Razor Pay Payment Gateway

42
VEHICLE POLLUTION MONITORING USING IoT

Admin App:

Fig. 10.7 Sign In Page Fig. 10.8. Admin Home Page

43
VEHICLE POLLUTION MONITORING USING IoT

Fig. 10.9. User Paid and Pending challans

44
VEHICLE POLLUTION MONITORING USING IoT

Fig. 10.10. Area module Fig. 10.11. Admin App Profile

45
VEHICLE POLLUTION MONITORING USING IoT

Chapter No. 11
SOURCE CODE
11.1 User Application Code:

1. Void Main File :-


import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:user/consts/colors.dart';
import 'package:user/consts/typography.dart';
import 'package:user/controllers/auth_controller.dart';
import 'package:user/controllers/home_controller.dart';
import 'package:user/controllers/userRegistrationController.dart';
import 'package:user/firebase_options.dart';
import 'package:user/views/auth_screens/sign_in_screen.dart';
import 'package:user/views/auth_screens/splash_screen.dart';
import 'package:user/views/user_registration/user_registration.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MultiProvider(
providers: [
ChangeNotifierProvider(create: (_) => AuthController()),
ChangeNotifierProvider(create: (_) => UserRegistrationController()),
ChangeNotifierProvider(create: (_) => HomeController())
],

46
VEHICLE POLLUTION MONITORING USING IoT

child: GetMaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
fontFamily: regular,
filledButtonTheme: FilledButtonThemeData(
style: FilledButton.styleFrom(
backgroundColor: blueColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6)),
minimumSize: const Size(double.infinity, 50),
),
),
inputDecorationTheme: const InputDecorationTheme(
border: OutlineInputBorder(),),
),
home: SplashScreen(),
),
);
}
}

2. FireBase Options :-
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;
/// Default [FirebaseOptions] for use with your Firebase apps.
///
/// Example:
/// dart
/// import 'firebase_options.dart';
/// // ...
/// await Firebase.initializeApp(
/// options: DefaultFirebaseOptions.currentPlatform,
/// );

47
VEHICLE POLLUTION MONITORING USING IoT

///
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for web - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
case TargetPlatform.iOS:
return ios;
case TargetPlatform.macOS:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for macos - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.windows:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for windows - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.linux:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for linux - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}

48
VEHICLE POLLUTION MONITORING USING IoT

}
static const FirebaseOptions android = FirebaseOptions(
apiKey: 'AIzaSyASUrcasjS6raxm4GDywW_zVBAj-TOFUFA',
appId: '1:210223083459:android:0a53cd7804a7adb4b91776',
messagingSenderId: '210223083459',
projectId: 'vehiclepollutionmonitori-8c43d',
databaseURL: 'https://vehiclepollutionmonitori-8c43d-default-rtdb.firebaseio.com',
storageBucket: 'vehiclepollutionmonitori-8c43d.appspot.com',
);
static const FirebaseOptions ios = FirebaseOptions(
apiKey: 'AIzaSyB6vlo1OX5g-ug6oAzJrzJbTAvcA7w4TMk',
appId: '1:210223083459:ios:2819c16c14a5094bb91776',
messagingSenderId: '210223083459',
projectId: 'vehiclepollutionmonitori-8c43d',
databaseURL: 'https://vehiclepollutionmonitori-8c43d-default-rtdb.firebaseio.com',
storageBucket: 'vehiclepollutionmonitori-8c43d.appspot.com',
iosBundleId: 'com.example.user',
);
}

3. Sign-In Screen :-
import 'package:user/consts/consts.dart';
// ignore: must_be_immutable
class SignInScreen extends StatelessWidget {
SignInScreen({super.key});
TextEditingController emailField = TextEditingController();
TextEditingController nameField = TextEditingController();
TextEditingController passField = TextEditingController();
final form_key = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
var controller = Provider.of<AuthController>(context, listen: false);
return Scaffold(
body: Container(

49
VEHICLE POLLUTION MONITORING USING IoT

padding: screenPadding,
width: context.width,
child: SingleChildScrollView(
child: Form(
key: form_key,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: context.height * 0.13,
),
"Hello Again!".text.fontFamily(semibold).size(22).make(),
20.heightBox,
customTextField(
name: "Email",
hint: "Enter your email",
controller: emailField),
customTextField(
name: "Password",
hint: "Enter Password",
is_pass: true,
controller: passField),
20.heightBox,
Consumer<AuthController>(builder: (context, controller, xxx) {
return FilledButton(
onPressed: () {
if (form_key.currentState!.validate()) {
controller
.userSignIn(
email: emailField.text, pass: passField.text)
.then((value) {
if (value != null) {
Get.off(() => Home());
}

50
VEHICLE POLLUTION MONITORING USING IoT

});
}
},
child: controller.is_loading
? SizedBox(
width: 10,
height: 10,
child: CircularProgressIndicator(
color: Colors.white,
strokeWidth: 2,
),
)
: "Sign In".text.make(),
);
}),
20.heightBox,
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
"Dont have an account?".text.make(),
10.widthBox,
"Sign Up".text.fontFamily(semibold).color(blueColor).make(),
],
).onTap(() {
Get.to(() => SignUpScreen());
})
],
),
),
),
),
);
}
}

51
VEHICLE POLLUTION MONITORING USING IoT

4. Sign-Up Screen:-
import 'package:user/consts/consts.dart';
// ignore: must_be_immutable
class SignUpScreen extends StatelessWidget {
SignUpScreen({super.key});
TextEditingController emailField = TextEditingController();
TextEditingController nameField = TextEditingController();
TextEditingController passField = TextEditingController();
final form_key = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
padding: screenPadding,
width: context.width,
child: SingleChildScrollView(
child: Form(
key: form_key,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: context.height * 0.13,
),
"Create an account".text.fontFamily(semibold).size(22).make(),
20.heightBox,
customTextField(
name: "Name",
hint: "Enter your name",
controller: nameField),
customTextField(
name: "Email",
hint: "Enter your email",
controller: emailField),

52
VEHICLE POLLUTION MONITORING USING IoT

customTextField(
name: "Password",
hint: "Enter Password",
is_pass: true,
controller: passField),
20.heightBox,
Consumer<AuthController>(builder: (context, controller, xxx) {
return FilledButton(
onPressed: () async {
if (form_key.currentState!.validate()) {
controller
.userSignUp(context,
email: emailField.text, pass: passField.text)
.then(
(value) async {
await controller.storeAuthDetails(
name: nameField.text, email: emailField.text);
if (value != null) {
Get.offAll(() => UserRegistrationScreen());
}
},
);
}
},
child: controller.is_loading
? const SizedBox(
width: 10,
height: 10,
child: CircularProgressIndicator(
color: Colors.white,
strokeWidth: 2,
),
)
: "Sign Up".text.fontFamily(semibold).size(16).make(),

53
VEHICLE POLLUTION MONITORING USING IoT

);
})
],
),
),
),
),
);
}
}

5. Splash Screen :-
import 'package:firebase_auth/firebase_auth.dart';
import 'package:user/consts/consts.dart';
import 'package:user/consts/images.dart';
import 'package:user/views/auth_screens/sign_in_screen.dart';
class SplashScreen extends StatelessWidget {
const SplashScreen({super.key});
// ignore: non_constant_identifier_names
ChangeScreen(context) {
Future.delayed(const Duration(seconds: 1), () {
FirebaseAuth.instance.authStateChanges().listen((value) async {
if (value != null) {
await Provider.of<AuthController>(context, listen: false)
.NavigateUser();
} else {
Get.offAll(() => SignInScreen(),
transition: Transition.fadeIn,
duration: const Duration(milliseconds: 500));
}
});
});
}
@override

54
VEHICLE POLLUTION MONITORING USING IoT

Widget build(BuildContext context) {


double width = MediaQuery.of(context).size.width;
ChangeScreen(context);
return Scaffold(
body: SizedBox(
width: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
iglogo,
width: width * 0.5,
),
20.heightBox,
"RSM Polytechnic".text.size(16).fontFamily(semibold).make()
],
),
),
);
}
}

6. History Screen :-
import 'package:flutter/material.dart';
class HistoryScreen extends StatelessWidget {
const HistoryScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold();
}
}

55
VEHICLE POLLUTION MONITORING USING IoT

7. Home Screen :-
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:razorpay_flutter/razorpay_flutter.dart';
import 'package:user/consts/colors.dart';
import 'package:user/consts/list.dart';
import 'package:user/consts/marginsAndPaddings.dart';
import 'package:user/consts/typography.dart';
import 'package:user/controllers/home_controller.dart';
import 'package:velocity_x/velocity_x.dart';
class HomeScreen extends StatefulWidget {
const HomeScreen({super.key});
@override
State<HomeScreen> createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
Razorpay _razorpay = Razorpay();
@override
void initState() {
// TODO: implement initState
super.initState();
_razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, _handlePaymentSuccess);
_razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, _handlePaymentError);
_razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, _handleExternalWallet);
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_razorpay.clear();
}
void _handlePaymentSuccess(PaymentSuccessResponse response) async {

56
VEHICLE POLLUTION MONITORING USING IoT

await Provider.of<HomeController>(context, listen: false)


.updatePaidStatus();
}
void _handlePaymentError(PaymentFailureResponse response) {
print("Errror");
// Do something when payment fails
}
void _handleExternalWallet(ExternalWalletResponse response) {
// Do something when an external wallet is selected
print("error");
}
void openCheckOut(amount) async {
amount = amount * 100;
var options = {
'key': 'rzp_test_aSIgdHeoVYMKRz',
'amount': amount,
'name': 'RSM POLYTECHNIC',
'prefill': {
'contact': '9665331199',
'email': 'contact@rsmpoly.org',
},
'external': {
'wallet': [
'paytm',
]
}
};
try {
_razorpay.open(options);
} catch (e) {
print(e);
}
}
getColor(value) {

57
VEHICLE POLLUTION MONITORING USING IoT

if (value > 100) {


return Colors.red;
} else if (value > 50) {
return Colors.orange;
} else {
return Colors.green;
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
padding: screenPadding,
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
20.heightBox,
StreamBuilder<DocumentSnapshot>(
stream: FirebaseFirestore.instance
.collection('Vehicles')
.doc(FirebaseAuth.instance.currentUser!.uid)
.snapshots(),
builder: (context, snapshot) {
if (snapshot.hasError) {
return Text('Error: ${snapshot.error}');
}
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(
child: SizedBox(
width: 10,
height: 10,
child: CircularProgressIndicator()),
);

58
VEHICLE POLLUTION MONITORING USING IoT

}
var documentData =
snapshot.data!.data() as Map<String, dynamic>;
return Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"${documentData['vehicle_number']}"
.text
.fontFamily(semibold)
.size(16)
.make(),
documentData['device_installed'] == true
? "${documentData['ppm']}"
.text
.fontFamily(semibold)
.color(
getColor(double.parse(documentData['ppm'])))
.make()
: "Device Not installed"
.text
.fontFamily(semibold)
.color(Colors.red)
.make()
],
),
20.heightBox,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,

59
VEHICLE POLLUTION MONITORING USING IoT

children: [
"Model".text.make(),
"${documentData['vehicle_model']}"
.text
.fontFamily(semibold)
.make()
],
),
Container(
height: 30,
width: 1,
decoration: BoxDecoration(color: Colors.black),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"type".text.make(),
"${documentData['vehicle_type']}"
.text
.fontFamily(semibold)
.make()
],
),
Container(
height: 30,
width: 1,
decoration: BoxDecoration(color: Colors.black),
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
"Insurance".text.make(),
"${documentData['insurance_status']}"
.text

60
VEHICLE POLLUTION MONITORING USING IoT

.fontFamily(semibold)
.make()
],
),
],
),
],
)
.box
.roundedSM
.border(color: borderColor)
.padding(
const EdgeInsets.all(16),
)
.make();
},
),
20.heightBox,
"Challans".text.fontFamily(semibold).size(18).make(),
10.heightBox,
Consumer<HomeController>(builder: (context, controller, xxx) {
return Row(
children: List.generate(
Challans.length,
(index) => "${Challans[index]}"
.text
.color(controller.selectedChallans == index
? Colors.white
: blueColor)
.make()
.box
.border(color: blueColor)
.roundedSM
.color(controller.selectedChallans == index

61
VEHICLE POLLUTION MONITORING USING IoT

? blueColor
: Colors.white)
.padding(
EdgeInsets.symmetric(horizontal: 10, vertical: 6),
)
.margin(
EdgeInsets.only(right: 10),
)
.make()
.onTap(() {
controller.updateChallan = index;
}),
),
);
}),
20.heightBox,
Expanded(
child:
Consumer<HomeController>(builder: (context, controller, xx) {
return StreamBuilder<QuerySnapshot>(
stream: controller.selectedChallans == 0
? FirebaseFirestore.instance
.collection('Challans')
.where('uid',
isEqualTo: FirebaseAuth.instance.currentUser!.uid)
.where('paid_status', isEqualTo: 'pending')
.snapshots()
: FirebaseFirestore.instance
.collection('Challans')
.where('uid',
isEqualTo: FirebaseAuth.instance.currentUser!.uid)
.where('paid_status', isEqualTo: 'paid')
.snapshots(),
builder: (context, snapshot) {

62
VEHICLE POLLUTION MONITORING USING IoT

if (snapshot.hasError) {
return Text('Error: ${snapshot.error}');
}
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(
child: SizedBox(
width: 10,
height: 10,
child: CircularProgressIndicator(
color: blueColor,
),
),
);
}
// Check if there are no pending documents
if (snapshot.data!.docs.isEmpty) {
return Center(
child: Text('No Challans found.'),
);
}
// Display the list of pending documents
return ListView.builder(
padding: EdgeInsets.all(0),
// itemCount: 10,
itemCount: snapshot.data!.docs.length,
itemBuilder: (context, index) {
var document = snapshot.data!.docs[index];
// Access the document data using document.data()
var data = document.data() as Map<String, dynamic>;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,

63
VEHICLE POLLUTION MONITORING USING IoT

children: [
"${data['vehicle_no']}"
.text
.fontFamily(semibold)
.size(16)
.make(),
"₹ ${data['fine']}"
.text
.color(data['paid_status'] == "paid"
? Colors.green
: Colors.red)
.fontFamily(semibold)
.size(16)
.make(),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"PPM ".text.size(16).make(),
"${data['ppm']}".text.size(16).make(),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Date ".text.size(16).make(),
"${data['date']}".text.size(16).make(),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Due Date ".text.size(16).make(),

64
VEHICLE POLLUTION MONITORING USING IoT

"${data['due_date']}".text.size(16).make(),
],
),
data['paid_status'] != "paid"
? 20.heightBox
: SizedBox(),
data['paid_status'] != "paid"
? FilledButton(
onPressed: () {
controller.SelectedChallanId =
document.id;
openCheckOut(int.parse(data['fine']));
},
child: "Pay Challan"
.text
.fontFamily(semibold)
.size(14)
.make())
: SizedBox()
],
)
.box
.border(color: borderColor)
.padding(EdgeInsets.all(12))
.roundedSM
.margin(
EdgeInsets.only(
bottom: 20,
),
)
.make();
},
);
},

65
VEHICLE POLLUTION MONITORING USING IoT

);
}),
)
],
),
),
);
}
}

8. Home :-
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:user/consts/colors.dart';
import 'package:user/controllers/auth_controller.dart';
import 'package:user/controllers/home_controller.dart';
import 'package:user/views/home/home_screen.dart';
import 'package:user/views/profile/profile_screen.dart';
class Home extends StatelessWidget {
Home({super.key});
List<Widget> Screens = [HomeScreen(), ProfileScreen()];
@override
Widget build(BuildContext context) {
var controller = Provider.of<AuthController>(context, listen: false);
return Scaffold(
bottomNavigationBar:
Consumer<HomeController>(builder: (context, controller, xxx) {
return BottomNavigationBar(
onTap: (value) {
controller.updateScreen = value;
},
selectedItemColor: blueColor,
currentIndex: controller.selectedScreenIndex,
items: [

66
VEHICLE POLLUTION MONITORING USING IoT

BottomNavigationBarItem(icon: Icon(Icons.home), label: "Home"),


BottomNavigationBarItem(icon: Icon(Icons.person), label: "Profile"),
],
);
}),
body: Consumer<HomeController>(builder: (context, controller, xxx) {
return Screens[controller.selectedScreenIndex];
}),
);
}
}

9. Profile Screen :-
import 'package:firebase_auth/firebase_auth.dart';
import 'package:user/consts/consts.dart';
import 'package:user/views/auth_screens/splash_screen.dart';
class ProfileScreen extends StatelessWidget {
const ProfileScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
width: double.infinity,
padding: EdgeInsets.only(top: 60, left: 20, right: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Profile".text.fontFamily(semibold).size(22).make(),
20.heightBox,
Row(
children: [
CircleAvatar(
backgroundColor: borderColor,
radius: 35,

67
VEHICLE POLLUTION MONITORING USING IoT

),
20.widthBox,
"${FirebaseAuth.instance.currentUser!.displayName}"
.text
.fontFamily(semibold)
.size(18)
.make()
],
)
.box
.border(color: borderColor)
.roundedSM
.padding(EdgeInsets.all(12))
.make(),
20.heightBox,
ListTile(
onTap: () async {
await FirebaseAuth.instance.signOut();
Get.offAll(() => SplashScreen());
},
trailing: Icon(
Icons.arrow_forward_ios,
color: blueColor,
),
title: "Sign Out".text.make(),
).box.border(color: borderColor).roundedSM.make()
],
),
),
);
}
}

68
VEHICLE POLLUTION MONITORING USING IoT

10. User Registration :-


import 'package:flutter/material.dart';
import 'package:get/route_manager.dart';
import 'package:get/utils.dart';
import 'package:provider/provider.dart';
import 'package:user/consts/list.dart';
import 'package:user/consts/marginsAndPaddings.dart';
import 'package:user/consts/typography.dart';
import 'package:user/controllers/userRegistrationController.dart';
import 'package:user/views/home/home.dart';
import 'package:user/views/shared_widgets/customFormField.dart';
import 'package:user/views/shared_widgets/customTextField.dart';
import 'package:velocity_x/velocity_x.dart';
class UserRegistrationScreen extends StatelessWidget {
UserRegistrationScreen({super.key});
final form_key = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
var controller =
Provider.of<UserRegistrationController>(context, listen: false);
return Scaffold(
body: Container(
width: double.infinity,
padding: screenPadding,
child: SingleChildScrollView(
child: Form(
key: form_key,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: context.height * 0.04,
),
"Add your vehicle".text.fontFamily(semibold).size(22).make(),

69
VEHICLE POLLUTION MONITORING USING IoT

20.heightBox,
customTextField(
name: "Vehicle Number",
hint: "MH 15 GB 90008",
controller: controller.vehicleDetails.vehicleNumber,
),
customDropDownButton(
hint: "Select Vehicle Type",
onchange: (value) {
controller.vehicleDetails.selectedVehicleType = value;
},
label: "Select Vehicle Type",
list: VehicleTypes,
selectedValue:
controller.vehicleDetails.selectedVehicleType),
customDropDownButton(
hint: "Select your insurance status",
onchange: (value) {
controller.vehicleDetails.insurance_status = value;
},
label: "Select Insurance status",
list: insuranceStatus,
selectedValue: controller.vehicleDetails.insurance_status),
customTextField(
name: "Vehicle Color",
hint: "black/ red",
controller: controller.vehicleDetails.vehicleColor,
),
customTextField(
name: "Vehicle Brand",
hint: "mahindra/ mercedes",
controller: controller.vehicleDetails.vehicleBrand,
),
customTextField(

70
VEHICLE POLLUTION MONITORING USING IoT

name: "Vehicle Model",


hint: "XUV 500",
controller: controller.vehicleDetails.vehicleModel,
),
customDropDownButton(
hint: "Select Device Status",
onchange: (value) {
controller.vehicleDetails.deviceStatus = value;
},
label: "Have you Installed the Device ?",
list: DeviceStatus,
selectedValue: controller.vehicleDetails.deviceStatus),
30.heightBox,
FilledButton(
onPressed: () async {
if (form_key.currentState!.validate()) {
await controller.storeVehicles();
Get.off(() => Home());
}
},
child: "Continue".text.make()),
30.heightBox,
],
),
),
),
),
);
}
}

71
VEHICLE POLLUTION MONITORING USING IoT

11.2 Admin Side Application Code:

1. Void Main file:-


import 'package:rsm/consts/consts.dart';
import 'package:rsm/controllers/challans_controller.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
runApp(const RSM());
}
class RSM extends StatelessWidget {
const RSM({super.key});
@override
Widget build(BuildContext context) {
return MultiProvider(
providers: [
ChangeNotifierProvider(
create: (_) => AuthController(),
),
ChangeNotifierProvider(
create: (_) => HomeScreenController(),
),
ChangeNotifierProvider(
create: (_) => ChallansController(),
),
],
child: GetMaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
fontFamily: regular,
filledButtonTheme: FilledButtonThemeData(
style: FilledButton.styleFrom(
backgroundColor: blueColor,
shape: RoundedRectangleBorder(

72
VEHICLE POLLUTION MONITORING USING IoT

borderRadius: BorderRadius.circular(6)),
minimumSize: const Size(double.infinity, 50),
),
),
inputDecorationTheme: const InputDecorationTheme(
border: OutlineInputBorder(),
),
),
home: SplashScreen(),
),
);
}
}

2. FireBase Options :
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;
/// Default [FirebaseOptions] for use with your Firebase apps.
/// Example:
/// dart
/// import 'firebase_options.dart';
/// // ...
/// await Firebase.initializeApp(
/// options: DefaultFirebaseOptions.currentPlatform,
/// );
///
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for web - '
'you can reconfigure this by running the FlutterFire CLI again.',
);

73
VEHICLE POLLUTION MONITORING USING IoT

}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
case TargetPlatform.iOS:
return ios;
case TargetPlatform.macOS:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for macos - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.windows:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for windows - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.linux:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for linux - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}
}
static const FirebaseOptions android = FirebaseOptions(
apiKey: 'AIzaSyASUrcasjS6raxm4GDywW_zVBAj-TOFUFA',
appId: '1:210223083459:android:ce17b6a6a415c511b91776',
messagingSenderId: '210223083459',
projectId: 'vehiclepollutionmonitori-8c43d',
storageBucket: 'vehiclepollutionmonitori-8c43d.appspot.com',
);

74
VEHICLE POLLUTION MONITORING USING IoT

static const FirebaseOptions ios = FirebaseOptions(


apiKey: 'AIzaSyB6vlo1OX5g-ug6oAzJrzJbTAvcA7w4TMk',
appId: '1:210223083459:ios:f75a5364a8bcde4db91776',
messagingSenderId: '210223083459',
projectId: 'vehiclepollutionmonitori-8c43d',
storageBucket: 'vehiclepollutionmonitori-8c43d.appspot.com',
iosBundleId: 'com.example.rsm',
);
}

3. Authentication Controller :-
import 'package:flutter/material.dart';
import 'package:firebase_auth/firebase_auth.dart';
class AuthController extends ChangeNotifier {
Future<UserCredential?> userSignIn({email, pass}) async {
UserCredential? user;
try {
user = await FirebaseAuth.instance
.signInWithEmailAndPassword(email: email, password: pass);
} on FirebaseAuthException catch (e) {
print(e);
}
return user;
}
}

4. Challan controller :-
import 'dart:convert';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:rsm/consts/consts.dart';
import 'package:http/http.dart' as http;
import 'package:rsm/consts/email_format.dart';
class ChallansController extends ChangeNotifier {

75
VEHICLE POLLUTION MONITORING USING IoT

int selectedChallans = 0;
String selectedVehicleUid = "";
set updateChallan(int value) {
selectedChallans = value;
notifyListeners();
}
Future<void> sendEmail({to, ppm, name, vehicleNumber}) async {
try {
final Uri url = Uri.parse('http://3.147.78.78:80/send-email');

final Map<String, dynamic> requestBody = {


'to': to,
'text':
getEmailContent(name: name, vehicleNumber: vehicleNumber, ppm: ppm),
'subject': "Subject: Notice of Traffic Violation - Payment Due",
};
final http.Response response = await http.post(
url,
body: jsonEncode(requestBody),
headers: {'Content-Type': 'application/json'},
);
if (response.statusCode == 200) {
print('Email sent successfully.');
} else {
print('Error sending email. Status code: ${response.statusCode}');
print('Response body: ${response.body}');
}
} catch (error) {
print('Error sending email: $error');
}
}
Future<void> addChallanDocument(
{name, email, ppm, uid, vehicleName, vehicleNo, docId}) async {
try {

76
VEHICLE POLLUTION MONITORING USING IoT

// Get a reference to the Firestore instance


FirebaseFirestore firestore = FirebaseFirestore.instance;
CollectionReference challansCollection = firestore.collection('Challans');

await challansCollection.add({
'ppm': ppm,
'date': getCurrentDateTimeString(),
'due_date': getDateAfterOneMonth(),
'fine': "500",
'paid_status': "pending",
'uid': uid,
'vehicle_name': vehicleName,
'vehicle_no': vehicleNo,
});
sendEmail(to: email, ppm: ppm, name: name, vehicleNumber: vehicleNo);
updateChallanStatus(docId);
print('Challan document added successfully.');
} catch (error) {
print('Error adding challan document: $error');
}
}
Future<void> updateChallanStatus(String vehicleId) async {
try {
// Get a reference to the Firestore instance
FirebaseFirestore firestore = FirebaseFirestore.instance;
// Reference to the "Vehicles" collection
CollectionReference vehiclesCollection = firestore.collection('Vehicles');
// Update the 'challan' field to true for the specified document ID
await vehiclesCollection.doc(vehicleId).update({'challan': true});
print('Challan status updated successfully.');
} catch (error) {
print('Error updating challan status: $error');
}
}}

77
VEHICLE POLLUTION MONITORING USING IoT

5. View Challan :-
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:rsm/consts/consts.dart';
import 'package:rsm/consts/list.dart';
import 'package:rsm/consts/margins_and_padding.dart';
import 'package:rsm/controllers/challans_controller.dart';
class ViewChallans extends StatelessWidget {
ViewChallans({super.key, this.vehicleData});
var vehicleData;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
scrolledUnderElevation: 0,
centerTitle: false,
title: "${vehicleData['vehicle_number']}"
.text
.fontFamily(semibold)
.size(18)
.make(),
),
body: Container(
padding: screenPadding.copyWith(top: 20),
width: double.infinity,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Owner Name".text.fontFamily(semibold).make(),
"${vehicleData['username']}".text.fontFamily(semibold).make()
],
),

78
VEHICLE POLLUTION MONITORING USING IoT

Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Vehicle Company".text.fontFamily(semibold).make(),
"${vehicleData['vehicle_brand']}"
.text
.fontFamily(semibold)
.make()
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"model".text.fontFamily(semibold).make(),
"${vehicleData['vehicle_model']}"
.text
.fontFamily(semibold)
.make()
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Insurance".text.fontFamily(semibold).make(),
"${vehicleData['insurance_status']}"
.text
.fontFamily(semibold)
.make()
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"PPM Value".text.fontFamily(semibold).make(),

79
VEHICLE POLLUTION MONITORING USING IoT

"${vehicleData['ppm']}".text.fontFamily(semibold).make()
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Device Status".text.fontFamily(semibold).make(),
vehicleData['device_installed'] == true
? "Installed"
.text
.fontFamily(semibold)
.color(Colors.green)
.make()
: "Not Installed"
.text
.color(Colors.red)
.fontFamily(semibold)
.make()
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Email".text.fontFamily(semibold).make(),
"${vehicleData['login_email']}"
.text
.fontFamily(semibold)
.make()
],
),
],
)
.box
.border(color: borderColor)

80
VEHICLE POLLUTION MONITORING USING IoT

.roundedSM
.padding(EdgeInsets.all(12))
.make(),
20.heightBox,
"Challans".text.fontFamily(semibold).size(18).make(),
10.heightBox,
Consumer<ChallansController>(builder: (context, controller, xxx) {
return Row(
children: List.generate(
Challans.length,
(index) => "${Challans[index]}"
.text
.color(controller.selectedChallans == index
? Colors.white
: blueColor)
.make()
.box
.border(color: blueColor)
.roundedSM
.color(controller.selectedChallans == index
? blueColor
: Colors.white)
.padding(
EdgeInsets.symmetric(horizontal: 10, vertical: 6),
)
.margin(
EdgeInsets.only(right: 10),
)
.make()
.onTap(() {
controller.updateChallan = index;
}),
),
);

81
VEHICLE POLLUTION MONITORING USING IoT

}),
20.heightBox,
Expanded(
child: Consumer<ChallansController>(
builder: (context, controller, xx) {
return StreamBuilder<QuerySnapshot>(
stream: controller.selectedChallans == 0
? FirebaseFirestore.instance
.collection('Challans')
.where('uid', isEqualTo: controller.selectedVehicleUid)
.where('paid_status', isEqualTo: 'pending')
.snapshots()
: FirebaseFirestore.instance
.collection('Challans')
.where('uid', isEqualTo: controller.selectedVehicleUid)
.where('paid_status', isEqualTo: 'paid')
.snapshots(),
builder: (context, snapshot) {
if (snapshot.hasError) {
return Text('Error: ${snapshot.error}');
}
if (snapshot.connectionState == ConnectionState.waiting) {
return SizedBox(
width: 10,
height: 10,
child: SizedBox(
width: 20,
height: 20,
child: Center(
child: CircularProgressIndicator(
color: blueColor,
),
),
),

82
VEHICLE POLLUTION MONITORING USING IoT

);
}
// Check if there are no pending documents
if (snapshot.data!.docs.isEmpty) {
return Center(
child: Text('No Challans found.'),
);
}
// Display the list of pending documents
return ListView.builder(
padding: EdgeInsets.all(0),
// itemCount: 10,
itemCount: snapshot.data!.docs.length,
itemBuilder: (context, index) {
var document = snapshot.data!.docs[index];
// Access the document data using document.data()
var data = document.data() as Map<String, dynamic>;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"${data['vehicle_no']}"
.text
.fontFamily(semibold)
.size(16)
.make(),
"₹ ${data['fine']}"
.text
.color(data['paid_status'] == "paid"
? Colors.green
: Colors.red)
.fontFamily(semibold)

83
VEHICLE POLLUTION MONITORING USING IoT

.size(16)
.make(),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"PPM ".text.size(16).make(),
"${data['ppm']}".text.size(16).make(),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Date ".text.size(16).make(),
"${data['date']}".text.size(16).make(),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Due Date ".text.size(16).make(),
"${data['due_date']}".text.size(16).make(),
],
),
],
)
.box
.border(color: borderColor)
.padding(EdgeInsets.all(12))
.roundedSM
.margin(
EdgeInsets.only(
bottom: 20,

84
VEHICLE POLLUTION MONITORING USING IoT

),
)
.make();
},
);
},
);
}),
),
]),
),
);
}
}

6. Home Screen Controller :-


import 'package:rsm/consts/consts.dart';
class HomeScreenController extends ChangeNotifier {
int selectedScreenIndex = 0;
set updateScreen(int val) {
selectedScreenIndex = val;
notifyListeners();
}
}

7. Area :-
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:rsm/consts/consts.dart';
String getAirQualityFeedback(double sensorValue) {
// Define threshold values for different air quality levels
int goodThreshold = 200; // Example threshold for good air quality
int moderateThreshold = 400; // Example threshold for moderate air quality
int poorThreshold = 600; // Example threshold for poor air quality

85
VEHICLE POLLUTION MONITORING USING IoT

int hazardousThreshold = 800; // Example threshold for hazardous air quality


// Check the air quality level based on the sensor value
if (sensorValue < goodThreshold) {
return "Good air quality";
} else if (sensorValue < moderateThreshold) {
return "Moderate air quality";
} else if (sensorValue < poorThreshold) {
return "Poor air quality";
} else if (sensorValue < hazardousThreshold) {
return "Hazardous air quality";
} else {
return "Very hazardous air quality";
}
}
class AreasScreen extends StatelessWidget {
const AreasScreen({super.key});
Color getAirQualityColor(double sensorValue) {
// Define the range for good to hazardous air quality
int goodThreshold = 200;
int moderateThreshold = 400;
int poorThreshold = 600;
int hazardousThreshold = 800;
// Map the sensor value to a color gradient from green to red
Color startColor = Colors.green.withOpacity(0.2);
Color endColor = Colors.red.withOpacity(0.2);
if (sensorValue < goodThreshold) {
return startColor;
} else if (sensorValue < moderateThreshold) {
double ratio =
(sensorValue - goodThreshold) / (moderateThreshold - goodThreshold);
return Color.lerp(startColor, endColor, ratio)!;
} else if (sensorValue < poorThreshold) {
double ratio = (sensorValue - moderateThreshold) /
(poorThreshold - moderateThreshold);

86
VEHICLE POLLUTION MONITORING USING IoT

return Color.lerp(startColor, endColor, ratio)!;


} else if (sensorValue < hazardousThreshold) {
double ratio =
(sensorValue - poorThreshold) / (hazardousThreshold - poorThreshold);
return Color.lerp(startColor, endColor, ratio)!;
} else {
return endColor;
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: StreamBuilder<QuerySnapshot>(
stream: FirebaseFirestore.instance.collection('Area').snapshots(),
builder: (context, snapshot) {
if (snapshot.hasError) {
return Text('Error: ${snapshot.error}');
}
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(
child: CircularProgressIndicator(
color: blueColor,
strokeWidth: 2,
),
);
}
var document = snapshot.data!.docs[0];
String ppm = document['ppm'];
double lat = document['lat'];
double lon = document['lon'];
String zone = document['zone_name'];
return Stack(
alignment: Alignment.bottomCenter,
children: [

87
VEHICLE POLLUTION MONITORING USING IoT

GoogleMap(
mapToolbarEnabled: false,
myLocationButtonEnabled: false,
markers: {
Marker(
markerId: MarkerId("moudle1"),
position: LatLng(lat, lon),
infoWindow: InfoWindow(
title: "$ppm ${getAirQualityFeedback(
double.parse(ppm),
)}",
),
)
},
circles: {
Circle(
circleId:
CircleId("your_unique_id"), // Unique identifier
center: LatLng(lat, lon), // Center coordinates
radius: 350, // Radius in meters
fillColor: getAirQualityColor(double.parse("600.0")),
// Fill color with opacity
strokeColor: Colors.transparent,
strokeWidth: 1
// Stroke width in pixels
)
},
initialCameraPosition:
CameraPosition(target: LatLng(lat, lon), zoom: 16),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(

88
VEHICLE POLLUTION MONITORING USING IoT

mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
zone.text.fontFamily(semibold).size(16).make(),
getAirQualityFeedback(double.parse(ppm)).text.make()
],
),
"$ppm"
.text
.fontFamily(semibold)
.size(16)
.color(Colors.green)
.make()
],
)
.box
.white
.padding(EdgeInsets.all(12))
.roundedSM
.make()
.marginAll(12)
],
);
}),
);
}
}

8. Sign-in Authentication :-
import '../../consts/consts.dart';
class SignInScreen extends StatelessWidget {
SignInScreen({super.key});
final _key = GlobalKey<FormState>();
TextEditingController emailField = TextEditingController();

89
VEHICLE POLLUTION MONITORING USING IoT

TextEditingController passField = TextEditingController();


@override
Widget build(BuildContext context) {
var height = MediaQuery.of(context).size.height;
var width = MediaQuery.of(context).size.width;
var controller = Provider.of<AuthController>(context, listen: false);
return Scaffold(
body: Container(
padding: const EdgeInsets.only(top: 60, left: 20, right: 20),
width: double.infinity,
child: SingleChildScrollView(
child: Form(
key: _key,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: height * 0.2,
),
"Hello Again !".text.fontFamily(semibold).size(22).make(),
30.heightBox,
customTextField(
name: "Email", hint: "Enter Email", controller: emailField),
customTextField(
name: "Password",
hint: "Enter your password",
is_pass: true,
controller: passField),
const SizedBox(
height: 20,
),
FilledButton(
onPressed: () async {
if (_key.currentState!.validate()) {

90
VEHICLE POLLUTION MONITORING USING IoT

// Form is valid, perform desired action


await controller
.userSignIn(
email: emailField.text, pass: passField.text)
.then((value) {
if (value != null) {
Get.off(() => Home());
}
});
}
},
child: const Text("Sign In"))
],
),
),
),
),
);
}
}

9. Sign-Up Authentication :-
import 'package:flutter/material.dart';
import 'package:rsm/consts/typography.dart';
import 'package:rsm/views/shared_widgets/custom_text_field.dart';
import 'package:velocity_x/velocity_x.dart';
class SignUpScreen extends StatelessWidget {
SignUpScreen({super.key});
final _formKey = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
var height = MediaQuery.of(context).size.height;
var width = MediaQuery.of(context).size.width;
return Scaffold(

91
VEHICLE POLLUTION MONITORING USING IoT

body: Container(
padding: const EdgeInsets.only(top: 60, left: 20, right: 20),
width: double.infinity,
child: Form(
key: _formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: height * 0.1,
),
"Create an account".text.fontFamily(semibold).size(22).make(),
10.heightBox,
customTextField(name: "Full Name", hint: "Enter your full name"),
customTextField(name: "Email", hint: "Enter Email"),
customTextField(
name: "Password", hint: "Enter your password", is_pass: true),
const SizedBox(
height: 20,
),
FilledButton(onPressed: () {}, child: const Text("Sign Up"))
],
),
),
),
);
}
}

10. Splash Screen :-


import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:get/route_manager.dart';
import 'package:rsm/consts/consts.dart';

92
VEHICLE POLLUTION MONITORING USING IoT

import 'package:rsm/consts/images.dart';
import 'package:rsm/consts/typography.dart';
import 'package:rsm/views/auth_screen/sign_in_screen.dart';
import 'package:velocity_x/velocity_x.dart';
class SplashScreen extends StatelessWidget {
const SplashScreen({super.key});
@override
Widget build(BuildContext context) {
Future.delayed(Duration(seconds: 1), () {
FirebaseAuth.instance.userChanges().listen(
(value) {
if (value == null) {
Get.off(
() => SignInScreen(),
transition: Transition.fadeIn,
duration: Duration(milliseconds: 500),
);
} else {
Get.offAll(() => Home());
}
},
);
});
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image(
width: 250,
image: AssetImage(
ig_logo,
),
),

93
VEHICLE POLLUTION MONITORING USING IoT

20.heightBox,
"RSM\nPOLYTECHNIC"
.text
.size(18)
.align(TextAlign.center)
.fontFamily(semibold)
.make()
],
),
),
);
}
}

11. Home Screen :-


import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:rsm/consts/consts.dart';
import 'package:rsm/controllers/challans_controller.dart';
import 'package:rsm/views/view_challans/view_challans.dart';
class HomeScreen extends StatelessWidget {
HomeScreen({super.key});
TextEditingController searchField = TextEditingController();

getColor(value) {
if (value > 100) {
return Colors.red;
} else if (value > 50) {
return Colors.orange;
} else {
return Colors.green;
}
}

94
VEHICLE POLLUTION MONITORING USING IoT

@override
Widget build(BuildContext context) {
var challanController =
Provider.of<ChallansController>(context, listen: false);
return Scaffold(
appBar: AppBar(
scrolledUnderElevation: 0,
centerTitle: false,
title: "Vehicles Information".text.fontFamily(semibold).make(),
),
body: Container(
width: double.infinity,
padding: const EdgeInsets.only(top: 10, left: 20, right: 20),
child: Column(
children: [
Row(
children: [
Expanded(
child: TextField(
controller: searchField,
decoration: const InputDecoration(
border: InputBorder.none,
isDense: true,
hintText: "Search Vehicles"),
),
),
Icon(
Icons.search,
color: borderColor,
)
],
)
.box
.roundedSM

95
VEHICLE POLLUTION MONITORING USING IoT

.border(color: borderColor)
.padding(
const EdgeInsets.symmetric(horizontal: 20),
)
.make(),
20.heightBox,
Expanded(
child: StreamBuilder<QuerySnapshot>(
stream: FirebaseFirestore.instance
.collection('Vehicles')
.where('vehicle_added', isEqualTo: true)
.snapshots(),
builder: (context, snapshot) {
if (snapshot.hasError) {
return Text('Error: ${snapshot.error}');
}
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(
child: SizedBox(
width: 10,
height: 10,
child: CircularProgressIndicator()),
);
}
// Display the list of documents
return ListView.builder(
padding: const EdgeInsets.all(0),
itemCount: snapshot.data!.docs.length,
itemBuilder: (context, index) {
var document = snapshot.data!.docs[index];
String owner_name = document['username'];
// String contact = document['contact_no'];
String email = document['login_email'];
String insurance_status = document['insurance_status'];

96
VEHICLE POLLUTION MONITORING USING IoT

String ppm = document['ppm'];


String type = document['vehicle_type'];
String vehicle_no = document['vehicle_number'];
bool isDeviceIntall = document['device_installed'];
if (document['challan'] == false &&
double.parse(document['ppm']) > 100) {
challanController.addChallanDocument(
docId: document.id,
name: owner_name,
email: email,
ppm: ppm,
uid: document['uid'],
vehicleName: document['vehicle_model'],
vehicleNo: vehicle_no);
}
return Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
vehicle_no.text
.fontFamily(semibold)
.size(16)
.make(),
isDeviceIntall
? ppm.text
.fontFamily(semibold)
.color(getColor(double.parse(ppm)))
.make()
: "Device Not Install"
.text
.color(Colors.red)
.make(),

97
VEHICLE POLLUTION MONITORING USING IoT

],
),
20.heightBox,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Owner".text.make(),
owner_name.text.fontFamily(semibold).make()
],
),
Container(
height: 30,
width: 1,
decoration: BoxDecoration(color: Colors.black),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"type".text.make(),
type.text.fontFamily(semibold).make()
],
),
Container(
height: 30,
width: 1,
decoration: BoxDecoration(color: Colors.black),
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
"Insurance".text.make(),

98
VEHICLE POLLUTION MONITORING USING IoT

insurance_status.text
.fontFamily(semibold)
.make()
],
),
],
),
],
)
.box
.roundedSM
.border(color: borderColor)
.padding(
const EdgeInsets.all(16),
)
.margin(EdgeInsets.only(bottom: 15))
.make()
.onTap(() {
challanController.selectedVehicleUid = document['uid'];
Get.to(
() => ViewChallans(vehicleData: document),
);
});
},
);
},
),
),
],
),
),
);
}
}

99
VEHICLE POLLUTION MONITORING USING IoT

12. Profile Screen :-


import 'package:firebase_auth/firebase_auth.dart';
import 'package:rsm/consts/consts.dart';
class ProfileScreen extends StatelessWidget {
const ProfileScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
width: double.infinity,
padding: EdgeInsets.only(top: 60, left: 20, right: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Profile".text.fontFamily(semibold).size(22).make(),
20.heightBox,
Row(
children: [
CircleAvatar(
backgroundColor: borderColor,
radius: 35,
),
20.widthBox,
"Admin".text.fontFamily(semibold).size(18).make()
],
)
.box
.border(color: borderColor)
.roundedSM
.padding(EdgeInsets.all(12))
.make(),
20.heightBox,
ListTile(
onTap: () async {

100
VEHICLE POLLUTION MONITORING USING IoT

await FirebaseAuth.instance.signOut();
Get.offAll(() => SplashScreen());
},
trailing: Icon(
Icons.arrow_forward_ios,
color: blueColor,
),
title: "Sign Out".text.make(),
).box.border(color: borderColor).roundedSM.make()
],
),
),
);
}
}

101
VEHICLE POLLUTION MONITORING USING IoT

Chapter No. 12
FEASIBILITY STUDY

12.1 Feasibility Study

 Project Overview:
IoT technology offers real-time monitoring and data collection capabilities, enabling efficient
tracking of vehicle emissions. The goal is to develop a scalable solution that can be deployed in
urban areas to monitor and mitigate air pollution from vehicles.

 Market Analysis:
The market for pollution monitoring solutions is growing rapidly due to increasing
environmental concerns and stricter regulations. Competitors may include established
environmental monitoring companies and startups offering IoT-based solutions. Market trends
indicate a shift towards smart cities and sustainable development, creating opportunities for
innovative pollution monitoring technologies.

 Technical Feasibility:
IoT sensors for pollution monitoring have advanced significantly, with high accuracy and
reliability. Integration with existing vehicle systems may require collaboration with automotive
manufacturers or aftermarket device installation.
Connectivity options like cellular networks or LPWAN technologies (e.g., LoRaWAN) can
facilitate data transmission. Potential challenges include sensor calibration, data interoperability,
and power management for IoT devices.

 Regulatory and Compliance Considerations:


Compliance with emissions standards such as Euro norms or EPA regulations is essential for the
acceptance and adoption of the solution. Data privacy and security regulations must be adhered
to, especially concerning the collection and transmission of sensitive environmental data.

 Cost Analysis:
Initial costs include sensor procurement, hardware development, and software engineering.
Ongoing operational costs may include data storage, maintenance, and network connectivity
fees. Potential revenue streams could come from selling data to governments, municipalities, or
private companies for environmental monitoring purposes.

 Risk Assessment:

102
VEHICLE POLLUTION MONITORING USING IoT

Technical risks include sensor malfunctions, data inaccuracies, or connectivity issues.


Regulatory risks involve changes in emissions standards or privacy regulations. Mitigation
strategies may include redundancy in sensor systems, regular maintenance checks, and
compliance monitoring.

 Environmental Impact:
Implementation of IoT-based pollution monitoring can lead to significant reductions in harmful
emissions, contributing to improved air quality and public health. However, there may be
environmental concerns related to the manufacturing and disposal of IoT devices, which need to
be addressed through sustainable practices.

 Social and Economic Impact:


Improved air quality can lead to reduced healthcare costs, increased productivity, and enhanced
quality of life for residents. Economic benefits may include cost savings from more efficient
traffic management and targeted enforcement of emissions regulations.

12.2 Analysis
1. Sensor Technology:

 Feasibility: Advances in sensor technology enable the development of highly sensitive and
accurate pollution monitoring devices capable of detecting various pollutants emitted by
vehicles.

 Challenges: Calibration of sensors to ensure accuracy across different environmental conditions


and pollutant concentrations. Sensor drift over time may affect data quality and reliability,
necessitating regular maintenance and recalibration.

2. Data Collection and Transmission:

 Feasibility: IoT platforms provide scalable solutions for real-time data collection from
distributed sensor networks installed in urban areas.

 Challenges: Ensuring reliable data transmission and connectivity in challenging environments


such as urban canyons or areas with poor network coverage. Bandwidth constraints and data
latency may affect the timeliness of pollution data delivery.

3. Integration with Vehicle Systems:

103
VEHICLE POLLUTION MONITORING USING IoT

 Feasibility: Integration with onboard vehicle systems or retrofitting vehicles with IoT devices
allows for seamless data collection and transmission.
 Challenges: Compatibility issues with different vehicle makes and models, as well as variations
in vehicle emissions control systems. Retrofitting existing vehicles with IoT devices may be
costly and require specialized expertise.

4. Data Processing and Analysis:

 Feasibility: Data analytics techniques, including machine learning algorithms, enable the
processing and analysis of large volumes of pollution data to identify trends, patterns, and
pollution hotspots.

 Challenges: Ensuring the accuracy and reliability of data analysis results, particularly in
dynamic urban environments with complex interactions between vehicles, infrastructure, and
weather conditions. Data privacy concerns may arise when processing and sharing sensitive
environmental data.

5. Power Management:

 Feasibility: Low-power IoT devices and energy-efficient sensor technologies allow for
prolonged operation without frequent battery replacements.

 Challenges: Balancing power consumption with data collection frequency and transmission
intervals to maximize device uptime while minimizing energy usage. Implementing efficient
power management strategies in remote or inaccessible deployment locations may be
challenging.

6. Scalability and Maintenance:

 Feasibility: IoT-based solutions offer scalability to deploy and manage large-scale pollution
monitoring networks across urban areas.

 Challenges: Managing and maintaining distributed sensor networks, including firmware


updates, sensor recalibration, and troubleshooting issues remotely. Ensuring data integrity and
reliability over the long term requires robust maintenance protocols and quality assurance
processes.
7. Data Security and Privacy:

104
VEHICLE POLLUTION MONITORING USING IoT

 Feasibility: Implementing encryption and authentication mechanisms ensures data security


during transmission and storage.

 Challenges: Protecting sensitive environmental data from unauthorized access, manipulation, or


cyberattacks. Complying with data privacy regulations and addressing concerns regarding the
collection and usage of personal or vehicle-related data.

105
VEHICLE POLLUTION MONITORING USING IoT

Chapter No. 13
ADVANTAGES AND LIMITATIONS
Advantages: -

1. Real-Time Monitoring: IoT enables continuous and real-time monitoring of vehicle emissions,
providing instant insights into pollution levels in urban areas. This allows for prompt
interventions and mitigation measures to address pollution hotspots.

2. Data Accuracy and Granularity: IoT sensors provide accurate and granular data on various
pollutants emitted by vehicles, including nitrogen oxides (NOx), particulate matter (PM),
carbon monoxide (CO), and hydrocarbons. This detailed data enables better understanding and
management of air quality issues.

3. Cost-Effective Solutions: IoT-based monitoring solutions offer cost-effective alternatives to


traditional monitoring methods. Wireless sensor networks eliminate the need for costly
infrastructure and manual data collection, reducing operational expenses in the long run.

4. Scalability: IoT platforms allow for the deployment of scalable monitoring networks across
large geographical areas. Multiple sensors can be deployed in urban environments to cover
diverse locations and monitor pollution levels effectively.

5. Predictive Analytics: Data collected from IoT sensors can be analyzed using advanced
analytics techniques, such as machine learning algorithms. This enables the prediction of
pollution trends, identification of pollution sources, and optimization of pollution control
strategies.

6. Environmental Protection: By providing accurate and timely data on vehicle emissions, IoT-
based monitoring helps in enforcing emissions regulations and implementing targeted
interventions to reduce pollution levels.

7. Public Health Benefits: Improved air quality resulting from effective pollution monitoring
leads to numerous public health benefits. Reduced exposure to harmful pollutants lowers the
risk of respiratory diseases, cardiovascular problems, and other health issues associated with air
pollution.

8. Policy Support: IoT-based pollution monitoring aligns with government initiatives and
environmental policies aimed at reducing vehicle emissions and improving air quality. It
provides policymakers with actionable data to develop evidence-based regulations and
strategies for pollution control.

106
VEHICLE POLLUTION MONITORING USING IoT

9. Community Engagement: IoT-based monitoring fosters community engagement by raising


awareness about air quality issues and empowering citizens to take proactive measures to reduce
pollution. Public access to pollution data promotes transparency and accountability in pollution
management efforts.

10. Technological Innovation: Implementing IoT for vehicle pollution monitoring drives
technological innovation in environmental monitoring and sustainability. It encourages the
development of new sensor technologies, data analytics tools, and smart city solutions to
address complex urban challenges.

107
VEHICLE POLLUTION MONITORING USING IoT

Chapter No. 14
APPLICATIONS

1) Real-time Emission Monitoring: IoT sensors can be installed in vehicles to continuously


monitor emissions such as CO2, NOx, particulate matter (PM), and hydrocarbons. This real-
time data can be transmitted to centralized servers for analysis.

2) Fleet Management: Companies with fleets of vehicles can use IoT sensors to monitor emissions
from each vehicle in real-time. This data can help in optimizing routes, identifying poorly
performing vehicles, and scheduling maintenance to reduce emissions.

3) Urban Air Quality Monitoring: By deploying IoT sensors at various locations throughout a
city, authorities can monitor the impact of vehicle emissions on air quality. This data can be
used to implement targeted interventions, such as traffic management measures or emission
control zones.

4) Emission Hotspot Detection: IoT sensors installed in strategic locations can detect emission
hotspots, such as congested intersections or areas with heavy traffic. Authorities can then take
proactive measures to alleviate congestion or reroute traffic to reduce emissions in these areas.

5) Vehicle Inspection and Maintenance Programs: IoT-enabled vehicle inspection systems can
automatically assess emissions during routine inspections. If a vehicle exceeds emission limits,
alerts can be sent to the owner, prompting them to schedule maintenance to rectify the issue.

6) Public Health Monitoring: High levels of vehicle emissions can have adverse effects on public
health, leading to respiratory problems and other health issues. IoT-based pollution monitoring
systems can provide data to public health agencies, enabling them to take appropriate actions to
protect public health.

7) Compliance Monitoring: Governments can use IoT sensors to monitor compliance with
emission standards. By collecting and analyzing emission data from vehicles, authorities can
identify non-compliant vehicles and enforce regulations more effectively.

8) Consumer Awareness: IoT-enabled pollution monitoring systems can provide consumers with
real-time information about the environmental impact of their vehicles. This information can
influence consumer behavior, encouraging them to choose cleaner and more fuel-efficient
vehicles.

108
VEHICLE POLLUTION MONITORING USING IoT

9) Policy Evaluation and Planning: Governments can use IoT data to evaluate the effectiveness
of existing pollution control policies and develop evidence-based strategies to further reduce
emissions from vehicles.

109
VEHICLE POLLUTION MONITORING USING IoT

FUTURE SCOPE

1. Enhanced Monitoring Capabilities


Objective: Improve the accuracy, coverage, and real-time monitoring capabilities of the IoT-based
system.

Future Scope:
Deploy advanced IoT sensors and devices with higher sensitivity and precision to capture detailed data
on vehicle emissions.
Integrate multi-modal sensing technologies (e.g., gas sensors, particulate matter sensors, noise sensors)
to monitor various pollutants and environmental conditions simultaneously.
Implement edge computing and fog computing solutions to process and analyze data locally, reducing
latency and improving real-time monitoring capabilities.

2. Data Analytics and Predictive Modeling


Objective: Utilize advanced data analytics, AI, and machine learning techniques to analyze, interpret,
and predict pollution levels and trends.

Future Scope:
Develop AI and machine learning algorithms to analyze complex IoT-generated datasets and identify
patterns, correlations, and anomalies in vehicle pollution.
Build predictive models to forecast future pollution levels based on historical data, weather conditions,
traffic patterns, and other relevant factors.
Implement anomaly detection and predictive maintenance algorithms to identify and address sensor
malfunctions or performance issues proactively.

3. Smart Infrastructure Integration


Objective: Integrate IoT-based pollution monitoring systems with smart infrastructure and urban
planning initiatives.

Future Scope:
Collaborate with city planners, transportation authorities, and infrastructure developers to integrate
pollution monitoring sensors into smart traffic management systems, intelligent transportation systems
(ITS), and smart city initiatives.
Utilize IoT data to optimize traffic flow, reduce congestion, and mitigate pollution hotspots through
adaptive traffic control, route optimization, and demand-responsive transportation solutions.

4. Public Engagement and Citizen Science


Objective: Enhance public awareness, engagement, and participation in pollution monitoring and
mitigation efforts.

Future Scope:
Develop user-friendly IoT-based mobile and web applications to provide real-time pollution data,

110
VEHICLE POLLUTION MONITORING USING IoT

insights, and personalized recommendations to the public.


Incorporate gamification, crowdsourcing, and social sharing features to encourage community
involvement, behavior change, and collective action in monitoring and reducing vehicle pollution.
Foster citizen science initiatives and collaborative research projects to empower individuals,
communities, and organizations to contribute to pollution monitoring, data collection, and analysis
efforts.

5. Policy Influence and Regulatory Support


Objective: Influence policy-making, enforcement, and regulatory frameworks to promote sustainable
transportation, reduce vehicle emissions, and improve air quality.

Future Scope:
Work closely with policymakers, legislators, regulatory bodies, and environmental agencies to advocate
for stricter emission standards, cleaner fuels, sustainable transportation solutions, and infrastructure
development.
Leverage IoT-generated data, insights, and evidence-based recommendations to inform policy
decisions, evaluate the effectiveness of pollution control measures, and drive continuous improvement
in environmental regulations and enforcement.

6. Research, Innovation, and Collaboration


Objective: Foster innovation, research, development, and collaboration in IoT-based pollution
monitoring technologies, solutions, and applications.

Future Scope:
Encourage interdisciplinary research and innovation in sensor technology, IoT devices, data analytics,
AI, machine learning, and environmental science to advance the field of vehicle pollution monitoring.
Collaborate with academic institutions, research organizations, industry partners, and technology
providers to explore new methodologies, best practices, and technological advancements in IoT-based
monitoring, mitigation, and management of vehicle pollution.

111
VEHICLE POLLUTION MONITORING USING IoT

CONCLUSION

In conclusion, implementing a project for vehicle pollution monitoring using IoT technology
presents a compelling solution to address the pressing environmental and public health challenges
posed by transportation emissions. By deploying IoT sensors in vehicles and urban infrastructure, real-
time data on emissions can be collected, analyzed, and utilized to inform evidence-based policy
decisions, optimize traffic management strategies, and empower individuals to make more sustainable
transportation choices. The future scope for this project is promising, with opportunities for
advancements in sensor technologies, data analytics, and collaborative initiatives to create smarter and
more sustainable transportation systems. Ultimately, by leveraging IoT technology for vehicle pollution
monitoring, we can work towards reducing emissions, improving air quality, and creating healthier and
more livable cities for current and future generations.

112
VEHICLE POLLUTION MONITORING USING IoT

REFERENCES

[1] Souvik Manna, Suman Sankar Bhunia, Nandini Mukherjee, Vehicular Pollution Monitoring U
sing loT, IEEE International Conference on Recent Advances and Innovations in Engineering
(ICRAIE-2014),May 09-11, 2014, Jaipur, India.
[2] Ramagiri Rushikesh, Chandra Mohan Reddy Sivappagari, Development of IoT based Vehicular
Pollution Monitoring System, International Conference on Green Computing and Internet of
Things (ICGCIoT) 2015.
[3] A.Rajalakshmi, S.Karthick, Dr.S.Valarmathy, Vehicular Pollution and Status Monitoring Using
IOT, International Journal of Advanced Research in Science, Engineering and Technology, Vol.
2, Issue 4 , April 2015.
[4] Prof. Vishal V. Pande, Rupesh A. Kale, Rupali S. Shirke, Jigar V. Chitroda, Aakash P. Panchal,
Online Vehicle Pollutants Monitoring System using GSM, International Journal of Advanced
Research in Electrical, Electronics and Instrumentation Engineering (An ISO 3297: 2007
Certified Organization)Vol. 4, Issue 4, April 2015.
[5] S.SMRUTHIE, G.SUGANYA, S.GOWRI, A.SIVANESHKUMAR, Vehicular pollution
monitoring using IoT, International Journal of Digital Communication and Networks
(IJDCN)Volume 2, Issue 12, December 15.

[6] Gopinath, S., Basha, S. H., Prabha, G., & Rajasekaran, M. P. (2018). Internet of Things (IoT)
based Smart Environmental Pollution Monitoring and Management System for Smart City.
Procedia Computer Science, 133, 615-622.

[7] Gupta, G., Choudhury, S., Yadav, A. K., & Yadav, A. (2018). Real-Time Monitoring of Vehicle
Emissions Using Internet of Things. 2018 4th International Conference on Computing Sciences
(ICCS).

[8] Han, B., Liu, W., Zhan, X., & Zhao, Y. (2018). An Internet of Things Approach for Extracting
the Impact of Traffic Pollution on Road Networks. Sensors, 18(6), 1794.

[9] Khan, T. U., Naqvi, M. R., Iqbal, M., Siddique, F., & Rashid, M. (2020). An IoT-Based Real-
Time Vehicle Emission Monitoring System. Sensors, 20(4), 1097.

113
VEHICLE POLLUTION MONITORING USING IoT

BIBLIOGRAPHY

1. https://copyright.gov.in/UserRegistration/frmLoginPage.aspx

2. https://www.ijsrd.com/

3. https://www.irjmets.com/uploadedfiles/paper//issue_1_january_2023/33097/final/fin_irjmets16
74484921.pdf

4. https://www.ijert.org/vehicle-pollution-monitoring-system-using-iot

5. https://ijrpr.com/uploads/V4ISSUE5/IJRPR13327.pdf

6. https://www.ijrte.org/wp-content/uploads/papers/v9i1/A1899059120.pdf

114
SmartX Prokits, Vedant Plaza, Chumble Marg, Near Ved Mandir, New CBS,Nashik
- 422001 Mo No – 7276757409 , 9421390933

CERTIFICATE OF COMPLETION

I hereby affirm, to the best of my knowledge and belief based on inspections,


observations, testing of the project and upon reports submitted by others

This VEHICLE POLLUTION MONITORING USING IoT is substantially complete and


operable. The project was completed in accordance with the department’s issued
guidelines.

PROJECT MEMBERS –

1. Ghotekar Aditya Bhalchandra


2. Birar Suyash Gopal
3. Dhondge Aman Sanjay
4. Kame Om Uttam
5. Ranka Raj Sachin

PROJECT DESCRIPTION -

Construction begin date : 28 / 10 / 2023


Substantial Completion date : 24 / 11 / 2023
Physical Completion date : 15 / 12 / 2023
Completion date : 10 / 01 / 2024

Yours Sincerely,

(SMARTX PROKITS Pvt. Ltd. )

Certified by : Vivek Bhakta ( Director SmartxProkits) Date : 08/04/2024


COPYRIGHT STATUS
4/14/24, 2:16 AM Copyright Office

Acknowledgement Slip
(Date: 13/12/2023)

Diary Number: 33148/2023- Form Received: Online


CO/SW

Copyright Reg. of: Computer Titled: VEHICLE POLLUTION MONITORING USING


Software IoT

Communication Address
Name Address Phone Number
MVPS RAJARSHI SHAHU
MVPS RAJARSHI SHAHU MAHARAJ POLYTECHNIC
MAHARAJ POLYTECHNIC GANGAPUR ROAD NASHIK
-422013

Financial Details
Payment ID Amount Bank Name Payment Mode Payment Date
332084 500 13/12/2023
* For future communication please mention this DIARY No.

INSTRUCTIONS

For the purpose of processing the application, following documents are mandatory to send by post along
with the acknowledgement slip(Office Copy).

1. 2 Copies of work

2. DD/IPO of Rs.(as applicable) per work favouring Registrar Copyright Office payable at New Delhi (Not
applicable for online payment)

3. Authorization from author/publisher

4. If the work is being used on goods or capable of being used on the goods

5. If the application is being field through attorney, a specific power of attorney in original duly signed by
the applicant and accepted by the attorney

6. Search Certificate from Trade Mark Office(TM-60) (Only in case of Artistic work).

7. Applicant must take a print out of the application, sign it and send along with the other documents.

Kindly send the above documents within 30 Days from the date of online submission on the following
address given by herewith: .

Office of the Registrar of Copyrights


Copyright Office, Department for Promotion of Industry & Internal Trade
Ministry of Commerce and Industry
Boudhik Sampada Bhawan,
Plot No. 32, Sector 14, Dwarka,
New Delhi-110078
Email Address: copyright@nic.in
Telephone No.: 011-28032496

***APPLICANT'S COPY***
THANK YOU

about:blank 1/2
4/14/24, 2:16 AM Copyright Office

Acknowledgement Slip
(Date:13/12/2023)

Diary Number: 33148/2023- Form Received: Online


CO/SW

Copyright Reg. of: Computer Titled: VEHICLE POLLUTION MONITORING USING


Software IoT

Communication Address
Name Address Phone Number
MVPS RAJARSHI SHAHU
MVPS RAJARSHI SHAHU MAHARAJ POLYTECHNIC
MAHARAJ POLYTECHNIC GANGAPUR ROAD NASHIK
-422013

Financial Details
Payment ID Amount Bank Name Payment Mode Payment Date
332084 500 13/12/2023
* For future communication please mention this DIARY No.

INSTRUCTIONS

For the purpose of processing the application, following documents are mandatory to send by post along
with this acknowledgement slip(Applicant's Copy).

1. 2 Copies of work

2. DD/IPO of Rs.(as applicable) per work favouring Registrar Copyright Office payable at New Delhi (Not
applicable for online payment)

3. Authorization from author/publisher

4. If the work is being used on goods or capable of being used on the goods

5. If the application is being field through attorney, a specific power of attorney in original duly signed by
the applicant and accepted by the attorney

6. Search Certificate from Trade Mark Office(TM-60) (Only in case of Artistic work).

7. Applicant must take a print out of the application, sign it and send along with the other documents.

Kindly send the above documents within 30 Days from the date of online submission on the following
address given by herewith: .

Office of the Registrar of Copyrights


Copyright Office, Department for Promotion of Industry & Internal Trade
Ministry of Commerce and Industry
Boudhik Sampada Bhawan,
Plot No. 32, Sector 14, Dwarka,
New Delhi-110078
Email Address: copyright@nic.in
Telephone No.: 011-28032496

***OFFICE COPY***
THANK YOU

about:blank 2/2
OUR PUBLICATION AND CERTIFICATION

IJSRD - International Journal for Scientific Research & Development| Vol. 11, Issue 12, 2024 | ISSN (online): 2321-0613

Vehicle Pollution Monitoring using IoT


Aditya Ghotekar1 Suyash Birar2 Aman Dhondge3 Om Kame4 Raj Ranka5
1,2,3,4,5
Department of Information Technology
1,2,3,4,5
MVP‟S RSM Polytechnic, KBT Circle, Gangapur Road, Nashik, India
Abstract — Pollution is one of the major cause affecting the proposed taking action in response to the increasing cost of
environment in today‟s world, especially Air Pollution. water [1].
According to the data the contribution of air pollution itself is In addition to this, we also got an paper proposed in
upto 70% is that of the total pollution causing damage to the the year April 2022, covering the same obstacle published in
environment. Also it is one of the major factor that has caused the “International journal of Advanced Research in Science,
uncertainty in global warming. And due to global warming, Communication and Technology”, this paper RFID
we came across with the uncertainty in the weather or climatic technology, as one off the enabling technologies of
conditions of the planet Earth. As noticed and recorded we loT(Internet of Things), is employed to develop the
saw a huge discrepancy in the climate and seasons too. The information system. RFID reading can be interrogated along
climate became more of humid in most of the regions of the with the corresponding tag ID through a wireless connection
earth. The Glacier has started melting at a tremendous among traffic lights and vehicles. This will maintain the
decreasing rate of 25 meters annually. All is due to the Global database and graph for the data by monitoring the emissions
warming, and major factor contributing to this is pollution. data, the engine health can be easily inspected and Examine.
Keywords: Node MCU, Internet of Things (IOT), MQ-135, Tracy C. Britton shared insights into improving water
MQ-7, Sensors distribution systems for water utilities. The paper emphasized
the reduction of water loss in the network, estimating
I. INTRODUCTION customer post-meter leakage to be up to 10% of total water
consumption. The conclusion highlighted the importance of
As of now we all know air pollution Is one of the major factor identifying and addressing post-meter leakage [2].
affecting the nature and also causing global warming at the Also we have got an paper from the year 2022 month
same time , but precisely one thing is constantly increasing January from the conference of “International Journal of
this rate is pollution that gets emitted on a day to day regular Engineering Research & Technology”, decoding on the
basis is vehicle pollution. Knowingly or unknowingly, we see solution of the obstacle which goes like Every 15 days, a
the gas that gets emitted out of the exhaust pipes of the pollution check is required, and just a few people follow
vehicles you see on the roads are playing a lead role here in through. This project setup has been Technology (LERT)
art pollution. Majorly, the gases that get emitted from these calibrated, and the system's performance has been validated.
engines are carbon monoxide (CO) and some minor The designed system monitors the pollution level released by
proportion of carbon dioxide (Co2). The process goes like automobiles, and if it exceeds a certain threshold value, a
this, the very first thing is when one turns on the ignition the warning message is delivered to the vehicle owner
engine starts, these engines are combustion engines which via the GSM module [3].
mainly run on the gasoline (Diesel , petrol) causing spark in
the engine, this leads to power production and thus the vehicle III. PROJECT CONCEPT
is able to move forth. The process does have a byproduct of
this combustion that is gas emission through the exhaust pipe. A. Overview
Therefore for tackling this event we are building an IoT based As per the recent data, the vehicular emission is a major cause
Software Application to limit the emissions by imposing of air pollution in urban areas. Typically, the vehicular
restrictions as well as keeping an eye on each and every emission contribute in an unbelievable ratio of 20-30% of the
vehicle using our monitoring device on gas overall damage to the environment, which makes breathing
exhaustion of vehicles. nearly harmful for the human mankind. If the percentage rises
in upcoming years this would be a big trouble maker for the
II. LITERATURE SURVEY mankind. So to restrict and overcome this we are proposing a
To your conformity we have an paper proposed in January concept of monitoring and controlling the vehicular
2023 in the journal publised by the “International Research emissions to somewhat extinct. We are going to design two
Journal of Modernisation in Engineering Technology and models based on IoT to keep eyes on the “ppm” values of the
Science” which comes across the same problem In our gases emitted by the vehicles. Basically, we figured out that
environment of the pollution is mostly because of the the vehicles that aren‟t serviced frequently comparatively and
emission of harmful gases from the automobiles. This can be majorly violated the ppm value which exceeded over „150‟
reduced only by strictly monitoring the concentrations of which is in the red zone. For a safer side the ppm value should
harmful pollutants like CO, NOX, smoke etc. It is difficult to be around 80 maximum, if it exceeds over 100 the air quality
check that manually. At that time this system is very useful to gets in trouble.
calculate the concentrations of harmful gases and to inform B. Hardware Requirements
the vehicle owner and the transport department which helps
For this model we are using a few components as our
in proper maintenance of the vehicles. G Hauber-Davidson
hardware for the model and some sensors to majorly focus on
discussed the role of smart water meters and their real-time
the monitoring of the CO gas emitted by vehicles. The first
monitoring capabilities for water consumption. The paper
one is the Node MCU, then we have used MQ135 for the

All rights reserved by www.ijsrd.com 126


Vehicle Pollution Monitoring using IoT
(IJSRD/Vol. 12/Issue 1/2024/026)

sensor part of the hardware LM35 as our temperature sensor analog signals like sound, light, temperature) to digital
and A/D converter for conversion of analog signals to digital signals like the computers. This process allows one from real-
signals. world to get the analog data in the human understandable
1) Node MCU (Microcontroller): language.
The main working of the node MCU that is the
microcontroller has the major role in this project covering all
the connections and integrations part on a motherboard.
Mainly this is the connecting block of the software part and
the hardware part of the project.

Fig. 4: A/D Converter


C. Working Modules
We have 2 modules ready for the action. The first one can be
placed at each and every vehicle at the time of manufacturing
itself, and the other one will be placed in heavy crowded areas
like congestion areas of the region, the traffic signals and
Fig. 1: Node MCU (MicroController) some of the heavily traffic areas. The vehicle module has a
2) MQ135 (Gas Sensor): job of monitoring the gas emission levels from the exhaust
This sensor is widely used for sensing gases from the pipe. The area module has a job of taking a note of air quality
atmosphere. It can detect Ammonia (NH3), sulfer (S), of that particular area where it has been placed so that the
Benzene (C5H6), Carbon dioxide (Co2) as well as the Carbon RTO nearby can take actions particularly.
Monoxide (CO). So we decided to select this particular sensor 1) Vehicle Module:
for the job. For this module we have also developed an application for 2
people one is for the user and one is for the administrator. To
be precise the user app consists of the basic information such
as the vehicle details and if the device is installed or not. Also
in addition to it the user also has the acknowledgment of the
challans he has to pay in accordance with the violation of the
rules and regulations of his vehicle. He also can register new
vehicles through the application, also he gets a payment
gateway in built in the app so he doesn‟t have to check any
other website or application to pay-off his challans. Lastly he
has a history of the challans and a pay-check of the past
Fig. 2: MQ135 (Gas sensor) payments. If the device is not installed he too gets a mail
3) LM35 (Temperature Sensor): directly from the admin to immediately install the device or
This is a temperature sensor which is again important while further actions could be taken. All the information would be
monitoring the emissions of the vehicle. The LM35 outputs in real-time and date.
the analog signal which is proportional to the instantaneous
temperature, meaning as the temperature increases or
decreases the analog signal value increases and decreases
simultaneously.

Fig. 3: LM35 (Temperature Sensor)


4) A/D converter:
The A/D converter is an analog signal converter to digital
signal converter. Basically it is a translator between the Fig. 5: User App

All rights reserved by www.ijsrd.com 127


Vehicle Pollution Monitoring using IoT
(IJSRD/Vol. 12/Issue 1/2024/026)

2) Area Module: Pollution Monitoring System, International Conference


For this module we have not made any complexed structure on Green Computing and Internet of Things (ICGCIoT)
of the application just the thing is that this would be only 2015.
accessible to the administrator or the person who is in [3] A.Rajalakshmi, S.Karthick, Dr.S.Valarmathy, Vehicular
authority of the application. Here in this we have check Pollution and Status Monitoring Using IOT,
marked all the left out points of the user app like the total International Journal of Advanced Research in Science,
information of the vehicles with the installed devices and Engineering and Technology, Vol. 2, Issue 4 , April
their current activity status. In addition, the admin will also 2015.
be able to check out the area where we have installed the area [4] Prof. Vishal V. Pande, Rupesh A. Kale, Rupali S. Shirke,
device, also he could see the air quality of the area in real- Jigar V. Chitroda, Aakash P. Panchal, Online Vehicle
time in a pre-defined radius coverage of 1km within a Pollutants Monitoring System using GSM, International
particular area where the device is installed. Journal of Advanced Research in Electrical, Electronics
and Instrumentation Engineering (An ISO 3297: 2007
Certified Organization)Vol. 4, Issue 4, April 2015.
[5] S.SMRUTHIE, G.SUGANYA, S.GOWRI,
A.SIVANESHKUMAR, Vehicular pollution monitoring
using IoT, International Journal of Digital
Communication and Networks (IJDCN)Volume 2, Issue
12, December 15.

Fig. 6: Admin App for Area

IV. CONCLUSION
This Project represents the design and development of
vehicular pollution monitoring system. The developed
system checks the pollution level emitted by the vehicles and
if it is above the threshold, a warning message will be sent to
the vehicular owner using the GSM module. These data are
finally stored in a cloud for future analysis. This idea differs
from the existing system that the vehicle owner gets an
awareness about the emission level without going for a
checking process. The main objective is we will be aware of
the pollution level from the vehicles. Hence a solution for
global warming.
A. Future scope:
In future as the number of vehicles will increase the pollution
will also increase. The air quality will become worse in future
so it is necessary to control the pollution as it can adversely
affect human health and can cause severe diseases like lung
cancer, astama, respiratory problems and many more. So
through our project the pollution will be in control and the
vehicles causing pollution will be detected.

REFERENCES
[1] Souvik Manna, Suman Sankar Bhunia, Nandini
Mukherjee, Vehicular Pollution Monitoring U sing loT,
IEEE International Conference on Recent Advances and
Innovations in Engineering (ICRAIE-2014),May 09-11,
2014, Jaipur, India.
[2] Ramagiri Rushikesh, Chandra Mohan Reddy
Sivappagari, Development of IoT based Vehicular

All rights reserved by www.ijsrd.com 128


CERTIFICATES OF COMPETITIONS

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy