You are on page 1of 12

Air quality monitoring system for indoor

environments using IoT


Cite as: AIP Conference Proceedings 2112, 020180 (2019); https://doi.org/10.1063/1.5112365
Published Online: 24 June 2019

Amita Biswal, J. Subhashini, and Ajit Kumar Pasayat

ARTICLES YOU MAY BE INTERESTED IN

Grey water recycling with corn cob as an adsorbent


AIP Conference Proceedings 2112, 020181 (2019); https://doi.org/10.1063/1.5112366

AIP Conference Proceedings 2112, 020180 (2019); https://doi.org/10.1063/1.5112365 2112, 020180

© 2019 Author(s).
Air Quality Monitoring System for Indoor Environments
using IoT
Amita Biswal1,a) , J. Subhashini1,b) and Ajit Kumar Pasayat2,c)
1
Department of Electronics and Communication Engineering, SRM Institute of Science and Technology,
Kattankulathur, Chennai, India
2
Department of Computer Science and Engineering, IIT Kharagpur, India
a)
Corresponding author: amitabiswal1988@gmail.com
b)
subhashini.j@ktr.srmuniv.ac.in
c)
akpasayat@gmail.com

Abstract. In this work, we have used an IoT based approach along with required mathematical formulae to ascertain the quality
of air in different indoor environments. By using the concept of an embedded technology, various sensors are connected to collect
the data in different environments. The cloud technology is used for storing the sensed data. This collected data is stored in the
information cloud and then inquired for the analysis of any environmental condition. This model is used to record and analyze
such data in ThingSpeak. ThingSpeak is an analytic data platform for which IoT can be used as aggregation, visualization and
analysis of live data steam in cloud. Moreover, Python codes are written for different mathematical formulae which are used in the
ThingSpeak to check the environment condition. It has been observed that the graphical representation of environmental parameters
in ThingSpeak gives the basic idea about the environment condition of that particular region.

INTRODUCTION
In recent days, Internet of Things (IoT) has become an inventive way of connecting a myriad of devices via
internet. In fact, IoT is a broad research area that will give solutions regarding recent issues like air pollution. In
addition, this innovative technology enables an entirely new fashion for interaction between humans and their devices.
Weiser [1] coined the term “Ubiquitous Computing”, wherein he described the technique of ubiquitous computing
devices that can be utilized to provide any service to an end user based upon any time or location using tab, pads,
and boards. With the advances in computational capability and technology of the computing devices, the exchange of
data and interconnectivity among systems has increased exponentially, permeating through almost every thing in our
surroundings. Today, IoT is an ubiquitous concept where physical objects are connected over the Internet and have
unique identifiers to facilitate their self identification with other devices and the ability to generate and transmit data
continuously over a network (Ndibanje et al. [2]). Consequently, network security, data theft protection, integrity of
sensor devices is an important concern in the IoT network due to high growth rate based on the exchanged data and
sensor interconnectivity. Accordingly, the Internet of Things elicits significant challenges in the field that benefit the
methods for potential realization. The combination of objects with Internet have the powerful analytic capabilities
which promises for the transformation of the data from our way of living and work status. In the recent days, air
pollution has become a growing issue due to the unchecked increase in the number of infrastructure and industrial
plants. So a plethora of diseases, particularly the ones involving respiratory system, can be ascribed to air pollution.
Moreover, recent research has elucidated the importance of micro-level data on pollution to study the deterioration
of human health, particulary, highlighting the influence of personal human exposure and external intense exposure
to air pollutants. Air pollution diseases include asthma, a chronic and sometimes debilitating airway inflammatory
disease caused by noxious gases and particulate matter; chronic obstructive pulmonary diseases, such as bronchitis
and emphysema caused by cigarette smoke and car exhausts; lung cancer associated with long-term fine particulate
matter exposure (Whittemore [3], Seaton et al.[4]). Additionally, due to air pollution, the cardiovascular system, and
the urinary system are also affected (Kampa and Castanas [5]). Blaschke et al.[6] shown that the unwanted gases also

The 11th National Conference on Mathematical Techniques and Applications


AIP Conf. Proc. 2112, 020180-1–020180-11; https://doi.org/10.1063/1.5112365
Published by AIP Publishing. 978-0-7354-1844-8/$30.00

020180-1
can be identified with a MOS sensor module and categorized in close contact with human perception. Mehdizadeh et
al. [7] used Cascade inertial impactors for sampling and separating the size of micro to nono-size airborne particles.
In recent times, the rapid inflation of particulates and pollutants has become an alarming issue requiring imminent
solutions. Its urgently required to inhibit this deteriorating situation by establishing efficient control and monitoring
systems. In Kiruthika and Umamakeswari [8], an IoT-based system was developed to clash the air pollution. In their
proposed model, several sensors are connected through an embedded system that collects data from the surrounding
environment. Lu et al. [9] found that the growing and developing of a entire portable cell biosensor system for envi-
ronmental monitoring applications such as control of air quality, water pollution monitoring, and radiation detection
leakage. Using the micro-machining technique on a single diaphragm Prajapati et al. [10] integrated gas sensor array
with four different detecting elements is manufactured. A new amperometric ADC multi - channel CMOS depicting
gas sensor array pixel - level architecture is studied by Li et al. [11]. Boubrima et al. [12] concentrated on an alternative
or complementary approach with a network of low-cost and wireless automatic detectors that aim at a finer spatiotem-
poral sensing granularity. Thus, Air pollution is an imminent concern nowadays faced by all major economies and
societies, highlighting the need for an efficient system for monitoring air quality that is necessary to ensure a safe and
healthy environment.
In the current model, Raspberry Pi 3B+ micro-controller plays an important role, to which various sensors like
MQ135, MQ7, DHT11 and dust sensor are connected. The sensors are detected the level of carbon dioxide, carbon
monoxide, temperature, humidity and dust particles present in the environment. Further, the sensor data are stored
on a local server and excavated whenever necessary. Moreover, Python codes for different mathematical formulae are
written which are used in the ThingSpeak. Finally, by the ThingSpeak, the various results are extracted and analyzed
to check the environment condition.

SENSORS AND MODULES USED


In this work, various sensors are used such as DHT11, MQ135, MQ7, GP2Y1010AU0F, Raspberry Pi Model 3B+ and
MQ Gas Sensor, and details about the sensors are discussed in the subsequent subsections. Moreover, Python codes
are written for different mathematical formulae which are used in the ThingSpeak to check the environment condition.

DHT11 Sensor
DHT11 sensor is used to measure the temperature and humidity in a particular region, and it is connected to Pin
16 of the Raspberry Pi module. This device gives the variation temperature and humidity in degree centigrade and
percentage format, respectively.

FIGURE 1. DHT11 Sensor

Further, the temperature is calculated by ThingSpeak using the formula as given below
⎛ ⎞
T ⎜⎜⎜ PW s ⎟⎟⎟ T c 
v=1− and ⎜⎜⎝ ⎟⎟⎠ = c1 v + c2 v1.5 + c3 + v3 + c4 + v3.5 + c5 + v4 + c6 + v4.5 , (1)
Tc PC T

020180-2
where T is the temperature, PW s is the Saturation vapour pressure (npa), T c is the Critical temperature with 647.096k,
and Pc is the Critical Pressure having 220640hpa with C1 = -7.85951783, C2 = 1.84408259, C3 = -11.7866497, C4 =
22.6807411, C5 = -15.9618719, and C6 = 1.80122502,
Moreover, ⎛ ⎞
T ⎜⎜⎜ PW s ⎟⎟⎟
θ= and ⎜⎝ ⎜ ⎟⎟ = a0 (1 − θ−1.5 ) + a1 (1 − θ−1.25 ), (2)
Tn Pn ⎠
where Pn is the vapour pressure at triple point temperature T n = 273.16K and PWi is the Saturation vapour pressure
(hpa) with a0 = -13.928169 and a1 = 34.707823.
In addition, the relative humidity is calculated by using the formula
Tn
Td = ⎡ ⎤, (3)
⎢⎢⎢ ⎥⎥
⎢⎢⎣ m  − 1⎥⎥⎥⎦
Pw
10log A

Furthermore, the absolute value of humidity is calculated by A = C PTw (g/m3 ), where C = 2.16679 gK/J and Pw is the
vapour pressure in Pa.

MQ135 Gas Sensor


For monitoring the air quality, a gas sensor, MQ135 is used. It measures the level of NH3 , NOx, alcohol, Benzene,
smoke, CO2 in air. The resistance connected to MQ135 is different for various kinds of concentrated gases, so the
sensitivity adjustment of components is necessary at time of using. The sensor has wide detecting scope, due to its
fast response, high sensitivity, stability and long life. It is mainly utilized in office, buildings and homes for air quality
control.

FIGURE 2. MQ135

Furthermore, the concentration is calculated by using the following formulae,


Vc × R L
Rs = − RL , (4)
Vout
where Vc =5, R s is the sensor resistance, RL is load resistance.
⎡ ⎤⎡ ⎤
⎢⎢⎢ q ⎥⎥⎥⎢⎢⎢ 1 ⎥⎥⎥⎥ (c0 − ci )
⎢ ⎥ ⎢
C = ⎢⎣ ⎥⎦⎢⎣1 − nt ⎥⎦ + + ci (5)
nV e ent

C is the concentration in ppm of CO2 , q is emission of CO2 min 1
, V is the volume of room (n3 ), e= 2.1718, Q
V = n (air
exchange per hour), t is the time in min., ci is the outdoor CO2 concentration (ppm) and CO is at time t = 0 in indoor.

020180-3
MQ7 Gas Sensor
For the measurement of carbon monoxide in the air, MQ7 is used. It responds to the concentration of CO up to 60 sec.
It is mainly used in house for domestic gas leakage and in industry or car for CO detector. The percentage of carbon
monoxide present in air is calculated by %CO in gas = %O2Min gas × %COH
%O2 Hb , where M = Partition coefficient, PV = nRT
b

with n is the number of moles and RTPV


= 1.01 × 105 Pa.

FIGURE 3. MQ7 Gas Sensor

Dust Sensor (GP2Y1010AU0F)


In this work, to know the level of dust particles in the air, GP2Y 1010AU0F is used. It detects the reflected light
from dust particulate in air and it is especially effective in detecting very fine particles such as smoke from cigarette.
Additionally, it can distinguish smoke from the house dust. It is mainly used in air purifier, air conditioner and air
monitor.

FIGURE 4. GP2Y1010AU0F

sampled mg/m3
Additionally, the dust factor (in mg/m3 ) in the atmosphere is calculated by Dust factor = . During
average extinction
normal operation, P = CO
V , where C is the average number of particles between two ticks, O is the number of ticks on

020180-4
 Mass of contaminant
track, V is the volume of pumped air. In addition, dust concentration mg/m3 = .
Sample volume

Raspberry Pi Model 3B+


Raspberry Pi 3B+ is main prototyping module for this work. It is a SBC (Single Board Computer) that is ARM based
and of the dimensions of a regular credit card. The various sensors used here are connected through different pin to
the Raspberry Pi board. The DHT11 sensor is connected to PIN 16, MQ135 sensor is connected to PIN 19, MQ7
sensor is connected to PIN 20, and Dust sensor is connected by PIN 21 respectively. Using this module, the acquired
and digitized parametric data can be sent through the Internet, to an information cloud for storage. The saved data is
further queried and analysed for the monitoring purpose.

FIGURE 5. Raspberry Pi 3B+

MQ Gas Sensor PCB


The design of this breakout board is optimized to work with any type of the MQ-series gas sensor. This board has two
mounting holes and provides convenient pads for gas sensors in accordance with required setting of resistor sensitivity.

FIGURE 6. MQ Gas Sensor PCB

020180-5
METHODOLOGY
The basic block diagram of the model is shown in Fig.7. For the required setup the main module, the Raspberry Pi 3B+
module is taken in which the peripheral sensors like temperature and humidity sensor, gas sensors, and dust sensor
are connected to it. The Raspberry Pi 3B+ has a Wi-Fi and a Bluetooth module in it. Python is a general purpose, high
level programming language and has a comprehensive standard library with a dynamic memory management that is
highly reliable for coding as it supports the limited ways to convey the embedded concept to programmers.

MQ135 Gas
Sensors

Temp. and
Dust
Humidity Raspberry Pi Sensor
Sensor

MQ7 Gas
Sensors

Local
Server

Analysis
Cloud
&
Storage
Report

FIGURE 7. Block diagram of the model

FIGURE 8. Full Set-up for Experiment

Due to its flexibility and employability, an IoT based system has the greater potential to improve living standards
in pollution hit areas. Additionally for monitoring, it can be easily set-up and implemented sin any place according to

020180-6
the requirement. The present study is based on a cloud based technique with the help of the internet where the sensed
data are stored in a simplified manner. The cost of the overall set-up is low and can be fixed for small towns, large
part of the countries, even for large indoor environment like buildings and companies. In ThingSpeak, the graphical
representation of the sensor value shows the air quality of that region and can be analyzed for a better environmental
condition.

Data from
DHT11,MQ135,MQ7,Dust
Sensor

Raspberry Pi

Air Quality Index and Different


Sensed Values

Data send to Cloud through


Internet

Getting
Normalize
d value? Yes

No

Check for that particular


environmental condition

Display on ThingSpeak Website

FIGURE 9. Data flow diagram

The data flow diagram of this model mainly consists of four important modules such as data acquisition module,
the air quality index module, the cloud based data storing and monitoring module and lastly the analysis module.

020180-7
EXPERIMENTAL RESULT AND DISCUSSION

Temperature and Humidity Detection


DHT11 Sensor is used to measure the level of temperature and humidity in a particular region. Fig. 10 shows the varia-
tion of temperature versus time through DHT11 Sensor in real time environment. This graph indicates the temperature
variation in accordance with time for an indoor environment and varies with different location of the experiment. A
Python script is written for the sensed data which is a basic programming language for Raspberry Pi and temperature
is represented in the form of degree Celsius and time in hrs:min format. Fig.10 displays the experimental results for
different places done in various environmental condition, while Fig. 10(a) and Fig. 10(b) are done for different timings
as well as different places of a particular location. In Fig. 10(a), the rise in temperature is due to a very hot location
and during mid-day time has been taken for the experiment. Fig. 10(b) shows the experimental result during the late
night of that region. It may be noted that the variation in temperature is due to very hot environment, for which the
people having diseases like asthma, dust allergy, etc. will be affected.

 $LUTXDOLW\,QGRRU

07:9,70520%



07:9,70520%





 
        
,90 ,90
(a) (b)

FIGURE 10. Temperature at two different places

 $LUTXDOLW\,QGRRU


\WLGLPX+


\WLGLPX+







 
        
'DWH 'DWH
(a) (b)

FIGURE 11. Humidity level in two different places

Fig.11 conveys the experimental results according to the environment for the experiment which varies accord-
ingly. In Fig. 11(a), it has been observed that the rise in humidity is due very hot weather in that particular location.
Fig. 11(b) is due to switching on the air conditioner inside room for which the humidity became less. High indoor
humidity causes the air too dry, so people having diseases like whizzing will be more affected and also for normal
people, it is difficult to stay in that environment.

020180-8
Air Quality Detection
MQ135 Sensor is used to measure the air quality which depends on the pollutants, namely carbon dioxide, Sulphur
dioxide, nitrogen oxide and smoke in the air. Fig.12 shows the variation of CO2 versus time through MQ135 Sensor
in real time environment which varies at different temperature and humidity. The fluctuation is due to the cigarette
smoke present in the air during the experiment. Fig.12 shows the variation of carbon dioxide in two different locations.
Fig.12(a) reveals that the level of carbon dioxide present in the environment for a populated area and also due to the
presence of cigarette smoke in the air. Fig. 12(b) is showing the graphical representation of the amount of carbon
dioxide present in indoor environment when tested in a less populated area and also in a normalized manner.

 $LUTXDOLW\,QGRRU


 
 


 




 
       
,90 
(a) (b)

FIGURE 12. Carbon Dioxide level in two different places

Gas Detection
MQ7 Sensor is high sensitivity to carbon monoxide, specially, used for indoor environments, like industry, family or
car. Fig.13 shows the fluctuation of carbon monoxide gas due to the presence of any type of gas or leakage of domestic
gas at that experiment location versus time in real time environment. It varies due to the gas which came by burning the
domestic used match box sticks at the time of experiment, sensed through MQ7 Sensor. Fig.13 depicts different results
for different location of the experiment. In Fig. 13(a), the level of carbon monoxide when the experiment is done in
a hot environment. In Fig. 13(b), the graph is showing the experimental result inside a room during evening time of
the day and its varying due to the presence of the gas during the experiment. The level of carbon monoxide present
in indoor environment for both the cases is calculated and represented in a normalized manner, which is suitable for
human beings to live in a healthy environment.

 $LUTXDOLW\,QGRRU

 



 





 
        
 
(a) (b)

FIGURE 13. Carbon Monoxide Level at two different places

020180-9
Dust Particle Detection
GP2Y1010AU0F is used to detect house dust and cigarette smoke. Fig.14 shows the presence of dust particles versus
time in real time environment. The variation of graph is because of the household dust present inside the room and
also caused due to using the dust particles of chalk for the experiment which is sensed by the dust sensor. Fig.14
demonstrates the amount of dust particles present in the air. In Fig.14(a), the dust particles present inside the house
taken for a full day. In Fig. 14(b), the variation has been observed because of the chalk dust as well as the dust
deposited inside the room for a long time gap are used for the experiment.



 $LUTXDOLW\,QGRRU





 





 
        
 
(a) (b)

FIGURE 14. Dust particles present in two different places

Data Uploading to Cloud


For the purpose of storing and uploading the data to cloud, we need an internet connection. We have taken the Jio
4G Wi-Fi module for the experiment, so the set up can be connected and the Raspberry Pi board also be initialized.
Based on our requirement, we have chosen the 4G network access. Here, the Raspberry Pi 3B+ module is used in the
present study in which a Wi-Fi module is present. By using this module, we can send the sensed data of the parameters
connected to it, though the internet, to cloud. Further, from cloud the recorded data is used for monitoring purpose,
and also for analysis of the air quality in that location. ThingSpeak plays a major role of uploading the stored data to
the website which gives the idea about the condition of the indoor environment.

CONCLUSION

In this paper, an air quality monitoring system has been developed using IoT to study the air pollution in different
indoor environments. In addition, Python codes are written for different mathematical formulae which are used in
the ThingSpeak to examine the environment condition. The model is developed by using different sensors such as (i)
Raspberry Pi 3 model 3B+, (ii) DHT11 as a temperature and humidity sensor, (iii) Dust sensor (GP2Y1010AU0F), (iv)
MQ-135 Sensor, (v) MQ-7 Sensor (for Carbon Monoxide), and (vi) MQ Gas Sensor PCB. The concept of IoT enables
comprehensive data assimilation that reveals critical information about the quality of air, the level of temperature
and humidity, the presence of various gases and the presence of dust particles present in the environment. The cloud
database created can be accessed for information relevant to the environment under study for air quality analysis. In
this case, temperature, humidity, air quality was observed to vary in accordance with time for an indoor environment
and with different locations of the experiment for which the people having diseases like asthma, dust allergy, etc. will
be affected. In particular, high indoor humidity causes the air too dry, so people having diseases like whizzing will
be more affected and also for normal people, it is difficult to stay in that environment. ThingSpeak platform is highly
useful to analyse the Cloud data on the environmental condition, as an air quality monitoring system.

020180-10
REFERENCES
[1] M. Weiser, Scientific american 265, 94–105 (1991).
[2] B. Ndibanje, H.-J. Lee, and S.-G. Lee, Sensors 14, 14786–14805 (2014).
[3] A. S. Whittemore, Annual Review of Public Health 2, 397–429 (1981).
[4] A. Seaton, D. Godden, W. MacNee, and K. Donaldson, The lancet 345, 176–178 (1995).
[5] M. Kampa and E. Castanas, Environmental pollution 151, 362–367 (2008).
[6] M. Blaschke, T. Tille, P. Robertson, S. Mair, U. Weimar, and H. Ulmer, IEEE Sensors Journal 6, 1298–1308
(2006).
[7] E. Mehdizadeh, V. Kumar, J. C. Wilson, and S. Pourkamali, IEEE Sensors Journal 17, 2329–2337 (2017).
[8] R. Kiruthika and A. Umamakeswari, “Low cost pollution control and air quality monitoring system using
raspberry pi for internet of things,” in 2017 International Conference on Energy, Communication, Data
Analytics and Soft Computing (ICECDS) (IEEE, 2017), pp. 2319–2326.
[9] Y. Lu, D. Macias, Z. S. Dean, N. R. Kreger, and P. K. Wong, IEEE Trans. Nanobiosci 14, 811–817 (2015).
[10] C. S. Prajapati, R. Soman, S. Rudraswamy, M. Nayak, and N. Bhat, Journal of Microelectromechanical
Systems 26, 433–439 (2017).
[11] H. Li, C. S. Boling, and A. J. Mason, IEEE transactions on biomedical circuits and systems 10, 817–827
(2016).
[12] A. Boubrima, W. Bechkit, and H. Rivano, IEEE Transactions on Wireless Communications 16, 2723–2735
(2017).

020180-11

You might also like