2.iot Based Air Quality Index Monitoring

You might also like

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

IOT BASED AIR QUALITY INDEX MONITORING

SYSTEM – MONITOR PM2.5, PM10, AND CO USING


NODE MCU

Submitted by

LOGANATHAN.P Reg. No. (22309010)


LOGESHWARAN.M Reg. No. (22309011)
NISHANTH.S Reg. No. (22309013)
RAMAKRISHNAN.N Reg. No. (22309017)
SRIDHAR.C Reg. No. (22309024)
SUJITH.S Reg. No. (22309027)

in partial fulfillment for the award of the degree of


DIPLOMA IN ELECTRICAL AND ELECTRONICS
ENGINEERING

SRI RANGANATHAR INSTITUTE OF POLYTECHNIC COLLEGE

ATHIPALAYAM, COIMBATORE – 641110.

Directorate of Technical Education, Chennai – 600025


Government of Tamilnadu
APRIL-2024
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 Electrical and Electronics Engineering


Certificate
This is to certify that this project report titled

“IOT BASED AIR QUALITY INDEX MONITORING SYSTEM – MONITOR PM2.5,


PM10, AND CO USING NODE MCU ”

Is a bonafide project work done by


LOGANATHAN.P Reg. No. (22309010)
LOGESHWARAN.M Reg. No. (22309011)

NISHANTH.S Reg. No. (22309013)


RAMAKRISHNAN.N Reg. No. (22309017)

SRIDHAR.C Reg. No. (22309024)


SUJITH.S Reg. No. (22309027)

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


DIPLOMA IN ELECTRICAL AND ELECTRONICS ENGINEERING
Of
Directorate of Technical Education, Government of Tamil Nadu.

During the year 2023-2024

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


iii
iv

ABSTRACT

As winter sets in, the air hanging over us thickens with smoke and
gaseous emissions from burning fields, industrial factories, and vehicular
traffic, blocking out the sun and making it hard to breathe. Experts say that
the high levels of air pollution and COVID-19 pandemic can be a dangerous
mix that can have serious consequences. The necessity for real-time
monitoring of Air Quality is very glaring. So in this project, we are going
to build an ESP32 Air Quality Monitoring System using Nova PM SDS011
sensor, MQ-7 sensor, and DHT11 sensor. We will also be using an OLED
Display module to display Air Quality Values.
The Air Quality Index (AQI) in India is based on eight pollutants,
PM10, PM2.5, SO2 and NO2, CO, Ozone, NH3, and Pb. However, it is not
necessary to measure all of the pollutants. So we are going to measure the
concentration of PM2.5, PM10, and Carbon Monoxide to calculate the Air
Quality Index. The AQI values will be published on Adafruit IO so that we
can monitor it from anywhere. Previously we have also measured the
concentration of LPG, Smoke, and Ammonia gas using Arduino.
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.K.KARTHIKEYAN,M.E., for forwarding us to do our project and offering adequate

duration in completing our project.

We are also grateful to the Head of Department Mr. P. THIRUMOORTHY 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

Ms.AMIRTHAMADHURI, M.E., Department of Electrical and Electronics Engineering

for his kind guidance & encouragement during this project.

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

Staff members of ELECTRICAL AND ELECTRONICS ENGINEERING

DEPARTMENT, Sri Ranganathar Institute of Polytechnic College, Athipalayam for

their sincere support in completion of this project.


vi

TABLE OF CONTENTS
CHAPTER PAGE
TITTLE
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.3.1 TREE-TERMINAL VOLTAGE REGULATORS 14
4.3.2 FIXED POSITIVE VOLTAGE REGULATORS 14
4.4 TRANSFORMER 15
4.5 ARDUINO 16
4.5.1 HARDWARE 17
4.5.2 ARCHITECTURE 19
4.6 LCD 22
4.7 LED 23
4.8 GAS SENSOR 23
4.9 DHT11 TEMPERATURE AND HUMIDITY SENSOR 25
4.10 SDS 011 SENSOR 26
4.11 CLOUD COMPUTING 28
4.12 INTERNET OF THINGS (IOT) 29
5 CIRCUIT DIAGRAM 31
5.1 CIRCUIT DIAGRAM 32
6 PROGRAM 34
7 SOFTWARE 43
vii

7.1 PCB DESIGN 44


7.2 PCB BOARD DESIGN 45
7.3 SOFTWARE 46
7.3.1 IDE 47
7.3.2 PRO IDE 47
8 CONCLUSION 49
9 BIBLIOGRAPHY 51
10 PHOTO GRAPHY 53
11 PROJECT ESTIMATION 55
viii

LIST OF FIGURES
FIGURE
TITLE PAGE NO
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 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 with descriptions 19
4.5.2 Arduino Architecture 20
4.6 LCD Diagram 22
4.7 LED Diagram 23
4.8 GAS sensors 24
4.9 DHT11 Sensor 25
4.10.1 SDS 011 Sensor 26
4.10.2 Block Diagram of SDS 011 Sensor 27
4.11 Cloud Computing 28
5.1 Circuit Diagram 33
7.1.1 PCB Board Diagram 45
10.1 Photography 54
ix

LIST OF ABBREVIATIONS
DC - DIRECT CURRENT
AC - ALTERNATING CURRENT
SCR - SILICON CONTROLLER RECTIFIER
METAL–OXIDE–SEMICONDUCTOR FIELD-EFFECT
MOSFET -
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
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
x

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
CRT - CATHODE RAY TUBE
LED - LIGHT EMITTING DIODE
PCB - PRINTED CIRCUIT BOARD
CHAPTER – 1
INTRODUCTION
1
1.1 INTRODUCTION
In this project we are going to make an IoT Based Air Pollution/Quality
Monitoring System with ESP8266, PM2.5 Particulate Matter Sensor, MQ-135
Air Quality Sensor & BME280 Barometric Pressure Sensor. We will monitor
the Air Quality on Thinspeak Server using the internet. This is a simple
prototype for an Environmental IoT Air Pollution/Quality Monitoring
System for monitoring the concentrations of major air pollutant gases. The
system uses 3 sensors like PMS5003 PM2.5 Particulate Matter Sensor, MQ-135
Air Quality Sensor, BME280 Barometric Pressure Sensor.
In this IoT project, you can monitor the pollution level from anywhere
using your computer or mobile. PMS5003 PM2.5 Particulate matter sensor from
Plantpower measure particle concentration in PM1.0, PM2.5 & PM10. This
MQ-135 Air Quality Sensor measures concentrations of gases such as CO,
CO2, SO2, and NO2 and gives the result in PPM (Part per Million). Similarly,
BME280 Measures environmental Temperature, Pressure & Humidity. The
sensors will gather the data of various environmental parameters and send it to
the Thingspeak server which displays the data online after the interval of every
15 seconds. We can install this system anywhere and can also trigger some
devices when pollution goes beyond some level like we can switch on
the Exhaust fan.

2
CHAPTER – 2
PROPOSED SYSTEM

3
2.1 PROPOSED SYSTEM
Temperature & humidity sensor, the production count circuit,
illumination intensity circuit and power consumption circuit are used to percept
the environment and object conditions. Analog signals are provided to Arduino
device produced by sensors and circuits. The digital equivalent of these signals
is transmitted to the database server by virtue of the Wi-Fi module interfaced
with the Arduino. The data stored on the database server is transferred to the
website time to time and the status of the alarm is checked continuously for any
uneven conditions observed by the industry person on the website. Then
adequate steps can be taken to solve the problems. This can be possible through
past experience and similar previous condition stored in database. In this we use
LAN as database for scalability. The industry person who will check the status
of the industry through the website will have to login using a user id and
password to get access to the website, this ensures security of the data.

4
CHAPTER – 3
BLOCK DIAGRAM

5
3.1 BLOCK DIAGRAM

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.

Figure No 4.1.1 Power Supply Diagram


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.

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.
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.

Figure No 4.5.1 (C) Arduino Uno R2 with descriptions

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 GAS 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 GAS 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.0
 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
4.9 DHT11 (TEMPERATURE AND HUMIDITY SENSOR)
This DHT11 Temperature and Humidity Sensor features a calibrated
digital output temperature and humidity sensor module. Its technology ensures
high reliability and excellent long-term stability. A high-performance 8-bit
microcontroller is connected. This sensor includes a resistive element and wet
NTC temperature measuring devices. It has excellent quality, fast response,
anti-interference ability and high cost performance advantages.

Figure No.4.9 DHT11 SENSORS


Each DHT11 sensors features extremely accurate calibration of humidity
calibration chamber. The calibration coefficients stored in the OTP program
memory. Internal sensors detect signals in the process in accordance with their
calibration coefficients. The single-wire serial interface system is integrated to
become quick and easy to use. The small size, low power, and signal
transmission distance up to 20 meters makes it useful in a variety of
applications and even the most demanding applications. The product is 4-pin
single row pin package. Convenient connections and special packages can be
provided according to users need.
Specification
 Supply Voltage: +5 V
 Temperature range :0-50 °C error of ± 2 °C
 Humidity :20-90% RH ± 5% RH error
 Interface: Digital

25
4.10 SDS 011 (AIR QUALITY MONITORING SENSOR)
The SDS 011 Sensor is a quite recent Air Quality Sensor developed
by Nova Fitness, a spin-off from the university of Jinan (in Shandong). With its
size, it is probably one of the best sensor in terms of accuracy: While other
sensors tend to focus on shrinking the sensor size, the SDS 011 has opted for a
size tradeoff allowing it to use a larger fan. And the larger the fan, the better the
quality. The clever engineering in the SD011 is to use the PCB as one side of
the casing (allowing to reduce the BOM cost). The diode is mounted on the
PCB side (this is mandatory as any noise between the doide and the LNA
should be avoided). The laser mounted on the plastic box and connected to the
PCB via flying wire.

Figure No.4.10.1 SDS 011 SENSOR


The biggest problem of this design is that the entire sensor inside is
getting very dusty, as shown on the picture below after running 24/7 for more
than 6 months. This is actually not so bad since the dust did not get accumulated
on the diode, nor on the laser frontend. As concern the fan, dust accumulation is
a "normal behavior" also seen on the dylos.
Last, as concerns the PCB, is it quite simple. The main CPU is an 8bit
processor (scratched to prevent from beeing reversed engineered!). Under the
shielding one can find the Low Noise Amplifier (directly mounted on the
opposite side of the diode).

26
This is the specification for the SDS011. One should not consider all those
values for granted as there is quite often a big difference between what is said to
be possible and what is actually possible (and this is why we are setting up all
our experiments).

Figure No.4.10.2 BLOCK DIAGRAM OF SDS 011 SENSOR

Output: PM2.5, PM10


Measuring Range: 0.0-999.9μg/m3
Input Voltage:5V
Maximum Current: 100mA
Sleep Current: 2mA
Response Time 1 second
Serial Data Output Frequency: 1 time/second
Particle Diameter Resolution: ≤0.3μm
Relative Error:10%
Temperature Range:-20~50°C
Physical Size: 71mm*70mm*23mm
Note that the SDS011 humidity working range is 0-70%. This is so good, since
above 70% humidity, the readings become unrealiable.
27
4.11 CLOUD COMPUTING
Cloud computing is the on-demand availability of computer system
resources, especially data storage and computing power, without direct active
management by the user. The term is generally used to describe data
centers available to many users over the Internet. Large clouds, predominant
today, often have functions distributed over multiple locations from
central servers. If the connection to the user is relatively close, it may be
designated an edge server. Clouds may be limited to a single organization
(enterprise clouds), or be available to many organizations (public cloud). Cloud
computing relies on sharing of resources to achieve coherence and economies of
scale.

Figure No 4.11 CLOUD COMPUTING


Advocates of public and hybrid clouds note that cloud computing allows
companies to avoid or minimize up-front IT infrastructure costs. Proponents
also claim that cloud computing allows enterprises to get their applications up
and running faster, with improved manageability and less maintenance, and that
it enables IT teams to more rapidly adjust resources to meet fluctuating and

28
unpredictable demand, providing the burst computing capability: high
computing power at certain periods of peak demand.
Cloud providers typically use a "pay-as-you-go" model, which can lead to
unexpected operating expenses if administrators are not familiarized with cloud-
pricing models. The availability of high-capacity networks, low-cost computers
and storage devices as well as the widespread adoption of hardware
virtualization, service-oriented architecture and autonomic and utility computing has led

to growth in cloud computing. By 2019, Linux was the most widely used
operating system, including in Microsoft's offerings and is thus described as
dominant. The Cloud Service Provider (CSP) will screen, keep up and gather
data about the firewalls, intrusion identification or/and counteractive action
frameworks and information stream inside the network.

4.12 INTERNET OF THINGS (IOT)


The Internet of things (IoT) is a system of interrelated computing devices,
mechanical and digital machines that are provided with
unique identifiers (UIDs) and the ability to transfer data over a network without
requiring human-to-human or human-to-computer interaction.
The definition of the Internet of things has evolved due to the
convergence of multiple technologies, real-time analytics, machine
learning, commodity sensors, and embedded systems. Traditional fields
of embedded systems, wireless sensor networks, control
systems, automation (including home and building automation), and others all
contribute to enabling the Internet of things. In the consumer market, IoT
technology is most synonymous with products pertaining to the concept of the
"smart home", covering devices and appliances (such as lighting
fixtures, thermostats, home security systems and cameras, and other home
appliances) that support one or more common ecosystems, and can be
controlled via devices associated with that ecosystem, such
29
as smartphones and smart speakers. There are a number of serious concerns
about dangers in the growth of IoT, especially in the areas
of privacy and security, and consequently industry and governmental moves to
begin to address these.

30
CHAPTER – 5
CIRCUIT DIAGRAM

31
5.1 CIRCUIT DIAGRAM
The Arduino UNO is a widely used open-source microcontroller board
based on the ATmega328P microcontroller and developed by Arduino.cc. The
board is equipped with sets of digital and analog input/output (I/O) pins that
may be interfaced to various expansion boards (shields) and other circuits. The
board features 14 Digital pins and 6 Analog pins. It is programmable with the
Arduino IDE (Integrated Development Environment) via a type B USB cable. It
can be powered by a USB cable or by an external 9 volt battery, though it
accepts voltages between 7 and 20 volts. Wi-Fi Module (ESP8266) ESP8266
offers a complete and self-contained Wi-Fi networking solution, allowing it to
either host the application or to offload all Wi-Fi networking functions from
another application processor. When ESP8266 hosts the application, and when
it is the only application processor in the device, it is able to boot up directly
from an external flash.
It has integrated cache to improve the performance of the system in such
applications, and to minimize the memory requirements. Temperature &
Humidity Sensor (DHT11) This DHT11 Temperature & Humidity Sensor
features a temperature & humidity sensor complex with a calibrated digital
signal output. By using the exclusive digital-signal-acquisition technique and
temperature & humidity sensing technology, it ensures high reliability and
excellent long-term stability. This sensor includes a resistive-type humidity
measurement component and an NTC temperature measurement component,
and connects to a high performance 8-bit microcontroller, offering excellent
quality, fast response, anti-interference ability and cost-effectiveness.

32
Figure No. 5.1 Circuit Diagram

33
CHAPTER – 6
PROGRAM

34
6.1 PROGRAM
#include <SDS011.h>
#include <SPI.h>
#include <WiFi.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"
#include "DHT.h"
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "esp32-hal-adc.h" // needed for adc pin reset
#include "soc/sens_reg.h" // needed for adc pin reset
uint64_t reg_b; // Used to store Pin registers
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for SSD1306 display connected using software SPI (default case):
#define OLED_MOSI 23
#define OLED_CLK 18
#define OLED_DC 4
#define OLED_CS 5
#define OLED_RESET 2
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT,
OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
const int numReadingsPM10 = 24;
const int numReadingsPM25 = 24;
const int numReadingsCO = 8;
WiFiClient client;
SDS011 my_sds;
const char *ssid = "Galaxy-M20"; // Enter your WiFi Name
const char *pass = "ac312124"; // Enter your WiFi Password
#define MQTT_SERV "io.adafruit.com"
#define MQTT_PORT 1883
#define MQTT_NAME "choudharyas" // Your Adafruit IO Username
#define MQTT_PASS "988c4e045ef64c1b9bc8b5bb7ef5f2d9" // Adafruit IO AIO key
#define DHTTYPE DHT11 // DHT 11
uint8_t DHTPin = 27;

35
DHT dht(DHTPin, DHTTYPE);
int error;
unsigned long interval = 3600000;
unsigned long previousMillis = 0;
int temperature, humidity, AQI;
float p10,p25;
int iMQ7 = 25;
int MQ7Raw = 0;
int MQ7ppm = 0;
double RvRo;
int ConcentrationINmgm3;
int readingsPM10[numReadingsPM10]; // the readings from the analog input
int readIndexPM10 = 0; // the index of the current reading
int totalPM10 = 0; // the running total
int averagePM10 = 0; // the average
int readingsPM25[numReadingsPM25]; // the readings from the analog input
int readIndexPM25 = 0; // the index of the current reading
int totalPM25 = 0; // the running total
int averagePM25 = 0; // the average
int readingsCO[numReadingsCO]; // the readings from the analog input
int readIndexCO = 0; // the index of the current reading
int totalCO = 0; // the running total
int averageCO = 0; // the average
Adafruit_MQTT_Client mqtt(&client, MQTT_SERV, MQTT_PORT, MQTT_NAME, MQTT_PASS);
Adafruit_MQTT_Publish AirQuality = Adafruit_MQTT_Publish(&mqtt,MQTT_NAME
"/f/AirQuality");
Adafruit_MQTT_Publish Temperature = Adafruit_MQTT_Publish(&mqtt,MQTT_NAME
"/f/Temperature");
Adafruit_MQTT_Publish Humidity = Adafruit_MQTT_Publish(&mqtt,MQTT_NAME
"/f/Humidity");
Adafruit_MQTT_Publish PM10 = Adafruit_MQTT_Publish(&mqtt,MQTT_NAME "/f/PM10");
Adafruit_MQTT_Publish PM25 = Adafruit_MQTT_Publish(&mqtt,MQTT_NAME "/f/PM25");
Adafruit_MQTT_Publish CO = Adafruit_MQTT_Publish(&mqtt,MQTT_NAME "/f/CO");
//Adafruit_MQTT_Publish NH3 = Adafruit_MQTT_Publish(&mqtt,MQTT_NAME "/f/NH3");
void setup()
{
my_sds.begin(16,17);

36
Serial.begin(9600);
dht.begin();
display.begin(SSD1306_SWITCHCAPVCC);
delay(10);
pinMode(DHTPin, INPUT);
pinMode(iMQ7, INPUT);
Serial.println("Connecting to ");
Serial.println(ssid);
reg_b = READ_PERI_REG(SENS_SAR_READ_CTRL2_REG);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED)
{
delay(550);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
for (int thisReading1 = 0; thisReading1 < numReadingsPM10; thisReading1++) {
readingsPM10[thisReading1] = 0;
}
for (int thisReading2 = 0; thisReading2 < numReadingsPM25; thisReading2++) {
readingsPM25[thisReading2] = 0;
}
for (int thisReading3 = 0; thisReading3 < numReadingsCO; thisReading3++) {
readingsCO[thisReading3] = 0;
}
display.clearDisplay();
display.display();
}
void loop()
{
unsigned long currentMillis = millis();
MQTT_connect();
if ((unsigned long)(currentMillis - previousMillis) >= interval) {
WRITE_PERI_REG(SENS_SAR_READ_CTRL2_REG, reg_b);
MQ7Raw = analogRead( iMQ7 );

37
Serial.print("MQ Raw: ");
Serial.println(MQ7Raw);
RvRo = MQ7Raw * (3.3 / 4095);
MQ7ppm = 3.027*exp(1.0698*( RvRo ));
Serial.print("CO: ");
Serial.println(MQ7ppm);
//Serial.println();
error = my_sds.read(&p25,&p10);
if (! error) {
Serial.println("P2.5: "+String(p25));
Serial.println("P10: "+String(p10));
}
}
temperature = dht.readTemperature();
humidity = dht.readHumidity();
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println();
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.println();
ConcentrationINmgm3 = MQ7ppm* (28.06/24.45); //Converting PPM to mg/m3. Where
28.06 is Molecular mass of CO and 24.45 is the Molar volume
Serial.print("mg/m3: "); // for more inforation on this follow:
https://www.markes.com/Resources/Frequently-asked-questions/How-do-I-convert-
units.aspx
Serial.println(ConcentrationINmgm3);
totalPM10 = totalPM10 - readingsPM10[readIndexPM10];
readingsPM10[readIndexPM10] = p10;
totalPM10 = totalPM10 + readingsPM10[readIndexPM10];
readIndexPM10 = readIndexPM10 + 1;
if (readIndexPM10 >= numReadingsPM10) {
readIndexPM10 = 0;
}
averagePM10 = totalPM10 / numReadingsPM10;
Serial.print("PM10 Average: ");
Serial.println(averagePM10);

38
totalPM25 = totalPM25 - readingsPM25[readIndexPM25];
readingsPM25[readIndexPM25] = p25;
totalPM25 = totalPM25 + readingsPM25[readIndexPM25];
readIndexPM25 = readIndexPM25 + 1;
if (readIndexPM25 >= numReadingsPM25) {
readIndexPM25 = 0;
}
averagePM25 = totalPM25 / numReadingsPM25;
Serial.print("PM2.5 Average: ");
Serial.println(averagePM25);
totalCO = totalCO - readingsCO[readIndexCO];
readingsCO[readIndexCO] = ConcentrationINmgm3;
totalCO = totalCO + readingsCO[readIndexCO];
readIndexCO = readIndexCO + 1;
if (readIndexCO >= numReadingsCO) {
readIndexCO = 0;
}
averageCO = totalCO / numReadingsCO;
Serial.print("CO Average: ");
Serial.println(averageCO);
if (averagePM10 > averagePM25){
AQI = averagePM10;
}
else {
AQI = averagePM25;
}
if (! Temperature.publish(temperature))
{
delay(30000);
}
if (! Humidity.publish(humidity))
{
delay(30000);
}
if (! PM10.publish(averagePM10))
{

39
delay(30000);
}
if (! PM25.publish(averagePM25))
{
delay(30000);
}
if (! CO.publish(MQ7ppm))
{
delay(30000);
}
if (! AirQuality.publish(AQI))
{
delay(30000);
}
displayvalues();
delay(10000);
//delay(3000);
}
void displayvalues()
{
display.clearDisplay();
display.setTextSize(2);
display.setCursor(0,15);
display.println("CO: ");
display.setCursor(40,15);
display.println(averageCO);
display.setTextSize(1);
display.setCursor(68,35);
display.println("mg/m3");
display.display();
delay(2000);
display.clearDisplay();
display.setTextSize(2);
display.setCursor(0,5);
display.println("Temp:");
display.setCursor(75,5);

40
display.println(temperature);
display.setCursor(101,5);
display.println("C");
display.setCursor(0,28);
display.println("Humid:");
display.setCursor(75,28);
display.println(humidity);
display.setCursor(101,28);
display.println("%");
display.display();
display.clearDisplay();
delay(2000);
display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(0,5);
display.println("PM2.5: ");
display.setCursor(75,5);
display.println(averagePM25);
display.setCursor(0,28);
display.println("PM10: ");
display.setCursor(75,28);
display.println(averagePM10);
display.setTextSize(1);
display.setCursor(90,49);
display.println("ug/m3");
display.display();
delay(2000);
}
void MQTT_connect()
{
int8_t ret;
// Stop if already connected.
if (mqtt.connected())
{
return;
}

41
uint8_t retries = 3;
while ((ret = mqtt.connect()) != 0) // connect will return 0 for connected
{
mqtt.disconnect();
delay(5000); // wait 5 seconds
retries--;
if (retries == 0)
{
// basically die and wait for WDT to reset me
while (1);
}
}
}

42
CHAPTER – 7
SOFTWARE

43
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
44
separate conducting lines called tracks or circuit traces, pads for connections,
visa to pass connections between layers of copper, and features such as solid
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

45
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:
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

46
32-bit ARM Cortex-M based microcontrollers: AVR Studio (older) and Atmel
Studio (newer).

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
47
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:
 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

48
CHAPTER – 8
CONCLUSION

49
8.1 CONCLUSION
With the advancement in technology, it is expected that the availability of
internet is everywhere. We are developing an industrial application using
internet of things (IOT) technology. In this project we have proposed to provide
an application for air monitoring and to inform the responsible person to take
appropriate measures. This project aims to serve as an efficient backbone for
achieving a network of sensors and actuators which can help for improving the
performance of the day to day activities of the society.

50
CHAPTER – 9
BIBLIOGRAPHY

51
9.1 BIBLIOGRAPHY
[1].Ashwini Deshpande, Prajakta Pitale, Sangita Sanap, “Industrial Automation
using Internet of Things (IOT)”, IJARCET Volume 5 Issue 2, February 2016.
[2]. Geetesh Chaudhari, Sudarshan Jadhav, Sandeep Batule, Sandeep Helkar,
“Industrial Automation using Sensing based Applications for Internet of
Things”, IARJSET Vol. 3, Issue 3, March 2016.
[3]. Keyur K. Patel, Sunil Patel, “IOT Based Data Logger for Monitoring and
Controlling Equipment Working Status and Environmental Conditions”,
IJIRCCE Vol. 4, Issue 4, April 2016.
[4]. Mahesh Jivanii, Sharon Panth, “Wireless IEEE 802.11 Based Device
Control Ad-Hoc Network Using Responsive Web Design (RWD)”, IJ-ETA-
ETS Volume 7 Issue 1, Jan‟14 – Jun‟14.
[5]. IoT: https://dzone.com/articles/the-internet-of-thingsgateways -and-next-
generation.

52
CHAPTER – 10
PHOTO GRAPHY

53
10.1 PHOTO GRAPHY

Figure No.10.1 Photography

54
CHAPTER – 11
PROJECT ESTIMATION

55
11.1 PROJECT ESTIMATION

S.NO. DESCRIPTION SPECIFICATION UNIT COST IN RS.


Resistor 1Kohm, connecting
wires (single lead), capacitors
100microfarad, 22 microfarad, As
1 Raw material Rs. 200
required
LED (red)

Arduino 01 Rs.550

MQ-7 sensor 01 Rs.150

DHT 11 sensor 01 Rs.180


Standard Items
2
PM SDS011 01 Rs.1,500

IOT 01 Rs.1,500

3 Machining Cost PCB board 01 Rs.550

TOTAL COST Rs.4,630

56
ii
iii

Directorate of Technical Education, Chennai - 600025


Government of Tami Nadu

BONAFIDE CERTIFICATE

Certified that this Report titled “IOT BASED AIR QUALITY INDEX
MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO USING NODE
MCU” is the bonafide work of P.LOGANATHAN (Reg. No. 22309010),
M.LOGESHWARAN (Reg. No. 22309011), S.NISHANTH (Reg. No. 22309013),
N.RAMAKRISHNAN (Reg. No. 22309017), C.SRIDHAR (Reg. No. 22309024),
S.SUJITH (Reg. No. 22309027) who carried out the work under my supervision.
Certified further that to the best of my knowledge the work reported here in does not
form part of any other thesis or dissertation on the basis of which a degree or award
was conferred on an earlier occasion on this or any other candidate.

Signature of the Guide with date Signature of the HOD with date
Ms.AMIRTHAMADHURI, M.E., Mr.P. THIRUMOORTHY M.E.,
ii
iii

Directorate of Technical Education, Chennai - 600025


Government of Tami Nadu

BONAFIDE CERTIFICATE

Certified that this Report titled “IOT BASED AIR QUALITY INDEX
MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO USING NODE
MCU” is the bonafide work of N.RAMAKRISHNAN (Reg. No. 22309017) who
carried out the work under my supervision. Certified further that to the best of my
knowledge the work reported here in does not form part of any other thesis or
dissertation on the basis of which a degree or award was conferred on an earlier
occasion on this or any other candidate.

Signature of the Guide with date Signature of the HOD with date
Ms.AMIRTHAMADHURI, M.E., Mr.P. THIRUMOORTHY M.E.,
ii
iii

Directorate of Technical Education, Chennai - 600025


Government of Tami Nadu

BONAFIDE CERTIFICATE

Certified that this Report titled “IOT BASED AIR QUALITY INDEX
MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO USING NODE
MCU” is the bonafide work of S.NISHANTH (Reg. No. 22309013) who carried out
the work under my supervision. Certified further that to the best of my knowledge the
work reported here in does not form part of any other thesis or dissertation on the
basis of which a degree or award was conferred on an earlier occasion on this or any
other candidate.

Signature of the Guide with date Signature of the HOD with date
Ms.AMIRTHAMADHURI, M.E., Mr.P. THIRUMOORTHY M.E.,
ii
iii

Directorate of Technical Education, Chennai - 600025


Government of Tami Nadu

BONAFIDE CERTIFICATE

Certified that this Report titled “IOT BASED AIR QUALITY INDEX
MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO USING NODE
MCU” is the bonafide work of M.LOGESHWARAN (Reg. No. 22309011) who
carried out the work under my supervision. Certified further that to the best of my
knowledge the work reported here in does not form part of any other thesis or
dissertation on the basis of which a degree or award was conferred on an earlier
occasion on this or any other candidate.

Signature of the Guide with date Signature of the HOD with date
Ms.AMIRTHAMADHURI, M.E., Mr.P. THIRUMOORTHY M.E.,
ii
iii

Directorate of Technical Education, Chennai - 600025


Government of Tami Nadu

BONAFIDE CERTIFICATE

Certified that this Report titled “IOT BASED AIR QUALITY INDEX
MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO USING NODE
MCU” is the bonafide work of P.LOGANATHAN (Reg. No. 22309010) who
carried out the work under my supervision. Certified further that to the best of my
knowledge the work reported here in does not form part of any other thesis or
dissertation on the basis of which a degree or award was conferred on an earlier
occasion on this or any other candidate.

Signature of the Guide with date Signature of the HOD with date
Ms.AMIRTHAMADHURI, M.E., Mr.P. THIRUMOORTHY M.E.,
ii
iii

Directorate of Technical Education, Chennai - 600025


Government of Tami Nadu

BONAFIDE CERTIFICATE

Certified that this Report titled “IOT BASED AIR QUALITY INDEX
MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO USING NODE
MCU” is the bonafide work of S.SUJITH (Reg. No. 22309027) who carried out the
work under my supervision. Certified further that to the best of my knowledge the
work reported here in does not form part of any other thesis or dissertation on the
basis of which a degree or award was conferred on an earlier occasion on this or any
other candidate.

Signature of the Guide with date Signature of the HOD with date
Ms.AMIRTHAMADHURI, M.E., Mr.P. THIRUMOORTHY M.E.,
ii
iii

Directorate of Technical Education, Chennai - 600025


Government of Tami Nadu

BONAFIDE CERTIFICATE

Certified that this Report titled “IOT BASED AIR QUALITY INDEX
MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO USING NODE
MCU” is the bonafide work of C.SRIDHAR (Reg. No. 22309024) who carried out
the work under my supervision. Certified further that to the best of my knowledge the
work reported here in does not form part of any other thesis or dissertation on the
basis of which a degree or award was conferred on an earlier occasion on this or any
other candidate.

Signature of the Guide with date Signature of the HOD with date
Ms.AMIRTHAMADHURI, M.E., Mr.P. THIRUMOORTHY M.E.,

You might also like