You are on page 1of 8

International Conference on Energy, Communication, Data Analytics and Soft Computing (ICECDS-2017)

Low Cost Pollution Control and Air Quality


Monitoring System using Raspberry Pi for
Internet of Things
Kiruthika.R1 A.Umamakeswari2
1
M.Tech - Embedded Systems School of Computing
SASTRA University SASTRA University
Thanjavur Thanjavur

Abstract:- Internet of Things (IoT) is an innovative collecting, storing, processing environmental


approach to connect various devices through the information and communicating with the neighboring
internet and use such an interconnection to implement nodes. The access method of the WSN gateway node
highly beneficial functions. IoT is certainly one of the [1,6,9] is convenient because it allows data to be
most widely researched topics and will continue to received from the WSN via the gateway at any time and
shape the approach we adopt to solve problems in the place. The gateway acts as the network coordinator and
years to come. In this paper, an IoT-based system has it can fetch, process and communicate the received data.
been proposed to combat air pollution, which is Smart building, Smart vehicle management, forecasting,
particularly a cause of concern in the densely populated Polluting Control and Quality monitoring are the
country e.g., India. An embedded system is used to sample emerging applications using Internet of Things
connect several sensors that collect data on the (IoT) [5].
surrounding environment. Based on the obtained data, a
prediction algorithm is put forth to proactively IoT devices not only sense the data, but also act on the
implement a solution to any problem encountered. The sensed data. In almost all the IoT based applications,
collected data is stored in a MySQL database that can data analytics will play a major role to take the dynamic
be queried whenever the relevant information is decisions for better performance. Embedded devices,
required. This model would analyze the data and report such as sensors, actuators, and smart-phones, provide a
it to the users. The obtained results are evaluated using great business potential towards the new era of IoT, in
ThinkSpeak open data IoT platform with data analytics. which all the devices are able to interconnect and
A major advantage of the proposed system is its cost- communicate with each other using Internet. The huge
effectiveness. Coupled with its scalable, dynamic and number of smart devices plays an important role in
flexible nature, this model can be easily set-up and bringing about the IoT revolution [5,8]. As per the
deployed in any area to monitor and control the quality Gartner report, 100 billion devices will be connected to
of its environment. IoT platform by 2020. The approximate economical
growth rate is more than 30 % per year.
Keywords: Internet of Things; Smart city, Wi-Fi
Module, IoT applications, Raspberry Pi, ThinkSpeak, In this day and age, air pollution is certainly an issue of
Environmental Monitoring. significance [7]. To keep it in control and provide a
better quality of life for all, air quality should be
I. INTRODUCTION monitored. With this in mind, an air quality monitoring
system to keep an eye on and check live air quality in
A Wireless Sensor Network [1, 6] consists of many specific areas has been implemented using IoT. Air
inexpensive wireless sensors, which are capable of sensors have been used to detect the presence of

978-1-5386-1887-5/17/$31.00 ©2017 IEEE

2319
International Conference on Energy, Communication, Data Analytics and Soft Computing (ICECDS-2017)

harmful gases/compounds, which are continually which acts as a sensor node to monitor the external
transmitted to a controller. The controller then environment factors such as temperature, moisture,
processes this data and transmits it via the internet. This humidity and MQ5 Gas sensors. MySQL open source
system enables authorities to be alerted in case of dire database is installed in the server to provide data storage
air quality in a region, thereby facilitating a quick functionalities. The output of the data prediction and
response to control such a situation. An additional analysis sensor values are stored in the My SQL
advantage offered by the system is that it monitors areas database and alert signal is generated when the
such as schools, hospitals and no-honking zones for monitored data cross its limit.
noise pollution and will allow authorities to keep an eye
on the same. The key concept of the air quality The rest of this paper is organized as follows. In section
monitoring system [10] is to get the accurate 2, hardware configuration using embedded system for
information at the correct place from reliable devices to pollution control and air quality monitoring System and
make the quality-related decisions with clarity and its importance are described. In section 3,
implement the process quickly. To develop an IoT- implementation module of hardware prototype model
based air quality monitoring system, several wireless with data prediction and filtering algorithm are
and wired sensors, (raspberry pi) sensor node, gateway discussed. Experimental results are presented in section
and ESP 8266 WiFi modules are used. The main 4. Finally section 5 concludes the work.
challenge in this work is to link air quality monitoring
II. HARDWARE CONFIGURATION
information together with multiple location-based IoT
data. To process the data in an efficient way, a data In IoT [8,11], the different hardware embedded
prediction and analysis algorithm is proposed. In figure development boards are used to establish the smart
1, a detailed architecture of the proposed work is applications. Based on Processor, GPU, Operating
described. Voltage, Clock Speed, Bus Width, System Memory,
Flash Memory, EEPROM, and Communication
Raspberry Pi 3[2,3,4] is a portable and a formidable Supported Development Environments, Programming
Single Board Computer (SBC) that consists of ARM Language, and I/O Connectivity, the hardware devices
processor and runs on a Linux Operating System (OS). are categorized.
It is a flexible System-on-Chip board which can be
utilized for a number of uses. In Raspberry Pi,
BCM2837 chip based on 64bit ARM v7 Quad Core
Processor is used and can support operating systems
such as Raspbian, Ubuntu Mate and Windows10. The
chip features a clock speed of 1.2 GHz with 1GB of
RAM and has 40 extended GPIO pins. It supports
network connectivity using BCM43143 WiFi Module
on board. Raspberry pi [2,3,4] was used as sensor node
as well as gateway node. The temperature, humidity and
moisture values are measured and data prediction and
analysis algorithm is proposed to avoid redundant data
storage and also increases the efficiency of decision
making process. ESP8266 is a new exciting, low cost
Wi-Fi module suitable for adding Wi-Fi functionality to
an existing controller (single board computers) through
UART serial connection. It has special features includes
802.11 b/g/n protocol, Wi-Fi Direct (P2P), soft-AP and
Integrated TCP/IP protocol stack. ESP8266 requires
3.3V power. This ESP8266 Wi-Fi Module is used in
this work to communicate the processed data to the Figure 1: Functional model of the proposed work
remote controllers through web link. Raspberry Pi

2320
International Conference on Energy, Communication, Data Analytics and Soft Computing (ICECDS-2017)

Raspberry pi is used as main board and sensors are III.PROTOTYPE IMPLEMENTATION


interfaced with the main board controller through
GrovePi device to collect different real time data from Environmental monitoring [12, 14, 15] is the collection
external surroundings and this processed data will be of processes and activities that have to be implemented
obtained by the web server using ESP 8266 wireless to monitor the environmental quality. Monitoring
modules and display it. With the help of Internet, users strategies and techniques are designed to reflect the
can access the data from anywhere, any time. current status of the environment, or to establish trends
Raspberry-Pi is interfaced with various sensors in environmental parameters. In this paper, we have
(temperature, Humidity, MQ 5 Gas Sensor) and real proposed a system to monitor pollution using the
time data will be obtained and stored in a Web-server. concept of IoT [8,11,18] and its associated techniques.
Raspberry Pi [2,3,4] will perform as the connection Such a system would monitor the damages done to the
gateway and publishes the packaged data to web environment and the degree of the damage to enforce
resources. Python is a general purpose high level the corresponding control and prevention practices. The
programming language. It has a dynamic memory system would then notify the concerned authorities
management and has a large and comprehensive about the issue to enable them to take the necessary
standard library. It provides better code reliability and steps.
its syntax supports the programmers to convey the
In this work, the data prediction and data filtering
embedded concepts in limited ways. Overall block
algorithm is proposed. Four sensors were used to sense
diagram of the proposed system as shown in fig.1.
the humidity, temperature, gas density and soil moisture
Different sensors are installed at the different location
content to monitor the air quality [16,17]. Based on the
in the environment. The temperature, humidity,
analysis report, the following values are defined: gas
moisture and MQ 5 gas sensor installed at the different
density threshold, temperature threshold, humidity
location and appropriately interfaced with the
threshold and moisture threshold. The system’s primary
Raspberry pi [2,3,4].
function is to send an alert the user through a website
that it is connected to and when any of the sensed
parameters exceed their corresponding threshold value.
The values are continually recorded and are transmitted
to an online database in intervals of three, five or ten
minutes (this value is specified by the user). The pins
connected to the sensors in the Raspberry Pi module are
initialized. A ‘Reference Value’ is calculated using the
recorded temperature and humidity values, and this
value is stored in the database. From the reference
value, the corresponding threshold values are
calculated. For the gas density sensing, MQ-5 sensor
was used to collect data from the surrounding
environment and continuously checks it with the gas
density threshold. If it is found to exceed the threshold,
an alert message is sent to a website, whilst the time and
density values are recorded into the database.
Otherwise, the database is simple updated with the
density value and the time at which it was recorded.
Similarly, the temperature and humidity values are
sensed, recorded and alerted (if threshold value is
exceeded). For soil moisture content, the sensed value is
checked with the moisture threshold. If it is found to be
Figure 2: Layer Services in the proposed model lower than the threshold, it sends an alert message to the
website, records the time and moisture values into the

2321
International Conference on Energy, Communication, Data Analytics and Soft Computing (ICECDS-2017)

database, and dispatches a command to pump water into highly useful for understanding the levels of pollution
the soil. Else, the moisture values and the time at which in a place. Places with higher population density would
they were measured are recorded into the database. be expected to have higher levels of pollution, and
therefore, the sensors can be calibrated as required to
monitor the observed values. Lower population density
would imply better environmental standards, so they
would require lower levels of monitoring by the system.
The same logic is also applicable for industrial and non-
industrial areas, where pollution caused by factories can
be kept under a close watch. The collected data can be
analyzed to understand more about the places under
monitor and to make crucial insights similar to the ones
mentioned above.

Such an IoT-based system [11,17] has great potential to


vastly improve the quality of life. Owing to flexibility
and deployability, it can be set-up and implemented
easily in any location where monitoring is required. It
provides connectivity to a cloud ecosystem where the
collected data can be observed and recorded in a
simplified manner, thereby improving the ease of usage.
Figure 3: Experimental Setup This system is also easy to scale, so areas ranging from
small towns to large portions of countries can be
monitored. But the feature that makes this system very
feasible to implement is its low cost. By establishing a
network of sensors over several regions, we can collect,
analyze and implement measures to control the quality
of the environment, and this system would help make
all the above possible.

IV.ALGORITHM FOR DATA PREDICTION AND


FILTERING

Input: gas_sensor_threshold

#current threshold of density of gas ( MQ 5) at a given


location
temperature_threshold
#current threshold of temperature at a given location
humidity_threshold
# current threshold of humidity at a given location
moisture_threshold
#current threshold of soil moisture content at a given
location
Figure 4:System Flow in Data prediction algorithm Output: alert if any threshold exceeded
The system shall be installed in several places of a city Values are collected in database for every 3, 5, 10
[1,12], preferably with a higher density of population. minutes
This system would then observe specific gas density
values using the temperature, humidity, soil moisture Reference Value which is calculated from temperature
and MQ-5 gas sensor over a period of time. This data is and relative humidity

2322
International Conference on Energy, Communication, Data Analytics and Soft Computing (ICECDS-2017)

Density of Gas (MQ 5) is checked with threshold value # Same logic is implemented in another Nodes using
python script to get all the information’s about the
Method: environment
initialize the pins connected to the sensors
# Collecting Gas (MQ5), Temperature, Moisture and V. EXPERIMENTAL RESULTS AND ANALYSIS
Humidity at Location 1
for each specific Interval #3, 5, 10 minutes This work presents the design and implementation of a
get value from connected sensor in raspberry Pi low cost but highly flexible, high-speed air quality
# calculate reference value = temperature_value - ((100 monitoring system using Raspberry pi [2,3,4] with
- humidity_value) / 5)
cloud storage technology for wide-ranging users. The
record time
store reference value in database flexibility level is increased due to the usage of
#temperature part Raspberry pi which sends the data and alert messages to
if temperature_value>temperature_threshold then the developer and end users, easily connectible to
send alert message external devices. Raspberry pi provides low cost and
record time efficient platform for implementing the air quality
storetemperature_value in database monitoring system. The significance of this system
else
provides required action can be taken in short span of
Normal message
record time time in the case of emergency condition and compact
storetemperature_value in database design with tiny size. In this work, raspberry pi 3 board
acts as a main controller and temperature & humidity
#gas sensor part (MQ5) sensor, moisture sensor and MQ5 gas sensor are used to
If gas_sensor_value>gas_sensor_threshold then measure the external parameters. The collected data is
send alert message
stored in a MySQL database that can be queried in
record time
storegas_sensor_value in database ThinkSpeak whenever the relevant information is
else required. This model would analyze the data and report
Normal message it to the users.
record time
storegas_sensor_value in database

#humidity part
If moisture_value<moisture_threshold then
send alert message
record time
storehumidity_value in database
else
record time
storehumidity_value in database

#soil moisture part


If moisture_value<moisture_threshold
then
send message to Actuators
record time storemoisture_value
in database
else
Normal message
record time
storemoisture_value in database
Figure 5:Data collected from different sensor
end for solve any raised exceptions (Temperature, Humidity, Gas, Moisture)
return status
end

2323
International Conference on Energy, Communication, Data Analytics and Soft Computing (ICECDS-2017)

Figure 7: Run time status Comparison in Time Vs. MQ


5 Gas Sensor, Time Vs. humidity Level

The proposed model is developed and implement in real


time field and the measured results are plotted in figure
7. Figure 7 shows the Run time status Comparison in
Time Vs. MQ 5 Gas Sensor at different location and
shows the Run time status Comparison in Time Vs. at
Humidity Level different location and also depicts Run
time status Comparison in Time Vs. Plant temperature
and describes Run time status Comparison in Time Vs.
Moisture. Based on the datasets collected by different
sensors from real time environment, the threshold value
can be set for the pollution. If the sensor value from the
Figure 6: Sensor data stored in MYSQL database environment exceeds the threshold value, the
communication module sends the message alert to the
client by using ThinkSpeak. The level of pollution and
quality of the external environmental are analyzed with
Raspberry Pi prototyping model. It provides highly
Àexible and cost-effective solution. In this paper, data
prediction and analysis was implemented in Raspberry
Pi[2,3,4], which provide better results to attain the alert
signal for effective execution. This work offers
advanced and modern services to society in order to
improve the overall quality of their life.

2324
International Conference on Energy, Communication, Data Analytics and Soft Computing (ICECDS-2017)

Figure 9: Run time status Comparison in Time Vs Figure 10: Run time status Comparison in Time Vs
Temperature Sensor Moisture level

Fig11: Twitter update for sensor values

2325
International Conference on Energy, Communication, Data Analytics and Soft Computing (ICECDS-2017)

VI. CONCLUSION applications, Procedia Comput. Sci. 34 (0) (2014)


165–171.
In this paper, an IoT-based system has been proposed to [6]. Davide Brunelli, Maurizio Rossi. Enhancing
address the issue of environmental degradation and lifetime of WSN for natural gas leakages detection.
pollution. Using different sensors connected to a Microelectronics Journal 45 (2014) 1665–1670.
[7]. A. Zanella, N. Bui, A. Castellani, L. Vangelista, M.
Raspberry Pi module, environmental parameters like
Zorzi, Internet of things for smart cities, IEEE
gas density, humidity, temperature and soil moisture are Internet of Things Journal 1 (1) (2014) 22–32.
observed and recorded at frequent intervals. The [8]. J. Oppermann, C.A. Boano, K. Römer, A decade
prediction algorithm proposed would use this data to of wireless sensing applications: Survey and
suggest solutions necessary to counteract any detected taxonomy, in: The Art of Wireless Sensor
problems. The analyzed data is then reported to the Networks: Vol.1:Fundamentals, Springer Berlin,
users to keep them informed and alert them in case of Heidelberg,2014,pp.11–50.
[9]. Jung YJ, Lee YK, Lee DG, Lee Y, Nittel S, Beard
any issue that requires attention. Thus, this system
K, etal. “Design of sensor data processing steps in
would enable the environment in which it is installed to
an air pollution monitoring system”. Sensors. 2011;
be monitored continuously and keep the pollution levels 11(12):11235–50.
to a minimum. Its cost-effective and scalable nature also [10]. S. D. T. Kelly, N. K. Suryadevara, and S. C.
makes it easy to install and use across large areas. With Mukhopadhyay, “Towards the implementation of
pollution being a major threat to our environments and IoT for environmental condition monitoring in
consequently, our way of life, it is imperative to take homes,” IEEE Sensors Journal, vol. 13, no. 10, pp.
measures to control the situation. But, adopting such an 3846–3853, 2013.
IoT-based approach would be an effective solution to [11]. N. Skeledzija, J. Cesic, E. Koco, V. Bachler, H. N.
Vucemilo, and H. Dzapo, “Smart home automation
monitor and resolve problems that the environment may
system for energy efficient housing," 2014 37th
encounter. International Convention on Information and
Communication Technology, Electronics and
ACKNOWLEDGEMENT Microelectronics
The authors wish to express their sincere thanks to the [12]. Petrolo R, Loscrí V, Mitton N. Towards a smart
Department of Science & Technology, New Delhi, city based on cloud of things. In: Proceedings of
the 2014 ACM internationalworkshop on Wireless
India (Project-ID:SR/FST/ETI-371/2014) and SASTRA
and mobile technologies for smart cities -
University, Thanjavur, India for extending the WiMobCity ’14. New York, New York, USA:
infrastructural support to carry out this work. ACM Press; 2014:61-66.
[13]. P. Kumar, L. Morawska, Energy–pollution nexus
REFERENCES for urban buildings, Environ. Sci. Technol. 47
(2013) 7591–7592
[1]. M. M. Rathore, A. Ahmad, A. Paul, and S. Rho. [14]. E.G. Snyder, T. Watkins, P. Solomon, E.
Urban planning and building smart cities based on Thoma, R. Williams, G. Hagler, D. Shelow, D.
the internet of things using big data analytics. Hindin, V. Kilaru, P. Preuss, The changing
Computer Networks, 2016, pp. 63-80. paradigm of air pollution monitoring, Environ.
[2]. Maksimovic M, Vujovic V, Davidovic N, Sci. Technol. 47 (20) (2013) 11369–11377.
Milosevic V,Perisic B. Raspberry Pi as Internet of [15]. P. Zhou, G. Huang, L. Zhang, K.-F. Tsang,
Things hardware: Performances and constraints. Wireless sensor network based monitoring
IcETRAN Conference; Vrnjackabanja, Serbia. system for a large-scale indoor space: data
2014. pp. 1–6. process and supply air allocation optimization,
[3]. Vujovic V, Maksimovic M. Raspberry Pi as a Energy Build. 103 (2015) 365–374
sensor web node for home automation. Computers [16]. I.K. Koponen, A. Asmi, P. Keronen, K.
and Electrical Engineering. 2015; 44:pp.153–71. Puhto, M. Kulmala, Indoor air measurement
campaign in Helsinki, Finland 1999—the
[4]. Li S, Da Xu L, Zhao S. The internet of things: a
effect of outdoor air pollution on indoor air,
survey. Inform Syst Front. 2015 Apr ;17(2):243 -
Atmos. Environ. 35 (8) (2001) 1465–1477.
59
[17]. G. Suciu, A. Vulpe, S. Halunga, O. Fratu, G.
[5]. S. Abraham, X. Li, A cost-effective wireless sensor
Todoran, and V. Suciu,“Smart cities built on
network system for indoor air quality monitoring
resilient Cloud computing and secure Internet
ofThings,” pp. 513–518, 2013.

2326

You might also like