Download as pdf or txt
Download as pdf or txt
You are on page 1of 57

MEASURING GAS CONCENTRATION IN AIR USING

ARDUINO
Submitted by

MUTHUVELAN.S Reg. No (19407689)


DEEPAN RAJ.K Reg. No (19407664)
KISHANKUMAR.S Reg. No (19407679)
MOORTHY.S Reg. No (19407688)
KALLEESWARAN.R Reg. No (19407674)

in partial fulfillment for the award of the degree of


DIPLOMA IN ELECTRONICS AND COMMUNICATION
ENGINEERING

SRI RANGANATHAR INSTITUTE OF POLYTECHNIC COLLEGE

ATHIPALAYAM, COIMBATORE – 641110.

Directorate of Technical Education, Chennai – 600025


Government of Tamilnadu
APRIL-2021
ii

SRI RANGANATHAR INSTITUTE OF POLYTECHNIC COLLEGE


(Approved By Govt. of Tamilnadu and AICTE)
Athipalayam,Coimbatore-641110. Ph(0422)-2904008,2904009
E-mail:sripoly@yahoo.co.in

Department of Electronics and Communication Engineering


Certificate

This is to certify that this project report titled

“MEASURING GAS CONCENTRATION IN AIR USING ARDUINO”

Is a bonafide project work done by

MUTHUVELAN.S Reg. No (19407689)


DEEPAN RAJ.K Reg. No (19407664)
KISHANKUMAR.S Reg. No (19407679)
MOORTHY.S Reg. No (19407688)
KALLEESWARAN.R Reg. No (19407674)

Submitted in the partial fulfillment of the requirements for the award of

DIPLOMA IN ELECTRONICS AND COMMUNICATION ENGINEERING


Of

Directorate of Technical Education, Government of Tamil Nadu.

During the year 2020-2021

Project guide Head of the Department


______________________________________________________________________________

Certified that the candidate was examined by using the Project Viva-Voce examination
Held on _____________

Internal Examiner External Examiner


ii
iii
iv

ABSTRACT

Now-a-days air pollution is one of the most important concerns of the world.
Air pollution may evolve from anthropogenic or natural sources. Air pollutants of
atmospheric substances like CO, CO2, SO2, NO2, and O3 suspended particulate
matter (SPM), repairable suspended particulate matter (RSPM), and volatile organic
compounds (VOCs) have a great effect on the people health. Most of the major cities
in developing countries and most cities of the developed countries are suffering from
it. Thus to develop a real time air quality and pollution monitoring system is critical.
We have developed an arduino based air pollution detector which combined a small-
sized, minimum-cost sensor to an arduino microcontroller unit. The advantages of the
detector, have a reliable stability, rapid response recovery and long-life features. It is
affordable, user-friendly, low-cost and minimum-power requirement hardware which
is appropriate for mobile measurement, as well as comprehensible data collection.
v

ACKNOWLEDGEMENT

At this pleasing moment of having successfully completed our project, We wish to

convey our sincere thanks and gratitude to the management of our college and our beloved

Chairman Mr. V.NARAYANASAMY, who has provided all the facilities to us.

We would like to express our sincere thanks to our beloved Vice Chairman

Mr.N.HARIKRISHNAN & Our Director Mrs.B.ARTHI HARIKRISHNAN, for giving us the

opportunity and support.

We would like to express our sincere thanks to our Principal

Mr.M.SATHYAMOORTHI.M.E.,MBA., for forwarding us to do our project and offering

adequate duration in completing our project.

We are also grateful to the Head of Department Mrs. P. KALAIVANI M.E., for his

constructive suggestions & encouragement during our project which leads to the successful

completion of our project.

With deep sense of gratitude, we extend our earnest & sincere thanks to our guide Mr. C

KRISHNAKUMAR, B.E., M.E., Department of Electronics and Communication Engineering

for his kind guidance & encouragement during this project.

We also express our indebt thanks to our Teaching and Non-Teaching Staff

members of ELECTRONICS AND COMMUNICATION ENGINEERING DEPARTMENT,

Sri Ranganathar Institute of Polytechnic College, Athipalayam for their sincere support in

completion of this project.


vi

TABLE OF CONTENTS

CHAPTER TITTLE PAGE


NO NO
ABSTRACT iv

LIST OF FIGURES viii

LIST OF ABBREVATIONS x

1 INTRODUCTION 1

2 PROPOSED SYSTEM 3

3 BLOCK DIAGRAM 5

4 COMPONENTS DESCRIPTION 7

4.1 POWER SUPPLY 8

4.2 TYPES OF BRIDGE RECTIFIERS 10

4.3 IC VOLTAGE REGULATORS 13

4.4 TRANSFORMER 15

4.5 ARDUINO 16

4.6 LCD 22

4.7 LED 23

4.8 MQ135 SENSOR 23


vii

5 CIRCUIT DIAGRAM 25

6 PROGRAM 28

7 SOFTWARE 31

7.1 PCB DESIGN 32

7.2 PCB Board Design 33

7.3 SOFTWARE 34

8 CONCLUSION 37

9 BIBLIOGRAPHY 39

10 PHOTO GRAPHY 41

11 PROJECT ESTIMATION 43
viii

LIST OF FIGURES

FIGURE NO TITLE PAGE NO

3.1 Block Diagram 6

4.1.1 Power Supply Diagram 8

4.1.2 Bridge Rectifier Diagram 9

4.2.1 Single Phase & Three Phase Rectifier Diagram 10

4.2.2 Uncontrolled Bridge Rectifier Diagram 10

4.2.3 Controlled Bridge Rectifier Diagram 11

4.2.4 Bridge Rectifier Diagram 12

4.3.2 (A) Fixed Positive Voltage Regulators Diagram 14

4.4.1 Transformer Diagram 15

4.5.1 Arduino Hardware front view 16

4.5.1 (A) Arduino Hardware back view 17

4.5.1 (B) Arduino with serial port 17

4.5.1 (C) Arduino Uno R2 19

4.5.2 Arduino Architecture 20

4.6 LCD Diagram 22


ix

4.7 LED Diagram 23

4.8 MQ 135 Sensor 24

5.1 Circuit Diagram 27

7.1.1 PCB Board Diagram 33

10.1 Photography 42
x

LIST OF ABBREVIATIONS

DC - DIRECT CURRENT

AC - ALTERNATING CURRENT

SCR - SILICON CONTROLLER RECTIFIER

MOSFET - METAL–OXIDE–SEMICONDUCTOR FIELD-EFFECT


TRANSISTOR
IGBT - INSULATED GATE BIPOLAR TRANSISTOR

V - VOLTAGE

PIV - PEAK INVERSE VOLTAGE

D - DIODE

IC - INTEGRATED CIRCUIT

VI - INPUT VOLTAGE

VO - OUTPUT VOLTAGE

GND - GROUND

IN - INPUT

OU - OUTPUT

PIC - PERIPHERAL INTERFACE CONTROLLER

CPU - CENTRAL PROCESSING UNIT


xi

RISC - REDUCED INSTRUCTION SET COMPUTER

MHZ - MEGA HERTZ

RAM - RANDOM ACCESS MEMORY

MA - MICRO AMPS

PWM - PULSE WITH MODULATION

CCP - CAPTURE, COMPARE, PULSE WITH MODULATION

SSP - SYNCHRONOUS SERIAL PORT

BOR - BROWN-OUT RESET

POR - POWER-ON RESET

PWRT - POWER-UP TIMER

OST - OSCILLATOR START-UP TIMER

WDT - WATCHDOG TIMER

RC - RESISTOR CAPACITOR

IC - INTEGRATED CIRCUIT

TMR - TIMER

A/D - ANALOG TO DIGITAL

DVD - DIGITAL VIDEO DISC


xii

CRT - CATHODE RAY TUBE

LED - LIGHT EMITTING DIODE

PCB - PRINTED CIRCUIT BOARD


CHAPTER – 1
INTRODUCTION
1
1.1 INTRODUCTION
It's miles now critical to expose air pollutants in actual t's far now
essential to show air pollution in actual time in maximum of the city areas. this
task is aimed in the direction of developing an iot device that may show display
air pollution in real time and log data to a web server. far off tracking have grow
to be facilitated the use of classic mote in the beyond, where has a few pitfall
are confined memory, processing velocity and complex programming strategies.
by using using net of things and recording sensor Information to a much off
server, the obstacles of reminiscence within the tracking devices and manual
series of information from the hooked up devices may be triumph over. The
web of things additionally allows tracking the records in real time. In which air
pollutants tracking device superior on this mission is based arduino board. the
arduino board connects with element talk platform using esp8266 wireless
module. due to the fact the towns generally have wireless hotspots at most of
the places, so the tool can Be with out trouble mounted close to any hotspot for
its operation. the aspect communicate is a wellknown iot platform which is
straightforward to use and software. the sensor used for monitoring the air
pollutants is mq-a hundred thirty 5 gasoline sensor. the sensor information is
also displayed on a individual liquid crystal display interface in the traking iot
tool. The measure of facts and sending it to the issue communicate server using
wireless module is controlled through the arduino comic strip. The arduino
comic strip is written, compiled and loaded to the arduino board using arduino
software.

2
CHAPTER – 2
PROPOSED SYSTEM

3
2.1 PROPOSED SYSTEM
In these undertaking we are going to make an iot based air quality
observing framework utilizing arduino in which we can screen the quality of the
air of a internet server utilizing web and It triggering a warning whilst air
pleasant goes beyond sure degree, implies while there are ok measure of unsafe
gases are available substantive all round were co2 ,smoke and liquor, benze
steam and nh3 . It's going to show the air awesome in ppm on the liquid crystal
display and simply as the air quality on website web page with the aim that we
are able to display screen it efficiently

4
CHAPTER – 3
BLOCK DIAGRAM

5
3.1 BLOCK DIAGRAM
POWER SUPPLY

ARDUINO

MQ-135 SENSOR LCD DISPLAY

Figure No.3.1 Block Diagram

6
CHAPTER – 4
COMPONENTS DESCRIPTION

7
4.1 POWER SUPPLY
A power supply is an electronic device that supplies electric energy to
an electrical load. The primary function of a power supply is to convert one
form of electrical energy to another and, as a result, power supplies are
sometimes referred to as electric power converters. Some power supplies are
discrete, stand-alone devices, whereas others are built into larger devices along
with their loads. Examples of the latter include power supplies found in desktop
computers and consumer electronics devices.
Every power supply must obtain the energy it supplies to its load, as well
as any energy it consumes while performing that task, from an energy source.
Depending on its design, a power supply may obtain energy from various types
of energy sources, including electrical energy transmission systems, energy
storage devices such as a batteries and fuel cells, electromechanical systems
such as generators and alternators, solar power converters, or another power
supply.
All power supplies have a power input, which receives energy from the
energy source, and a power output that delivers energy to the load. In most
power supplies the power input and output consist of electrical connectors or
hardwired circuit connections, though some power supplies employ wireless
energy transfer in lieu of galvanic connections for the power input or output.
Some power supplies have other types of inputs and outputs as well, for
functions such as external monitoring and control.

Figure No 4.1.1 Power Supply Diagram

8
Bridge Rectifier Circuit with Working Operation and Their Types A
bridge rectifier circuit is a common part of the electronic power supplies. Many
electronic circuits require rectified DC power supply for powering the various
electronic basic components from available AC mains supply. We can find this
rectifier in a wide variety of electronic AC power devices like home appliances,
motor controllers, modulation process, welding applications, etc.

Figure No 4.1.2 Bridge Rectifier Diagram

What is a Bridge Rectifier?


A Bridge rectifier is an Alternating Current (AC) to Direct Current (DC)
converter that rectifies mains AC input to DC output. Bridge Rectifiers are
widely used in power supplies that provide necessary DC voltage for the
electronic components or devices. They can be constructed with four or more
diodes or any other controlled solid state switches. Depending on the load
current requirements, a proper bridge rectifier is selected. Components’ ratings
and specifications, breakdown voltage, temperature ranges, transient current
rating, forward current rating, mounting requirements and other considerations
are taken into account while selecting a rectifier power supply for an
appropriate electronic circuit’s application.
9
4.2 TYPES OF BRIDGE RECTIFIERS
Bride rectifiers are classified into several types based on these factors:
type of supply, controlling capability, bride circuit’s configurations, etc. Bridge
rectifiers are mainly classified into single and three phase rectifiers. Both these
types are further classified into uncontrolled, half controlled and full controlled
rectifiers. Some of these types of rectifiers are described below.

1. Single Phase and Three Phase Rectifiers

Figure No 4.2.1 Single Phase & Three Phase Rectifier Diagram


The nature of supply, i.e., a single phase or three-phase supply decides these
rectifiers. The Single phase bridge rectifier consists of four diodes for
converting AC into DC, whereas a three phase rectifier uses six diodes, as
shown in the figure. These can be again uncontrolled or controlled rectifiers
depending on the circuit components such as diodes, thyristors, and so on.
2. Uncontrolled Bridge Rectifiers

Figure No 4.2.2 Uncontrolled Bridge Rectifier Diagram

10
This bridge rectifier uses diodes for rectifying the input as shown in the
figure. Since the diode is a unidirectional device that allows the current flow in
one direction only. With this configuration of diodes in the rectifier, it doesn’t
allow the power to vary depending on the load requirement. So this type of
rectifier is used in constant or fixed power supplies.

3. Controlled Bridge Rectifier

Figure No 4.2.3 Controlled Bridge Rectifier Diagram

In this type of rectifier, AC/DC converter or rectifier – instead of


uncontrolled diodes, controlled solid state devices like SCR’s, MOSFET’s,
IGBT’s, etc. are used to vary the output power at different voltages. By
triggering these devices at various instants, the output power at the load is
appropriately changed.

Bridge Rectifier Circuit Diagram


The main advantage of bridge rectifier is that it produces almost double
the output voltage as with the case of a full wave rectifier using center-tapped
transformer. But this circuit doesn’t need center tapped transformer so it
resembles low-cost rectifier. The bridge rectifier circuit diagram consists of
various stages of devices like transformer, Diode Bridge, filtering and

11
regulators. Generally all these blocks combination is called as regulated DC
power supply that powers various electronic appliances.
The first stage of the circuit is a transformer which is a step-down type that
changes the amplitude of the input voltage. Most of the electronic projects uses
230/12V transformer to step-down the AC mains 230V to 12V AC supply.

Figure No 4.2.4 Bridge Rectifier Diagram


Next stage is a diode-bridge rectifier which uses four or more diodes
depending on the type of bridge rectifier. Choosing a particular diode or any
other switching device for a corresponding rectifier needs some considerations
of the device like Peak Inverse Voltage (PIV), forward current If, voltage
ratings, etc. It is responsible for producing unidirectional or DC current at the
load by conducting a set of diodes for every half cycle of the input signal. Since
the output after the diode bridge rectifiers is of pulsating nature, and for
producing it as a pure DC, filtering is necessary. Filtering is normally performed
with one or more capacitors attached across the load, as you can observe in the
below figure wherein smoothing of wave is performed. This capacitor rating
also depends on the output voltage.
The last stage of this regulated DC supply is a voltage regulator that maintains
the output voltage to a constant level. Suppose the microcontroller works at 5V
DC, but the output after the bridge rectifier is around 16V, so to reduce this
voltage, and to maintain a constant level – no matter voltage changes in input
side – a voltage regulator is necessary.

12
Bridge Rectifier Operation
As we discussed above, a single-phase bridge rectifier consists of four
diodes and this configuration is connected across the load. For understanding
the bridge rectifier’s working principle, we have to consider the below circuit
for demonstration purpose. During the Positive half cycle of the input AC
waveform diodes D1 and D2 are forward biased and D3 and D4 are reverse
biased. When the voltage, more than the threshold level of the diodesD1 and
D2, starts conducting – the load current starts flowing through it, as shown as
red lines path in the diagram below.

4.3 IC VOLTAGE REGULATORS


Voltage regulators comprise a class of widely used ICs. Regulator IC
units contain the circuit for reference source, comparator amplifier, control
device, and overload protection all in a single IC.
Although the internal construction of the IC is somewhat different from
that described for discrete regulator circuits, the external operation is much the
same. IC units provide regulator of either a fixed positive voltage, a fixed
negative, or an adjustable set voltage.
A power supply can be built using a transformer connected to the AC
supply line to step the AC voltage to desired amplitude, then rectifying that AC
voltage, filtering with a capacitor and RC filter, if desired, and finally regulator
the DC voltage using an IC regulator.
The regulators can be selected for operation with load current from
hundreds of mill amperes to tens of amperes, corresponding to power ratings
from mill watts to tens of watts.

13
4.3.1 TREE-TERMINAL VOLTAGE REGULATORS
Fig shows the basic connection of a three-terminal voltage regulator IC to
load. The fixed voltage regulator has on unregulated DC input voltage, VI,
applied to one input terminal, a regulator output DC voltage, VO, from a second
terminal, with the third terminal connected to ground.
For a selected regulator, IC device specifications list a voltage range over
which the input voltage can vary to maintain a regulator output voltage over a
range of load current. The specification also lists the amount of output voltage
change resulting from a change in load current (load regulator) or in input
voltage

4.3.2 FIXED POSITIVE VOLTAGE REGULATORS


FROM TRANSFORMER SEC

Figure No 4.3.2 (A) Fixed Positive Voltage Regulators Diagram


The series 78 regulators provide fixed regulated voltage from 5 to 24V.
Figure shows how one such IC, a 7812, is connected to provide voltage
regulator without from this units of +12V DC. An unregulated input voltage VI
is filtered by capacitor CI and connected to the IC’s IN terminal. The IC’s OUT
terminal provide a regulated +12V which is filtered by capacitor C2 (mostly for
any high-frequency noise). The third IC terminal is connected to ground
(GND). Which the input voltage may vary over some permissible voltage range,
and the output load may vary over some acceptable range, the output voltage
remains constant within specified voltage variation limits.

14
4.4 TRANSFORMER
A transformer is a static electrical device that transfers electrical energy
between two or more circuits. A varying current in one coil of the transformer
produces a varying magnetic flux, which, in turn, induces a varying
electromotive force across a second coil wound around the same core. Electrical
energy can be transferred between the two coils, without a metallic connection
between the two circuits. Faraday's law of induction discovered in 1831
described the induced voltage effect in any coil due to changing magnetic flux
encircled by the coil.

Figure No 4.4.1 Transformer Diagram

Transformers are used for increasing or decreasing the alternating


voltages in electric power applications, and for coupling the stages of signal
processing circuits. Since the invention of the first constant-potential
transformer in 1885, transformers have become essential for the transmission,
distribution, and utilization of alternating current electric power. A wide range
of transformer designs is encountered in electronic and electric power
applications. Transformers range in size from RF transformers less than a cubic
centimeter in volume, to units weighing hundreds of tons used to interconnect
the power grid.
15
4.5 ARDUINO
Arduino is an open-source hardware and software company, project and
user community that designs and manufactures single-board
microcontrollers and microcontroller kits for building digital devices. Its
products are licensed under the GNU Lesser General Public License (LGPL) or
the GNU General Public License (GPL), permitting the manufacture of Arduino
boards and software distribution by anyone. Arduino boards are available
commercially in preassembled form or as do-it-yourself (DIY) kits.
Arduino board designs use a variety of microprocessors and controllers.
The boards are equipped with sets of digital and analog input/output (I/O) pins
that may be interfaced to various expansion boards ('shields')
or breadboards (For prototyping) and other circuits. The boards feature serial
communications interfaces, including Universal Serial Bus (USB) on some
models, which are also used for loading programs from personal computers.
The microcontrollers can be programmed using C and C++ programming
languages. In addition to using traditional compiler toolchains, the Arduino
project provides an integrated development environment (IDE) based on
the Processing language project.

Figure No 4.5.1 Arduino Hardware front view


The Arduino project started in 2005 as a program for students at
the Interaction Design Institute Ivrea in Ivrea, Italy, aiming to provide a low-

16
cost and easy way for novices and professionals to create devices that interact
with their environment using sensors and actuators.
4.5.1 HARDWARE

Figure No 4.5.1 (A) Arduino Hardware back view

Arduino-compatible R3 UNO board made in China with no Arduino


logo, but with identical markings, including "Made in Italy" text Arduino
is open-source hardware. The hardware reference designs are distributed under
a Creative Commons Attribution Share-Alike 2.5 license and are available on
the Arduino website. Layout and production files for some versions of the
hardware are also available.
Although the hardware and software designs are freely available
under copyleft licenses, the developers have requested the name Arduino to
be exclusive to the official product and not be used for derived works without
permission. The official policy document on use of the Arduino name
emphasizes that the project is open to incorporating work by others into the
official product. Several Arduino-compatible products commercially released
have avoided the project name by using various names ending in -Arduino.

Figure No 4.5.1 (B) Arduino with serial port

17
An early Arduino board with an RS-232 serial interface (upper left) and
an Atmel ATmega8 microcontroller chip (black, lower right); the 14 digital I/O
pins are at the top, the 6 analog input pins at the lower right, and the power
connector at the lower left.
Most Arduino boards consist of an Atmel 8-bit AVR
microcontroller (ATmega8, ATmega168, ATmega328, ATmega1280,
ATmega2560) with varying amounts of flash memory, pins, and features. The
32-bit Arduino Due, based on the Atmel SAM3X8E was introduced in
2012. The boards use single or double-row pins or female headers that facilitate
connections for programming and incorporation into other circuits. These may
connect with add-on modules termed shields. Multiple and possibly stacked
shields may be individually addressable via an I²C serial bus. Most boards
include a 5 V linear regulator and a 16 MHz crystal oscillator or ceramic
resonator. Some designs, such as the LilyPad, run at 8 MHz and dispense with
the onboard voltage regulator due to specific form-factor restrictions.
Arduino microcontrollers are pre-programmed with a boot loader that
simplifies uploading of programs to the on-chip flash memory. The default
bootloader of the Arduino UNO is the optiboot bootloader. Boards are loaded
with program code via a serial connection to another computer. Some serial
Arduino boards contain a level shifter circuit to convert between RS-232 logic
levels and transistor–transistor logic (TTL) level signals. Current Arduino
boards are programmed via Universal Serial Bus (USB), implemented using
USB-to-serial adapter chips such as the FTDI FT232. Some boards, such as
later-model Uno boards, substitute the FTDI chip with a separate AVR chip
containing USB-to-serial firmware, which is reprogrammable via its
own ICSP header. Other variants, such as the Arduino Mini and the unofficial
Boarduino, use a detachable USB-to-serial adapter board or cable, Bluetooth or
other methods. When used with traditional microcontroller tools, instead of the

18
Arduino IDE, standard AVR in-system programming (ISP) programming is
used.

Figure No 4.5.1 (C) Arduino Uno R2 with descriptions

The Arduino board exposes most of the microcontroller's I/O pins for use
by other circuits. The Diecimila, Duemilanove, and current Uno provide 14
digital I/O pins, six of which can produce pulse-width modulated signals, and
six analog inputs, which can also be used as six digital I/O pins. These pins are
on the top of the board, via female 0.1-inch (2.54 mm) headers. Several plug-in
application shields are also commercially available. The Arduino Nano, and
Arduino-compatible Bare Bones Board and Boarduino boards may provide
male header pins on the underside of the board that can plug into
solderless breadboards.
Many Arduino-compatible and Arduino-derived boards exist. Some are
functionally equivalent to an Arduino and can be used interchangeably. Many
enhance the basic Arduino by adding output drivers, often for use in school-
level education, to simplify making buggies and small robots. Others are
electrically equivalent but change the form factor, sometimes retaining
compatibility with shields, sometimes not. Some variants use different
processors, of varying compatibility.

4.5.2 ARCHITECTURE
Here Architecture is of Arduino or precisely the IC of Arduino
(ATmega328p). The ATmega328/P is a low-power CMOS 8-bit microcontroller

19
based on the AVR® enhanced RISC (reduced instruction set computer)
architecture. In Order to maximize performance and parallelism, the AVR
uses Harvard architecture – with separate memories and buses for program and
data. Instruction in the program memory are executed with a single level of
pipelining. The clock is controlled by an external 16MHz Crystal Oscillator.

Figure No 4.5.2 Arduino Architecture

The basic working of CPU of ATmega328:


1. The data is uploaded in serial via the port (being uploaded from the
computer’s Arduino IDE). The data is decoded and then the instructions are sent
to instruction register and it decodes the instructions on the same clock pulse.
2. On the next clock pulse the next set of instructions are loaded in instruction
register.
3. In general purpose registers the registers are of 8-bit but there are 3 16-bit
registers also.
a. 8-bit registers are used to store data for normal calculations and results.
b. 16-bit registers are used to store data of timer counter in 2 different register.
Eg. X-low & X-high. They are fast, and are used to store specific hardware

20
functions.
4. EEPROM stores data permanently even if the power is cut out.
Programming inside a EEPROM is slow.
5. Interrupt Unit checks whether there is an interrupt for the execution of
instruction to be executed in ISR (Interrupt Service Routine).
6. Serial Peripheral Interface (SPI) is an interface bus commonly used to send
data between microcontrollers and small peripherals such as Camera, Display,
SD cards, etc. It uses separate clock and data lines, along with a select line to
choose the device you wish to talk to.
7. Watchdog timer is used to detect and recover from MCU malfunctioning.
8. Analog comparator compares the input values on the positive and negative
pin, when the value of positive pin is higher the output is set.
9. Status and control are used to control the flow of execution of commands by
checking other blocks inside the CPU at regular intervals.
10. ALU (Arithmetic and Logical unit) The high performance AVR ALU
operates in direct connection with all the 32 general purpose working registers.
Within a single clock cycle, arithmetic operations b/w general purpose registers
are executed. The ALU operations are divided into 3 main categories –
arithmetic, logical and bit-function.
11. I/O pins The digital inputs and outputs (digital I/O) on the Arduino are what
allow you to connect the Arduino sensors, actuators, and other ICs. Learning
how to use them will allow you to use the Arduino to do some really useful
things, such as reading switch inputs, lighting indicators, and controlling relay
outputs.
EXTRA:
1. Automatic (Software) Reset: Rather than requiring a physical press of the
reset button before an upload, the Arduino is designed in a way that allows it to
be reset by software running on a connected computer. The Arduino Software
(IDE) uses this capability to allow you to upload code by simply pressing the

21
upload button in the Arduino environment. This means that the bootloader can
have a shorter timeout, as the lowering of DTR (Data Terminal Ready) can be
well-coordinated with the start of the upload.
2.Firmware: Firmware is a software program or set of instructions
programmed on a hardware device. It provides the necessary instructions for
how the device communicates with the other computer hardware. Firmware is
held in non-volatile memory devices such as ROM.
3.To check whether the firmware is installed in your Arduino or not just press
the reset button and if the inbuilt LED flickers (on pin 13) the firmware is
present.

4.6 LCD
A liquid-crystal display (LCD) is a flat panel display, electronic visual
display, or video display that uses the light modulating properties of liquid
crystals. Liquid crystals do not emit light directly. LCDs are available to display
arbitrary images (as in a general-purpose computer display) or fixed images
which can be displayed or hidden, such as preset words, digits, and 7-segment
displays as in a digital clock. They use the same basic technology, except that
arbitrary images are made up of a large number of small pixels, while other
displays have larger elements.

Figure No 4.6 LCD Diagram

22
LCDs are used in a wide range of applications including computer
monitors, televisions, instrument panels, aircraft cockpit displays, and signage.
They are common in consumer devices such as DVD players, gaming devices,
clocks, watches, calculators, and telephones, and have replaced cathode ray tube
(CRT) displays in most applications. The LCD screen is more energy efficient
and can be disposed of more safely than a CRT. Its low electrical power
consumption enables it to be used in battery-powered electronic equipment.

4.7 LED
A light-emitting diode (LED) is a two-lead semiconductor light source. It
is a pn-junction diode, which emits light when activated.]When a suitable
voltage is applied to the leads, electrons are able to recombine with electron
holes within the device, releasing energy in the form of photons. This effect is
called electroluminescence, and the color of the light (corresponding to the
energy of the photon) is determined by the energy band gap of the
semiconductor.

Figure No 4.7 LED Diagram

4.8 MQ135 SENSOR


Air quality sensor for detecting a wide range of gases, including NH3,
NOx, alcohol, benzene, smoke and CO2. Ideal for use in office or factory.
MQ135 gas sensor has high sensitivity to Ammonia, Sulfide and Benze steam,

23
also sensitive to smoke and other harmful gases. It is with low cost and
particularly suitable for Air quality monitoring application.

Figure No 4.8 MQ 135 Sensor


Features:
High Sensitivity
High sensitivity to Ammonia, Sulfide and Benze
Stable and Long Life
Detection Range: 10 - 300 ppm NH3, 10 - 1000 ppm Benzene, 10 - 300 Alcohol
Heater Voltage: 5.0V
Dimensions: 18mm Diameter, 17mm High excluding pins, Pins - 6mm High
Long life and low cost
Applications:
Domestic air pollution detector
 Industrial air pollution detector
 Portable air pollution detector
To get a blood alcohol content (BAC) reading, users simply have to blow
in a straw attached to the equipment for a few seconds. From here, the machine
utilizes the vapors in the breath to calculate an estimation of the level of alcohol
in a person’s system. This simple approach is due to the fact that alcohol is not
digested by the body and is merely absorbed through different parts. These
include the mouth, stomach and intestines. As a result, traces of the material can
still be identified minutes after drinking, making it possible for the Breath
analyzer to calculate an accurate number.

24
CHAPTER – 5
CIRCUIT DIAGRAM

25
5.1 CIRCUIT DIAGRAM
We are going to begin with interfacing the esp8266 with the
arduino.esp8266 runs on threev and within the event that you'll provide it 5v
from, at that factor it may not paintings as it should be and it might get harm.
Interface of the vcc and the ch_pd to the 3.3v pin of arduino. the rx pin of
esp8266 takes a shot at 3.3v and it may no longer communicate with the arduino
when we are able to interface it straightforwardly to the arduino. alongside these
strains, we must make a voltage divider for it so one can exchange over the 5v
into3.3v. this want to be viable by means of manner of associating three
resistors in association as we did inside the circuit. companion the tx pin of the
esp8266 to the pin 10of the arduino and the rx pin Of the esp8266 to the pin
nine of arduino via the resistors.esp8266 wireless module offers your duties get
entry to to wireless or internet. It was a modest gadget and makes your ventures
exceptional. it could talk with any smaller scale controller and it is the most
driving gadgets within the iot stage. emerge as acquainted with here. at that
factorWe will associate the mq135 sensor with the arduino Even as we interface
vcc and the ground pin of the sensor to the 5v and floor of the arduino and the
sensor of the analog to the a0 of the board. associate a ringer to the pin eight of
the arduino that allows you to start to blare while the condition turns out to be
valid. the mq135 sensor can hit upon nh3, nox, liquor, benze steam and some
distinct gases, so it is immaculate gasoline sensor for our air high-quality
monitoring assignment On the factor when We can interface it to arduino then it
will discover the gases, and we can get the pollution level in ppm (components
according to million). mq135 gas sensor gives the yield in type of voltage levels
and we need to trade over it into ppm. so for converting over the yield in ppm,
here we have applied a library for mq135 sensor, it's miles clarified in element
in code rationalization section below. sensor become giving us estimation of
nine whilst there has been no gasoline close to it and the sheltered diploma of
air exceptional is 350 ppm And it ought now not surpass a thousand ppm. on the
26
point whilst it surpasses the reduce off of a thousand ppm, at that factor it starts
cause complications, sluggishness and dormant, stale, stuffy air and at the off
chance that surpasses past 2000 ppm, at that point it can reason extended pulse
and several distinct illnesses. on the point whilst the worth could be below one
thousand ppm, at that factor the lcd and page will show clean air. at something
point the worth will enlarge 1000 ppm, at that factor the ringer will
beginBlaring and the liquid crystal display and page will display negative air,
open home windows. on the off hazard that it'll increase2000, at that point the
signal will keep blaring and the liquid crystal display and location page will
show risk! move to outdoor air.

Figure No. 5.1 Circuit Diagram

27
CHAPTER – 6
PROGRAM

28
6.1 PROGRAM
#include <LiquidCrystal.h>
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
pinMode(A0,INPUT);
lcd.begin(16, 2);
lcd.setCursor(0,0);
lcd.print(" POLLUTION");
lcd.setCursor(0,1);
lcd.print("DETECTION SYSTEM");
delay(3000);
}
void loop() {
int alcohol=analogRead(A0);
if(alcohol>200)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("SensorValue :");
lcd.print(alcohol);
lcd.setCursor(0,1);
lcd.print("Pollution Sensed");
delay(500);
}
else
{
lcd.clear();

29
lcd.setCursor(0,0);
lcd.print("SensorValue :");
lcd.print(alcohol);
lcd.setCursor(0,1);
lcd.print(" Normal");
delay(500);
}
}

30
CHAPTER – 7
SOFTWARE

31
7.1 PCB DESIGN
A printed circuit board (PCB) mechanically supports and electrically
connects electronic components or electrical components using conductive
tracks, pads and other features etched from one or more sheet layers of copper
laminated onto and/or between sheet layers of a non-conductive substrate.
Components are generally soldered onto the PCB to both electrically connect
and mechanically fasten them to it. Printed circuit boards are used in all but the
simplest electronic products. They are also used in some electrical products,
such as passive switch boxes. Alternatives to PCBs include wire wrap and
point-to-point construction, both once popular but now rarely used. PCBs
require additional design effort to layout the circuit, but manufacturing and
assembly can be automated. Specialized CAD software is available to do much
of the work of layout. Mass-producing circuits with PCBs is cheaper and faster
than with other wiring methods, as components are mounted and wired in one
operation. Large numbers of PCBs can be fabricated at the same time, and the
layout only has to be done once. PCBs can also be made manually in small
quantities, with reduced benefits. PCBs can be single-sided (one copper layer),
double-sided (two copper layers on both sides of one substrate layer), or multi-
layer (outer and inner layers of copper, alternating with layers of substrate).
Multi-layer PCBs allow for much higher component density, because circuit
traces on the inner layers would otherwise take up surface space between
components. The rise in popularity of multilayer PCBs with more than two, and
especially with more than four, copper planes was concurrent with the adoption
of surface mount technology. However, multilayer PCBs make repair, analysis,
and field modification of circuits much more difficult and usually impractical.
A basic PCB consists of a flat sheet of insulating material and a layer of
copper foil, laminated to the substrate. Chemical etching divides the copper into
separate conducting lines called tracks or circuit traces, pads for connections,
visa to pass connections between layers of copper, and features such as solid
32
conductive areas for EM shielding or other purposes. The tracks function as
wires fixed in place, and are insulated from each other by air and the board
substrate material. The surface of a PCB may have a coating that protects the
copper from corrosion and reduces the chances of solder shorts between traces
or undesired electrical contact with stray bare wires. For its function in helping
to prevent solder shorts, the coating is called solder resist. A printed circuit
board can have multiple copper layers. A two-layer board has copper on both
sides; boards sandwich additional copper layers between layers of insulating
material. Conductors on different layers are connected with visas, which are
copper-plated holes that function as electrical tunnels through the insulating
substrate. Through-hole component leads sometimes also effectively function as
After two-layer PCBs, the next step up is usually four-layer. Often two layers
are dedicated as power supply and ground planes, and the other two are used for
signal wiring between components.

Figure No 7.1.1 PCB Board Diagram

7.2 PCB Board Design


Initially PCBs were designed manually by creating a photo mask on a
clear Mylar sheet, usually at two or four times the true size. Starting from the
schematic diagram the component pin pads were laid out on the Mylar and then
traces were routed to connect the pads. Rub-on dry transfers of common
component footprints increased efficiency. Traces were made with self-adhesive
Tape. Pre-printed non-reproducing grids on the assisted in layout. The finished
was onto a photoresist coating on the blank copper-clad boards. Modern PCBs
are designed with dedicated layout software, generally in the following steps:

33
1. Schematic capture through an electronic design automation (EDA) tool.
2. Card dimensions and template are decided based on required circuitry and
case of the PCB.
3. The positions of the components and heat sinks are determined.
4. Layer stack of the PCB is decided, with one to tens of layers depending on
complexity. Ground and power planes are decided. A power plane is the
5. Counterpart to a ground plane and behaves as an AC signal ground while
providing DC power to the circuits mounted on the PCB. Signal
interconnections are traced on signal planes. Signal planes can be on the outer
as well as inner layers. For optimal EMI performance high frequency signals are
routed in internal layers between power or ground planes.
6. Line impedance is determined using dielectric layer thickness, routing copper
thickness and trace-width. Trace separation is also taken into account in case of
differential signals. Micro strip, strapline or dual strip line can be used to route
signals.
7. Components are placed. Thermal considerations and geometry are taken into
account. Visa and lands are marked.
8. Signal traces are routed. Electronic design automation tools usually create
clearances and connections in power and ground planes automatically.
9. Gerber files are generated for manufacturing.

7.3 SOFTWARE
A program for Arduino hardware may be written in any programming
language with compilers that produce binary machine code for the target
processor. Atmel provides a development environment for their 8-bit AVR and
32-bit ARM Cortex-M based microcontrollers: AVR Studio (older) and Atmel
Studio (newer).

34
7.3.1 IDE
The Arduino integrated development environment (IDE) is a cross-
platform application (for Windows, macOS, Linux) that is written in the
programming language Java. It originated from the IDE for the
languages Processing and Wiring. It includes a code editor with features such as
text cutting and pasting, searching and replacing text, automatic
indenting, brace matching, and syntax highlighting, and provides simple one-
click mechanisms to compile and upload programs to an Arduino board. It also
contains a message area, a text console, a toolbar with buttons for common
functions and a hierarchy of operation menus. 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 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
toolchain, also included with the IDE distribution. The Arduino IDE employs
the program avrdude 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.

7.3.2 PRO IDE


On October 18th, 2019, Arduino Pro IDE (alpha preview) was released.
The system still uses Arduino CLI (Command Line Interface), but
improvements include a more professional development environment,
autocompletion support, and Git integration. The application frontend is based
on the Eclipse Theia Open Source IDE. The main features available in the alpha
release are:

35
 Modern, fully featured development environment
 Dual Mode, Classic Mode (identical to the Classic Arduino IDE) and Pro Mode
(File System view)
 New Board Manager
 New Library Manager
 Board List
 Basic Auto-Completion (Arm targets only)
 Git Integration
 Serial Monitor
 Dark Mode

36
CHAPTER – 8
CONCLUSION

37
8.1 CONCLUSION
These system is used to monitor the air quality of the atmosphere using MQ135 gas
sensor and arduino. Here the IOT technology is used to monitor the various gases present in
air and the ppm values are displayed in the thinks speak web server

38
CHAPTER – 9
BIBLIOGRAPHY

39
9.1 BIBLIOGRAPHY
[1] Poonam Pal1, Ritik Gupta2, Sanjana Tiwari3, Ashutosh Sharma IOT
BASED AIR MONITORING SYSTEM USING ARDUINO Volume: 04 Issue:
10 | Oct -2017
[2] Harsh N. Shah1 , Zishan Khan 2, Abbas Ali merchant3 , Moin Moghal 4,
Aamir Shaikh 5, Priti Rane 6, IOT Based Air Pollution Monitoring System”
Volume 9, Issue 2, February-2018 ISSN 2229-5518
[3]Gagan Parmar1, Sagar Lakhani2, Manju 3 K. Chattopadhyay 4 An IoT Based
Low Cost Air Pollution Monitoring System Proceeding 27-29 October,2017
[4]Ch.V.Saikumar1,M.Reji,2 P.C.Kishoreraja3, IOT Based Air quality
Monitoring Stystem IJPAR Volume 117 No. 9 2017, 53-57 ISSN: 1311-8080
[5] Mehmet Taştan1 “An IOT Based Air Quality Measurement and Warning
System for Ambient Assisted Living” European Journal of Science and
Technology No.16, pp. 960-968, August 2019
[6] K.Nirosha1, B. Durgasree2, N. Shirisha3 IOT BASED AIR POLLUTION
MONITORING SYSTEM 2394-0697, VOLUME-4, ISSUE-6, 2017
[7] D. Verma S. Dhul . R. Saini . R. B. Dubey IoT Based Air Pollution
Monitoring System 2350-0557, Volume-5, Issue-3, May-2018
[8] Neha R. Rewatkar1 Prof. Deepali M. Khatri2 A Review: Cost Effective IOT
Based Air Pollution Monitoring and Air Quality Analysis volume 5 issue 1
January 2017

40
CHAPTER – 10
PHOTO GRAPHY
41
10.1 PHOTO GRAPHY

Figure No.10.1 Photography

42
CHAPTER – 11
PROJECT ESTIMATION

43
11.1 PROJECT ESTIMATION

S.NO
DESCRIPTION SPECIFICATION UNIT COST IN RS.
.

Resistors 1Kohm, Connecting


Wires (Single Lead) As
1 Components Capacitors 100microfarad, Rs.200
Required
22microfarad
LED (Red)
Arduino: UNO R3
Development Board - Clone 01 Rs.450

2 Standard Items Model - High Quality


LCD Display 16X2 01 Rs.150

MQ135 Sensor 01 Rs.750

3 Machining Cost PCB Board 04 Rs.450

Design / Typing
4 --- -- Rs.1,200
Work

5 Transport Cost -- -- Rs.500

6 Miscellaneous -- -- Rs.500

TOTAL COST Rs.4,200

44

You might also like