0% found this document useful (0 votes)
26 views53 pages

BATCH 11 Project Report

The existing air pollution monitoring systems are expensive and complicated. They propose a low-cost air pollution monitoring system using various gas sensors, a Wi-Fi module, cloud server and mobile application. The system detects air pollution levels and sends alerts if the parameters exceed limits. It aims to provide a simple, mobile and inexpensive solution for air quality monitoring.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views53 pages

BATCH 11 Project Report

The existing air pollution monitoring systems are expensive and complicated. They propose a low-cost air pollution monitoring system using various gas sensors, a Wi-Fi module, cloud server and mobile application. The system detects air pollution levels and sends alerts if the parameters exceed limits. It aims to provide a simple, mobile and inexpensive solution for air quality monitoring.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 53

AIR POLLUTION MONITORING USING IOT

191EE77A-PROJECT WORK-PHASE-II

A PROJECT REPORT
Submitted

YOGESH S (113120UG05322)
VINODHINI U (113120UG05021)
JAIANAND K (113120UG05311)
In partial fulfillment for the award of the degree Of
BACHELOR OF ENGINEERING
In
DEPARTMENT OF ELECTRICAL AND ELECTRONICS
ENGINEERING
VELTECH MULTI TECH Dr.RANGARAJAN Dr.SAKUNTHALA
ENGINEERING COLLEGE, AVADI, CHENNAI.
(An Autonomous Institution)

ANNA UNIVERSITY: CHENNAI 600 025


JANUARY 2024

1
BONAFIDE CERTIFICATE

Certified that this project “ AIR POLLUTION MONITORING USING IOT "
is the bonafide work of the following students.

YOGESH S (113120UG05322)
VINODHINI N (113120UG05021)
(113120UG05311)
JAIANAND K
who carried out the project work under my supervision. Certified further that to the
best of knowledge, the work reported herein does not form part of any other project
report or dissertation on the basis of which a degree or award was conferred on an
earlier occasion this or any other candidate.

SIGNATURE SIGNATURE
Dr. Deepthi Joseph, M.Tech., Ph.D. Mrs.P.Gajalaxmi,M.Tech.
HEAD OF THE DEPARTMENT INTERNAL GUIDE
Electrical and Electronics Engineering Electrical and Electronics
Engineering.
191EE77A - PROJECT WORK-PHASE-II

Submitted for the Project Work Phase -II Viva -Voce

examination held on ...................

INTERNAL EXAMINER EXTERNAL EXAMINER

2
ACKNOWLEDGEMENT
We take this opportunity to acknowledge all the people who helped us to do our
project a successful one.
We greatly convey our sincere thanks and heartfelt gratitude to our beloved chairman
Col. Prof. Dr. Shri. Vel. R. RANGARAJAN, B.E (Elec.,), B.E (Mech.,),M.S (Auto.,),
D.Sc. Vice chairman Dr. (Mrs.). SAKUNTHALA RANGARAJAN, M.B.B.S., for their
support through the institution.
We are very much in debited to our beloved principal Dr. V. RAJAMANI, Ph.D.
giving us necessary permission and coordination to do our project.
We wish to express our profound gratitude to our Head of the Department, Mrs. Dr.
Deepthi Joseph, M.Tech., Ph.D. for her guidance encouragement for accomplishing the
project work.
We wish to convey our thanks to Mr.S.Dhanajeyan,M.E. Project coordinator who is
supporting and helping us to make this project as successful one.
We also wish to convey our heartfelt thanks to Mrs.P.Gajalaxmi,M.Tech. project
internal guide who is supporting and helping us to make this project a successful one.
We also extend our thanks to all of the staff members of the EEE department who
gave us the moral support and encouragement for preceding the project in the right way
for the completion of the project in successful way.
We bestow our thanks to friends and family for their motivation and encouragement at
all time we thank each and every one who helped us for the successful completion of the
project.

3
ABSTRACT:

We live in a time of industrial boom. With the rapid development of technology, the

number of industries and factories responsible for environmental pollution is increasing

rapidly every day. Continuous monitoring is necessary to control pollution in the air or in

the environment. However, most existing systems are expensive and complicated.

However, the slow increase in low-cost air quality monitoring systems is responsible for

the overall degradation.

To solve this problem, we designed an air pollution detection and monitoring

system that has a simple design, is mobile, and has a low cost. Our proposed monitoring

system embodies a device composed of various gas sensors, a NodeMcu Wi-Fi module, a

cloud server, and a cloud server monitoring application. In our implemented device, the

data from the air pollution monitoring server can be easily accessed. It also consists of a

warning system that will send an alert to the responsible officials if the pollution parameter

exceeds the standard permissible limit. The total cost of our implemented system is BDT,

which is generally lower than previously implemented systems .

4
LIST OF TABLES

CHAPTER NO TITLE PAGE NO

ABSTRACT 01
TABLE OF CONTENT 02

LIST OF FIGURES 04

LIST OF ABBREVIATIONS 05

LIST OF TABLES 06

1 INTRODUCTION 07

2 EXISTINGSYSTEM 08

2.1 BLOCK DIAGRAM 09

3 PROPOSED SYSTEM 10

3.1 BLOCK DIAGRAM 10

4 LITERATURE SURVEY 11

4.1 AIR QUALITY MONITORING 11

4.2 WITHOUT IOT CONTROL 12


5 HARDWARE DESCRIPTION

5.1 MICROCONTROLLER ATMEGA328

PIN CONFIGURATION 1
5.3 SPECIFICATION

5
5.4 APPLICATION

6 HARDWARE REQUIREMENTS

6.1 AIR QULAITY SENSOR MQ135

6.1.1 Specifications

6.1.2 Applications

6.2 MQ5 SENSOR

6.2.1 General description

6.2.1 Product description

6.2.3 Features

6.2.4 Applications

6.3 16×2 LCD

6.3.1 Product description

6.3.2 Features

6.3.3 Applications

7 SOFTWARE DESCRIPTION

7.1 EMBEDDED C

7.1.1 Description

7.1.2 Multiple address spaces

6
7.1.3 Named registers

7.2 I/O HARDWARE ADDRESSING

7.3 EMBEDDED C PORTABILITY

7.4 ARDUINO SOFTWARE (IDE)


7.4.1 Arduino bootloader issue

7.4.2 Hardware needed

7.4.3 Using another arduino as an ISP

7.4.4 Software needed

7.4.5 Boatload download instructions

7.4.6 Summary

7.5 USB Over current Protection

7.5.1 How to use Arduino

08 REFERENCES

09 CONCLUSION

7
LIST OF FIGURES

FIG NO NAME OF THE FIGURE PAGE NO

2.1 BLOCK DIAGRAM OF EXISTING SYSTEM 13


3.1 BLOCK DIAGRAM OF PROPOSED SYSTEM 14

5.1 ATMEGA328 17

5.2 AIR QUALITY SENSOR 26

5.3 16×2 LCD 30

7.1 ARDUINO SOFTWARE IDE 32


7.3 BOOTLOAD INSTRUCTIONS 43

8
LIST OF ABBREVIATIONS

IOT - Internet of Things

LCD - Liquid Crystal Display Wi-Fi - Wireless Fidelity

UART - Universal asynchronous receiver transmitter

USB - Universal Serial Bus I2C – Inter Integrated Circuit

RISC - Reduced Instruction Set Computer

FTDI - Future Technology Devices International Limited MAC - Media Access

Control Address

PCB - Printed Circuit Board

9
LIST OF TABLES

CHAPTOR NO NAME OF THE TABLE PAGE NO

5.2 PIN CONFIGURATION

10
CHAPTER 01
INTRODUCTION

Air pollution is the most important problem of each nation, whether or not it's
miles advanced or growing. health troubles were growing at a quicker price in particular in
city regions of growing countries where industrialization and the growing quantity of
motors result in launch of lot of gaseous pollutants. harmful outcomes of pollution consist
of slight hypersensitive reactions along with inflammation of the throat, eyes and nose as
well as a few critical problems like bronchitis, heart sicknesses, pneumonia, lung and
annoyed bronchial asthma. in keeping with a survey, because of air pollution 50,000 to
100,000 premature deaths according to 12 months occur inside the U.S. on my own. while
in the ecu the wide variety reaches three hundred,000 and over 3,000,000 international.
IOT based totally Air pollutants tracking gadget video display units the Air
satisfactory over a web server using internet and could trigger an alarm when the air
exceptional is going down past a certain threshold stage, approach while there are
sufficient number of harmful gases gift in the air like CO2, smoke, alcohol, benzene, NH3,
LPG and NOx. it's going to show the air first-rate in PPM at the lcd and as well as on
website in order that it can display it very effortlessly. LPG sensor is brought on this
system that is used by and large in homes. The system will display temperature and
humidity. The system can be hooked up anywhere however commonly in industries and
houses in which gases are primarily to be located and gives an alert message when the
system crosses threshold limit.

11
CHAPTER 02
EXISTING SYSTEM

In existing machine, the drawbacks of the traditional tracking gadgets are their big size,
heavy weight and first-rate expensiveness. these lead to sparse deployment of the
monitoring stations. so that it will be effective, the places of the tracking stations want
cautious placement due to the fact the air pollution scenario in urban regions is enormously
related to human sports (e.g. construction activities) and region-dependent (e.g., the traffic
chokepoints have tons worse air satisfactory than average). IOT based totally Air pollution
monitoring gadget video display units the Air first-rate over a webserver the usage of net
and will cause an alarm when the air nice goes down beyond a certain level, method whilst
there are range of harmful gases present inside the air.

12
2.1 BLOCK DIAGRAM:

13
CHAPTER 03

PROPOSED SYSTEM
This paper presents real-time standalone air quality monitoring. Internet of Things (IoT)is
nowadays finding profound use in every sector, plays a key role in our air quality
monitoring system too. The setup will show the air quality in PPM on the webpage so that
we can monitor it very easily. In this IoT project, we can monitor the pollution level from
anywhere using your computer or mobile.

3.1 BLOCK DIAGRAM:

14
CHAPTER 04
LITERATURE SURVEY

4.1 The Existing method for pollution monitoring system:

the explanation of the Air wi-fine Index (AQI) and its popular levels are describedwireless
in. From 0-100 ppm the atmosphere is safe for living. If the ppm stage will increase above
100 then it movements out of the protection quarter.
If the ppm fee rises above 200 then it becomes extremely risky for human life.
The DHT11 sensor module is used to measure the temperature and the humidity of the
surroundings.
The MQ-135 gasoline sensor is used to degree the air wi-fiwireless of the surroundings. it
can be calibrated with appreciate to clean air, alcohol, carbon dioxide,
hydrogen and methane. in this task, it's been calibrated with appreciate to clean air.
The controlling movement of Arduino and NodeMcu has been describedwireless. This
studies has proven the uses of C++ because the programming language for scripting
software code. It has an in- constructed c084d04ddacadd4b971ae3d98fecfb2a module
which permits the mission to put into effect IoT effortlessly.
Arduino IDE is used to enforce the coding a part of the task [5], [8]. IOT cloud is used for
the cloud carrier. It has a free model which requires a put off of 15 seconds to add an entry
in the cloud [6], [7].
As this mission uses sensors, each of them have inner heater factors and withdraw greater
energy(P=V*I), so though each sensors are became ON, their output voltage tiers range
and display unpredictable values because of wi-fi in wireless energy pressure. So, we used
a separate strength supply for the sensors as NodeMcu alone isn't wireless to power two
sensors.

15 | P a
CHAPTER 05
HARDWARE DESCRIPTION

MICROCONTROLLER ATMEGA328

5.1 ARDUINO:
Arduino ATMEGA-328 microcontroller encompass 14 enter and output analog and virtual
pins (from this 6 pins are considered to be a PWM pins), 6 analog inputs and ultimate
virtual inputs. electricity jack cable is used to connect arduino board with the computer.
Externally battery is hooked up with the arduino microcontroller for the power deliver.
Arduino is an open supply microcontroller from which there is no comments present
within the microcontroller. This arduino board consist of I2C bus that can be capable of
transfer the information from arduino board to the output devices. those arduino forums
are programmed over RS232 serial interface connections with ATmega arduino
microcontrollers. The operating volt ranges from 5v. The enter voltage endorsed for
arduino microcontroller is from 7v and the maximum of 12v. The DC enter current given
to the arduino board is in the variety of 40mA.
It is composed of different forms of recollections together with flash memory, EEPROM,
SRAM. The period of the arduino board is nearly approximately 68.64mm and the width
of the microcontroller is set 53.4mm. the weight of the arduino microcontroller is ready
20g. we will use diverse varieties of microcontroller which include eight bit AVL Atmel
microcontroller and 32 bit Atmel arm microprocessor. From these one-of-a-kind styles of
processors, we can use the ones processors for numerous engineering initiatives in addition
to commercial programs. a number of the examples of the use of the arduino inside the
business programs are controlling the actuators and sensors. some of the examples of
arduino microcontrollers are Arduino Duemilanove, Arduino UNO, Arduino Leonardo,
Arduino Mega, and Arduino MEGA 2560 R3, Arduino MEGA 2560 R3, Arduino Nano,
Arduino Due, LilyPadArduino, micro arduino. we have already noted, arduino has been
16
programmed through the use of c and c++ programming language. these c and c++ are
high level languages. normally it has 18 variety of enter and output pins. among those 6
pins are considered to be an analog inputs.From those analog inputs, we can be capable of
paintings the arduino microcontroller the usage of analog inputs deliver. commonly analog
inputs may be in the variety of 0-5V. much like that digital inputs are present within the
microcontroller that can act the use of microcontroller the use of virtual inputs. digital
inputs may be within the variety of 5V.
PIN DIAGRAM

ATMEGA 328 microcontroller, which acts as a processor for the ardubuilt-ino board.
nearly it consists ofintegrated 28 pintegrateds. From those 28 pbuilt-ins, the built-inputs
may be managed built-ingintegrated transmittbuilt-ing and receivintegratedg the

17
integratedputs to the external device. It also built-in pulse width modulation (PWM). these
PWM are used to transmit the complete signal integrated a pulse modulation.
enterintegrated electricity deliver built-inintegrated Vcc and Gnd are used. those IC built-
inespecially consists ofintegrated analog and digital integratedputs. those analog and
digital built-inputs are used for the process of built-in programs.
The power pbuilt-ins are as follows:
● VIN: The built-input voltage to the Arduintegratedo board while it's built-ing an external
strength source (built-in place ofintegrated five volts from the USB connection or other
regulated strength supply). you can supply voltage through this pintegrated, or, if
impartbuiltintegrated voltage through the strength jack, get right of entry to it via this
pintegrated.
● 5V: The regulated strength deliver used to electricity the microcontroller and other
components on the board. this may come either from VIN through an on-board regulator,
or be supplied by way of USB or every other regulated 5V supply.
● 3V3: A 3.3 volt deliver generated built-in the on-board regulator. most built-in draw is
50 mA.
● GND: floor pintegrateds.
each of the 14 digital pintegrateds on the Uno may be used as an integrated or output,
integrated pintegratedMode(), digitalWrite(), and digitalRead() features. They perform at 5
volts. each pintegrated can provide or acquire a most of 40 mA and has an built-
inbuiltintegrated pull-up resistor (disconnected through default) of 20-50 kOhms. further,
some pbuilt-ins have specialised functions:
● Serial: zero (RX) and 1 (TX): Used to obtabuiltintegrated (RX) and transmit (TX) TTL
serial built-inintegrated. those pbuilt-ins are related to the correspondbuilt-ing pintegrateds
of the ATmega8U2 USB-to-TTL Serial chip.
● external Interrupts: 2 and 3. those pintegrateds may be configured to cause an
integratedterrupt on a low cost, a integrated or fallbuilt-ing edge, or a change integrated
18
cost. See the attachInterrupt() function for built-info.
● PWM: 3, 5, 6, nine, 10, and eleven. provide eight-bit PWM output with the
analogWrite() characteristic.
● SPI: 10 (SS), eleven (MOSI), 12 (MISO), thirteen (SCK). these pbuilt-ins assist SPI
verbal exchange, which, although supplied through the underlybuilt-ing hardware, isn't
always currently protected built-inbuiltintegrated Ardubuilt-ino language.
● LED: 13. there may be a 7fd5144c552f19a3546408d3b9cfb251 LED linked to virtual
pintegrated 13. while the pbuilt-in is high fee, the LED is on, when the pbuilt-in is LOW,
it's off.
● 2C: four (SDA) and five (SCL). support I2C (TWI) conversation built-in the
twbuiltintegrated library.
● AREF. Reference voltage for the analog integratedputs. Used with analogReference().
● Reset. carryintegrated this lintegratede LOW to reset the microcontroller. commonly
used to feature a reset button to shields which block the one at the board
Analog Input:
Arduino atmega-328 microcontroller board include 6 analog inputs pins. these analog
inputs may be named from A0 to A5. From these 6 analog inputs pins, we can do the
method by the usage of analog inputs. Analog inputs can be used in the running variety of
zero to 5V. Analog sign is considered because the continuous time sign, from which these
analog signal may be used for certain programs. these also are referred to as as non-
discrete time sign. Inputs which include voltage, cutting-edge and so forth.., are taken into
consideration to beeither analog sign or digital sign most effective with the aid of
analysing thetime sign properties. diverse applications of arduinomicrocontroller can use
best an analog enter as opposed to virtual inputs. For these programs, analog enter ports or
pins may be used.
Digital Input:
virtual inputs can be defined because the non-non-stop time sign with discrete input
19
pulses. it could be represented as zero’s and 1’s. these virtual inputs may be either on
nation or in off kingdom. Arduino atmega328 microcontroller also includes 12 digital enter
pins. it is able to be stated as D0 to D11. nearly 12 inputs can be used for virtual
input/output programs. The working of the virtual enter ports is in which the discrete enter
pulses may be prompted and supplied to the ports. those ports acquire the input and
therefore the port can be used for both enter and output procedure. these digital pins can
access only the digital inputs.

Power Jack Cable / USB PORT:


This Arduino atmega-328 microcontroller may be interfaced with the other electronic
gadgets inclusive of laptop by way of the usage of USB port or power jack cable from
those energy jack cable, we will upload this system of Arduino for his or her programs. at
the beginning, the program can be initialised or may be edited with the aid of using
Arduino software program tools. Then these packages may be transferred thru arduino
microcontroller board by way of using usb cable or electricity jack cable.
Strength supply:
there may be an additional energy deliver source found in Arduino microcontroller. power
supply port is gift on the nook of the arduino microcontroller. both we can use this power
supply port by connecting with external energy deliver.(ie, ac electricity supply), or by
way of connecting an dc electricity supply thru input pins. those strength supplies produce
an lively shape to the arduino microcontroller. those arduino microcontrollers can take
delivery of quite a number power supply. whilst the power supply voltage rangeexceeds,
the microcontroller receives broken. therefore, onlythe unique range of energy deliver
ought to receive to thearduino microcontroller.

Architecture Diagram:
20
AVR provides a rich set of instructions and 32 target market records. All 32 registers are
simultaneously connected to the Mathematical Logic Unit (ALU), allowing individual
registers to input a single instruction in one clock cycle. The result is more green code

21
while being delivered 10 times faster than traditional CISC microcontrollers.
ATmega48PA / 88PA / 168PA / 328P provides the following functions: 4/8/16/32K bytes
on-device programmable flash memory (including read and write function),
256/512/512/1K bytes EEPROM, 512/1K/1K/2K bytes SRAM, 23 commonly used I/O
modes, 32 target function registers, three time switches/counters with detection, internal
and external interrupts, serial Programmed USART, byte-oriented 2-wire serial interface,
one SPI serial port, 6-channel 10-bit ADC (8 channels in TQFP and QFN/MLF
applications), programmable gateway controller with internal oscillator Dog timer and five
software programs to select energy saving mode. Idle mode halts the CPU while allowing
the SRAM, timer/counters, USART, 2-pin serial interface, SPI port, and interrupt handling
devices to operate. Power down mode saves the recording but freezes the oscillator,
disabling all the different chips until the next interrupt or hardware reset. In power saving
mode, the asynchronous timer continues to run, allowing the user to control the timer base
even when the device is in sleep mode. ADC noise reduction mode stops the CPU,
asynchronous timers, and all I/O modules other than the ADC to reduce conversion noise
when certain ADC levels are converted. In standby mode, the crystal/resonator oscillator is
in motion while the device is at rest. This allows you to get started very quickly and
effortlessly. The device was synthesized using Atmel's high-density non-volatile memory.
On-chip ISP flash memory allows on-machine reprogramming of memory via the SPI
serial interface using a conventional risk-free memory programmer or on-chip boot
software running in the AVR hub. Boot programs can use any connection to download
application software from application Flash memory. When the software flash level is
updated, the software at the boot flash level persists, allowing correct write-in-control
operation. The Atmel ATmega48PA/88PA/168PA/328P combines an 8-bit RISC CPU
with in-system self-programming flash memory on a single chip, resulting in a powerful
microcontroller that provides flexibility for many control applications.

22
COMMUNICATION:

Arduino Uno has some interfaces to communicate with laptop, other Arduino or
different microcontrollers. The ATmega328 provides UART TTL (5V) serial
communication located on virtual pins 0 (RX) and 1 (TX). The onboard ATmega8U2 takes
the USB communication interface and exposes it as a virtual port for software on the PC.
'8U2 firmware uses a standard USB COM driver, no external driver is needed.

However, on Windows, a *.inf file must be present. The Arduino software


includes a serial monitor that can easily send messages to and from the Arduino board. The
RX and TX LEDs on the board will blink when data is sent to the laptop via the USB-
serial chip and USB connection (but are not currently used for message exchange between
pins 0 and 1). The SoftwareSerial library allows communication between all of the Uno's
digital pins. ATmega328 also supports I2C (TWI) and SPI segments. The Arduino
software program includes a string library that easily uses the I2C bus; See documentation
for information. To use SPI communication, please refer to the ATmega328
documentation.

23
CHAPTER 06

HARDWARE IMPLEMENTATION:

6. 1 GAS SENSOR MQ-2


GENERAL DESCRIPTION

In current technology scenario, monitoring of gases produced is very important.


From home appliances such as air conditioners to electric chimneys and safety systems
at industries monitoring of gases is very crucial. Gas sensors spontaneously react to the
gas present, thus keeping the system updated about any alterations that occur in the
concentration of molecules at gaseous state. The gas sensor module consists of a steel
exoskeleton under which a sensing element is housed.

This sensing element is subjected to current through connecting leads. This


current is known as heating current through it, the gases coming close to the sensing
element get ionized and are absorbed by the sensing element. This changes the
resistance of the sensing element which alters the value of the current going out of it.
The connecting leads of the sensor are thick so that sensor can be connected firmly to
the circuit and sufficient amount of heat gets conducted to the inside part. They are
casted from copper and have tin plating over them.

PRODUCT DESCRIPTION
MQ-2 gas sensor is designed with sensitive material of sno2, which with lower
conductivity in clean air. When the target combustible gas exists, the sensor’s
conductivity is higher. Signal conditioning circuit is used to convert the change of
conductivity to correspond output signal with the input gas concentration. MQ-2 gas
sensor has high sensitivity to LPG, Propane and Hydrogen, also could be used to
Methane and other combustible steam, it is with low cost and suitable for different
24
GAS SENSOR MQ-8
DESCRIPTION
MQ-8 gas sensor composed by micro AL2O3 ceramic tube, Tin Dioxide (SnO2)
sensitive layer, measuring electrode and heater are fixed into a crust made by plastic
and stainless steel net. MQ-8 gas sensor has high sensitivity to hydrogen gas and has
anti-interference to gases. The enveloped MQ-8 have 6 pin , 4 of them are used to fetch
signals, and other 2 are used for providing heating current.

FEATURES
 Operating voltage: 5VDC
 Operating current:100-150mA
 Both analog and digital output
 Simple drive circuit

APPLICATIONS
 Hydrogen gas leakage detection
 Portable gas detector
 Fire safety detection system

25
mounted on a pcb board which has an operating voltage of 5VDC. The sensor output
values can be get by means of both analog and digital.

Gas sensor MQ-2

FEATURES

 Analog and Digital output


 Good sensitivity to Combustible gas in wide range
 High sensitivity to LPG, Propane and Hydrogen
 Operation voltage: 5VDC
 Simple drive circuit
 Long life and low cost

APPLICATIONS

 Domestic gas leakage detector


 Industrial Combustible gas detector
 Portable gas detector

26
GAS SENSOR MQ-4
GENERAL DESCRIPTION

In the current technological scenario, monitoring the produced gases is very


important. From home appliances like air conditioners to electric chimneys and
commercial security systems, gas maintenance is important. Gas sensors instantly react
to the presence of gas allowing the system to report changes in the concentration of gas
molecules. The gas sensor module consists of a metal exoskeleton with elements
underneath.

This hearing carries current through the connection. This current is called
heating current and through this current, the gas close to the sensor is ionized and
absorbed by the sensing element. This changes the resistance of the sensor, so the
amount of current coming out of the sensor also changes. Since the sensor connection is
thick, the sensor can be fixed to the circuit and sufficient heat can be generated inside.
They are cast from copper and coated with tin..

PRODUCT DESCRIPTION
MQ-4 gas sensor detects the concentration of methane gas in the environmental
air and output the reading as an analog voltage. The concentration sensing range of 300
ppm to 10,000 ppm is suitable for leak detection. Signal conditioning circuit is used to
convert the change of conductivity to correspond output signal with the input gas
concentration. MQ-4 gas sensor has high sensitivity to Methane, also to Propane and
Butane. The sensor could be used to detect different combustible gas, especially
Methane; it

27
is with low cost and suitable for different application. The MQ-4 gas module is mounted
on a pcb board which has an operating voltage of 5V DC. The sensor output values can be
get by means of both analog and digital.

Gas sensor MQ-4

FEATURES

 Analog and digital output


 High sensitivity to CH4, natural gas
 Small sensitivity to alcohol and smoke
 Fast response
 Stable and long life
 Operating voltage: 5VDC

APPLICATIONS

 Domestic gas leakage detector


 Industrial Combustible gas detector
 Alcohol checker
28
GAS SENSOR MQ-8
DESCRIPTION
MQ-8 gas sensor composed by micro AL2O3 ceramic tube, Tin Dioxide (SnO2)
sensitive layer, measuring electrode and heater are fixed into a crust made by plastic and
stainless steel net. MQ-8 gas sensor has high sensitivity to hydrogen gas and has anti-
interference to gases. The enveloped MQ-8 have 6 pin , 4 of them are used to fetch signals,
and other 2 are used for providing heating current.

FEATURES
 Operating voltage: 5VDC
 Operating current:100-150mA
 Both analog and digital output
 Simple drive circuit

APPLICATIONS
 Hydrogen gas leakage detection
 Portable gas detector
 Fire safety detection system

DC FAN
GENERAL DESCRIPTION
DC Brushless cooling fans have a long history of being an effective method of
cooling electronic circuits. Today, DC brushless cooling fans are found in new
applications and are being evaluated by engineers that may not have previously used fans
in their products. These engineers may not be familiar with all of the “undocumented
features” that are inherent to these types of fans.

29
If the engineer is not familiar with all the characteristics of air moving devices, they could
be in for a nasty surprise. Fan manufacturers typically specify the nominal speed of the
fan, as well as an operating voltage range.

PRODUCT DESCRIPTION
A DC fan is a device used for cooling purpose in many systems. when a supply is
given to a device it starts rotating. The direction of the fan can be changed by reversing the
supply. DC or direct current fan works on the principal, when a current carrying conductor
is placed in a magnetic field, it experiences a torque and has a tendency to move.

The fan has a DC brushless motor, with an operating voltage of 5V, and is rated at 360mA.
Keeping the temperature down in your project can often be a necessity, and this fan can
definitely help. When designing the electronics that interface to a DC brushless cooling
fan, it is critically important to be aware of this behavior.

30
6.3 16×2 LCD

GENERAL DESCRIPTION

LCD stands for liquid crystal display. They come in many sizes 8x1, 8x2, 10x2,
16x1, 16x2, 16x4, 20x2, 20x4,24x2, 30x2, 32x2, 40x2 etc. Many multinational
companies like Philips Hitachi Panasonic make their own special kind of
LCD'S to be used in their products. All the LCD'S performs the same functions
(display characters numbers special characters ASCII characters etc). Their
programming is also same and they all have same 14 pins (0-13) or 16 pins (0
to 15). Alphanumeric displays are used in a wide range of applications,
including palmtop computers, word processors, photocopiers, point of sale
terminals, medical instruments, cellular phones, etc.

6.3.1 PRODUCT DESCRIPTION

This is a special LCD screen designed for electronic products. It is a 16-character, 2-line
alphanumeric LCD display connected to a 9-way D-type connector. This allows devices to
be connected tomost E-Block I/O ports. The LCD screen requires data in serial format
which is detailed in the user manual below. The monitor also needs 5V power supply.
Please be careful not to exceed 5V, otherwise the device will be damaged. 19 5V is best
developed by E-blocks multi-function programmer or 5V constant control power supply.
16 x 2 intelligent alphanumeric dot matrix display is capable of displaying 224 characters
and symbols. The full list of 9 symbols and symbols is printed on page 7/8 (please note
that these symbols may differ depending on the type of LCD used). This manual contains
all the specifications for connecting the device that requires a power supply (+5V).

31
6.3.2 FEATURES:

 Input voltage: 5v
 E-blocks compatible
 Low cost
 Compatible with most I/O ports in the E-Block range

6.3.3 APPLICATIONS:

 Monitoring

SINGLE RELAY BOARD


GENERAL DESCRIPTION

Relays are simple switches which are operated both electrically and mechanically.
Relays consist of a n electromagnet and also a set of contacts. The switching mechanism is
carried out with the help of the electromagnet. The main operation of a relay comes in
places where only a low-power signal can be used to control a circuit.
It is also used in places where only one signal can be used to control a lot of
circuits. They were used to switch the signal coming from one source to another
destination. The high end applications of relays require high power to be driven by electric

32
motors and so on. Such relays are called contactors.

PRODUCT DESCRIPTION
A relay is an electromechanical switch which is activated by an electric current. A
single relay board arrangement contains driver circuit, power supply circuit and isolation
circuit. A relay is assembled with that circuit. The driver circuit contains transistors for
switching operations. The transistor is use for switching the relay.

An isolation circuit prevents reverse voltage from the relay which protects the
controller and transistor from damage. The input pulse for switching the transistor is given
from the microcontroller uni t. It is used for switching of a single device.

33
CHAPTER 07
SOFTWARE DESCRIPTION EMBEDDED C

7.1 ABOUT EMBEDDED C

High-level language programming has lengthy been in use for


embedded- systems development. but, assembly programming nonetheless
prevails, specifically for digital-signal processor (DSP) based structures. DSPs
are often programmed in meeting language by using programmers who
recognize the processor architecture inner out. the important thing motivation
for this practice is overall performance, in spite of the dangers of meeting
programming while as compared to high-degree language programming.

If the video decoding takes 80 percent of the CPU-cycle budget rather


than ninety percent, as an example, there are two times as many cycles to be
had for audio processing. This coupling of performance to give up-person
capabilities is feature of some of the actual-time programs in which DSP
processors are carried out. DSPs have a especially specialised architecture to
achieve the overall performance requirements for signal processing programs
within the limits of fee and power intake set for patron packages. unlike a
traditional Load-store (RISC) architecture, DSPs have a statistics direction with
reminiscence-get right of entry to gadgets that immediately feed into the
arithmetic devices. address registers are taken out of the overall-motive sign up
file and positioned subsequent to the reminiscence units in a separate register
record.

34
A in addition specialization of the data course is the coupling of
multiplication and addition to form a single cycle Multiply-gather unit (MAC).
it's far mixed with unique-cause accumulator registers, which are separate from
the general-cause registers. statistics memory is segmentedandplaced
near the MAC to gain the high bandwidths required to hold up with the
streamlined facts direction. Limits are frequently placed at the quantity of
memory-addressing operations. The localization of assets in the data direction
saves many information actions that commonly take vicinity in a Load-shop
architecture.

The maximum important, not unusual mathematics extension to DSP


architectures is the handling of saturated constant-point operations with the aid
of the arithmetic unit. fixed-factor mathematics can be implemented with little
additional price over integer mathematics. automated saturation (or clipping)
extensively reduces the range of manage-float instructions wanted for checking
overflow explicitly within the application. changes in technological and
monetary requirements make it greater high-priced to maintain programming
DSPs in meeting. Staying with the cell phone as an instance, the sign-
processing algorithms required emerge as increasingly more complicated.
features including more potent errors correction and encryption must be
brought. communication protocols turn out to be more state-of-the-art and
require a whole lot more code to enforce. In certain markets, multiple protocol
stacks are applied to be well matched with a couple of provider providers. in
addition, backward compatibility with older protocols is needed to live
35
synchronized with issuer networks which are in a sluggish system of upgrading.

nowadays, most embedded processors are supplied with C compilers.


no matter this, programming DSPs is still done in assembly for the signal
processing elements or, at first-rate, by way of the use of assembly-written
libraries provided via manufacturers. the key cause for this is that although the
architecture is properly matched to the requirements of the sign-processing
software, there is no way to express the algorithms efficiently and in a natural
way in popular C. Saturated mathematics.
7.1.1 DESCRIPTION

Embedded C is designed to bridge conflicting functions of standard C and


embedded devices and application architectures. It binds the C language to the basic
elements required by the application configuration and is usually provided by DSP
processors. Built-in support for literal data types and named addresses in C signature
based on DSP-C
DSP-C [1] is an industry-designed extension of C with which
experience was gained since 1998 by various DSP manufacturers in their
compilers. For the development of DSP-C by ACE (the company three of us
work for), cooperation was sought with embedded-application designers and
DSP manufacturers.

7.1.2 MULTIPLE ADDRESS SPACES

Embedded C supports the multiple address spaces found in most


embedded systems. It provides a formal mechanism for C applications to
directly access (or map onto) those individual processor instructions that are
designed for optimal memory access. Named address spaces use a single,
36
simple approach to grouping memory locations into functional groups to
support MAC buffers in DSP applications, physical separate memory spaces,
direct access to processor registers, and user-defined address spaces.

The Embedded C extension supports defining both the natural


multiple address space built into a processor's architecture and the application-
specific address space that can help define the solution to a problem.

Embedded C uses address space qualifiers to identify specific


memory spaces in variable declarations. There are no predefined keywords
for this, as the
actual memory segmentation is left to the implementation. As an example,
assume that X and Y are memory qualifiers. The definition:

X int a[25] ;

Means that a is an array of 25 integers, which is located in the X memory.


Similarly (but less common):

X int * Y p ;

Means that the pointer p is stored in the Y memory. This pointer points to
integer data that is located in the X memory. If no memory qualifiers are used,
the data is stored into unqualified memory.

For proper integration with the C language, a memory structure is


specified, where the unqualified memory encompasses all other memories. All
unqualified pointers are pointers into this unqualified memory. The unqualified
37
memory abstraction is needed to keep the compatibility of the void * type, the
NULLpointer, and to avoid duplication of all library code that accesses
memory through pointers that are passed as parameters.

7.1.3 NAMED REGISTERS

Embedded C allows direct access to processor registers that are not


addressable in any of the machine's address spaces. The processor registers are
defined by the compiler-specific, named-register, storage class for each
supported processor. The processor registers are declared and used like
conventional C variables (in many cases volatile variables). Developers
using Embedded C can
now develop their applications, including direct access to the condition code
register and other processor-specific status flags, in a high-level language,
instead of inline assembly code.

Named address spaces and full processor access reduces application


dependency on assembly code and shifts the responsibility for computing data
types, array and structure offsets, and all those things that C compilers routinely
and easily do from developers to compilers.

7.2 I/O HARDWARE ADDRESSING

The motivation for including I/O hardware as a priority in embedded C is to improve


device driver mobility. In principle, a hardware driver should only care about the device
itself. Drivers operate the equipment through registers, which are specialized equipment.
However, the method of accessing these names may differ between different systems, even

38
if the same device is connected. I/O hardware access fundamentals aim to create a set that
abstracts system-specific access methods from access devices. The ultimate goal is to
allow code portability between device drivers on different systems. In the design of the I/O
hardware address interface we must follow the following:

1. The source code of the device driver must be portable.


2. The interface should not interfere with the application by generating machine code that
works like other methods.
3. The design should allow for encapsulation of system-dependent access methods.
Compilation is based on
which includes small functions defined in the archive. These interfaces are divided into
two groups; one provides access to the device, the second controls the access itself.

To access the device, the following functions are defined by Embedded C:

unsigned int iord( ioreg_designator );


void iowr( ioreg_designator, unsigned int value );
void ioor( ioreg_designator, unsigned int value );
void ioand( ioreg_designator, unsigned int
value ); void ioxor( ioreg_designator, unsigned int
value );

These interfaces provide read/write access to device registers, as well as typical


methods for setting/resetting individual bits. Variants of these functions are
defined (with buf appended to the names) to access arrays of registers. Variants
are also defined (with l appended) to operate with long values.

39
All of these interfaces take the I/O descriptor ioreg_designator as one of the
parameters. These registry generators are an abstract version of the actual
registry provided by the system and hide the access process from the driver's
source code. Three functions are defined to manage I/O scratchpad indicators.
While these are abstract settings for the device driver, the driver is responsible
for initiating and releasing the logon process. These functions do not enter or
initialize the device itself, as this is the responsibility of the driver. For
example, they allow the operating system to map the device's memory to the
user's address..

void iogroup_acquire( iogrp_designator );


void iogroup_release( iogrp_designator );
void iogroup_map( iogrp_designator, iogrp_designator );

The iogrpdesignator specifies a logical group of I/O register designators;


typicallythis will be all the registers of one device. Like the I/O register
designator, the I/O group designator is an identifier or macro that is provided
by the system implementation. The map variant allows cloning of an access
method when one device driver is to be used to access multiple identical
devices.

7.3 EMBEDDED C PORTABILITY

By design, a number of properties in embedded C remain implementation


defined. This indicates that portability of embedded C programs is not always
guaranteed. Embedded C provides access to DSP performance features. As not
all processors are equal, not all embedded C implementations are equal. For

40
example, suppose an application requires 24-bit fixed-point arithmetic and the
embedded C implementation provides only 16 bits because that is the native
size of the processor. When the algorithm is expressed in embedded C, it will
not produce outputs of the correct precision.

In such a case, there is a mismatch between the application requirements


and the processor capabilities. In any case, the algorithm will not run efficiently
on such a processor, including using assembly. Embedded C cannot resolve
such discrepancies. However, embedded c
Portability of embedded applications and provides a major improvement in
software engineering. Although there are many differences between
performance-specific processors, there are significant similarities in the special-
purpose features they provide to speed up applications.

Writing C code with low-level processor-specific support seems to have


many of the portability problems typically associated with assembly code. In
limited experience with porting applications using the Embedded C extension,
an automotive engine controller application (about 8000 lines of source) was
ported to the ETPU, a 24-bit special-purpose processor, to a general-purpose 8-
bit Freescale 68S08. with a screen full of definitions placed in a header file. The
porting process was much easier than expected. For example, variables
implemented on processor registers were ported to non-volatile memory in
general-purpose microprocessors by changing the definitions in the header
definition and without any actual code changes. This exercise was to identify
porting issues and it is clear that the performance of a special purpose processor
is significantly higher than that of a general purpose target.

41
7.4 ARDUINO SOFTWARE (IDE)
Get the latest version from the download page. You can choose between the installer
(.exe) and the Zip package. We recommend using the first one, which directly installs
everything you need using the Arduino software (IDE), including drivers. To use the zip
package, you must install the driver manually. Zip archives are also useful if you want to
create a portable installation.

After the download is completed, start the installation and please allow the driver
installation when you receive a transaction notification.

42
Choose the components to install

Choose the installation directory (we suggest to keep the default one)

43
extract and install all the required files to execute properly the Arduino
Software (IDE)

7.4.1 Arduino Boot loader Issue

The current boot loader burned onto the Arduino UNO is not compatible
with ROBOTC. In its current form, you will be able to download the ROBOTC
Firmware to the Arduino UNO, but you will not able to download any user
programs.

The reason for this is because there is a bug in the Arduino UNO
firmware that does not allow flash write commands to start at anywhere but the
beginning of flash memory (0x000000). See the bottom of this page for more
technical details.

Because ROBOTC is not able to burn a new bootloader as of today, you


will need to use the Arduino's Open-Source language with a modified

44
bootloader file to re-burn your bootloader on your Arduino UNO boards. The
enhanced bootloader
is backwards compatible with the original one. That means you'll still be able to
program it through the Arduino programming environment as before, in
addition to ROBOTC for Arduino.

7.4.2 Hardware Needed

To burn a new version of the Arduino boot loader to your UNO, you'll
need an AVR ISP Compatible downloader.

Using an AVR ISP (In System Programmer)

 Your Arduino UNO (to program)


 An AVR Programmer such as the AVR Pocket Programmer
 An AVR Programming Cable (the pocket programmer comes with one)

If you have extra Arduino boards, but no ISP programmer, SparkFun.com has a
cool tutorial on how to flash a bootloader using an Arduino as an ISP.

7.4.3 Using another Arduino as an ISP

 Your Arduino UNO (to program)


 A Working Arduino (doesn't matter what kind)
 Some Male-to-Male Jumper Cables

For instructions on this method, take a look at the SparkFun.com website:


http://www.sparkfun.com/tutorials/247

7.4.4 Software Needed


ROBOTC is not currently able to burn a bootloader onto an Arduino board,
45
so you'll need to download a copy of the latest version of the Arduino Open-
Source programming language.

 Arduino Official Programming Language - Download Page

In addition, you'll need the ROBOTC modified bootloader. You can download
that here:

 ROBOTC Modified UNO Bootloader - Modified Bootloader

7.4.5 Boatload Download Instructions

 Download the Arduino Open Source Software and a copy of the Modified
Bootloader File
 Copy the Modified Bootloader File into the /Arduino-
1.0/hardware/arduino/bootloaders/stk500v2/ and overwrite the existing
bootloader.

 Power up your Arduino UNO (either via USB or external power) Plug in your
AVR ISP Programmer to your computer (make sure you have any required

46
drivers installed)
 Connect your AVR ISP Programmer into your Arduino UNO Board via the
ISP Header (the 2x3 header pins right above the Arduino Logo)
 Launch the Arduino Open-Source Software

 Change your settings in the Arduino Software to look for an Arduino UNO

 Change your settings in the Arduino Software to select your ISP Programmer
Type (Check your programmer's documentation for the exact model)

47
 Select the "Burn Bootloader" option under the "Tools" menu. The modified
bootloader will now be sent to your Arduino. This typically take a minute or so.

 You should be all set to download ROBOTC firmware and start using your
Arduino UNO with ROBOTC.

48
7.4.6 Summary

Microcontroller Arduino UNO


Operating Voltage 5V Input Voltage (recommended)

Input Voltage (limits) 6-20V

Digital I/O Pins 54 (of which 14 provide PWM output)

Analog Input Pins 16

DC Current per I/O Pin 40mA

DC Current for3.3VPin 50mA

Flash Memory 256 KB of which 8 KB used by bootloader

SRAM 8KB

EEPROM 4KB

Lock Speed 16MHz

The Arduino UNO can be powered via the USB connection or with an
external power supply. The power source is selected automatically. External
(non- USB) power can come either from an AC-to-DC adapter (wall-wart) or
battery. The adapter can be connected by plugging a 2.1mm center-positive
plug into the board's power jack. Leads from a battery can be inserted in the
Gnd and Vin pin headers of the POWER connector.
The board can operate on an external supply of 6 to 20 volts. If supplied
with less than 7V, however, the 5V pin may supply less than five volts and
theboard may be unstable. If using more than 12V, the voltage regulator may

49
overheat and damage the board. The recommended range is 7 to 12 volts.

They differ from all preceding boards in that it does not use the FTDI USB-to-
serial driver chip. Instead, it features the programmed as a USB-to-serial
converter.

7.5 USB Over current Protection

Physical Characteristics and Shield Compatibility

Arduino UNO features a resettable polysilicon fuse that protects the computer's
USB port from short circuits and overcurrent. Although most computers provide their own
internal protection, fuses provide an additional layer of protection. If more than 500 mA is
applied to the USB port, the fuse will trip until the short circuit or overload is resolved.

The maximum length and width of UNO PCB are 4 inches and 2.1 inches
respectively; The USB connector and power input are connected to the first.
Three screw holes allow the plate to be fixed to a location or building. Note that the
distance between pins 7 and 8 is 160 mils (0.16"), not the 100 mils between the other pins.
UNO's design is compatible with most shields.

Designed for Diecimila Dumiranov. Pins 0 through 13 (and the adjacent AREF
and GND pins), analog inputs 0 through 5, the power connector, and the ICSP connector
are all in the same place.

Also, the main UART (serial port) is located on the same pins (0 and 1) as the
external interface 0 and 1 (pins 2 and 3 respectively). SPI is available in the ICSP header
of Mega and Duemilanove/Diecimila. Please note that I2C has different pins on the Mega
(20 and 21) than Duemilanove / Diecimila (analog inputs 4 and 5).

50
7.5.1 How to use Arduino
Arduino can sense the environment by receiving input from various
sensors and influence he environment by controlling lights, motors, and other
actuators. The microcontroller on the board is programmed using the Arduino
programming language (based on Wiring) and the Arduino development
environment (based on Processing). Arduino projects can be stand-alone or
they can communicate with software on running on your computer (e.g. Flash,
Processing, MaxMSP).

Arduino is a cross-platform program. You must follow different instructions


for your personal OS. Check on the Arduino site for the latest instructions.
http://arduino.cc/en/Guide/HomePage
Once you have downloaded/unzipped the Arduino IDE, you can connect the
Arduino to your PC via USB cable.

51
CHAPTER 08
CONCLUSION

The system to monitor the air of environment using Arduino microcontroller, IOT
Technology is proposed to improve quality of air. The use of IOT technology enhances the
process of monitoring various aspects of environment such as air quality monitoring issue
proposed in this paper. Here, using the MQ135 and MQ6 gas sensor gives the sense of
different types of dangerous gas and Arduino is the heart of this project. Which controls
the entire process. Wi-Fi module connects the whole process to internet and LCD is used

52
CHAPTER 09
REFERENCE

[1] Arun Raj V., Priya R.M.P., and Meenakshi, V., "Air Pollution Monitoring In Urban Area,"
International Journal of Electronics and Communication Engineering, 2020 .
[2] Matthews V.O., Uzairue S.I., Noma-Osaghae E., and Nwukor F., Design and Simulation of a
Smart Automated Traffic System in a Campus Community.", International Journal of Emerging
Technologies and Innovative Research (www.jetir.org | UGC and issn Approved), ISSN:2349-5162,
5 (8), 2018, pp. 492-497, Available at :http://www.jetir.org/papers/JETIR1807794.pdf.
[3] Priyanka, V., "Review: Air Quality Monitoring System," International Journal of Advanced
Research in Computer and Communication Engineering, 5(6), 2019.
[4] Matthews, V. O., Noma-Osaghae, E., and Uzairue, S. I., "An Analytics Enabled Wireless Anti-
Intruder Monitoring and Alarm System," International Journal of Scientific Research in Science,
Engineering and Technology, 4, 2018, pp. 5-11.
[5] Nghi Dam, Andrew Ricketts, Benjamin Catlett, Justin Henriques , "Wearable Sensors for
Analyzing Personal Exposure to Air Pollution," IEEE , 2017.
[6] Etinosa, N.-O., Okereke, C., Robert, O., Okesola, O. J., and Okokpujie, K. O., "Design and
Implementation of an Iris Biometric Door Access Control System," in Computational Science and
Computational Intelligence (CSCI), 2017, Las Vegas, USA, 2017
[7] Al-Ali, A.R., Zualkernan, I. and Aloul, F., 2010. A mobile GPRS-sensors array for air pollution
monitoring. IEEE Sensors Journal, 10(10), pp.1666-1671.
[8] Snyder, E.G., Watkins, T.H., Solomon, P.A., Thoma, E.D., Williams, R.W., Hagler, G.S.,
Shelow, D., Hindin, D.A., Kilaru, V.J. and Preuss, P.W., 2013. The changing paradigm of air
pollution monitoring.

Youtube link: https://youtu.be/s8uSgNf8ZTc?si=PkcsVVNWg8a6hG8y

53

You might also like