Professional Documents
Culture Documents
IOT Based Air Quality Monitoring
IOT Based Air Quality Monitoring
CHAPTER 1
INTRODUCTION
Means when there are sufficient amount of harmful gases present in the air like CO2,
smoke, alcohol, benzene, NH3, LPG and NOx. It will show the air quality in PPM on
the LCD and as well as on webpage so that it can monitor it very easily. LPG sensor is
added in this system which is used mostly in houses. The system will show
temperature and humidity. The system can be installed anywhere but mostly in
industries and houses where gases are mostly to be found and gives an alert
message when the system crosses threshold limit.
Department of Page 1
Air Quality Monitoring System using IoT
OBJECTIVES
An IoT based system will provide easy installion, costless & maintance free for
proposed system . The Dust sensor (LDR) is used for measuring dust particles. MQ
135, MQ2 sensor used for measuring CO2 in air. Dust, CO2 & GAS quality
measurements made in real-time are shown graphically .This information is received
by specially designed application interface running on mobile connected through
Wi-Fi wireless link .The data generated will be in excel as well as graphical form
using Blynk software for analysis purpose.
Proposed model
In the proposed demonstrate air and water manages the clever condition. Which
implies it will recognize the varieties in the sensor information and settle the edge
esteem contingent upon the distinguished level of CO2, GAS and impurity air. In this
level detected information will be prepared, put away in the cloud i.e.in to the Blynk
sheets and furthermore it will demonstrate a pattern of the detected parameters as
for the predefined values. The end clients can peruse the information utilizing cell
phones, PCs and so forth.
Department of Page 2
Air Quality Monitoring System using IoT
CHAPTER 2
BASICS OF IoT:
2.2 Introduction The Internet of Things (IoT) is the network of physical objects
devices, vehicles, buildings and other items embedded with electronics, software,
sensors, and network connectivity that enables these objects to collect and exchange
data. The IoT allows objects to be sensed and controlled remotely across existing
network infrastructure, creating opportunities for more direct integration of the
physical world into computer based systems, and resulting in improved efficiency,
accuracy and economic benefit, when IoT is augmented with sensors and actuators,
the technology becomes an instance of the more general class of cyber physical
systems, which also encompasses technologies such as smart grids, smart homes,
intelligent transportation and smart cities. Each thing is uniquely identifiable through
its embedded computing system but is able to interoperate within the existing
Internet infrastructure.
Department of Page 3
Air Quality Monitoring System using IoT
Department of Page 4
Air Quality Monitoring System using IoT
Literature Review :-
The drawbacks of the conventional monitoring instruments are their large size,
heavy weight and extraordinary expensiveness. These lead to sparse deployment of
the monitoring stations. In order to be effective, the locations of the monitoring
stations need careful placement because the air pollution situation in urban areas is
highly related to human activities (e.g. construction activities) and location-
dependent (e.g., the traffic choke-points have much worse air quality than average).
IOT Based Air Pollution Monitoring System monitors the Air Quality over a web
server using internet and will trigger an alarm when the air quality goes down
beyond a certain level, means when there are amount of harmful gases present in
the air like CO2, smoke, alcohol, benzene, NH3, NOx and LPG. The system will show
the air quality in PPM on the LCD and as well as on webpage so that it can be
monitored very easily. Temperature and Humidity is detected and monitored in the
system.
LPG gas is detected using MQ6 sensor and MQ135 sensor is used for monitoring Air
Quality as it detects most harmful gases and can measure their amount accurately.
In this IOT project, it can monitor the pollution level from anywhere using your
computer or mobile. This system can be installed anywhere and can also trigger
some device when pollution goes beyond some level, like we can send alert SMS to
the user
Department of Page 5
Air Quality Monitoring System using IoT
NodeMcu
ESP8266
NodeMcu
Department of Page 6
Air Quality Monitoring System using IoT
Working:-
Proposed Air Pollution Monitoring System is based on the block diagram as shown in
Fig.1. The data of air is recognized by MQ135, dust sensor LDR and MQ2 LPG gas
sensor. The MQ135 sensor can sense NH3, NOx, alcohol, Benzene, smoke, CO2. So it
is dynamic gas sensored for our Air pollution Monitoring system. When it will be
connected to Arduino then it will sense all gases, and it will give the Pollution level in
PPM (parts per million). MQ135 gas sensor will give the output in form of voltage
levels and we have to convert it into PPM. So for converting the output in PPM, we
have used a library for MQ135 gas sensor and MQ2 sensor. Sensor is giving us value
of 90 when there is no gas near it and the air quality safe level is 350 PPM and it
should not exceed 1000 PPM. When it will exceed the limit of 1000 PPM, it will cause
Headaches, sleepiness and stagnant, stuffy air.
If it exceeds beyond 2000 PPM then it will cause increased heart rate and many
different diseases. When the value will be less than 1000 PPM, then the LCD and
webpage will display “Fresh Air”. When the value will increase from 1000 PPM,
then the buzzer will start beeping and the LCD and webpage will display “Poor Air,
Open Windows”. And when it will increase 2000, the buzzer will keep beeping and
give an alert message on smart phone through IoT. The LCD and webpage will display
“Danger! Move to fresh Air”. It will contain temperature and humidity so it will
possibly show the current temperature and humidity of the air. For temperature &
Humidity we have used DHT11 sensor . According to the model the 2 sensors works
as input data, they transmit data for temperature humidity and CO2. LCD is the
output devices. LCD shows the data of the gases in ppm (parts per million).
Department of Page 7
Air Quality Monitoring System using IoT
CHAPTER 3
SYSTEM ARCHITECTURE
Department of Page 8
Air Quality Monitoring System using IoT
Hardware description:
What is NodeMcu ESP8266 ?
NodeMcu
NodeMCU is an open source IoT platform. Which includes firmware which runs on
the ESP8266 Wi-Fi Module from Espressif Systems,and hardware which is based on
the ESP-12 module. The term “NodeMCU” by default refers to the firmware rather
than the dev kits. NodeMCU firmware was developed so that AT commands can be
replaced with Lua scripting making the life of developers easier. So it would be
redundant to use AT commands again in NodeMCU.
NodeMcu ESP8266
Department of Page 9
Air Quality Monitoring System using IoT
The ESP8266 is a low-cost Wi-Fi chip with full TCP/IP stack and microcontroller
capability produced by Shanghai-based Chinese manufacturer, Espressif.
ESP8266 Feature:
Open-source
Interactive
Programmable
Low cost
Simple
Smart
WI-FI enabled
USB-TTL included
Department of Page 10
Air Quality Monitoring System using IoT
NodeMCU Pinout ESP8266
NodeMCU ESP8266 based boards were first introduced with LUA scripting language
for programming but since Arduino IDE is most popular among electronic hobbyist
for programming the development boards, so this leads to the esp8266 package that
needs to be added to Arduino IDE for programming ESP based boards. Since the
NodeMCU ESP8266 boards were designed for a different architecture but later on
implemented for Arduino IDE, as a result, we needed GPIO pin mapping of NodeMCU
pinout that is marked on the board from D0-D8 but while in coding we use the
mapped GPIO pin no. so that (note that in latest IDE we can directly write the pins as
D0, D1 or so.)
Department of Page 11
Air Quality Monitoring System using IoT
Here is the NodMCU Pinout of the Pins mapped with there corresponding values of
GPIO no. For example – D7 pin mapped to GPIO pin 13. so, in coding, we need to
declare the D7 as pin 13.
Department of Page 12
Air Quality Monitoring System using IoT
Low Cost
Less pinout
Department of Page 13
Air Quality Monitoring System using IoT
CHAPTER 5
The power supplies are designed to convert high voltage AC mains electricity to a
suitable low voltage supply for electronic circuits and other devices. A RPS
(Regulated Power Supply) is the Power Supply with Rectification, Filtering and
Regulation being done on the AC mains to get a Regulated power supply for
Microcontroller and for the other devices being interfaced to it.
A power supply can by broken down into a series of blocks, each of which performs a
particular function. A dc power supply which maintains the output voltage constant
irrespective of ac mains fluctuations or load variations is known as “Regulated D.C
Power Supply”
Department of Page 14
Air Quality Monitoring System using IoT
Transformer:
Transformers convert AC electricity from one voltage to another with little loss of
power. Transformers work only with AC and this is one of the reasons why mains
electricity is AC. Step-up transformers increase in output voltage, step-down
transformers decrease in output voltage. Most power supplies use a step-down
transformer to reduce the dangerously high mains voltage to a safer low voltage.
The input coil is called the primary and the output coil is called the secondary. There
is no electrical connection between the two coils; instead they are linked by an
alternating magnetic field created in the soft-iron core of the transformer. The two
lines in the middle of the circuit symbol represent the core. Transformers waste
very little power so the power out is (almost) equal to the power in. Note that as
voltage is stepped down current is stepped up. The ratio of the number of turns on
each coil, called the turn’s ratio, determines the ratio of the voltages. A step-down
transformer has a large number of turns on its primary (input) coil which is
connected to the high voltage mains supply, and a small number of turns on its
secondary (output) coil to give a low output voltage.
Department of Page 15
Air Quality Monitoring System using IoT
Turns ratio = Vp/ VS = Np/NS
VS X IS=VP X IP
RECTIFIER
TYPES OF RECTIFIERS:
Department of Page 16
Air Quality Monitoring System using IoT
Type of Rectifier
Number of diodes 1 2 4
Ripple frequency f 2f 2f
Transformer Utilization
Factor(TUF)
0.287 0.693 0.812
Full-wave Rectifier:
Department of Page 17
Air Quality Monitoring System using IoT
From the above comparison we came to know that full wave bridge rectifier as more
advantages than the other two rectifiers. So, in our project we are using full wave
bridge rectifier circuit.
Bridge Rectifier:
A bridge rectifier makes use of four diodes in a bridge arrangement to achieve full-
wave rectification. This is a widely used configuration, both with individual diodes
wired as shown and with single component bridges where the diode bridge is wired
internally.
A bridge rectifier makes use of four diodes in a bridge arrangement as shown in fig
(a) to achieve full-wave rectification. This is a widely used configuration, both with
individual diodes wired as shown and with single component bridges where the
diode bridge is wired internally.
Department of Page 18
Air Quality Monitoring System using IoT
Operation: During positive half cycle of secondary, the diodes D2 and D3 are in
forward biased while D1 and D4 are in reverse biased as shown in the fig(b). The
current flow direction is shown in the fig (b) with dotted arrows.
During negative half cycle of secondary voltage, the diodes D1 and D4 are in forward
biased while D2 and D3 are in reverse biased as shown in the fig(c). The current flow
direction is shown in the fig (c) with dotted arrows.
Filter:
A Filter is a device which removes the ac component of rectifier output but allows
the dc component to reach the load.
Department of Page 19
Air Quality Monitoring System using IoT
Capacitor Filter:
We have seen that the ripple content in the rectified output of half wave rectifier is
121% or that of full-wave or bridge rectifier or bridge rectifier is 48% such high
percentages of ripples is not acceptable for most of the applications. Ripples can be
removed by one of the following methods of filtering.
(a) A capacitor, in parallel to the load, provides an easier by –pass for the ripples
voltage though it due to low impedance. At ripple frequency and leave the D.C. to
appear at the load.
(b) An inductor, in series with the load, prevents the passage of the ripple current
(due to high impedance at ripple frequency) while allowing the dc (due to low
resistance to dc).
(c) Various combinations of capacitor and inductor, such as L-section filter section
filter, multiple section filter etc. which make use of both the properties mentioned in
(a) and (b) above. Two cases of capacitor filter, one applied on half wave rectifier and
another with full wave rectifier.
Department of Page 20
Air Quality Monitoring System using IoT
C = ¼*√3*f*r*Rl
Where,
f = supply frequency,
r = ripple factor,
Rl = load resistance
Note: In our circuit we are using 1000µF hence large value of capacitor is placed to
reduce ripples and to improve the DC component.
Regulator:
Voltage regulator ICs is available with fixed (typically 5, 12 and 15V) or variable
output voltages. The maximum current they can pass also rates them. Negative
voltage regulators are available, mainly for use in dual supplies. Most regulators
include some automatic protection from excessive current ('overload protection')
and overheating ('thermal protection'). Many of the fixed voltage regulators ICs
have 3 leads and look like power transistors, such as the 7805 +5V 1A regulator
shown on the right. The LM7805 is simple to use. You simply connect the positive
lead of your unregulated DC power supply (anything from 9VDC to 24VDC) to the
Input pin, connect the negative lead to the Common pin and then when you turn on
the power, you get a 5 volt supply from the output pin.
Department of Page 21
Air Quality Monitoring System using IoT
The Bay Linear LM78XX is integrated linear positive regulator with three terminals.
The LM78XX offer several fixed output voltages making them useful in wide range of
applications. When used as a zener diode/resistor combination replacement, the
LM78XX usually results in an effective output impedance improvement of two orders
of magnitude, lower quiescent current. The LM78XX is available in the TO-252, TO-
220 & TO-263packages,
Features:
• Output Voltage 5.0V, 6V, 8V, 9V, 10V, 12V, 15V, 18V, 24V.
Department of Page 22
Air Quality Monitoring System using IoT
General Description
The LM78XX series of three terminal regulators is available with several fixed output
voltages making them useful in a wide range of applications. One of these is local on
card regulation, eliminating the distribution problems associated with single point
regulation. The voltages available allow these regulators to be used in logic systems,
instrumentation, Hi-Fi, and other solid state electronic equipment. Although
designed primarily as fixed voltage regulators these devices can be used with
external components to obtain adjustable voltages and currents.
The LM78XX series is available in an aluminum TO-3 package which will allow over
1.0A load current if adequate heat sinking is provided. Current limiting is included to
limit the peak output current to a safe value. Safe area protection for the output
transistor is provided to limit internal power dissipation. If internal power dissipation
becomes too high for the heat sinking provided, the thermal shutdown circuit takes
over preventing the IC from overheating. Considerable effort was expanded to make
the LM78XX series of regulators easy to use and minimize the number of external
components. It is not necessary to bypass the output, although this does improve
Department of Page 23
Air Quality Monitoring System using IoT
CHAPTER 6
Department of Page 24
Air Quality Monitoring System using IoT
Pin Configuration:
For Module
1 Vcc Used to power the sensor, Generally the operating voltage is +5V.
3 Digital Out You can also use this sensor to get digital output from this pin, by
setting a threshold value using the potentiometer.
4 Analog This pin outputs 0-5V analog voltage based on the intensity of the gas.
Out
For Sensor
Department of Page 25
Air Quality Monitoring System using IoT
1 H -Pins Out of the two H pins, one pin is connected to supply and the other to
ground
2 A-Pins The A pins and B pins are interchangeable. These pins will be tied to the
Supply voltage.
3 B-Pins 1. A pins and B pins are interchangeable. One pin will act as output while
the other will be pulled to ground.
10. The Sensitivity of Digital pin can be varied using the potentiometer
GAS SENSOR MQ 2
Department of Page 26
Air Quality Monitoring System using IoT
The LPG Gas Sensor, MQ-6, is an ideal sensor to detect the presence of a dangerous Liquefied
petroleum gas (LPG) and it has high sensitivity to propane, butane, isobutene, natural gas. The sensor
can also be used to detect combustible gases, especially methane. It is an electronic device which
detects dangerous gas leaks in the kitchen or near the gas heater. This unit detects 200 to 10000ppm
of LPG. Sensor can be easily configured as an alarm unit.
The MQ-6 gas sensor is made up of SnO2 which has lower conductivity in clean air. A simple
electro-circuit is used here which is used to convert the changing conductivity into corresponding
output signal of gas concentration. Sensor’s conductivity increases with increasing concentration of
LPG. The sensor has excellent sensitivity combined with a quick response time.
FEATURES:
Department of Page 27
Air Quality Monitoring System using IoT
Sensor composed by micro AL2O3 ceramic tube, Tin Dioxide (SnO2) sensitive Layer , measuring
electrode and heater are fixed into a crust made by plastic and stainless steel net. The heater provides
necessary work conditions for work of sensitive components. The enveloped MQ-6 has 6 pin,4 of
them are used to fetch signals, and other 2 are used for providing heating current.This sensor has a
high sensitivity and fast response time. The sensor's output is an analog resistance. The drive circuit is
very simple; all you need to do is power the heater coil with 5V, add a load resistance, and connect
the output to an ADC.
Department of Page 28
Air Quality Monitoring System using IoT
This sensor continuously senses the gas, and if concentration level goes above
danger level then it turns relay ON which gives interrupt to microcontroller and
alternately switches on buzzer and exhaust fan.
Department of Page 29
Air Quality Monitoring System using IoT
The MQ-135 Gas sensors are used in air quality control equipments and are
suitable for detecting or measuring of NH3, NOx, Alcohol, Benzene, Smoke, CO2. The
MQ-135 sensor module comes with a Digital Pin which makes this sensor to operate
even without a microcontroller and that comes in handy when you are only trying to
detect one particular gas. If you need to measure the gases in PPM the analog pin
need to be used. The analog pin is TTL driven and works on 5V and so can be used
with most common microcontrollers. A sensor to detect or measure common air
quality gases such as CO2, Smoke, NH3, NOx, Alcohol, Benzene then this sensor
might be the right choice.
We can either use the digital pin or the analog pin to do this. Simply power the
module with 5V and you should notice the power LED on the module to glow and
when no gas it detected the output LED will remain turned off meaning the digital
output pin will be 0V. Remember that these sensors have to be kept on for pre-
heating time (mentioned in features above) before you can actually work with it.
Now, introduce the sensor to the gas you want to detect and you should see the
output LED to go high along with the digital pin, if not use the potentiometer until
the output gets high. Now every time your sensor gets introduced to this gas at this
particular concentration the digital pin will go high (5V) else will remain low (0V).
Department of Page 30
Air Quality Monitoring System using IoT
We can also use the analog pin to achieve the same thing. Read the analog values (0-
5V) using a microcontroller, this value will be directly proportional to the
concentration of the gas to which the sensor detects. You can experiment with this
values and check how the sensor reacts to different concentration of gas and
develop your program accordingly.
MQ-135 gas sensor applies SnO2 which has a higher resistance in the clear air as
a gas-sensing material. When there is an increase in polluting gases, the resistance of
the gas sensor decreases along with that. To measure PPM using MQ-135 sensor we
need to look into the (Rs/Ro) v/s PPM graph taken from the MQ135 datasheet.
Department of Page 31
Air Quality Monitoring System using IoT
The above figure shows shows the typical sensitivity characteristics of the MQ-135
for several gases. in their: Temp: 20, Humidity: 65%, O2 concentration 21%,
RL=20kΩ,
The value of Ro is the value of resistance in fresh air (or the air with we are
comparing) and the value of Rs is the value of resistance in Gas concentration. First
you should calibrate the sensor by finding the values of Ro in fresh air and then use
that value to find Rs using the below formula:
Once we calculate Rs and Ro we can find the ratio and then using the graph shown
above we can calculate the equivalent value of PPM for that particular gas.
Applications:
Department of Page 32
Air Quality Monitoring System using IoT
Light dependent Resistor or “LDR” is a variable resistor sensitive to light intensity in according to the
photoelectric effect. The effect frees electrons proportional to the flux of light shines. The unit
observed in the microcontroller is the electric pressure. In the project LDR is used to adjust the light
intensity outdoors.
Department of Page 33
Air Quality Monitoring System using IoT
Intrinsic photo resistors (Un doped semiconductor): These are made of pure
semiconductor materials such as silicon or germanium. Electrons get excited from
valance band to conduction band when photons of enough energy fall on it and number
charge carriers is increased.
Extrinsic photo resistors: These are semiconductor materials doped with impurities
which are called as dopants. Theses dopants create new energy bands above the valence
band which are filled with electrons. Hence this reduces the band gap and less energy is
required in exciting them. Extrinsic photo resistors are generally used for long
wavelengths.
Department of Page 34
Air Quality Monitoring System using IoT
Construction of a Photocell
The structure of a light dependent resistor consists of a light sensitive material which
is deposited on an insulating substrate such as ceramic. The material is deposited in
zigzag pattern in order to obtain the desired resistance and power rating. This zigzag
area separates the metal deposited areas into two regions. Then the ohmic contacts
are made on the either sides of the area. The resistances of these contacts should be
as less as possible to make sure that the resistance mainly changes due to the effect
of light only. Materials normally used are cadmium sulphide, cadmium selenide,
indium antimonide and cadmium sulphonide. The use of lead and cadmium is
avoided as they are harmful to the environment.
Department of Page 35
Air Quality Monitoring System using IoT
Characteristics of LDR
LDR’s are light dependent devices whose resistance is decreased when light falls on
them and that is increased in the dark. When a light dependent resistor is kept in
dark, its resistance is very high. This resistance is called as dark resistance. It can be
as high as 1012 Ω and if the device is allowed to absorb light its resistance will be
decreased drastically. If a constant voltage is applied to it and intensity of light is
increased the current starts increasing. Figure below shows resistance vs.
illumination curve for a particular LDR.
Photocells or LDR’s
Department of Page 36
Air Quality Monitoring System using IoT
are non linear devices. There sensitivity varies with the wavelength of light incident
on them. Some photocells might not at all response to a certain range of
wavelengths. Based on the material used different cells have different spectral
response curves.
When light is incident on a photocell it usually takes about 8 to 12 ms for the change
in resistance to take place, while it takes one or more seconds for the resistance to
rise back again to its initial value after removal of light. This phenomenon is called as
resistance recovery rate. This property is used in audio compressors. Also, LDR’s are
less sensitive than photo diodes and phototransistor. (A photo diode and a photocell
(LDR) are not the same, a photo-diode is a pn junction semiconductor device that
converts light to electricity, whereas a photocell is a passive device, there is no pn
junction in this nor it “converts” light to electricity).
• The Light Dependent Resistor (LDR) is made using the semiconductor Cadmium
Sulphide (CdS).
• The light falling on the brown zigzag lines on the sensor causes the resistance of
The device to fall. This is known as a negative co-efficient. There are some LDRs that work in the
opposite way i.e. their resistance increases with light (called positive coefficient).
• The resistance of the LDR decreases as the intensity of the light falling on it increases.
Incident photons drive electrons from the valence band into the conduction band.
Department of Page 37
Air Quality Monitoring System using IoT
Software Requirement
Arduino
Arduino is a type of computer software and hardware company that offers open-
source environment for user project and user community that intends and fabricates
microcontroller based inventions for construction digital devices and interactive
objects that can sense and manage the physical world. For programming the
microcontrollers, the Arduino proposal provides an software application or IDE
based on the Processing project, which includes C, C++ and Java programming
software. It also support for embedded C, C++ and Java programming software.
Department of Page 38
Air Quality Monitoring System using IoT
Department of Page 39
Air Quality Monitoring System using IoT
Blynk was designed for the Internet of Things. It can control hardware remotely, it
can display sensor data, it can store data, vizualize it and do many other cool things.
Blynk App - allows to you create amazing interfaces for your projects using various
widgets we provide.
Blynk Server - responsible for all the communications between the smartphone and
hardware. You can use our Blynk Cloud or run your private Blynk server locally. It’s
open-source, could easily handle thousands of devices and can even be launched on
a Raspberry Pi.
Blynk Libraries - for all the popular hardware platforms - enable communication with
the server and process all the incoming and outcoming commands.
Now imagine: every time you press a Button in the Blynk app, the message travels to
space the Blynk Cloud, where it magically finds its way to your hardware. It works
the same in the opposite direction and everything happens in a blynk of an eye.
Department of Page 40
Air Quality Monitoring System using IoT
Applications:-
3) This system is also can be inter faced with vehicle airbag system
Advantages:-
1) Easy to Install
Disadvantages:-
1) When power is off , then the total system is off so always required battery .
Department of Page 41
Air Quality Monitoring System using IoT
CHAPTER 5
Conclusion
The system to monitor the air of environment using Arduino microcontroller, IOT
Technology is proposed to improve quality of air. With the use of IOT technology
enhances the process of monitoring various aspects of environment such as air
quality monitoring issue proposed in this paper. Here, using the MQ135, LDR and
MQ2 gas sensor gives the sense of different type of dangerous gas and arduino is the
heart of this project. Which control the entire process. Wi-Fi module connects the
whole process to internet and LCD is used for the visual Output.
Department of Page 42
Air Quality Monitoring System using IoT
References
[1] https://securedstatic.greenpeace.org/india/Global/India/Airpoclypse--Not-just-
Delhi--Air-in-mostIndian-cities-hazardous--Greenpeace-report.pdf
[2] content/uploads/2008/04/5v-regulator-using7805.JPG
[4]https://www.aliexpress.com/item/1PCS-LOTSolution-PH-valuo-Temperature-
detector-sensormodule-for-arduino-Freeshipping/32620995019.html?
spm=2114.401
Department of Page 43