Real Time Air Quality Monitoring System
Real Time Air Quality Monitoring System
Real Time Air Quality Monitoring System
A Project report submitted in partial fulfillment of the requirements for the award of
the degree of
BACHELOR OF TECHNOLOGY
IN
ELECTRONICS AND COMMUNICATION ENGINEERING
Submitted by
M. DEEPSHIKA (318126512152) M.VIKRAM (318126512156)
S.GANESH(318126512169) A. DEVA KALYAN(319126512L16)
i
ACKNOWLEDGEMENT
We would like to express our deep gratitude to our project guide Mr.N.Ram Kumar,
Assistant professor ,Department of Electronics and Communication Engineering, ANITS,
for his/her guidance with unsurpassed knowledge and immense encouragement. We are
grateful to Dr. V. Rajyalakshmi, Head of the Department, Electronics and
Communication Engineering, for providing us with the required facilities for the
completion of the project work.
We are very muchthankful to the Principal and Management, ANITS, Sangivalasa, for
their encouragement and cooperation to carry out this work.
We express our thanks to all teaching faculty of Department of ECE, whose suggestions
during reviews helped us in accomplishment of our project. We would like to thank all
non-teaching staff of the Department of ECE, ANITS for providing great assistance in
accomplishment of our project.
We would like to thank our parents, friends, and classmates for their encouragement
throughout our project period. At last but not the least, we thank everyone for supporting
us directly or indirectly in completing this project successfully.
PROJECT STUDENTS:
M.Deepshika (318126512152)
M.Vikram(318126512156)
S.Ganesh (318126512169)
A.Deva Kalyan(319126512L16)
iii
ABSTRACT
Air pollution refers to the release of pollutants into the air—pollutants which are
harmful to human health and the planet as a whole such as Carbon Monoxide(CO), Methane,
Nitrous Oxide ,Carbon Dioxide(CO2), Flourinated gases(F-gases) which as a whole effect the
climatic changes. As the issue becomes more dominant it is constantly required to monitor these
harmful gases and take necessary actions to eradicate this issue. This project presents the idea of
detecting harmful gases in the environment and provide the data to a administrator.The main aim
of this system is to achieve pollutants monitoring using wireless sensors connected to the Internet,
which send the measurements to a centralized server. IOT allows the devices to send the location
of the places that breached the threshold levels .Low power sensors are used to detect the
parameters and interact with the microcontroller to process the data and transmit it through the
internet using IOT .The ultimate goal of this project is to detect harmful gasses and send the data
to an administrator to monitor the conditions. In this project we are targeting to build a system
that can fetch the values of harmful pollutants present in that location and raise an alarm
whenever the levels are breached, so that we can effectively monitor the changes and take
necessary actions to normalize the pollutant levels. High levels of Carbon Monoxide intake can
cause several health related issues like dull headache, weakness. dizziness. nausea or vomiting.
shortness of breath, blurred vision .In the same way excess intake of nitrous oxide can cause
dizziness, unconsciousness, and even death. Previously we have built the LPG detector using
MQ6 sensor and Smoke detector using MQ2 sensor but this time we have used MQ135 sensor
which is the best choice for monitoring Air Quality as it can detects most harmful gases and can
measure their amount accurately. In this IOT project, you can monitor the pollution level from
anywhere using your computer or mobile. We can install this system anywhere and can also
trigger some device when pollution goes beyond some level, like we can switch on the Exhaust
fan or can send alert SMS/mail to the user. Index Terms: Arduino, Gas sensor, Buzzer.
iv
CONTENTS
ABSTRACT iv
CHAPTER 1 INTRODUCTION 01
1.1 Purpose 02
1.2 Project Objective 03
CHAPTER 2 LITERATURE SURVEY 05
3.3.3 Applications 17
v
3.4.2 Specifications 19
3.4.3 Features 19
3.4.4 Applications 22
3.5.1 Specifications 23
3.5.3 Applications 24
3.6.1 Features 26
3.6.3 Advantages 30
3.6.4 Disadvantages 30
3.7.3 Applications 33
3.8 Buzzer 33
3.9.1 Description 36
vi
3.11.1 System Design 42
CHAPTER 4 RESULT 47
APPLICATIONS AND ADVANTAGES 50
CHAPTER 5 CONCLUSION 51
REFERENCES 52
APPENDIX:SOURCE CODE 53
vii
LIST OF FIGURES
Fig. 3.1 Block Diagram Description 07
Fig. 3.3.1 Arduino pin Diagram. 10
Fig. 3.3.2 Arduino Layouts 15
Fig. 3.4 MQ135 gas sensors 18
Fig. 3.4.1 WiFi module pinout 22
Fig. 3.6.1 LCD Display 27
Fig. 3.7 DHT11 Sensor 31
Fig. 3.8.1 Buzzer 34
Fig. 3.8.2 Buzzer driver 34
Fig.3.9 Block Diagram of power supply 35
Fig.3.9.1 Circuit Diagram of power supply 36
Fig. 3.9.2 Circuit Diagram 36
Fig. 4.1 Hardware Kit 47
Fig. 4.1.1 Display of output in Thingspeak 49
LIST OF TABLES
viii
CHAPTER -1
INTRODUCTION
Previously we have built the LPG detector using MQ6 sensor and Smoke
detector using MQ2 sensor but this time we have used MQ135 sensor which is the best
choice for monitoring Air Quality as it can detects most harmful gases and can
measure their amount accurately. In this IOT project, you can monitor the pollution
level from anywhere using your computer or mobile. We can install this system
anywhere and can also trigger some device when pollution goes beyond some level,
like we can switch on the Exhaust fan or can send alert SMS or mail to the user.
1
PURPOSE:
2
PROJECT OBJECTIVE:
Nowadays the air condition is very polluted. In recent years, car emissions,
chemicals from factories, smoke, and dust are everywhere. That is the reason why now
air condition is very polluted. The effect of air pollution is very bad for our health,
especially for a place where the air in our body is taken for breathing.
Air pollution cannot be detected by human feelings. Air pollution may contain a
lot of dangerous substances such as ozone, particulate matter sulfur dioxide, nitrogen
dioxide, carbon
monoxide, and lead. This proposed system uses a wireless sensor network with
low-cost sensors and hardware components along the necessary software to effectively
monitor the air pollution phenomenon. Air pollution is the worst environmental problem
and it causes a multitude of adverse effects on human health, water bodies, and climate.
The main source of air pollution in all major cities is due to vehicles and the second
major source remains the industries. The air pollution monitoring system
is installed in a particular locality where there are traces of acute air pollution to
detect the constituent gases of air which may lead to harmful effects on human health
and other leaving beings.
Substances in the polluted air are very dangerous. For example, if the carbon
monoxide is above 100ppm, it makes humans feel dizzy, nauseous, and within minutes
they could die. This research makes humans find out which content of the air is polluted.
With module node MCU
esp8266, we can monitor the air pollution remotely, because there is a Wi-Fi
module in node MCU esp8266. This makes the air condition can be monitored every time.
3
Air is getting polluted because of release of toxic gases by industries, vehicle
emissions and increased concentration of harmful gases and particulate matter in the
atmosphere. The level of pollution is increasing rapidly due to factors like industries,
urbanization, increasing in population, vehicle use which can affect human health.
Particulate matter is one of the most important parameter having the significant
contribution to the increase in air pollution.
This creates a need for measurement and analysis of real time air quality
monitoring so that appropriate decisions can be taken in a timely period. This paper
presents a real-time standalone air quality monitoring. Internet of Things is nowadays
finding profound use in each and every sector, plays a key role in our air quality monitoring
system too. The setup will show the air quality in PPM in webpage so that we can monitor
it very easily. In this IoT project, you can monitor the pollution level from anywhere using
your computer or mobile [1]. The setup will show the air quality in PPM in webpage so
that we can monitor it very easily. In this IoT project, you can monitor the pollution level
from anywhere using your computer or mobile. Air condition is much polluted. In recent
years, car emissions, chemicals from factories, smoke and dust are everywhere. That is the
reason why now air condition is much polluted. The effect of air pollution is very bad for
our health, especially for place where the air in our body is taken for breathing. In our
lungs may cause some diseases, such as asthma, cough, lung disorders [1].The air pollution
cannot be detected by human feelings. The air pollution may contain a lot of dangerous
substances, such as LPG gas, carbon monoxide, and methane [2]. Substances in the
polluted air are very dangerous. For example, if the carbon monoxide is above 100ppm, it
makes human feel dizzy, nauseous, and within minutes they could die. This research makes
human find out which content of the air is polluted. With module node mcu esp8266, we
can monitor the air pollution remotely, because there is a Wi-Fi in nodemcu esp8266. This
makes the air condition can be monitored every time.
4
CHAPTER -2
LITERATURE SURVEY
2.1 Literature Review
To know about which area contains more pollution and escape from that particular place
easily.
2.3 Aim
To prevent, control and abate pollution of streams, wells, land and air to protect the
environment from any degradation by effective monitoring and implementation of
pollution.
5
has limited uses according to the intended function, as Zigbee is meant for users with
Zigbee-receiver, Bluetooth.
In this project we are going to make IOT based Air Pollution Monitoring System in
which we will monitor the Air Quality over a web server using internet and will
trigger a alarm when the air quality goes down beyond a certain level, means when
there are sufficient amount of harmful gases are present in the air like CO2, smoke, alcohol,
benzene and NH3. It will show the air quality in PPM on the LCD and as well as on
webpage so that we can monitor it very easily.
6
CHAPTER 3:HARDWARE IMPLEMENTATION
RESET
SOFTWARE
USED
ARDUINO IDE 16 X 2 LCD DISPLAY
EMBEDDED C
BUZZER
MQ2 MUTLI DRIVER BUZZER
ARDUINO UNO
GAS SENSOR
ESP8266 Wi-
Fi IOT CLOUD
MODEM
MQ6 MULTI
GAS SENSOR
MOBILE
OSCILLATOR
7
MQ135 sensor can sense NH3, NOx, alcohol, Benzene, smoke, CO2 and some other gases,
so it is perfect gas sensor for our Air Quality Monitoring System. When we will connect it to
Arduino then it will sense the gases, and we will get the Pollution level in PPM (parts per
million). MQ135 gas sensor gives the output in form of voltage levels and we need to
convert it into PPM. So for converting the output in PPM, here we have used a library for
MQ135 sensor.
STEP2:
To begin, you'll need to install the Arduino Programmer, aka the integrated development
environment (IDE).
STEP3:
Connect your Arduino to the USB port of your computer. This may require a specific
USB cable. Every Arduino has a different virtual serial-port address, so you'll need to
reconfigure the port if you're using different Arduinos.
STEP 4:
Set the board type and the serial port in the Arduino Programmer.
STEP 5:
Test the microcontroller by using one of the preloaded programs, called sketches, in
the Arduino Programmer. Open one of the example sketches, and press the upload button
to load it. The Arduino should begin responding to the program: If you've set it to
blink an LED light, for example, the light should start blinking.
8
STEP6:
To upload new code to the Arduino, either you'll need to have access to code you can
paste into the programmer, or you'll have to write it yourself, using the Arduino
programming language to create your own sketch. An Arduino sketch usually has five parts:
a header describing the sketch and its author; a section defining variables; a setup routine that
sets the initial conditions of variables and runs preliminary code; a loop routine, which is
where you add the main code that will execute repeatedly until you stop running the sketch;
and a section where you can list other functions that activate during the setup and loop
routines. All sketches must include the setup and loop routines.
STEP7:
Once you've uploaded the new sketch to your Arduino, disconnect it from your computer
and integrate it into your project as directed.
3.3 Arduino Uno
The Arduino Uno is a microcontroller board based on the ATmega328 . It has 14 digital
input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16
MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset button.
It contains everything needed to support the microcontroller; simply connect it to a
computer with a USB cable or power it with a AC-to-DC adapter or battery to get started.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-
serial driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2)
programmed as a USB-to-serial converter. The Uno board has a resistor pulling the 8U2
HWB line to ground, making it easier to put into DFU mode.
The board has the following new features:
1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two
other new pins placed near to the RESET pin, the IOREF that allow the
shields to adapt to the voltage provided from the board. In future, shields
will be compatible with both the board that uses the AVR, which operates
with 5V and with the Arduino Due that operates with 3.3V. The second one
is a not connected pin, that is reserved for future purposes.
Stronger RESET circuit.
9
3.3.1 Arduino pin Diagram:
10
3.3.2 Pin Description:
Microcontroller ATmega328
Operating Voltage 5V
Input Voltage 7-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 mA
POWER:
The Arduino Uno can be powered via the USB connection or with an external power supply.
The power source is selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery.
The adapter can be connected by plugging a 2.1mm center-positive plug into the
board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin
headers of the POWER connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less than
7V,however, the 5V pin may supply less than five volts and the board may be unstable. If
using more than 12V, the voltage regulator may overheat and damage the board. The
recommended range is 7 to 12 volts
11
The power pins are as follows:
V I N : The input voltage to the Arduino board when it's using an external power source
(as opposed to 5 volts from the USB connection or other regulated power source). You can
supply voltage through this pin, or, if supplying voltage via the power jack, access it through
this pin.
5V.This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or
the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the
regulator, and can damage your board. We don't adviseit.
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current drawis
50 mA.
GND. Ground pins.
IOREF. This pin on the Arduino board provides the voltage reference with which the micro-
controller operates. A properly configured shield can read the IOREF pin voltage and
select the appropriate power source or enable voltage translators on the outputs for working with
the 5V or 3.3V.
Memory:
The ATmega328 has 32 KB (with 0.5 KB used for the boot loader). It also has 2 KB of
SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library.
Each of the 14 digital pins on the Uno can be used as an input or output, using pin mode,digital
Write , and digital read functions. They operate at 5 volts. Each pin can provide or receive a
maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms.
In addition, some pins have specialized functions:
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
These pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial
chip.
External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low
value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.
12
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite()
function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication using
the SPI library.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the
LED is on, when the pin is LOW, it's off. The Uno has 6 analog inputs, labeled A0 through A5,
each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure
from ground to 5 volts, though is it possible to change the upper end of their range using the AREF
pin and the analog Reference function. Additionally, some pins have specializedfunctionality:
TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire library.
AREF: Reference voltage for the analog inputs. Used with analog Reference.
Reset: Bring this line LOW to reset the micro-controller. Typically used to add a
resetbutton to shields which block the one on theboard.
See also the mapping between Arduino pins and ATmega328 ports. The mapping for
theAtmega8, 168, and 328 is identical.
Communication:
The Arduino Uno has a number of facilities for communicating with a computer,
another Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V)
serial communication, which is available on digital pins 0 (RX) and 1 (TX). An
ATmega16U2 on the board channels this serial communication over USB and appears as
a virtual com port to software on the computer. The '16U2 firmware uses the standard
USB COM drivers, and no external driver is needed. However, on Windows, a .inf
file is required. The Arduino software includes a serial monitor which allows simple
textual data to be sent to and from the Arduino board. The RX and TX LEDs on the
board will flash when data is being transmitted via the USB-to-serial chip and USB
Connection to the computer(but not for serial communication on pin 0 and pin 1.
13
1).USB Overcurrent Protection:
The Arduino Uno has a resettable polyfuse that protects your computer's USB ports
from shorts and overcurrent. Although most computers provide their own internal protection,
the fuse provides an extra layer of protection. If more than 500 mA is applied to the USB port,
the fuse will automatically break the connection until the short or overload is removed.
Rather than requiring a physical press of the reset button before an upload, the Arduino
Uno is designed in a way that allows it to be reset by software running on a connected computer.
One of the hardware flow control lines (DTR) of the ATmega8U2/16U2 is connected to the
reset line of the ATmega328 via a 100 nanofarad capacitor. When this line is asserted (taken low),
the reset line drops long enough to reset the chip. The Arduino software uses this capability
to allow you to upload code by simply pressing the upload button in the Arduino environment.
This means that the bootloader can have a shorter timeout, as the lowering of DTR can be well-
coordinated with the start of the upload.
This setup has other implications. When the Uno is connected to either a computer
running Mac OS X or Linux, it resets each time a connection is made to it from software (via USB).
For the following half-second or so, the bootloader is running on the Uno. While it is programmed
to ignore malformed data (i.e. anything besides an upload of new code), it will intercept the first few
bytes of data sent to the board after a connection is opened. If a sketch running on the board receives
one-time configuration or other data when it first starts, make sure that the software with which it
communicates waits a second after opening the connection and before sending this data.
The Uno contains a trace that can be cut to disable the auto-reset. The pads on either side
of the trace can be soldered together to re-enable it.It's labeled "RESET-EN". You may also be able
to disable the auto-reset by connecting a110 ohm resistor from 5V to the reset line; see thisforum
thread for details.
14
Physical Characteristics:
The maximum length and width of the Uno PCB are 2.7 and 2.1 inches respectively, with the
USB connector and power jack extending beyond the former dimension. Four screw holes
allow the board to be attached to a surface or case. Note that the distance between digital pins 7
and 8 is 160 mil (0.16"), not an even multiple of the 100 mil spacing of the other pins.
ARDUINO LAYOUTS:
15
16
3.3.3 APPLICATIONS OFARDUINO
UNO:
Embedded system
Robotics
Motion control rig
DC motor control ( using H-bridge )
Ardupilot( drone hardware and software)
Defense and security defense
Parking lot counter
Home and industrial automation
Game Duino( for creating retro 2D games)
Water quality testing
Data loggers ( used in scientific research)
Xoscillo( open-source oscilloscope)
Count down timer for traffic lights
MQ135 Gas Sensor module for Air Quality having Digital as well as Analog output.
Sensitive material of MQ135 gas sensor is SnO2, which with lower conductivity in
clean air. When the target combustible gas exist, The sensors conductivity is more
higher along with the gas concentration rising. MQ135 gas sensor has high sensitivity
to Ammonia, Sulphide and Benze steam, also sensitive to smoke and other harmful gases.
It is with low cost and suitable for
different
application.
Used for family, Surrounding environment noxious gas detection device, Apply to
ammonia, aromatics, sulfur, benzene vapor, and other harmful gases/smoke, gas detection,
tested concentration range: 10 to 1000 ppm.
17
Figure:MQ135 Gas
Sensor
3 Digital Out You can also use this sensor to get digital output fromthis pin, by setting a
threshold value using the potentiometer.
4 Analog Out This pin outputs 0-5V analog voltage based on the intensity of the gas
18
For Sensor:
1 H -Pins Out of the two H pins, one pin is connected to supply and the other to ground
2 A-Pins TheApins and B pins are interchangeable. These pins will be tied to the
Supply voltage.
3 B-Pins A pins and B pins are interchangeable. One pin will act as output
while the other will be pulled to ground.
Working voltage:DC 5V
19
Preheat duration 20 seconds
Can be used as a Digital or analog sensor
The Sensitivity of Digital pin can be varied using the potentiometer
You 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).
You can also use the analog pin to achieve the same thing. Read the analog values (0- 5V)
using a micro controller, 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.
20
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Ω, Ro: sensor resistance at 100ppm of NH3 in the clean air.
Rs:sensor resistance at various concentrations of
gases.
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.
21
3.4.4 Applications:
The ESP8266 is capable of either hosting an application or offloading all the Wi-
Fi networking functions from another application processor. Each ESP8266 Wi-Fi
module comes pre-programmed with an AT command set firmware, now you can
simply hook this up to your Arduino device and get as much Wi-Fi ability as a Wi-Fi
Shield offers.
22
Inter-Integrated Circuit (I²C) serial communication protocol.
UART (on dedicated pins, plus a transmit-only UART can be enabled onGPIO2).
ESP-01 comes with 8 pins (2 GPIO pins) with PCB (printed circuit
board) trace antenna.
ESP-02 comes with 8 pins, (3 GPIO pins) with a U-FL antenna connector.
23
3.5.2 ESP8266 WiFi Module Pinout:
GPIO0 & GPIO2: – General Purpose I/O Pins. It also known as TX/RX
pins are used for Programming the module or for serial I/O purpose.
3.5.3 Applications:
Wireless Web Server
Geolocation using ESP8266
Pressure Sensors on Railway Tracks
Air Pollution Meter
24
Temperature logging system
World’s smallest IoT project
Wi-Fi controlled robot
25
filter areas are printed black to increase contrast. After a beam of light passes
through the color filter, it passes through yet another polarizer to sharpen the
image and eliminate glare. The image is then available for viewing.
This is the first interfacing example for the parallel port. We will star
with something simple. This example does not use the Bi-directional feature found on
newer ports, thus it should work with most, if noall Parallel Ports. It however does not
show the use of the status port as an input. So what are we interfacing? A 16
Character X 2 Line LCD Module to the Parallel Port. These LCD Modules are very
common these days, and are quite simple to work with, as all the logic required
running them is on board.
3.6.1 Features:
26
A general purpose alphanumeric LCD, with two lines of 16 characters
27
Pin Definition of LCD
In the above table Vcc and Vss are supply pins and VEE (Pin no.3) is used
for controlling LCD contrast. Pin No.4 is Rs pin for selecting the register, there are two
very important registers are there in side the LCD. The RS pin is used for their
selection as follows. If RS=0, the instruction command code register is selected,
allowing the user to send data to be displayed on the LCD. R/W is a read or writes Pin,
which allows the user to write information to the LCD or read information from it.
R/W=1 when reading R/W=0 when writing. The LCD to latch information
presented to its data pins uses the enable (E) pin. The 8-bit data pins, D0-D7, are used
to send information to the LCD or read the contents of the LCD’s internal registers. To
display letters and numbers, we must send ASCII codes for the letters A-Z, and number
0 -9 to these pins while making RS=1.So these are the pins which make as 1 and
symbol A is for Power Supply for LED B/L and K is for the power suplly for LED
B/L and Rs is for instruction or data register select.
28
ABSOLUTE MAXIMUM RATINGS:
Quality control:
Color displays:
In color LCDs each individual pixel is divided into three cells,
or subpixels, which are colored red, green, and blue, respectively, by additional filters
(pigment filters, dye filters and metal oxide filters). Each subpixel can be
controlled independently to yield thousands or millions of possible colors for each pixel.
CRT monitors employ a similar 'subpixel' structures via phosphors, although the
analog electron beam employed in CRTs do not hit exact 'subpixels'.
29
To reduce smudging in a moving picture when pixels do not respond
quickly enough to color changes, so-called pixel overdrive may be used.
2. LCD’s are consist of some microwatts for display in comparison to some mill
watts for LED’s.
5. LCD’s are thinner and lighter when compared to cathode ray tube and LED.
6. NO BURN-IN
3. Low reliability
8.It has individually Liquid crystals which cant complete all blocks of blackLight.
30
3.7 DHT11 SENSOR
31
The temperature range of DHT11 is from 0 to 50 degree Celsius with a 2-
degree accuracy. Humidity range of this sensor is from 20 to 80% with 5% accuracy.
The sampling rate of this sensor is 1Hz .i.e. it gives one reading for every second.
DHT11 is small in size with operating voltage from 3 to 5 volts. The maximum current
used while measuring is 2.5mA
DHT11 sensor has four pins- VCC, GND, Data Pin and a not
connected pin. A pull-up resistor of 5k to 10k ohms is provided for
communication between sensor and micro- controller.
32
Applications
BUZZER:
33
3.8.1 Buzzer Driver:
34
3.9 Power Supply:
The Power Supply is a Primary requirement for the project work. The required
DC power supply for the base unit as well as for the recharging unit is derived from
the mains line. For this purpose center tapped secondary of 12V-012V transformer is used.
From this transformer we getting 5V power supply. In this +5V output is a regulated
output and it is designed using 7805 positive voltage regulator. This is a 3 Pin voltage
regulator, can deliver current up to 800 milliamps.
STEPDOWN AC TO DC 12V
AC SUPPLY TRANSFORME CONVERTO BATTERY REGULATOR
R R
35
3.9.2 Circuit diagram:
The rectified Output is filtered for smoothening the DC, for this purpose capacitor is
used in the filter circuit. The filter capacitors are usually connected in parallel
with the rectifier output and the load. The AC can pass through a capacitor but DC cannot,
the ripples are thus limited and the output becomes smoothed. When the voltage across
the capacitor plates tends to rise, it stores up energy back into voltage and current. Thus,
the fluctuation in the output voltage is reduced considerable.
+12v
IN4007 X2
230V/12V-0-12V 2200uf/25v
100uf/25v
36
VOLTAGE REGULATR:
The advantage of this type of regulator is, it is easy to use and minimize the
number of external components.
The following are the features voltage regulators:
Output current in excess of 1.5A for 78 and 78Lseries
Internal thermal overload protection
No external components
required
Output transistor sage area
protection
Internal short circuit current limit.
Available in aluminum 3
package.
POSITIVEVOLTAGE
REGULATOR
37
High power dissipation capability
Internal short-circuit current limiting
Nominal Regulator
Output Voltage
5V uA7805C
6V uA7806C
8V uA7808C
8.5V uA7885C
10V uA7810C
12V uA7812C
15V uA7815C
18V uA7818C
24V uA7824C
38
3.10 SOFTWARE IMPLEMENTATION:
3.10.1:ARDUINO IDE:
The Arduino IDE consists an editor for writing code, console area, and a series of
buttons with inbuilt functionalities. The Arduino hardware is interfaced to the
Arduino IDE with the help of cable to upload sketches and communicate with each other.
Arduino is a software community, an open source platform, a user-friendly community
that develops and promotes microcontroller established hardware kits for persuasive
interaction with the world. The digital and analog pins assembled on the board
gives the competence to associate with distinct shields. The GNU took the lead in
releasing the Source code of the IDE. For the purpose of Programming and
incorporating with the circuits the Arduino board has specialized pins available for
the interfacing. The ATmega controllers consist of flash memory with a boot loader
for uploading programs into it. The optiboot loader is the default loader for the Arduino
boards. With the utilization of the cables the boards are loaded with the code. The
sketch may be written in any programming language that has the capability in providing
the binary code for the target machines. The Application code is written by the
utilization of Java in the form of cross platform. It has a dedicated software library for
wiring the modules or shields to the boards. In the body of the Arduino editor,
specifically two functions play a predominant role they are the setup and loop functions.
The setup body of code initializes the various variables, their pin modes, set of libraries.
In general loop signifies the unending repetition of sketch.
The software tool used for implementing the software
design is Arduino IDE. The Arduino Integrated Development Environment (IDE) is a cross-
platform application (for Windows, macOS, Linux) that is written in functions from C
and C++. It is used to write and upload programs to Arduino compatible boards, but also,
with the help of third-party cores, other vendor development boards. The source code for
the IDE is released under the GNU General Public License, version 2. The Arduino IDE
supports the languages C and C++ using special rules of code structuring. The Arduino
IDE supplies a software library from the Wiring
39
project, which provides many common input and output procedures. User-written code
only requires two basic functions, for starting the sketch and the main program loop,
that are compiled and linked with a program stub main() into an executable cyclic
executive program with the GNU tool chain, also included with the IDEdistribution.
The Arduino IDE employs the program to convert the executable code into a text
file in hexadecimal encoding that is loaded into the Arduino board by a loader
program in the board's firmware. By default, is used as the uploading tool to flash the
user code onto official Arduino boards. With the rising popularity of Arduino as a
software platform, other vendors started to implement custom open source
compilers and tools (cores) that can build and upload sketches to other micro
controllers that are not supported by Arduino's official line of micro-controllers. In
October 2019 the Arduino organization began providing early access to a new Arduino
Pro IDE with debugging and other advanced feature
STEP2:
To begin, you'll need to install the Arduino Programmer, aka the integrated
development environment (IDE).
STEP3:
Connect your Arduino to the USB port of your computer. This may require a
specific USB cable. Every Arduino has a different virtual serial-port address, so you
'll need to reconfigure the port if you're using different Arduinos.
STEP4
Set the board type and the serial port in the Arduino
Programmer.
40
STEP5:
Test the microcontroller by using one of the preloaded programs, called sketches,
in the Arduino Programmer. Open one of the example sketches, and press the upload
button to load it. The Arduino should begin responding to the program: If you've
set it to blink an LED light, for example, the light should start blinking.
STEP6:
To upload new code to the Arduino, either you'll need to have access to code you
can paste into the programmer, or you'll have to write it yourself, using the
Arduino programming language to create your own sketch. An Arduino sketch
usually has five parts: a header describing the sketch and its author; a section
defining variables; a setup routine that sets the initial conditions of variables and runs
preliminary code; a loop routine, which is where you add the main code that will
execute repeatedly until you stop running the sketch; and a section where you can
list other functions that activate during the setup and loop routines. All sketches must
include the setup and loop routines.
STEP7:
Once you've uploaded the new sketch to your Arduino, disconnect it from your
computer and integrate it into your project as directe.
Either a website or a mobile app is required in order to display the rrading of the gas
sensors So that we have thingSpeak as a website which displays the information in the
form of Graphical representations of the values for every 2 mins of the sensors readings
and we have to connect the ssid key and password to the nodemcu which helps to
transmit the data to the thingSpeak Sever. ThingSpeak Server contains the private and
public mode in order to make people view the particular gases in that particular area
then the administrator has to keep the view as public.ThingSpesk can also the send the
values to the serial monitor so it can read and write the data.Serial Monitor contains the
41
3.11 SYSTEM DESIGN AND IMPLEMENTATION:
3.11.1 SYSTEM DESIGN:
The term design describes a final system and the process by which it is developed.
It refers to the technical specifications that will be applied in implementations the
candidate system. The design may be defined as the process of applying various
techniques and principles for the purpose of defining a device, a process or a system in
sufficient details to permit its physical realization. The designer’s goal is how the
output is to be produced and in what format samples of the output and input are
also presented. Second input data and database files have to be designed to meet the
requirements of the proposed output. The processing phases are handled through the
program Construction and Testing.
42
helps in sending the output data to a centralized server like thingspeak. Thingspeak is
a open source website which helps in connecting with the internet enabled devices
through wi-fi,it allows user to effectively monitor the data and visualize it
collectively.It offers great user interface which allows us to visualize the data graphically.
3.11.2 Circuit Diagram:
43
Detailed Diagram of Air quality Monitoring system:
44
3.12 SYSTEM IMPLEMENTATION:
Westart with connecting the ESP8266 with the Arduino. ESP8266 runs on
3.3V and if you will give it 5V from the Arduino then it won’t work properly and it
may get damage. Connect the VCC and the CH_PD to the 3.3V pin of Arduino. The
RX pin of ESP8266 works on 3.3V and it will not communicate with the Arduino when
we will connect it directly to the Arduino. So, we will have to make a voltage divider
for it which will convert the 5V into 3.3V. This can be done by connecting three
resistors in series like we did in the circuit. Connect the TX pin of the ESP8266 to the
pin 10 of the Arduino and the RX pin of the esp8266 to the pin 9 of Arduino through
the resistors.
45
CHAPTER 4:RESULT
Display of Temp,RH
46
Circuit Diagram
47
Results in ThingSpeak:
48
Serial Monitor Representation values of gas sensors
49
APPLICATIONS AND ADVANTAGES:
Applications:
Prevent smog dangers: This is one of the most important reasons why people use the air
pollution control. ...
Protect their health: This is part of the reason why most people install the air pollution
control. Most of these chemicals could damage the lungs.
Improve their indoor air quality: People use it to improve the air when they are indoors.
Advantages:
Air pollution control helps to protect the human health: To every human on earth, health is
wealth; health is paramount for the running of our day to day activities, without which we
would have to rely on others to live. Air Pollution Scrubber Suppliers come to help protect
our health, which is very valuable.
Air pollution control helps prevent economic wastes: With air pollution control, the
wastes accrued from dead crops and bad water will be limited or stopped. Some California
wine producers complained about how their crops were polluted and customers complained
that the wine had begun to taste like sulfur. With the presence of air pollution control,
economic slowdowns like this will be prevented or at least managed to the barest minimum.
Increased worker productivity: No matter how strong the immune system is, there are times
when it fails, especially when there is excess air pollution. As pollution is controlled, workers
can now work for a longer period of time.
Helps improve indoor air quality: Air pollution control helps to secure the quality of the
air inside your house.
Prevent smog dangers: This is one of the most important reasons why people use the air
pollution control. Smog can be very hazardous, which is why air pollution control should be
installed at an early stage to prevent smog.
Protect their health: This is part of the reason why most people install the air pollution
control. Most of these chemicals could damage the lungs.
Improve their indoor air quality: People use it to improve the air when they are indoors.
50
CHAPTER 5:CONCLUSION AND FUTURE SCOPE
Our system mainly focussed on monitoring the harmful pollutants in air using
wireless gas sensors and esp8266 wi-fi module which helps in monitoring the results.
The proposed system is very much easy to implement. The concept is much new and
we detect number of gases. The arduino and sensors are very less expensive so we can
implement this system in high pollution areas. In futurethis type of systems have to be
implemented because with help of this sytem we can actually detect and monitor the
pollution of air and sound. In big cities this system is very much useful because
implmentation cost is very much less these the big systems. So we have to think about
future and make world pollution free.
51
REFERENCES:
G. Parmar, S. Lakhani, and M. Chattopadhyay, “An IoT based low cost air pollution monitoring
system,” in 2017 International Conference on Recent Innovations in Signal processing and Embedded
Systems (RISE), Bhopal, India, October 2017.
G. Rout, S. Karuturi, and T. N. Padmini, “Pollution monitoring system using IoT,” ARPN Journalof
Engineering and Applied Sciences, vol. 13, pp. 2116–2123, 2018.
B. C. Kavitha, D. Jose, and R. Vallikannu, “IoT based pollution monitoring system using
raspberry–PI,” International Journal of Pure and Applied Mathematics, vol. 118, 2018.
Asmi, A., Putra, J. C. P., &Rahman, I. B. A., “A Study of Indoor Air Quality of Public Toilet
in University's Building”, in Humanities, Science and Engineering (CHUSER), IEEE
Colloquium
I-Haija, Q. A., Al-Qadeeb, H., &AlLwaimi, A.,“Case study: Monitoring of air quality in king
Faisal University using a microcontroller and WSN”, Procedia Computer Science, volume
52
APPENDIX:
Code For Sensors:
#include <LiquidCrystal.h>
LiquidCrystal lcd(8,9,10,11,12,13);
#include <SoftwareSerial.h>
#include <DHT.h>
int DHTTYPE = DHT11;
int relay1 = 7;
int relay2 = 6;
int DHTPIN = 4;
int sensor1 = A0;
int sensor2 = A1;
int value1 = 0;
int value2 = 0;
DHT DHT(DHTPIN, DHTTYPE);
#define buz 5
void setup()
{
Serial.begin(9600);
lcd.begin(16,2);
DHT.begin();
pinMode(relay1,OUTPUT);
pinMode(relay2,OUTPUT);
pinMode(sensor1,INPUT);
pinMode(sensor2,INPUT);
pinMode(buz,OUTPUT);
lcd.print("Air Monitoring");
lcd.setCursor(0,1);
lcd.print(" system");
delay(1500);
lcd.clear();
}
void loop()
53
{
float h = DHT.readHumidity();
float t = DHT.readTemperature();
value1 = analogRead(A0);
value2 = analogRead(A1);
Serial.println(value1);
Serial.println(",");
Serial.println(value2);
Serial.println(",");
Serial.println(h);
Serial.println(",");
Serial.println(t);
if(value1 < 200)
{
lcd.print("Gas PPM Level ");
lcd.setCursor(0,1);
lcd.print("High in Air");
digitalWrite(relay1,LOW);
digitalWrite(buz,HIGH);
delay(1500);
lcd.clear();
}
if(value2 > 300)
{
lcd.print("Smoke PPM Level");
lcd.setCursor(0,1);
lcd.print("High in Air");
digitalWrite(relay2,HIGH);
digitalWrite(buz,HIGH);
delay(1500);
lcd.clear();
}
else
{
54
digitalWrite(relay1,LOW);
digitalWrite(relay2,LOW);
digitalWrite(buz,LOW);
}
}
55
lcd.print("USING NODEMCU");
lcd.setCursor(0, 1);
lcd.print("AND THINGSPEAK");
delay(1000);
Serial.println("Connecting to ");
Serial.println(ssid);
lcd.clear();
lcd.print("Connecting to ");
lcd.setCursor(0, 1);
lcd.print(ssid);
WiFi.begin(ssid, pass);
56
}
void loop()
{
if (Serial.available() > 0)
{
Serial.print("if serial available");
BMPValue = Serial.readStringUntil(',');
Serial.read();
TempValue = Serial.readStringUntil(',');
Serial.read();
TiltValue = Serial.readStringUntil('\0');
Serial.print("BMPValue---------- >");
Serial.print(BMPValue);
Serial.print(TempValue);
Serial.print(TiltValue);
}
57
client.print("Content-Type: application/x-www-form-urlencoded\n");
client.print("Content-Length: ");
client.print(postStr.length());
client.print("\n\n");
client.print(postStr);
Serial.print("postStr====>");
Serial.print(postStr);
delay(500); lcd.clear();
lcd.print("Data sent to ");
lcd.setCursor(0, 1);
lcd.print(" Thingspeak");
delay(1000);
}
else
{
Serial.print("else serial available");
lcd.clear();
lcd.print("Data not sent ");
lcd.setCursor(0, 1);
lcd.print(" to Thingspeak");
delay(1000);
}
client.stop(); lcd.clear();
lcd.print("Reading...");
delay(2000);
}
58