Air Quality Monitoring System

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 50

CHAPTER 1

INTRODUCTION AND BACKGROUND

1.1 Introduction

he Air Excellence Guide (AEG) may be a common indicator of air quality. The Air
Quality Indicator (AQI) is calculated and supported on air pollutants like CO and
NO2 compounds that consume opposing possessions happening the atmosphere
and human health. The Air Quality Indicator may be a range that represents the
very finest meditation of a specific air unused matter at a particular time. I propose
an air quality as well as air pollution monitoring system that allows us to monitor
and check live air quality as well as air pollution in an area through Internet of
Things (IoT). It uses air sensors (Gas Sensor MQ135) to sense presence of harmful
gases/compounds in the air and constantly transmit this data. In addition, system
keeps measuring air level and reports it. The sensors interact with Arduino Uno
(Microcontroller) which processes this data and transmits it over the application.
This allows authorities to monitor air pollution in different areas and act against it
[1]. In addition, authorities can keep a watch on the air pollution near schools, and
hospitals areas. Normally, little concentrations area unit measured exploitation ppb
(parts per billion), that represents units of mass of a material per one billion units
of total mass. Parts per million (ppm) may be similar and unremarkable used unit
to measure concentrations of pollutants. It determines the requirements of a new
system and analyze on product and resource requirement, which is required for the
successful system. The product requirement contains input and output
requirements it gives the wants in term of input to produce the required
productivity. The resource requirements define in brief about the hardware that are
needed to achieve the required functionality. In this project I am going to make an

1
IoT based Air Pollution Detection Monitoring System in which I monitor the Air
Quality over a web server using ESP8266 Wi-Fi device and a trigger alarm when
the air quality goes down a certain level means when there is amount of harmful
gases is present in the air like CO2. It shows the air quality in PPM (Parts Per
Million) on LCD and webpage so that I monitor it very easily.

1.2 Purpose of Project

The project is an implementation of IoT (Internet of Things) Based Air Pollution


Monitoring System Using Arduino. Air pollution is a growing issue and it is
necessary to monitor air quality for a better future and healthy living for all. IoT is
getting popular day-by-day and standards are on its way. Therefore, collection of
air quality information is easier. Analysis of monitoring data allows us to assess
how bad air pollution from day to day. According to the recent survey, Dhaka, the
capital of Bangladesh is the third in the list of most air-polluted city. Thus because
of this expansion in the quantity of vehicles contamination is developing quickly
and it influencing people groups wellbeing too. This air contamination makes
disease and harm safe, neurological, regenerative and respiratory framework. In
extraordinary cases, it can likewise cause passing. As indicated by overview 50000
to 100000 unexpected losses occurred to us only because of air contamination [2].
Along these lines, there is a requirement for checking air quality and to monitor it.
IoT is the system of physical gadgets, vehicles, home apparatuses, and different
things implanted with hardware, programming, sensors, and availability which
empowers these articles to associate and trade information. IoT permits articles to
be noticed or controlled. In this paper, I am proposing and going to piloting a
model which IoT to screen air contamination

2
1.3 Objectives of Monitoring Air Quality

The air quality monitoring program design dependent upon the monitoring specific
objectives specified for the air quality management in the selected area of interest.
Defining the output influence, the design of the network and optimize the resources
used for monitoring. It also ensures that the network is specially designed to
optimize the information on the problems at hand. There might be different
objectives for the development of the environmental monitoring and surveillance
system. Normally, the system has to provide on-line data and information transfer
with a direct /automatically/ on-line quality control of the collected data. Several
monitors, sensors and data collection systems to be applied to make on-line data
handover and control likely. The main objectives stated for the development of an
air quality measurement and surveillance program might be to facilitate the
background concentration(s) measurements, monitor current levels as a baseline
for assessment, check the air quality relative to standards or limit values, detect the
importance of individual sources, enable comparison of the air quality data from
different areas and countries, collect data for the air quality management, traffic
and land-use planning purposes, observe trends (related to emissions), develop
abatement strategies, determine the exposure and assess the effects of air pollution
on health, vegetation or building materials, inform the public about the air quality
and raise the awareness, develop warning systems for the prevention of undesired
air pollution episodes, facilitate the source apportionment and identification,
supply data for research investigations, develop/validate management tools (such
as models), develop and test analytical instruments and to support legislation in
relation to the air quality limit values and guidelines. The relationships between the
data collected and the information to be derived from them must be taken into
account when a monitoring program is planned, executed and reported. This

3
emphasizes the need for users and potential users of the data to be involved in
planning surveys, not only to ensure that the surveys are appropriate to their needs
but also to justify committing the resources.

1.4 Air Quality Parameters

The important parameters that are considered in the proposed framework include:
Carbon Dioxide (CO2) – CO2 is colorless, odorless gas and non-combustible gas.
Also, it is measured under the category of smother gases that have ability of
interfering the availability of oxygen for tissues. Carbon Dioxide is a gas vital to
life in the world, because it is one of the most vital elements evolving
photosynthesis process, which converts solar into chemical energy. The
concentration of CO2 has amplified due mainly to massive remnant fuels boiling.
This increase makes plants grow rapidly. The rapid growth of undesirable plants
leads to the increase use of chemicals to eliminate them [3]. Sulphur Dioxide
(SO2) - Sulphur Dioxide is a colorless gas, detectable by the distinct odor and
taste. Like CO2, it is mainly due to fossil fuels boiling and to manufacturing
processes. In high attentions may cause breathing problems, especially in sensitive
groups, like asthmatics. It contributes to acid rains. Nitrogen Dioxide (NO2) –
Nitrogen Dioxide is a brownish gas, easily detectable for its odor, very corrosive
and highly oxidant. It is produced as the result of fossil fuels burning. Frequently
NO terrified to the atmosphere is converted in NO2 by chemical processes. In high
absorptions, NO2 may principal to respiratory problems. Like SO2, it contributes
to acid rains. Smoke - About 1 million people are in custom of tobacco smoking
globally of which majority population is from rising countries. Every year nearly
4.9 million people expired due to smoking allow to 2007 report. In addition,
second hand smoke is serious threat to the health of people of all age’s causes
41000 deaths each year. LPG - Liquefied petroleum gas (LPG) is an odorless and

4
colorless liquid which evaporates readily into a gas. Leakage is generally noticed
by adding an odorant into it. It is considered under the category of highly
flammable gases and it can be classified as a carcinogen and mutagen if Butadiene
content is more than 0.1%. LPG may escape in the form of a gas or a fluid. If it
escapes in the form of a liquid, it vanishes quickly and will eventually form large
cloud of gas in air, which is relatively thicker than air thus drops to the ground.
Whereas, LPG vapors travel along the ground for a long distance and gets
collected in drains or basements. Gas principals to burn or detonate after getting in
touch with a source of ignition. Temperature and humidity- Quantity of
temperature is an important for safety of people and affects our life skills.
Greenhouse outcome can be observed by measuring temperature and comparing
temperature changes from historical to present time especially since the industrial
revolution using climate data. Humidity is a type of gas that guards us from UV
rays from the sun and helps trick heat on Earth, thereby making the climate on
Earth, a pleasant one for living. However, as humidity increases, the warmth on
Earth also increases which makes our life uncomfortable. Humidity is essential for
various storage and food processing facilities.

1.5 Importance of Air Pollution Monitoring System

Air is one of the most basic and important elements for human being to survive.
Clean and Sound air is the key to a good and healthy life. But now days in city life
it has become the most threatened factor. Pollution of air has become the most
concerned and affected issue now for us. A diversity of air pollutants has known or
suspected injurious effects on human health and the atmosphere. In most areas,
these toxins are principally the products of combustion from space warming,
power generation or from motor vehicle traffic flow. Pollutants from these sources
may not only prove a problem in the immediate locality of these sources but can

5
travel long distances. Generally, if someone is young and in a good state of health,
moderate air pollution levels are unlikely to have any serious short term effects.
However, higher levels and long term exposure to air pollution can lead to more
serious symptoms and conditions causing human health. This not only affects the
respiratory and inflammatory response systems, but can also lead to more serious
conditions such as heart disease and cancer. People with lung or heart situations to
be more vulnerable to the effects of air pollution. Air pollution has also been
recognized by doctors as one of the world’s greatest 10 killers seeing some 29,000
premature deaths in UK and 430,000 worldwide in one year. Air pollution can
cause both short term and long term effects on health and many people are
concerned about pollution in the air that they breathe.

6
CHAPTER 2

PROPOSED SYSTEM ARCHITECTURE

2.1 Introduction

The paper aims at designing an air pollution monitoring system which can
be installed in a specific locality and to enhance the system from the previously
developed systems beating the earlier disadvantages by developing an android app
available for the public. This app can be used by anyone to get in live updates
about the pollution in their region. It uses Arduino integrated with individual gas
sensors like carbon monoxide, ammonia along with particulate matter, humidity,
and smoke which measures the concentration of each gas separately. The collected
data is uploaded to the cloud using thing speak platform at regular time intervals.
Ethernet shield is used for connecting Arduino and cloud. Pictorial or graphical
representation of values can be shown in Thing speak The users can install an
android application through which they get the recent updates and graphical
content up to date [6]. The average concentration of each gas is analyzed using
matlab. Then certain time control is assigned based on the standard level of each
gas measured and the result can be viewed in android application. The architecture
of air pollution monitoring and awareness creation system. The concentration level
of each gas can be viewed both as a graph and in numerical format. Based on these
values the air quality index value is calculated and the nature of the air quality in
that area is determined which is also displayed through the app. Along with this,
the health effects for the corresponding air quality is displayed to create awareness
among the public. Additionally, they could also get to know the temperature and
weather in that region. The users will not get disturbed with irrelevant data as the

7
values displayed are location specific and help them stay tuned to the current status
of air pollution

2.2 Proposed System Architecture

Internet of Things (IoT) mainly deals with connecting smart devices to internet by
joining the advantage of OSI layered Architecture. In the context of this work we
propose a cluster of Air Quality Monitoring Gas Sensor MQ135 motes, which are
used to measure the concentration of Air pollutants in the air. The Gas Sensors
MQ135 is interface with a tiny entrenched platform equipped with other [7]. We
have mainly used the Arduino UNO which is an open source development boards
with ESP8266-12E chips. MQ135 Gas Sensor is used to collect gas concentration
measurements. This sensor data would be captured and sent to the Arduino UNO
for IoT (Internet of Things) based data acquirement.

2.3 Circuit Diagram

8
I connect the ESP8266 with the Arduino. ESP8266 runs on 3.3V and connect the
VCC and the CH_EN to the 3.3V pin of Arduino. The RX pin of ESP8266 works
on 3.3V and it communicate with the Arduino when I connect it directly to the
Arduino. So, I have to make a voltage divider for it which convert the 5V into
3.3V. This can be done by connecting three resistors in series like I did in the
circuit. Connect the TX pin of the ESP8266 to the pin 8 of the Arduino and the RX
pin of the esp8266 to the pin 9 of Arduino. ESP8266 Wi-Fi module gives my
projects access to Wi-Fi or internet. Then I connect the MQ135 sensor with the
Arduino. Connect the VCC and the ground pin of the sensor to the 5V and ground
of the Arduino and the Analog pin of sensor to the A0 of the Arduino. Connect a
buzzer to the pin 7 of the Arduino which start to beep when the condition becomes
true. In last, I connect LCD with the Arduino [8]. The connections of the LCD are
as follows Connect pin VCC to the 5V of the Arduino; Connect pin GND to the
GND of the Arduino; Connect pin RS to the pin 12 of the Arduino; Connect pin
RW & GND (Read/Write) to used Jumper pin; Connect pin E to the pin 11 of the
Arduino; The following four pins are data pins which are used to communicate
with the Arduino; Connect pin D4 to pin 5 of Arduino; Connect pin D5 to pin 4 of
Arduino; Connect pin D6 to pin 3 of Arduino; Connect pin D7 to pin 2 of Arduino.

9
CHAPTER – III

MODULE DESCRIPTION

3.1 ARDUINO

Arduino interface boards provide the engineers,artists,designers,hobbyists and


anyone who tinker with technology with a low-cost,easy-to-use technology to
create their creative,interactiveobjects,useful projects etc.,A whole new breed of
projects can now be built that can be controlled from a computer.

WHAT IS ARDUINO?

Figure 3.1 ARDUINO UNO

Arduino is a open source electronics prototyping platform based on


flexible,easy-to-use hardware and software.It’s intended for
artists,designers,hobbyists,and anyone interested in creating interactive objects or
environments.It’s an open-source physical computing platform based on a
microcontroller board,and a development environment for writing software for the
board.

10
In simple words,Arduino is a small microcontroller board with a USB plug to
connect to your computer and a number of connection sockets that can be wired up
to external electronics,such as motors,relays,lightsensors,laser
diodes,loudspeakers,microphones,etc.,They can either be powered through the USB
connection from the computer or from a 9V battery.They can be controlled from
the computer or programmed by the computer and then disconnected and allowed
to work independently.

Anyone can buy this device through online auction site or search engine.Since
the Arduino is an open-source hardware designs and ccreate their own clones of the
Arduino and sell them,so the market for the boards is competitive.An official
Arduino costs about $30,and a clone often less than $20.

The name “Arduino” is reserved by the original makers. However, clone Arduino
designs often
have the letters “duino” on the end of their name, for example, Freeduino or
DFRduino. The software for programming your Arduino is easy to use and also
freely available for Windows, Mac, and LINUX computers at no cost.

Microcontroller
Microcontroller can be described as a computer embedded on a rather small circuit
board.To describe the function of a microcontroller more precisely,it is a single
chip that can perform various calculations and tasks,and send/receive signals from
other devices via the available pins. Precisely what tasks andcommunication with
the world it does, is what is governed by what instructions we give tothe
Microcontroller. It is this job of telling the chip what to do, is what we refer to as
programming on it.
11
However, the uC by itself, cannot accomplish much; it needs several
external inputs: power, for one; a steady clock signal, for another. Also, the job of
programming it has to be accomplished by an external circuit. So typically, auC is
used along with a circuit which provides these things to it; this combination is
called a microcontroller board. The Arduino Uno that you have recieved, is one
such microcontroller board. The actual microcontroller at its heart is the chip called
Atmega328. The advantages that Arduino offers over other microcontroller boards
are largely in terms of reliability of the circuit hardware as well as the ease of
programming and using it.

OPEN-SOURCE HARDWARE
Open-source hardware shares much of the principles and approach of free
and open-source software.The founders of Arduino wanted people to study their
hardware,to understand how it works,make changes to it,and share those changes
with the world.To facilitate this,they release all of the original design files(Eagle
CAD)for the Arduinohardware.These files are licensed under a Creative Common
Attribution Share-Alike license,which allows for both personal and commercial
derivative works,as long as they(people) credit Arduino and release their designs
under the same license.
The Arduino software is also oen-source.The source code for the Java
environment is released under the GPL and the C/C++ microcontroller libraries are
under the LGPL

12
HISTORY OF ARDUINO
While teaching a physical computing class at the Interaction Design Institute
Ivrea in 2005, Massimo Banzi’s students were unwilling to spend the 76 euros for
the BASIC Stamp microcontrollers commonly used in such applications. Banzi and
his collegues looked for alternatives, finally settling on the wiring platform
developed by one of Banzi’s students. In his own words:
“…we started to figure out how could we make the whole platform even simpler,
even cheaper, even easier touse. And then we started to essentially reimplement the
whole thing as an open source project.” Once they had a prototype, a student wrote
the software that would allow wiring programs to run on the new platform. Upon
seeing the project, visiting professor Casey Reas suggested that there might be
wider applications than just design schools for the new product. The prototype was
redesigned for mass production and a test run of 200 boards was made. Orders
began coming in from other design schools and the students looking for Arduinos,
and the Arduino project was born and MassimoBanzi and David Cuartielles
became its founders.”ARDUINO” is an Italian word,meaning “STRONG
FRIEND”.The English version of the name is “Hardwin”. As of May 2011,more
than 300,000 Arduino units are “in the wild”.
Design Goals
 Work with a Mac (as most design students use one)
 USB connectivity (MacBooks don’t have serial ports
 Look nice
 Cheap (about 20 euros, the cost of going out for pizza in Europe)
 More powerful than a BASIC stamp
 Something you could build/fix yourself
Simple and easy to use by someone without formal electronics training

13
Business Models
Since the entire project is open source, anyone can build and sell Arduino-
compatible devices. So in this sense, the Arduino project relies heavily on its
branding for it’s financial success . Other projects manufacture compatible and
cheaper boards, however people are loyal to the Arduino branded boards because
they associate quality and a certain image to the
final product .
By the Numbers
Year Units Sold
2005 200
2006 10 000
2010 120 000
2011 300 000

Competitors
Before Arduino, the largest players in the design/hobbyist market segment were
the PIC microcontroller family (made by Microchip) and the BASIC Stamp (made
by Parallax). Since the introduction of the Arduino, other large companies have
tried to enter the hobbyist market, including Texas Instruments , and even
Microsoft . However, the open-sourced tools

14
of the Arduino and the size of its community are large barriers for new platforms
to overcome.

COMMUNITY

As the project is aimed at students and hobbyists who may not have any
formal electronics background, there are many excellent guides online covering
everything from making a light blink to creating a laser harp. The official forum
has almost 60 000 registered users, and along with helping users with their
projects, is extremely active in developing new libraries to extend the functionality
of the Arduino . The open-source share and share alike sentiment is very strong,
and the vast majority of users freely publish the code to their projects.

PHYSICAL COMPUTING
Physical Computing is an approach to learn how humans communicate
through computers that starts by considering how humans express themselves
physically.

15
PLATFORM

HARDWARE

ARDUINO Board Layout

Figure 1 ARDUINO board layout

ARDUINO pin diagram

Figure 2 ARDUINO pin diagram


ATmega8(Microcontroller)

16
 16 MHz
 8 Kbyte Flash RAM(1K taken by the boot loader)
 1 Kbyte RAM(eg.for auto/local variables and stack)
 14 digital Input/Output Ports

Figure 3 ATmega8

Single chip USB to async. Serial data transfer


interface

 USB 2.0 compatible


 Transmit and receive LED frive signals
 256 Byte receive,128 Byte transmit buffer
 Data transfer rate from 300bits/sec to 2
Mb/sec

Fig2.1 Android Software Architecture


The OFF-the shelf adapter
 must be a DC adapter (i.e. it has to put out
DC, not AC)
 should be between 9V and 12V DC
 must be rated for a minimum of 250mA
current output, although you will likely
17
want something more like 500mA or 1A output, as it gives you the current
necessary to power a servo or twenty LEDs if you want to.
 must have a 2.1mm power plug on the Arduino end, and
 the plug must be "centre positive", that is, the middle pin of the plug has to
be the + connection.
Current rating: Since you'll probably be connecting other things to the Arduino
(LEDs, LCDs, servos) you should get an adapter that can supply at least 500mA, or
even 1000 mA (1 ampère). That way you can be sure you have enough juice to
make each component of the circuit function reliably.
The Arduino's on-board regulator can actually handle up to 20V or more, so you
can actually use an adapter that puts out 20V DC. The reasons you don't want to do
that are twofold: you'll lose most of that voltage in heat, which is terribly
inefficient. Secondly, the nice 9V pin on the
Arduino board will actually be putting out 20V
or so, which could lead to potential disaster
when you connect something expensive to
what you thought was the 9V pin. Our advice is
to stick with the 9V or 12V DC adapter.

ARDUINO flavors!!
There have been many revisions of the USB
Arduino.some of them are
1. Arduino UNO:
This is the latest revision of the basic Arduino USB board. It connects to the
computer with a standard USB cable and contains everything else you need to
program and use the board. It can be extended with a variety of shields: custom
daughter-boards with specific features. It is similar to the Duemilanove, but has a

18
different USB-to-serial chip the ATMega8U2,
and newly designed labeling to make inputs
and outputs easier to identify.
2. Arduino Mega 2560:
A larger, more powerful Arduino board.
Has extra digital pins, PWM pins, analog
inputs, serial ports, etc.The version of the
Mega released with the Uno, this version
features the Atmega2560, which has twice the memory, and uses
the ATMega 8U2 for USB-to-serial communication.
3. ArduinoDuemilanove:
The Duemilanove automatically
selects the appropriate power
supply (USB or external power),
eliminating the need for the power
selection jumper found on previous boards. It also adds an easiest to cut
trace for disabling the auto-reset, along with a solder jumper for re-
enabling it.
Note: around March 1st, 2009, the Duemilanove started to ship with
the ATmega328p instead of theATmega168.

4. ArduinoFio:
An Arduino intended for use as a
wireless node. Has a header for
an XBee radio, a connector for
a LiPobattery, and a battery

19
chargingcircuit.

20
5. LilyPad Arduino:

A stripped-down, circular Arduino board


designed for stitching into clothing and
other fabric/flexible applications. Needs
an additional adapter to communicate
with a computer.

6. ArduinoDiecimila:

The main change in the ArduinoDiecimila is that it can be reset from the
computer, without the need to physically
press the reset button on the board. The
Diecimila uses a low dropout voltage
regulator which lowers the board's power
consumption when powered by an
external supply (AC/DC adapter or
battery). A resettable polyfuse protects
your computer's USB ports from shorts
and surges. It also provides pin headers for
the reset line and for 3.3V. There is a

21
built-in LED on pin 13. Some blue Diecimila boards say "Prototype - Limited
Edition" but are in fact fully-tested production boards (the actual prototypes are
red).

7. LilypadArduino 03

This revision has a 6-pin programming header that's compatible with FTDI
USB cables and the Sparkfun FTDI Basic Breakout. It adds support for
automatic reset, allowing sketches to be uploaded without pressing the reset
button on the board. The header is surface mounted, meaning that the board has
no pokey bits sticking out the back.

22
8. Arduino NG Rev.C

Revision C of the Arduino NG does not have


a built-in LED on pin 13 - instead you'll see
two small unused solder pads near the labels
"GND" and "13". There is, however, about
1000 ohms of resistance on pin 13, so you
can connect an LED without external
resistor.

9. Arduino Extreme

The Arduino Extreme uses many more surface


mount components than previous USB
Arduino boards and comes with female pin
headers. It also has RX and TX LEDs that indicate when data is being sent to or
from the board.

10.Arduino Mini 04

On this version of the Arduino Mini, two of


the pins changed. The third pin became
23
reset (instead of ground) and fourth pin became ground (instead of being
unconnected). These boards are labelled "Mini 04".

Still
there are
,Arduino S
erial,Ard ui
no Serial

v2.0,Arduino Nano 3.0,Arduino Nano 2.x,Serverino(S3V3),Arduino Stamp


02,Mini USB adapter 03,Mini USB Adapter,Arduino
Bluetooth.

Figure 4 Different FlavoursOf ARDUINO with their Configuration

Basic Terminologies in ARDUINO:

24
1.Analog to digital converter(ADC)
The process of Analog to digital conversion is shown in figure.
The Arduino has 10 bits of Resolution when reading analog signals.
2 power 10=1024 increments
Influence also by how fast you sample

2.Pulse width modulation (PWM)


The Arduino has 8bit of resolution,when outputting a signal using PWM.The range
of output voltage is from 0 to 5 Volts
2power 8=255 Increments
Average of on/off(digital signals to make an average voltage),Duty cycle in 100%
of 5Volts.
LANGUAGE REFERENCES:
The Microcontroller on the board is programmed using the Arduino
programming language(based on wiring) and the arduino development
environment(based on processing).
Arduino Programming Language(APL)(based on wiring)
The Arduino programming language is an implementation of Wiring, a similar
physical computing platform, which is based on the Processing multimedia
programming environment.
Wiring
Wiring is an open-source programming framework for microcontrollers. Wiring
allows writing cross-platform software to control devices attached to a wide range
of microcontroller boards to create all kinds of creative coding, interactive objects,
spaces or physical experiences. The framework is thoughtfully created with
25
designers and artists in mind to encourage a community where beginners through
experts from around the world share ideas, knowledge and their collective
experience. There are thousands of students, artists, designers, researchers, and
hobbyists who use Wiring for learning, prototyping, and finished professional
work production.
Arduino development environment(based on processing)
Processing
Processing is an open source programming language and environment for people
who want to create images, animations, and interactions. Initially developed to
serve as a software sketchbook and to teach fundamentals of computer
programming within a visual context, Processing also has evolved into a tool for
generating finished professional work. Today, there are tens of thousands of
students, artists, designers, researchers, and hobbyists who use Processing for
learning, prototyping, and production.

Software
The software used by the arduino is Arduino IDE.

heArduino IDE is a cross-platform application written in Java, and is derived from


the IDE for the Processing programming language and the Wiringproject. It is
designed to introduce programming to artists and other newcomers unfamiliar with
software development. It includes a code editor with features such as syntax
highlighting, brace matching, and automatic indentation, and is also capable of
compiling and uploading programs to the board with a single click. There is
typically no need to edit makefiles or run programs on acommand-line interface.
Although building on command-line is possible if required with some third-party
tools such as Ino.

26
The Arduino IDE comes with a C/C++ library called "Wiring" (from the project of
the same name), which makes many common input/output operations much easier.
Arduino programs are written in C/C++, although users only need define two
functions to make a runnable program:

 setup() – a function run once at the start of a program that can initialize settings
 loop() – a function called repeatedly until the board powers off

3.2 POWER SUPPLY UNIT

All electronic circuits works only in low DC voltage, so we need a power


supply unit to provide the appropriate voltage supply for their proper functioning
.This unit consists of transformer, rectifier, filter & regulator. AC voltage of
typically 230v rms is connected to a transformer voltage down to the level to
the desired ac voltage. A diode rectifier that provides the full wave rectified
voltage that is initially filtered by a simple capacitor filter to produce a dc
voltage. This resulting dc voltage usually has some ripple or ac voltage
variation . A regulator circuit can use this dc input to provide dc voltage that not
only has much less ripple voltage but also remains the same dc value even the dc
voltage varies some what, or the load connected to the output dc voltages
changes.

Fig 24.General Block of Power Supply Unit

27
DIODE BRIDGE RECTIFIER

Fig25 : Diode Bridge Rectifier

A diode bridge or bridge rectifier is an arrangement of four


diodesconnected in a bridge circuitas shown below, that provides the same polarity
of output voltage for any polarity of the input voltage. When used in its most
common application, for conversion of alternating current (AC) input into direct
current(DC) output, it is known as a bridge rectifier. The bridge rectifier provides
full wave rectification from a two wire AC input (saving the cost of a center tapped
transformer) but has two diode drops rather than one reducing efficiency over a
center tap based design for the same output voltage.

Fig 26: Schematic Of A Diode Bridge Rectifier

The essential feature of this arrangement is that for both polarities of the voltage at
the bridge input, the polarity of the output is constant.

28
BASIC OPERATION OF DIODE BRIDGE RECTIFIER

When the input connected at the left corner of the diamond is positive with
respect to the one connected at the right hand corner, current flows to the right
along the upper colored path to the output, and returns to the input supply via the
lower one.

operation of diode bridge rectifier

When the right hand corner is positive relative to the left hand corner, current
flows along the upper colored path and returns to the supply via the lower colored
path.

AC, half-wave and full wave rectified signals

29
In each case, the upper right output remains positive with respect to the
lower right one. Since this is true whether the input is AC or DC, this circuit not
only produces DC power when supplied with AC power: it also can provide what
is sometimes called "reverse polarity protection". That is, it permits normal
functioning when batteries are installed backwards or DC input-power supply
wiring "has its wires crossed" (and protects the circuitry it powers against damage
that might occur without this circuit in place).

Prior to availability of integrated electronics, such a bridge rectifier was


always constructed from discrete components. Since about 1950, a single four-
terminal component containing the four diodes connected in the bridge
configuration became a standard commercial component and is now available with
various voltage and current ratings.

TRANSFORMER: A transformer is a static piece of which electric power in one


circuit is transformed into electric power of same frequency in another circuit. It can
raise or lower the voltage in the circuit, but with a corresponding decrease or increase
in current. It works with the principle of mutual induction. In our project we are using
a step down transformer to providing a necessary supply for the electronic circuits.
Here we step down a 230v ac into 12v ac.

RECTIFIER: A dc level obtained from a sinusoidal input can be improved 100%


using a process called full wave rectification. Here in our project for full wave
rectification we use bridge rectifier. From the basic bridge configuration we see that
two diodes(say D2 & D3) are conducting while the other two diodes (D1 & D4) are
in off state during the period t = 0 to T/2.Accordingly for the negative cycle of the
input the conducting diodes are D1 & D4 .Thus the polarity across the load is the
same.
30
In the bridge rectifier the diodes may be of variable types like 1N4001, 1N4003,
1N4004, 1N4005, IN4007 etc… can be used . But here we use 1N4007, because it can
withstand up to 1000v.

FILTERS: In order to obtain a dc voltage of 0 Hz, we have to use a low pass filter. so
that a capacitive filter circuit is used where a capacitor is connected at the rectifier
output& a dc is obtained across it. The filtered waveform is essentially a dc voltage
with negligible ripples & it is ultimately fed to the load.

REGULATORS: The output voltage from the capacitor is more filtered & finally
regulated. The voltage regulator is a device, which maintains the output voltage
constant irrespective of the change in supply variations, load variations & temperature
changes. Here we use fixed voltage regulator namely LM7805.The IC LM7805 is a
+5v regulator which is used for microcontroller.

Circuit Diagram:

Fig29 power supply unit

FEATURES & DESCRIPTION OF REGULATORS

• Output Current up to 1A

• Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V


31
• Thermal Overload Protection

• Short Circuit Protection

• Output Transistor Safe Operating Area Protection

The KA78XX/KA78XXA series of three-terminal positive regulator are


available in the TO-220/D-PAK package and with several fixed output voltages,
making them useful in a wide range of applications. Each type employs internal
current limiting, thermal shut down and safe operating area protection, making it
essentially indestructible. If adequate heat sinking is provided, they can deliver
over 1A output current. Although designed primarily as fixed voltage regulators,
these devices can be used with external components to obtain adjustable voltages
and currents.

Introduction to NodeMCU

Introduction

NodeMCU is an open source LUA based firmware developed for ESP8266 wifi
chip. By exploring functionality with ESP8266 chip, NodeMCU firmware comes
with ESP8266 Development board/kit i.e. NodeMCU Development board.

32
NodeMCU Development Board/kit v0.9 (Version1)

Since NodeMCU is open source platform, their hardware design is open for
edit/modify/build.

NodeMCUDev Kit/board consist of ESP8266 wifi enabled chip. The ESP8266 is a


low-cost Wi-Fi chip developed by Espressif Systems with TCP/IP protocol. For
more information about ESP8266, you can refer ESP8266 WiFi Module.

There is Version2 (V2) available for NodeMCUDev Kit i.e. NodeMCU


Development Board v1.0 (Version2), which usually comes in black colored PCB.

33
NodeMCU Development Board/kit v1.0 (Version2)

For more information about NodeMCU Boards available in market


refer NodeMCU Development Boards

NodeMCUDev Kit has Arduino like Analog (i.e. A0) and Digital (D0-D8) pins on
its board.

It supports serial communication protocols i.e. UART, SPI, I2C etc.

Using such serial protocols we can connect it with serial devices like I2C enabled
LCD display, Magnetometer HMC5883, MPU-6050 Gyro meter + Accelerometer,
RTC chips, GPS modules, touch screen displays, SD cards etc.

34
How to start with NodeMCU?

NodeMCU Development board is featured with wifi capability, analog pin, digital
pins and serial communication protocols.

To get start with using NodeMCU for IoT applications first we need to know about
how to write/download NodeMCU firmware in NodeMCU Development Boards.
And before that where this NodeMCU firmware will get as per our requirement.

There is online NodeMCU custom builds available using which we can easily get
our custom NodeMCU firmware as per our requirement.

To know more about how to build custom NodeMCU firmware online and
download it refer Getting started with NodeMCU

How to write codes for NodeMCU?

After setting up ESP8266 with Node-MCU firmware, let’s see the IDE (Integrated
Development Environment) required for development of NodeMCU.

NodeMCU with ESPlorer IDE

Lua scripts are generally used to code the NodeMCU. Lua is an open source,
lightweight, embeddable scripting language built on top of C programming
language.

For more information about how to write Lua script for NodeMCU
refer Getting started with NodeMCU using ESPlorerIDE

NodeMCU with Arduino IDE

Here is another way of developing NodeMCU with a well-known IDE i.e.


Arduino IDE. We can also develop applications on NodeMCU using Arduino

35
development environment. This makes easy for Arduino developers than
learning new language and IDE for NodeMCU.

Basic 16x 2 Characters LCD - Black on Green 5V:

Description:

This is a basic 16 character by 2-line display. Black text on Green background.


Utilizes the extremely common HD44780 parallel interface chipset. Interface code
is freely available. We will need ~11 general I/O pins to interface to this LCD
screen. Includes LED backlight.

Fig3.4.1 16/2 character LCD display

Pin Description: The most commonly used LCDs found in the market today are 1
Line, 2 Line or 4 Line LCDs which have only 1 controller and support at most of
80 characters, whereas LCDs supporting more than 80 characters make use of 2
HD44780 controllers.

36
Fig 3.4.2 Pin Description of LCD

Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16
Pins (two pins are extra in both for back-light LED connections). Pin description is
shown in the table below.

Figure 3.4.3: Character LCD type HD44780 Pin diagram

37
Pin description of character LCD:

Pin No. Name Description


Pin no. 1 VSS Power supply (GND)
Pin no. 2 VCC Power supply (+5V)
Pin no. 3 VEE Contrast adjust
0 = Instruction input
Pin no. 4 RS
1 = Data input
0 = Write to LCD module
Pin no. 5 R/W
1 = Read from LCD module
Pin no. 6 EN Enable signal
Pin no. 7 D0 Data bus line 0 (LSB)
Pin no. 8 D1 Data bus line 1
Pin no. 9 D2 Data bus line 2
Pin no. 10 D3 Data bus line 3
Pin no. 11 D4 Data bus line 4
Pin no. 12 D5 Data bus line 5
Pin no. 13 D6 Data bus line 6
Pin no. 14 D7 Data bus line 7 (MSB)

Table 3.4.1: Character LCD pins with 1 Controller

Pin No. Name Description


Pin no. 1 D7 Data bus line 7 (MSB)
Pin no. 2 D6 Data bus line 6
Pin no. 3 D5 Data bus line 5

38
Pin no. 4 D4 Data bus line 4
Pin no. 5 D3 Data bus line 3
Pin no. 6 D2 Data bus line 2
Pin no. 7 D1 Data bus line 1
Pin no. 8 D0 Data bus line 0 (LSB)
Enable signal for row 0 and 1
Pin no. 9 EN1
(1stcontroller)
0 = Write to LCD module
Pin no. 10 R/W
1 = Read from LCD module
0 = Instruction input
Pin no. 11 RS
1 = Data input
Pin no. 12 VEE Contrast adjust
Pin no. 13 VSS Power supply (GND)
Pin no. 14 VCC Power supply (+5V)
Enable signal for row 2 and 3
Pin no. 15 EN2
(2ndcontroller)
Pin no. 16 NC Not Connected

Table 3.4.2: Character LCD pins with 2 Controller

LCD Background:

Frequently, an 8051 program must interact with the outside world using
input and output devices that communicate directly with a human being. One of the
most common devices attached to an 8051 is an LCD display. Some of the most
common LCDs connected to the 8051 are 16x2 and 20x2 displays. This means 16
characters per line by 2 lines and 20 characters per line by 2 lines, respectively.

39
Interfacing Example - 16 Characters x 2 Lines LCD:

Description: This is the first interfacing example for the Parallel Port. We will
start with something simple. This example doesn't use the Bi-directional feature
found on newer ports, thus it should work with most, if no all Parallel Ports. It
however doesn't show the use of the Status Port as an input. A 16 Character x 2
Line LCD Modules 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.

Schematic:

Fig 3.4.4 Schematic Diagram of 2 line 16 character LCD display

Circuit Description:

Above is the quite simple schematic. The LCD panel's Enable and
RegisterSelect is connected to the Control Port. The Control Port is an open
collector / open drain output. While most Parallel Ports have internal pull-up
resistors, there is a few which don't. Therefore by incorporating the two 10K
external pull up resistors, the circuit is more portable for a wider range of

40
computers, some of which may have no internal pull up resistors. We make no
effort to place the Data bus into reverse direction. Therefore we hard wire the R/W
line of the LCD panel, into write mode. This will cause no bus conflicts on the data
lines. As a result we cannot read back the LCD's internal Busy Flag which tells us
if the LCD has accepted and finished processing the last instruction. This problem
is overcome by inserting known delays into our program.

The 10k Potentiometer controls the contrast of the LCD panel. Nothing
fancy here. As with all the examples, I've left the power supply out. We can use a
bench power supply set to 5v or use an onboard +5 regulator. Remember a few de-
coupling capacitors, especially if we have trouble with the circuit working
properly.

GAS SENSOR

A gas detector is a device which detects the presence of various gases within
an area, usually as part of a safety system. This type of equipment is used to detect
a gas leak and interface with a control system so a process can be automatically
shut down. A gas detector can also sound an alarm to operators in the area where
the leak is occurring, giving them the opportunity to leave the area. This type of
device is important because there are many gases that can be harmful to organic
life, such as humans or animals.

Gas detectors can be used to detect combustible, flammable and toxic gases,
and oxygen depletion. This type of device is used widely in industry and can be
found in a variety of locations such as on oil rigs, to monitor manufacture
processes and emerging technologies such as photovoltaic. They may also be used
in firefighting.

41
Gas detectors are usually battery operated. They transmit warnings via a series of
audible and visible signals such as alarms and flashing lights, when dangerous
levels of gas vapors are detected. As detectors measure a gas concentration, the
sensor responds to a calibration gas, which serves as the reference point or scale.
As a sensor’s detection exceeds a preset alarm level, the alarm or signal will be
activated. As units, gas detectors are produced as portable or stationary devices.
Originally, detectors were produced to detect a single gas, but modern units may
detect several toxic or combustible gases, or even a combination of both types.

HUMIDITY SEaNSOR

Humidity sensor for determining the humidity content or relative humidity of air.
Converts relative humidity to output voltage.

SPECIFICATIONS:
Rated Voltage DC 0.8V max.
Operating Temperature 0~60 degreeC.
Rated power < 3.0nA
Operating Humidity 0~100% RH.
Resistance: 75% RH - 20 max. at 25 degreeC.
Storage temperature -30~85 degreeC.

42
43
CHAPTER – IV

PREPARATION OF PRINTIG CIRCUITED BOARD

PCB DESGNING AND FABRICATION

PROCEDURE FOR MAKING THE PCB

PREPARING OF LAYOUT

With the diagram and all the hand, draw a complete layout plan of the circuit
on a sheet of a tracing paper. As a model, for laying the circuit, a thermo cole base
may be used to hold components. Avoid over crowding of components while
making full space utilization. Keep the ground line on the side of the PCB and the
supply line on other side as far as possible. When all the components have been
mounted on the tracing paper sheet fixed on a piece of thermo cole base, take out a
sketch pen for making in such a way that all the connecting wires are equal in
width, termination rounded off. Re-draw draw it on a fresh paper if required.

PAINTING OF PCB

The tracing so prepared has to be imposed over the copper printed circuit
board keeping in view that the component would be mounted from the non-clad
side of the board. Take a PCB lamination sheet and cur a piece of required size of
the board by using hacksaw file edges, put the copper clad sheet on the table
keeping side on the runway the dirt grease and oxide with a sand paper with its
marked side tracing the carbon paper and at her side on top. Since the tracing paper
is transformed you can now reproduce a carbon point over a surface but using ball

44
pen on a hard pencil over the drawing on the transparent side. When the carbon
print has been obtained over the copper clad board drill ropes in the board using a
hand drill. The holes may be draw with 1/32 bit for component lead sand the
carbon should be raised or wiped by mistake.

DEVELOPMENT OF THE PRINTED CIRCUIT DIAGRAM

After painting the board, it will be made by the cool air for sometime. Now
take a plastic tray and get some Fe Cl3 chemical powder. The ferric chloride salt is
then added with 500ml of water. The color of the solution is pink. Color of the salt
is in yellow, now we add three to five drops of dilute HCL or H2SO4. This is
necessary to quicken the process.

ETCHING OF PCB

Now we take the painted copper clad board and dip it in the solution kept in
the tray. After 15 to 25 minutes we see the board, with only printed pattern portion
remaining in other place the copper coating is removed due to the chemical action.
Then the board is taken out and washes in water. After wash the board by using
thinner solution. Now a printed circuit has been formed on the board.

Take fresh water and mix a few teaspoons of FeCL3 add a few drops of
dilute HCL to it, as it speeds the etching process. Shake well immerse the PC Bin
the solution for about 20 minutes occasionally altering the solution by giving the

45
seesaw reaction to the disk storing reduces the etching time. Observe the changing
color on the copper surface. Take out the PCB only when the unpainted portion of
the copper surface is completely dissolved in the

3solution wash the PCB with the water. After the PCB is thoroughly washed
remove the paint by soft pieces of the cloth dipped in thinner or turpentine.

DRILLING OF HOLES

Then take a drilling machine with 1/32 drill bit to make holes for the
incretion of the components use 1/18 drill bit for inset wires and other thick
components.

Now the PCB is ready to use.

ADVANTAGES

 Reliability in operation and low cost.


 Space required becomes less.

DIS ADVANTAGES

 It can’t withstand larger weight such as transformer.

46
MATERIAL REQUIRED

 Copper clad sheet (It is made of hylam or board over


which the sheet copper is pressed.)
 “Paint or Nail polish” or even “PCB Ink”.
 Painting brush, tray.
 Ferric chloride solution and also few drop of dilute HCL or
H2so4.
 Thinner or kerosene or petrol.
 Cotton cloth.
 Trace paper.

47
CHAPTER 5

CONCLUSION

5.1 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 gives the sense of different type of dangerous gas and Arduino is
the heart of this project. Which control the entire process, Arduino module
connects the whole process to LCD and serial monitor is used for the visual
Output.

5.2 Future Scope

The future scope is that device which we are having can be done in a
compact way by reducing the size of the device for further implementation or the
modifications which can be is that detecting the vehicles amount of pollution
which can be determined. In future the range can be made increased according to
the bandwidth for the high range frequencies. Further research can be made by
making the people in the right direction for their welfare. Therefore, there is
another beneficiary by using this device in an app so the all can be used in an GSM
mobile phones for their daily updates by increasing their range.

48
REFERENCE

[1] Ch.V.Saikumar, M.Reji, P.C.Kishoreraja, “IOT Based Air Quality Monitoring


System”, International Journal on Information Theory (IJIT), Vol-117, No.-9,
2017;

[2] Riteeka Nayak, Malaya Ranjan Panigrahy , Vivek Kumar Rai and T Appa Rao
“IOT based air pollution monitoring system”, International Journal on Information
Theory (IJIT) Vol-3, Issue-4, 2017;

[3] Poonam Pal, Ritik Gupta, Sanjana Tiwari, Ashutosh Sharma, “Air Pollution
System Using Arduino”, International Journal on Information Theory (IJIT), Vol-
04, Issue-10, 2017;

[4] D.Arunkumar, K.Ajaykanth, M.Ajithkannan, M.Sivasubramanian, “Smart Air


Pollution Detection And Monitoring Using IoT”, International Journal on
Information Theory (IJIT) Vol-119, No.-15, 2018;

[5] Shanzhi Chen, Hui Xu, Dake Liu, Bo Hu, and Hucheng Wang, “A Vision of
IoT: Applications, Challenges, and Opportunities with China Perspective”, IEEE
INTERNET OF THINGS JOURNAL, VOL.-1, NO.-4, August 2014;

[6] S. Chen, H. Xu, D. Liu, B. Hu and H. Wang, "A Vision of IoT: Applications,
Challenges, and Opportunities with China Perspective," in IEEE Internet of Things
Journal, Vol-1, No.-4, 2014;

49
[7] Ms. Sarika Deshmukh, Mr.Saurabh surendran and Prof.M.P. Sardey, “Air and
Sound Pollution Monitoring System using IoT” International Journal on
Information Theory (IJIT), Vol-5, Issue-6, 2017;

[8] Navreetinder Kaur,Rita Mahajan and Deepak Bagai, “Air Quality Monitoring
System based on Arduino Microcontroller”, International Journal on Information
Theory (IJIT), Vol.-5, Issue-6, June 2016;

[9].Palaghat Yaswanth Sai, “An IoT Based Automated Noise and Air Pollution
Monitoring System”, International Journal on Information Theory (IJIT), Vol.-6,
Issue-3, March 2017;

[10] L.Ezhilarasi, 2 K.Sripriya, 3 A .Suganya , 4 K.Vinodhini, “A System for


Monitoring Air and Sound Pollution using Arduino Controller with IOT
Technology”, International Journal on Information Theory (IJIT), Vol.-3 Issue-2,
2017;

[11] Devahema, P.V. Sai Surya Vamsi, Archit Garg, Abhinav Anand, Desu
Rajasekhar Gupta, “IOT based Air Pollution Monitoring System”, Journal of
Network Communications and Emerging Technologies (JNCET), Vol-8, Issue-4,
2018;

[12] Hardware components Link: https://www.arduino.cc/ [13] ESP8266 Web


Server with Arduino IDE Link: https://randomnerdtutorials.com/esp8266-web-
server-with-arduino-ide/

50

You might also like