0% found this document useful (0 votes)
39 views32 pages

Shetty 2019

This document summarizes a chapter about using machine learning and IoT techniques to create an air pollution control model. The chapter introduces the objectives of the project, which are to reduce air pollution by collecting data on vehicle emissions using sensors, notifying vehicle owners when emissions exceed thresholds, and stopping fuel flow if emissions remain too high. It then provides a literature review and overview of the project design, implementation, results, and conclusions. The system aims to help control air pollution by monitoring vehicle emissions in real-time and taking steps to reduce emissions when thresholds are exceeded.

Uploaded by

Venkat
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)
39 views32 pages

Shetty 2019

This document summarizes a chapter about using machine learning and IoT techniques to create an air pollution control model. The chapter introduces the objectives of the project, which are to reduce air pollution by collecting data on vehicle emissions using sensors, notifying vehicle owners when emissions exceed thresholds, and stopping fuel flow if emissions remain too high. It then provides a literature review and overview of the project design, implementation, results, and conclusions. The system aims to help control air pollution by monitoring vehicle emissions in real-time and taking steps to reduce emissions when thresholds are exceeded.

Uploaded by

Venkat
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/ 32

CHAPTER EIGHT

Air pollution control model


using machine learning and IoT
techniques
Chetan Shetty, B.J. Sowmya, S. Seema, K.G. Srinivasa
M S Ramaiah institute of Technology, Bengaluru, Karnataka

Contents
1. Introduction 188
1.1 Objectives of the project 189
2. Literature survey 190
3. Design 197
3.1 Graphical user interface 201
4. Implementation and results 201
4.1 Module description 203
4.2 Actual data vs predicted data 203
4.3 Explanation of algorithm 205
5. Conclusion 211
References 216
Further reading 216
About the authors 217

Abstract
Problem with the automobile engines continues to increase in a very large scale. Every
vehicle has its own emission but problem arises when the emission occurs beyond stan-
dard values. Even though lot of changes has been made in the consumption of fuel,
increasing urbanization and industrialization contribute for the poor air quality. With
the technical advancements in machine learning, it’s been possible to build predictive
models for monitoring and controlling pollution based on the real-time data. With this,
we are using IoT techniques for monitoring the emission rates of vehicles. A predictive
model is built on the real-time data available, predicting the values of carbon monoxide.
Sensors are embedded in the vehicles to measure the pollutants levels. By using the
monitoring techniques, vehicle details such as location, owner is notified with the cur-
rent situation of pollution in his location and his vehicle emission rate contributing to
environment. Machine learning model is used for the prediction of pollution level in the
vehicle location based on the previous data and the current data obtained by the sen-
sors. Here the pollutants level can be controlled using smart emission surveillance

Advances in Computers, Volume 117 # 2020 Elsevier Inc. 187


ISSN 0065-2458 All rights reserved.
https://doi.org/10.1016/bs.adcom.2019.10.006
188 Chetan Shetty et al.

system. The system shoots beyond threshold value taken from the Bharat Stage emis-
sion standards then automatically a notification will be sent to the vehicle owner. The
emitted level will be monitored and the fuel supply to the engine will be cut off using
solenoid valve at the same time.

1. Introduction
Air pollution is one of the gravest problems faced by the environment
especially by densely populated countries like India. The rapid growth of
population has led to an increased usage of vehicles. These vehicles use fuels
which undergoes incomplete combustion to emit toxins. The principal
emissions from motor vehicles contains harmful gases which contributes
to greenhouse effect.
Automotive emissions include CO2, carbon monoxide (CO), hydrocar-
bons (HC), nitrogen oxides. The magnitude of each of these emissions relies
on the mixture of vehicle/fuel, weather conditions, and driving patterns.
Under emission standards, the emission limits for a specific car differ
depending on the vehicle’s weight, its type of gas, and whether it is a pas-
senger or a vehicle carrier. Diesel cars have a greater nitrogen oxide emission
limit, while petrol cars have a greater carbon monoxide emission limit.
The main idea is to measure the emission levels from the motor vehicles
and control the pollution. Sensors are used to detect the gases released from
the exhaust. The levels of the different gases are measured and compared
with the standard values. If the amount of pollutants is higher than the
threshold level then the LED is turned on automatically, which is controlled
by Arduino and vehicle owner will be sent a notification. The fuel supply is
stopped using fuel injector making the vehicle immobile.
The purpose of this work is to build a robust system that can keep check
on the amount of pollutants released by the vehicles into the atmosphere.
Sudden environmental changes in pollution is one of the major contribu-
tion to environmental pollution. Increased number and usage of vehicles
has reduced the quality of air and its surroundings and has even led to
catastrophic problems in human beings.
Hence, a technical solution needs to be developed to reduce air pollution
from automobiles.
Problems include:
• How to find out the amount of pollutants released by vehicle?
• How to reduce the emission of toxic gases from vehicles?
Air pollution control model using machine learning 189

• How to assist the owner in keeping a check of his contribution to air


pollution?
• How to make the system affordable to all?
These above-mentioned problems can be solved provided we know how to
deploy technology.
• The solution must be cost effective and flexible to the user.
• It must consume less power supply.
• The solution must be eco-friendly.
• The solution must be durable and fault tolerant.
• Since the solution demands lots of hardware component, it must be
compact and user friendly.

1.1 Objectives of the project


The main objective of the project is to reduce air pollution. The project aims
at enabling facilities such as:
• A device that collects the value of pollutants emitted by the vehicle
Multiple sensors are placed together to form a device which collects the data
about all the different pollutants emitted by the vehicle. The device is placed
at the exhaust of a vehicle to ensure accurate readings.
• Notifying the owner of the vehicle about excessive pollutants being
emitted by their vehicle
Whenever the emission level of pollutants crosses the standard levels set by
NAQI there is a message sent to the owner of the vehicle. The message
notifies the owner about the current status of the environment and the
impact of excessive emission. The aim of message is to intimate the owner
that their vehicle needs servicing.
• A device that stop the flow of fuel from the fuel tank to the engine
After the owner has been notified about the excessive pollutants emitted
from their vehicles. There is a waiting phase to ensure that the owner take
appropriate measures to control the emission. If there are no changes made
and the emission continues to be greater than the standard values we use a
solenoid to block the flow of fuel.
The system uses sensors to detect the gases released from the exhaust of
vehicle. Depending on the threshold values set, led glows depending on the
amount of gases released into the atmosphere. If the quantity released is
beyond the threshold value, green led glows else the red.
The values of toxic gases released is noted and sent as text message using
GSM board to the owner of the vehicle. If any of the value of gas exceeds
190 Chetan Shetty et al.

threshold value, the fuel supply is cut off using the solenoid valve preventing
the vehicle from being used until it’s given for service. The current scope of
the project is that we can retrieve a better processed data from sensors and
send the processed data to server for maintenance by refactoring the code.
Hardware compaction is the major current scope of the project. The other
possible scope of the project is real-time data analysis which leads to better
efficiency. An Android application for the routing of vehicles through less
polluted areas is also one of the scopes.

2. Literature survey
India is the world’s second-largest country in terms of population.
Transportation sector is a key component in its rapidly growing economy.
This project aims at preventing and predicting the air pollution produced by
automobiles using Arduino board, three gas sensors, namely, MQ-2, MQ-7
and MQ-135, GSM module and solenoid valve. It is mainly an IoT based
project. The sensors sense the gaseous levels of emissions released from the
exhaust of the vehicle. Based on the threshold value, the respective led glows
for each sensor depending on the quantity of toxic gases which it can sense.
An alert message is sent to the owner warning him that his vehicle has
exceeded the safe emission standards of BS IV. We propose this system as
this idea is analyzed and conceptualized by referring a few IEEE papers
and by applying our own ideas on prevention of air pollution and controlling
it. This system has a major feature which aids in curbing the air pollution to a
huge extent. The system cuts/chokes down the fuel supply from the fuel
injector using the solenoid valve when the emission rate is higher than
the given threshold value. IoT is an emerging field and its technology assists
in automating almost everything. Hence, we use the benefits of this field in
controlling a major problem faced by the environment that is air pollution.
This system has a great possibility of bringing a revolutionary change in the
concept of prevention and control measures for air pollution.
M.U. Ghewari et al. [1] discusses about how to monitor air pollution on
roads and track vehicles which cause pollution over a specified limit. The
great amount of particulate and toxic gases is produced due to increase in
industrialization and urbanization. There is poor control on emissions and
little use of catalytic converters. The serious problem that has been around
for a very long time is increase in usage of automobiles. Internet of things
(IoT) [2] is being used to address this problem. Here, combination of elec-
trochemical toxic gas sensors, wireless sensor networks and radio frequency
Air pollution control model using machine learning 191

identification (RFID) [3] tagging system are used to monitor car pollution
records anytime and anywhere. Few locations to be monitored with usually
high volume of traffic are identified. The RFID readers are being placed
on the either side of a road for each location with a fixed distance between
them. A passive RFID tag is equipped in each vehicle passing through road.
Sensor nodes, composed of gas sensors, are placed on the roadside. The sensor
nodes are identified and are addressed by unique IP address [4]. These sensors
gather data continuously and sent to the server wirelessly. Whenever the
sensors sense sudden rise in pollution, search is initiated for corresponding
RFID tags, i.e., vehicles which are causing pollution are identified using
the tag attached on them. These RFID readers detects a car passing by it.
The RFID readers identify specific tag number and transmit the same via
the GPRS [5] the server. This system also generates an alert when the pollu-
tion level increases. Then, the appropriate actions are taken by the authorities
accordingly. The authorities monitor and analyze all the gathered data. The
proposed framework is as shown below (Fig. 1).
A graph for pollutant data for various vehicles is shown below. Once the
level of the pollution exceeds permissible level, motorists may be advised to
avoid that particular area. It may be done using the same Internet of things.
It may enable to reduce the pollution level over a certain span of time.
This framework may be integrated as an enabling tool to design intelligent
transportation system for smart city [6] (Fig. 2).

Alert
INTERNET Analyze Data

Wireless
Router

Server

RFID Reader CO Sensor

RFID Tag

Database

Administrator

Fig. 1 Pollution framework.


192 Chetan Shetty et al.

Carbon monoxide Sulpher dioxide


460

440
Sensed Raw Data

420

400

380

360

340
1 2 3 4 5
Car ID (RFID Tag)
Fig. 2 Pollution level monitoring.

B. Hunshal et al. [7] discuss the various sensing criteria, test processes,
environmental parameters and microsystem-based realization needs. Gas
sensors have become an essential element of internal combustion engine
control systems to provide data for air-to-fuel (A/F) feedback control to
improve car efficiency and fuel economy as well as lower emission con-
centrations. Increasingly strict restrictions on evaporative emissions and
on-board diagnostic requirements [8] (OBD), including catalyst monitor-
ing, require monitoring of exhaust gas constituents [i.e., carbon monoxide
(CO), hydrocarbons (HCs), and nitrogen oxides (NOx)]. MOTOR cars
have two primary emission kinds: (1) tailpipe exhaust and (2) fuel system evap-
orative emissions. The only exhaust gas sensor that is currently used on cars is
the oxygen sensor that has been used widely in cars for over 15 years. The
primary function of this sensor is for feedback control of the air-to-fuel ratio
[9] (A/F) to maintain the gasoline/air mixture close to stoichiometry in order
to minimize emissions. The tailpipe emissions are present only when the
vehicle is operated (as opposed to the evaporative emissions) and the unde-
sirable emissions can be divided into four main categories: (1) well over a
hundred different species of HCs (including oxygenated “HC,” such as
aldehydes and ketones); (2) carbon monoxide (CO); (3) oxides of nitrogen
(NO); (4) particulates (mainly from diesel engines).
For low tailpipe emissions, the precision of the air-to-fuel feedback con-
trol system (under static and dynamic driving circumstances) is of paramount
significance as the catalyst’s effectiveness is significantly peaked as a function
of A/F. One idea [10] is to add an extra feedback loop to the air-to-fuel
Air pollution control model using machine learning 193

control system to further optimize the A/F for lowest emissions. This can be
achieved by measuring behind the catalytic converter HCs (and/or CO)
and NO. To obtain the smallest possible emissions, the air-to-fuel feed-
back scheme would then minimize the (normalized) difference between
the two sensor signals. This works because the level of combustible gas
concentrations substantially increases under fuel “rich” conditions, while
substantially increased levels of NO indicate fuel “lean” conditions. By con-
stantly measuring the exhaust gas concentrations as well as other readily
available engine operating parameters, such as temperature, speed and load,
and mass air flow, an actual mass of emissions can be obtained [11]. This
information could be used to monitor the tailpipe emissions of the entire
combustion system.
S.P. Bangal et al. [12] use a vehicle identification and detection strategy
based on unintended electromagnetic emissions. When operating, cars with
inner combustion motors radiate the vehicle’s distinctive electromagnetic
emissions. Emissions rely on electronics, harness cables, type of body, and
many other characteristics. Since each vehicle’s emissions are unique, they
can be used for purpose of identification. This article explores a procedure
based on their RF emissions to detect and identify cars. Measured emission
information collected parameters such as the average magnitude or normal
magnitude deviation within a frequency band. These parameters have been
used as inputs to an artificial neural network [13] (ANN) trained to define
the car producing the emissions. The approach was tested with emissions
from a Toyota Tundra, a GM Cadillac, a Ford Windstar, and ambient noise
captured. When using emissions capturing an ignition spark event, the ANN
was able to classify the source of signals with 99% accuracy. Using neural
networks, identification was allowed. In order to highlight distinctions
between cars and ambient noise, several parameters were obtained from
the measured emission spectrograms. The most significant parameters were
the standard deviation and amount of pulses in a frequency band. A 99.3%
identification rate could be accomplished using these two parameters
alone when a spark event was captured. When a spark event was not cap-
tured, however, the neural network was unable to successfully identify
the responsible vehicle. It is possible that detection of vehicles without
using the ignition pulse [14] could be accomplished if “noise-free” mea-
surements of the vehicle were available to better train the network and
to help form more useful parameters that characterize the vehicles in this
case. S. Smurtie et al. [15] presents a car emission surveillance scheme based
on IoT. Due to cars, the primary source of atmospheric taint occurs.
194 Chetan Shetty et al.

Using empirical scrutiny, the ritual mechanized air monitoring scheme is


highly rigorous, but inexpensive and single data class makes it impossible
for large-scale furnishing. We have brought the Internet of things (IoT)
into the field of environmental obstacle to eject the problems in ritual pro-
cesses. This paper is intended to implement a car emission surveillance
scheme using the Internet of things (IoT), a green thumb for tracking down
vehicles that cause taint on town highways and measure multiple types of
toxic waste and their air level. This article presents at any moment any-
where using gas sensor a kind of real-time air pollution monitoring scheme.
The measured information is communicated by text message to the car
owner and domestic environment organizations. This assay demonstrates that
the system is consistent, cost effective and can be tractably controlled, it can
smell the car exhaust in real-time, and it can enhance the exhaust surveillance
system’s detection level and precision. This scheme offers excellent results
only in urban regions in tracking air pollution. The main objective of smart
emission monitoring system is to make it more innovative, user friendly,
time saving and also more efficient than the existing system. Using smart
systems not only efficiently takes an advance in environmental quality,
but it also helps vehicle owner to save a lot of unnecessary troubles com-
pared to the traditional emission test. G. Sarella et al. [16] presents the auto-
mated air pollution detection system for vehicles. This is intended to use
semiconductor detectors in vehicle emission outlets that detect pollutant
levels and also indicate this amount by a meter. When the amount of pol-
lution/emission shoots beyond the threshold level already set, there will be
a buzz in the car indicating that the limit has been violated and the car will
stop after a certain period of time, a cushion moment provided to the driver
to park his/her car. The GPS begins to locate the closest service stations dur-
ing this time span. The fuel provided to the engine will be cut off after
the timer runs out and the car will have to be transported to the mechanic
or the closest service station. A microcontroller monitors and controls the
synchronization and execution of the whole process. This idea, when aug-
mented as a real-time project, will benefit the society and help in reducing
the air pollution. The semiconductor sensors were used to identify the vehi-
cle’s contaminant amount. This concept is primarily focused on three
blocks; smoke detector, microcontroller and injector of petrol. The smoke
detector continually detects pollutants (CO, NOx, etc.). The microcon-
troller compares the level of pollutants with the stipulated level allowed
by the government. When the pollutant level exceeds the standardized
limit, it sends a signal to the fuel injector. On receiving a signal from the
Air pollution control model using machine learning 195

Detector
Predefined values

sensor Transducer
(standard values from
survey and government)
ADC

Fuel Injector
Microcontroller

GPS

Fig. 3 Detector module.

controller, the fuel injector stops the fuel supply to the engine after a par-
ticular period of time. The overall block diagram of the proposed system is
given in Fig. 3.
L. Myllyvirta and S. Dahiya [2], National Air Quality Index (NAQI),
state that air pollution has become a major problem and a big threat to
the public health and hazardous to the environment. It has been stated that
more than 3 million deaths has been recorded over the year 2012 by World
Health Organization (WHO) and more than 6 lakhs of deaths in India
among them by estimated by global burden of diseases (GBD). After all this,
NAQI was introduced in India. NAQI measures the pollution level in
different areas and informs us about it. It generated its own data by using
IoT techniques. Realizing the need and importance of public health,
Central Pollution Control Board has started NAQI which plays major role
in creating awareness in people (Fig. 4).
NAQI concludes that however there is lot amount of data available for
16 cities all over India and more than 50 cities are suffering by air pollution
because of industrial clustering effecting more than a million people and
hence major steps has to be taken to prevent pollution (Fig. 5).
Dr. S. Guttikunda [5] explains about the outdoor air pollution spreading
very fast across many cities in both developing and developed countries. In
both type of countries, cities only differ in the air quality index values and obvi-
ously AQI is high in developing countries because of large urban industries.
196 Chetan Shetty et al.

Number Remark Health Impact


1–50 Good Minimal impact
51–100 Satisfactory Minor breathing, discomfort to sensitive people
101–200 Moderate Breathing discomfort to the people with lungs, asthma and heart diseases
201–300 Poor Breathing discomfort to most people on prolonged exposure
301–400 Very Poor Respiratory illness on prolonged exposure
401–500 Severe Effects healthy people and serious impacts to those with existing diseases

Fig. 4 AQI pollution level and health impact by NAQI.

City PM CO Ozone NO2 SO2 Contribution to bad Air days


Agra
Ahmedabad Most
Bangalore Second most
Chandrapur
Chennai Third most
Delhi
Faridabad
Hyderabad
Kanpur
Lucknow
Mumbai
Muzaffarpur
Navi Mumbai
Patna
Pune
Varanasi

Fig. 5 Different pollutants contribution to bad air quality in different cities by NAQI.

This is because developing countries are concentrating more on rapid


industrialization for growth of their country. The air pollutants arise from
different sources especially from combustion sources, industrial outlets and
automobiles. Nitrogen oxides (NOx), carbon monoxide (CO), carbon
dioxide (CO2), volatile organic compounds (VOCs) and particulate matter
(PM) are the most important pollutants released into atmosphere by traffic.
Other pollutants containing sulfur arise mainly form the industries. Among
all these, PM accounts for more health hazards as it can cause chronic and
many acute respiratory diseases. Automobile exhaust, industrial outlet of
flue gases are main causes of release of PM into environment. The author
explains that it’s not only important to control pollution, but also to control
the emission of pollutants into environment.
Finally, author concludes that along with public health, even envir-
onmental regulations are more effected in a very bad manner. As a part
of pollution control, following regulations and creating awareness plays
major roles.
Air pollution control model using machine learning 197

Fig. 6 Use of different fuels.

S. Kumar and D. Katoria [3] explain about the air pollution and its con-
trol measures, author defines air pollution as presence of any foreign material
in the air in excess quantity. Pollution has become a global challenge
effecting human health and environment and causing serious threats for
social well-being. Government and industries has to follow some strict
measures toward pollution control. Author says complains that fuel combus-
tion is the most important phenomena causing air pollution. So the author
suggests how to control the exhausts of the fuel combustion, mainly CO and
particulate matter (Fig. 6).
The author concludes that there are numerous ways of controlling air
pollution and using different fuels in automobiles is one type. Author also
represented various technologies embedded in industries like filtration of
flue gases before they are released to atmosphere using filter bags and
scrubbers.

3. Design
Architectural design is the process of defining a collection of hardware
and software components and their interfaces to establish the framework for
the development of a system. It defines the structure, behavior, and more
views of a system (Fig. 7).
The proposed system is lightweight and compact on automobiles. This
surely helps in reduction of harmful gaseous levels from vehicles. It provides
a guarantee that it would be a very big change in the prevention and control
measures for air pollution. The sensors and the other components used in
building this system cost very less and hence the system is cost effective.
TXD RXD
GND GND
Sensors RXD TXD

Connect RX,TX to
CO TTL RX,TX

HC

CO2
12V 2Amp
DC Adapter Arduino and GSM 12V 2Amp
DC Adapter
Vehicle Input
Input

Solenoid
Text LEDs
Message
Fig. 7 Architectural design.
Air pollution control model using machine learning 199

Apart from being cost effective, this system is high in performance as it uses
low power consumption sensors and also for the fact that these sensors are
highly precise in detection. If the value sensed by the sensors are higher than
the threshold value, the fuel supply is instantly cut off preventing the vehicle
to be mobile. A system architecture or systems architecture is the conceptual
model that defines the structure, behavior, and more views of a system. An
architecture description is a formal description and representation of a sys-
tem, organized in a way that supports reasoning about the structures and
behaviors of the system.
System architecture can comprise system components, the externally vis-
ible properties of those components, the relationships (e.g., the behavior)
between them. It can provide a plan from which products can be procured,
and systems developed, that will work together to implement the overall sys-
tem. There are two different models in this project. The modules are as
follows:
Module 1
Sensors are used to detect the pollutants released by the vehicle (Fig. 8).
We use three different types of sensors, namely, MQ7, MQ2, MQ135 to
collect different types of emissions. MQ7 is highly sensitive to carbon
monoxide. MQ2 is suitable for detecting gas leaks. MQ135 can be used
to detect NH3, NOx, alcohol, benzene, smoke, CO2, etc. The value col-
lected by each sensor is gathered at the Arduino board. Arduino has been
programmed in such a way that it collects data from different sensors and
compares it with standard values. There are six LED’s used to depict the

GAS SENSOR
ALERT
GSM MESSAGE
CO SENSOR ARDUINO

H2 SENSOR

LED

Fig. 8 IoT module.


200 Chetan Shetty et al.

current status of different pollutants from which three of them are red
and are green. If the values received by the sensors are greater than
the standard values the LED lights go red. If the values are with in stan-
dard values then the LED lights remain green. If the pollutant values
remain to be greater than their standard value, Arduino passes the data
onto the GSM module. GSM module is responsible for sending alert
messages in order to notify the user.
The figure above depicts the architecture model of the hardware. The
sensors are connected to the Arduino board. Arduino board constantly
receives values from the sensors. All the LED lights are connected to the
Arduino board through a circuit. The GSM module and Arduino board
are connected via an interface. A mobile sim card is placed inside GSM
module. The sim card is used to send different alert messages to the
owner of the vehicles.
Model 2
The values gathered at the Arduino board are stored in a dataset. This helps
us keep track of the changes happening in the air at different points of time.
Once there are enough values present in the dataset, the data gathered can
be used to create a model that can make analysis and predictions (Fig. 9).
The figure above represents a model designed using machine learning
algorithms. The dataset consists of real-time data which has been col-
lected from different sensors. The dataset acts as an input to our model.

Dataset
Real Time data from
pollutants in Air

Machine Learning Inference on


Algorithm Dataset

CO NO2 H2S PH

Inference Inference Inference Inference

Fig. 9 Machine learning module.


Air pollution control model using machine learning 201

The model uses a machine learning algorithm (decision forest regression


algorithm in this case) to learn the different values that can be present in
the dataset.
Once learning is done the model is now prepared to draw inferences on
the different pollutants present in the air as well as do predictions of pol-
lution level in future.

3.1 Graphical user interface


The main graphical user interface is made using a package available in
R Studio called TclTk. Tcl stands for tool command language. It is a very
powerful but easy to learn dynamic programming language, suitable for a
very wide range of uses, including web and desktop applications, network-
ing, administration, testing and many more. Open source and business-
friendly, Tcl is a mature yet evolving language that is truly cross platform,
easily deployed and highly extensible. Tk is a graphical user interface toolkit
that takes developing desktop applications to a higher level than conven-
tional approaches. Tk is the standard GUI not only for Tcl, but for many
other dynamic languages, and can produce rich, native applications that
run unchanged across Windows, Mac OS X, Linux and more. In Fig. 10
we can see a start button and a stop button which are used. When start but-
ton is clicked the sensors start detecting pollutants. Once we click on stop
button the emission rate is displayed on the screen. Locate me button can
be used to realizer the pollution level in the area around you. Close button
quits the application.

4. Implementation and results


The work overall has been done in three different modules. The three
modules are IoT module, data analytics module and Android app module.
The overall functioning of the project is as follows:
The sensors, i.e., MQ-2, MQ-7 and MQ-135 sense the emission levels
from the vehicular exhaust. These values are then sent to the Arduino for
processing. If the emission levels are under control or hasn’t crossed
threshold, i.e., all three green LEDs will glow, the system will again collect
the next set of values. If the threshold has been crossed, i.e., all red LEDs
with glow, then a message is sent to the owner of the vehicle about the extra
Fig. 10 GUI of the model.
Air pollution control model using machine learning 203

emission level saying that if issue not resolved immediately the vehicle will
be stopped in 10 min. Even after this, if his vehicle is still emitting extra emis-
sions then his fuel supply is blocked by the use of solenoid valve.

4.1 Module description


Sensors: MQ7, MQ2, MQ135 are the different sensors used. MQ7 is a simple
to use carbon monoxide sensor. It can detect CO concentration from 0 to
2000 ppm. MQ2 is a used for detecting gas leakages. It is very helpful for
detecting H2, LPG, CH4, CO. MQ135 is an air quality sensor which detects
wide range of gases.
Arduino: Arduino acts as a microprocessor, i.e., all data preprocessing
occurs at the Arduino. It takes data from the sensors and compares the values
with standard values. It updates the status by changing the condition of the
LED lights. If the values are high it sends data to GSM module.
GSM: GSM is a digital mobile telephony system. It is used to send alert
messages to the owner of the vehicle. It acts as an interface between Arduino
and the user. Arduino sends the pollutant information to the GSM module.
The GSM module uses this data and notifies the user.
Machine learning model: Decision forest regression is a technique used for
training the model. A large portion of the air pollution data gathered is given
as input for the model to learn. After completion of learning phase the model
is tested with the remaining data. The test depicts the accuracy of the model.
The model is now ready to perform predictive analysis for any new data
(Figs. 11 and 12).

4.2 Actual data vs predicted data


Accuracy ¼ mean of predicted data  mean of actual data
Accuracy ¼ abs (0.07344472  0.07094936)
Predicted accuracy ¼ 0.002495359
Xn
|y  xi |
i¼1 i
MAE ¼
n
where
MAE ¼ Mean absolute error
Yi ¼ Predicted value
Xi ¼ Actual value
n ¼ no. of samples
MAE ¼ 0.002495359
204 Chetan Shetty et al.

Row Actual_CO
82000 0.063786
82002 0.059671
82003 0.05144
82004 0.063786
82006 0.065844
82011 0.053498
82013 0.053498
82015 0.032922
82018 0.076132
82027 0.061728
82030 0.142546
82033 0.066042
82037 0.057613
82038 0.037037
82040 0.088477
82042 0.069959
82046 0.084362
82047 0.082305
82048 0.022634
82049 0.069959
82050 0.059671
82051 0.053498
82052 0.059671
82054 0.059671
82058 0.039095
82060 0.059671
82062 0.041152
82063 0.057613
82075 0.061728
Fig. 11 Sample of actual CO emission.

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
sX
T
t¼1 t
ðyb  yt Þ2
RMSD ¼
n
where
RMED ¼ Root mean squared error
^y ¼ Predicted value
y ¼ Actual value
n ¼ no. of samples
T ¼ tuple
RMSD ¼ 0.06188289
Air pollution control model using machine learning 205

Row Predicted_CO
82000 0.058448
82002 0.050152
82003 0.058404
82004 0.061571
82006 0.066013
82011 0.070858
82013 0.063261
82015 0.058845
82018 0.066795
82027 0.068744
82030 0.082279
82033 0.082279
82037 0.070897
82038 0.068074
82040 0.081954
82042 0.062502
82046 0.071635
82047 0.056945
82048 0.060428
82049 0.05592
82050 0.057738
82051 0.072202
82052 0.062976
82054 0.05526
82058 0.056665
82060 0.057874
82062 0.043161
82063 0.064508
82075 0.064079
Fig. 12 Sample of predicted CO emission.

4.3 Explanation of algorithm


Algorithm: To read the sensor data and process it.
Input: Sensor value, owner’s phone number.
Output: Intimation in terms of SMS, Blocking of fuel supply.
Method:
Function air_pollution_control() {
Hydrocarbon gases(HC) = values_read_by_MQ2
Carbon Monoxide(CO) = values_read_by_MQ7
Carbon dioxide(CO2) = values_read_by_MQ135
206 Chetan Shetty et al.

Threshold_for_MQ2 = 400;
Threshold_for_MQ7 = 300;
Threshold_for_MQ135(in ppm) = 500;
Set Solenoid Pin to High;
Print values_read_by_MQ2, values_read_by_MQ7, values_read_by_MQ135
counter=0;
If (HC > Threshold_for_MQ2) {
Red_LED_for_MQ2 set to High;
Green_LED_for_MQ2 set to Low;
counter=counter+1;
}
If (CO > Threshold_for_MQ7) {
Red_LED_for_MQ7 set to High;
Green_LED_for_MQ7 set to Low;
counter=counter+1;
}
If (CO2 > Threshold_for_MQ135) {
Red_LED_for_MQ135 set to High;
Green_LED_for_MQ135 set to Low;
counter=counter+1;
}
else {
Red_LED_for_MQ2 set to Low;
Green_LED_for_MQ2 set to High;
Red_LED_for_MQ7 set to Low;
Green_LED_for_MQ7 set to High;
Red_LED_for_MQ135 set to Low;
Green_LED_for_MQ135 set to High;
}
If(counter>=3) {
SendMessage();
wait(10 minutes);
Set Solenoid Pin to Low;
}
}
One graph shows average values of the particular pollutant in all s stations,
and all such graphs are combined (Fig. 13).
This graph shows the overall average values of the pollutants in every
station all over Bangalore (Fig. 14).
Fig. 13 Average values of pollutants in each station.
208 Chetan Shetty et al.

WS
WD
SR
SO2
RH
PM2.5
Ozone
NOx
Mean value range
NO2
NO
Stations

120 120
CO
40 80
40

80

Pollutants

Fig. 14 Overall average values of pollutants.

This graph shows the overall average values of the pollutants in


every station all over the Bangalore shown in points of different colors
(Fig. 15).
Arduino IDE is the interface used for implementing the IoT project. The
code given here is for the implementation of gas sensors, GSM module and
the solenoid valve (Fig. 16).
The screenshot shown above is the configuration of the Arduino IDE for
the emission system. The Arduino board used is Arduino Uno and the port
used is COM3 (Fig. 17).
The screenshot depicts the interface of the Cool Term software which is
used to collect the data obtained from the Arduino serial monitor into the
text data (Fig. 18).
The screenshot shows the notification which is sent to the vehicle owner
when the threshold value crosses the standard values (Fig. 19).
The screenshot show the Arduino IDE serial monitor. This is used to
display the level of the pollutants, sensed by the MQ-sensors (Fig. 20).
The screenshot tells that the vehicle is going to be stopped in few minutes
since the threshold value is crossed (Fig. 21).
Fig. 15 Average values of pollutants in each station.
210 Chetan Shetty et al.

Fig. 16 Arduino IDE interface.

Fig. 17 Arduino IDE settings for Arduino board.


Air pollution control model using machine learning 211

Fig. 18 Cool Term software to collect data.

The above graph depicts the error rate generated for individual trees in a
random forest. As the number of trees increase we can see reduction in the
error rates (Fig. 22).
This diagram depicts the prediction error realized during the testing pro-
cess after tuning the parameters of random forest algorithm (Figs. 23–25).

5. Conclusion
Over the last few decades there has been an increase in the rate of pol-
lution, leading to several environmental issues. There will be an enormous
population that does not take the pollution from their cars seriously, which
has already caused several environmental issues like depletion of the ozone
layer and so on. So, this scheme is going to be very useful to curb this issue.
Smart emission surveillance system’s primary goal is to create it more inno-
vative, user friendly, time saving and also more effective than the current
system. Using smart systems not only takes a step forward in environmental
quality, it also enables car owners save a lot of unnecessary problems
212 Chetan Shetty et al.

Fig. 19 Notification to the vehicle owner.

compared to traditional emission testing. The idea of identifying and indi-


cating pollution level to the driver. This scheme only monitors three param-
eters and can therefore be extended by considering more parameters that
cause the cars in particular to pollute. This system gives availability of view-
ing the sensor outputs through internet. It can be done by providing orders
from a distance to regulate emissions. Many pollutants do not have detectors
which, if available, are very costly and therefore constructing detectors for
distinct parameters could be a very difficult job in the future. The fact that
this system is just an add-on, as it does not change the configuration of the
engine by any means, will make it easier to employ this system in the existing
vehicles. The same concept can also be extended to industries.
Air pollution control model using machine learning 213

Fig. 20 Arduino IDE serial monitor.

Fig. 21 Arduino IDE serial monitor with stopping message in terminal.


214 Chetan Shetty et al.

3000
2500 Random Forest
Error
2000
1500

0 100 200 300 400 500


trees

Fig. 22 Model error rate decreasing with increase in number of trees.

Fig. 23 Model error rate decreasing with trees (0  30).


Air pollution control model using machine learning 215

Fig. 24 Feature importance histogram.

Best Model Error

300
OOBError

200

100

0
3 6 9
mtry
Fig. 25 OOB error rate.
216 Chetan Shetty et al.

References
[1] Ghewari MU, Mahamuni T, Kadam P, Pawar A: Vehicular pollution monitoring using
IoT, Int Res J Eng Technol 05(02).
[2] Myllyvirta L, Dahiya S: A Status Assessment of National Air Quality Index (NAQI) and
Pollution Level Assessment for Indian Cities, 2015: 2015, Greenpeace India greenpeace.
org/india. https://www.greenpeace.org/india/Global/india/2015/docs/India-NAQI-
PRESS.pdf.
[3] Kumar S, Katoria D: Air pollution and its control measures, Int J Environ Eng Manag
4(5):445–450, 2013. https://pdfs.semanticscholar.org/ed3f/1297ea9b3576c592587a6
960ce198daa9d0a.pdf.
[4] Rose Sweetlin T, Priyadharshini D, Preethi S, Sulaiman S: Control of vehicle pollution
through Internet of things (IOT), Int J Adv Res Ideas Innov Technol 3(2) Available online
at, www.ijariit.com.
[5] Guttikunda S: Air Quality Index (AQI): Methodology & Applications for Public
Awareness in Cities, 2010: http://www.urbanemissions.info/wp-content/uploads/
docs/SIM-34-2010.pdf.
[6] Kspcb: http://kspcb.kar.nic.in/.
[7] Hunshal B, Patil D, Surannavar K, Tatwanagi MB, Nadaf SP: Vehicular pollution mon-
itoring system and detection of vehicles causing global warming, Int J Eng Sci Comput
7(6):12611, 2017.
[8] https://en.wikipedia.org/wiki/Arduino.
[9] https://en.wikipedia.org/wiki/PyCharm.
[10] Lolge SN, Wagh SB: A review on vehicular pollution monitoring using IoT, Int J Electr
Electron Eng 9(01):745, 2017.
[11] Usha S, Naziya Sultana A, Priyanka M, Sumathi: Vehicular pollution monitoring using
IoT. In National Conference on Frontiers in Communication and Signal Processing Systems
(NCFCSPS ’17), vol. 6, 2017, An ISO 3297: 2007 Certified Organization. Special
Issue 3.
[12] Bangal SP, Gite Pravin E, Ambhure Shankar G, Gaikwad Vaibhav M: IoT based vehicle
emissions monitoring and inspection system, Int J Innov Res Electr Electron Instrum Control
Eng 5(4):410, 2017, ISO 3297:2007 Certified.
[13] https://en.wikipedia.org/wiki/GSM.
[14] https://www.sparkfun.com/products/9403.
[15] Smruthie S, Suganya G, Gowri S, Sivaneshkumar A: Vehicular pollution monitoring
using IoT, Int J Digit Commun Netw 2: 2014.
[16] Sarella G, Khambete AK: AMbient air quality analysis using air quality index—a case
study of Vapi, Int J Innov Res Sci Technol 1(10):21319, 2015.

Further reading
[17] http://wiki.seeedstudio.com/Grove-Gas_Sensor-MQ2/.
[18] https://www.olimex.com/Products/Components/Sensors/SNS-MQ135/resources/
SNS-MQ135.pdf.
[19] https://www.rhydolabz.com/sensors-gas-sensors-c-137_140/air-quality-sensor-mq135-
p-1115.html.
[20] http://events.awma.org/files_original/ControlDevicesFactSheet07.pdf.
Air pollution control model using machine learning 217

About the authors


Chetan Shetty is working as a Lead Data
Scientist, HCL Technologies, Bangalore. His
area of interest includes Machine Learning
and Deep Learning.

B.J. Sowmya is working as an Assistant


Professor, Department of Computer Science
and Engineering, M S Ramaiah Institute
of Technology, Bangalore 560054. Her area
of interest is Data Analytics, Machine
Learning, and Internet of Things.

Dr. S. Seema is working as Professor,


Department of Computer Science and
Engineering, M S Ramaiah Institute of
Technology, Bangalore 560054. Her area of
interest is Data Analytics, Machine Learning,
and Internet of Things.

Dr. K.G. Srinivasa is working as Professor


at National Institute of Technical Teacher
Training & Research, Chandigarh,
Chandigarh, India. He is the recipient of All
India Council for Technical Education—
Career Award for Young Teachers, Indian
Society of Technical Education—ISGITS
National Award for Best Research Work
Done by Young Teachers, Institution of
Engineers(India)—IEI Young Engineer
218 Chetan Shetty et al.

Award in Computer Engineering, Rajarambapu Patil National Award


for Promising Engineering Teacher Award from ISTE—2012, IMS
Singapore—Visiting Scientist Fellowship Award. He has published more
than hundred research papers in International Conferences and Journals.
He has visited many Universities abroad as a visiting researcher. He has vis-
ited University of Oklahoma, USA, Iowa State University, USA, Hong
Kong University, Korean University, National University of Singapore
are few prominent visits. He has authored two books namely File
Structures using C++ by TMH and Soft Computer for Data Mining
Applications LNAI Series—Springer. He has been awarded BOYSCAST
Fellowship by DST, for conducting collaborative Research with Clouds
Laboratory in University of Melbourne in the area of Cloud Computing.
He is the principal Investigator for many funded projects from UGC,
DRDO, and DST. His research areas include Data Mining, Machine
Learning and Cloud Computing.

You might also like