IOT Based Environmental Parameters Monitoring System For Smart Cities

You might also like

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

Abstract:-

A smart city enables the effective utilization of resources and better quality of
services to the citizens. To provide services such as air quality management, weather
monitoring and automation of homes and buildings in a smart city, the basic
parameters are temperature, humidity and CO2. This paper presents a customised
design of an Internet of Things (IoT) enabled environment monitoring system to
monitor temperature, humidity and CO2 and measures water TDS (Total dissolved
solids).

The level of pollution is increasing rapidly due to factors like industries, urbanization,
increasing in population, vehicle use which can affect human health. IOT Based Air
Pollution Monitoring System is used to monitor the Air Quality over a web server using
Internet. It will trigger an alarm when the air quality goes down beyond a certain level,
means when there are sufficient amount of harmful gases present in the air like CO2,
smoke, alcohol, benzene, NH3 and NOx. It will show the air quality in PPM on the LCD
and as well as on webpage so that air pollution can be monitored very easily.

The system uses MQ135 and MQ6 sensor for monitoring Air Quality as it detects most
harmful gases and can measure their amount accurately.

KEYWORDS: Air Pollution, MQ135 Sensor, water TDS, IOT, Arduino Uno
INTRODUCTION :-

Pollution is the biggest problem of every nation, whether it is developed or


developing. Health problems have been growing at faster rate especially in urban areas
of developing countries where industrialization and growing number of vehicles leads
to release of lot of gaseous pollutants. Harmful effects of pollution include mild allergic
reactions such as irritation of the throat, eyes and nose as well as some serious
problems like bronchitis, heart diseases, pneumonia, lung and aggravated asthma.
According to a survey, due to air pollution 50,000 to 100,000 premature deaths per
year occur in the U.S. alone. Whereas in EU number reaches to 300,000 and over
3,000,000 worldwide. IOT Based Air Pollution Monitoring System monitors the Air
quality over a web server using Internet and will trigger an alarm when the air quality
goes down beyond a certain threshold level, means when there are sufficient amount
of harmful gases present in the air like CO2, smoke, alcohol, benzene, NH3, LPG and
NOx. It will show the air quality in PPM on the LCD and as well as on webpage so that it
can monitor it very easily. LPG sensor is added in this system which is used mostly in
houses. The system will show temperature and humidity. The system can be installed
anywhere but mostly in industries and houses where gases are mostly to be found and
gives an alert message when the system crosses threshold limit.
Literature Review :-

1. Smart City IoT Based Weather Monitoring System Adil


Hamid Malik1, Aaqib jalal2, Bilal Ahmed Parray3, Meena kohli4 BE student1, 2, 3, Assistant Professor4
Department of ECE Model Institute of Engineering and Technology Jammu, India

Abstract:

Climatic change and environmental monitoring have received much attention recently. Man wants
to stay updated about the latest of latest weather conditions of any place like a college campus or any
other particular building. Since the world is changing so fast so should the weather stations. Here in this
paper we present a weather station that is very helpful for smart city challenges. This weather station is
based on IoT (internet of things). It is equipped with environmental sensors used to capture distributed
meteorological measurements at any particular place and report them in real time on cloud. To
accomplish this we used Raspberry pi2 and different environmental sensors like DHT11, rain drop sensor
module KG004, MQ2 and a buzzer. The sensors constantly sense the weather parameters and keeps on
transmitting it to the online web server over a wifi connection. The weather parameters are uploaded on
the cloud and then provides the live reporting of weather informatics. Also system allows user to set
alerts for particular instances, the system provides alerts to user if the weather parameters cross those
values. This paper also focuses on the IoT application in the new generation of environmental informatics
and provides a new paradigm for environmental monitoring in future. It will also give the graphical
representation of the weather parameters that will help the user to compare the weather stastics of
different instants of time and from this graphical representation the user can predict the weather of that
particular place. The system has been development particularly in the view of building smart city by
giving the weather update of any particular place like a particular office or room.
2. Smart City Parking: A QR Code based Approach

Tanmay Satpalkar, Sagar Salian, Sagaya Stephen Shakila Shaikh Assistant Profes sor Computer
Department St. John College of Engineering & Technology Mumbai University

Abstract-

In this paper, we implement a system that allows drivers to find parking slots online
and reserve it. The drivers use this system on their personal devices having the android.
It eliminates the drawbacks of existing system like use of RFID, LED, and IR sensors. In
this system, driver can reserve the parking slot in the specific zone, checking the free
slots and reserving it as per the needs of the vehicle. Further the QR code is generated
which encodes the unique details of the user. QR code is used for encryption and to
ease the process of authentication. Furthermore, we explain the detail working of SPS.
Thus by using this system it may be very useful to reduce the load on the driver as well
as to reduce traffic on road and can be helpful to park the vehicle in the peak hours.

3. THE SMART CITY INFRASTRUCTURE DEVELOPMENT & MONITORING

Mahmoud AL-HADER Limitless, Dubai United Arab Emirates


mahmoud.hader@gmail.com

Abstract

The smart city infrastructure is the introductory step for establishing the overall
smart city framework and architecture. Very few smart cities are recently established
across the world. Some examples are: Dubai, Malta, Kochi (India), Singapore. The scope
of these cities is mainly limited to construct a technology park converting the industrial
real estate to state of the art information technology using the evolution in the telecom
and IP networks including insignificant asset management automation system. The
development background is to create an operational platform that would manage the
power consumption and operational resources in order to reduce the overall running
operational cost.
PROBLEM DEFINITION

In today’s world many pollution monitoring systems are designed by considering


different environmental parameters. Existing system model is presented in figure 1 uses
Zigbee based wireless sensor networks to monitor physical and environmental
conditions with thousands of application in different fields. Zigbee range is short
distance, so we can use IoT for wide area network.

figure 1

The sensor nodes directly communicated with the moving nodes deployed on the
object of interest which avoided the use of complex routing algorithm but local
computations are very minimal.

As we have seen number of times the dustbins are getting overflown and concern
person don’t get the information within a time and due to which unsanitary condition
formed in the surroundings, at the same time bad smell spread out due to waste, bad
look of the city which paves the way for air pollution and to some harmful diseases
around the locality which is easily spreadable.
BASICS OF IoT:
2.1 Definition the Internet of Things (IoT) is the interconnection of uniquely identifiable
embedded computing devices within the existing Internet infrastructure. The “Internet
of Things” connects devices and vehicles using electronic sensors and the Internet.

2.2 Introduction The Internet of Things (IoT) is the network of physical objects devices,
vehicles, buildings and other items embedded with electronics, software, sensors, and
network connectivity that enables these objects to collect and exchange data. The IoT
allows objects to be sensed and controlled remotely across existing network
infrastructure, creating opportunities for more direct integration of the physical world
into computer based systems, and resulting in improved efficiency, accuracy and
economic benefit, when IoT is augmented with sensors and actuators, the technology
becomes an instance of the more general class of cyber physical systems, which also
encompasses technologies such as smart grids, smart homes, intelligent transportation
and smart cities. Each thing is uniquely identifiable through its embedded computing
system but is able to interoperate within the existing Internet infrastructure.

So, Internet of Things or IoT is an architecture that comprises specialized hardware


boards, Software systems, web APIs, protocols which together creates a seamless
environment which allows smart embedded devices to be connected to internet such
that sensory data can be accessed and control system can be triggered over internet.
Proposed Hardware Architecture:

2 x 16
LCD

MQ 135
Co2 sensor Arduino

UNO
Humidity
sensor

DC
Temperature
POWER SUPPLY
sensor
Hardware description:
Arduino UNO
Overview

The Arduino Uno is a microcontroller board based on the ATmega328


(datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM
outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack,
an ICSP header, and a reset button. It contains everything needed to support the
microcontroller; simply connect it to a computer with a USB cable or power it with a
AC-to-DC adapter or battery to get started.

The Uno differs from all preceding boards in that it does not use the FTDI
USB-to-serial driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to
version R2) programmed as a USB-to-serial converter. Revision 2 of the Uno board has a
resistor pulling the 8U2 HWB line to ground, making it easier to put into DFU mode.
Revision 3 of the board has the following new features:

1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two
other new pins placed near to the RESET pin, the IOREF that allow the shields to adapt
to the voltage provided from the board. In future, shields will be compatible both with
the board that use the AVR, which operate with 5V and with the Arduino Due that
operate with 3.3V. The second one is a not connected pin, that is reserved for future
purposes.
Fig 2.1 Arduino UNO

Microcontroller ATmega328

Operating Voltage 5V

Input Voltage (recommended) 7-12V

Input Voltage (limits) 6-20V

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

Analog Input Pins 6

DC Current per I/O Pin 40 mA

DC Current for 3.3V Pin 50 mA

Flash Memory 32 KB of which 0.5 KB used bybbootloader

SRAM 2 KB

EEPROM 1 KB

Clock Speed 16 MHz


Power

The Arduino Uno can be powered via the USB connection or with an external power
supply. The power source is selected automatically.

External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or
battery. The adapter can be connected by plugging a 2.1mm center-positive plug into
the board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin
headers of the POWER connector.

The board can operate on an external supply of 6 to 20 volts. If supplied with less than
7V, however, the 5V pin may supply less than five volts and the board may be unstable.
If using more than 12V, the voltage regulator may overheat and damage the board. The
recommended range is 7 to 12 volts.

The power pins are as follows:

VIN. The input voltage to the Arduino board when it's using an external power
source (as opposed to 5 volts from the USB connection or other regulated power
source). You can supply voltage through this pin, or, if supplying voltage via the power
jack, access it through this pin.

5V.This pin outputs a regulated 5V from the regulator on the board. The board can
be supplied with power either from the DC power jack (7 - 12V), the USB connector
(5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins
bypasses the regulator, and can damage your board. We don't advise it.
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw
is 50 mA.

GND. Ground pins.

Memory

The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB of
SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).

Input and Output

Each of the 14 digital pins on the Uno can be used as an input or output, using
pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin
can provide or receive a maximum of 40 mA and has an internal pull-up resistor
(disconnected by default) of 20-50 kOhms. In addition, some pins have specialized
functions:

Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
These pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL
Serial chip.

External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on


a low value, a rising or falling edge, or a change in value. See the attachInterrupt()
function for details.

PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite()
function.

SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication
using the SPI library.

LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH
value, the LED is on, when the pin is LOW, it's off.

The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of
resolution (i.e. 1024 different values). By default they measure from ground to 5 volts,
though is it possible to change the upper end of their range using the AREF pin and the
analogReference() function. Additionally, some pins have specialized functionality:

TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire
library.

There are a couple of other pins on the board:

AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset
button to shields which block the one on the board.

See also the mapping between Arduino pins and ATmega328 ports. The mapping for
the Atmega8, 168, and 328 is identical.

Communication

The Arduino Uno has a number of facilities for communicating with a computer,
another Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V)
serial communication, which is available on digital pins 0 (RX) and 1 (TX). An
ATmega16U2 on the board channels this serial communication over USB and appears as
a virtual com port to software on the computer. The '16U2 firmware uses the standard
USB COM drivers, and no external driver is needed. However, on Windows, a .inf file is
required. The Arduino software includes a serial monitor which allows simple textual
data to be sent to and from the Arduino board. The RX and TX LEDs on the board will
flash when data is being transmitted via the USB-to-serial chip and USB connection to
the computer (but not for serial communication on pins 0 and 1).

A SoftwareSerial library allows for serial communication on any of the Uno's digital pins.

The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software
includes a Wire library to simplify use of the I2C bus; see the documentation for details.
For SPI communication, use the SPI library.

Programming

The Arduino Uno can be programmed with the Arduino software (download). Select
"Arduino Uno from the Tools > Board menu (according to the microcontroller on your
board). For details, see the reference and tutorials.
The ATmega328 on the Arduino Uno comes preburned with a bootloader that allows
you to upload new code to it without the use of an external hardware programmer. It
communicates using the original STK500 protocol (reference, C header files).

You can also bypass the bootloader and program the microcontroller through the ICSP
(In-Circuit Serial Programming) header; see these instructions for details.

The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is
available . The ATmega16U2/8U2 is loaded with a DFU bootloader, which can be
activated by:

On Rev1 boards: connecting the solder jumper on the back of the board (near the
map of Italy) and then resetting the 8U2.

On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to
ground, making it easier to put into DFU mode.

You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X
and Linux) to load a new firmware. Or you can use the ISP header with an external
programmer (overwriting the DFU bootloader). See this user-contributed tutorial for
more information.

Automatic (Software) Reset

Rather than requiring a physical press of the reset button before an upload, the
Arduino Uno is designed in a way that allows it to be reset by software running on a
connected computer. One of the hardware flow control lines (DTR) of the
ATmega8U2/16U2 is connected to the reset line of the ATmega328 via a 100 nanofarad
capacitor. When this line is asserted (taken low), the reset line drops long enough to
reset the chip. The Arduino software uses this capability to allow you to upload code by
simply pressing the upload button in the Arduino environment. This means that the
bootloader can have a shorter timeout, as the lowering of DTR can be well-coordinated
with the start of the upload.

This setup has other implications. When the Uno is connected to either a computer
running Mac OS X or Linux, it resets each time a connection is made to it from software
(via USB). For the following half-second or so, the bootloader is running on the Uno.
While it is programmed to ignore malformed data (i.e. anything besides an upload of
new code), it will intercept the first few bytes of data sent to the board after a
connection is opened. If a sketch running on the board receives one-time configuration
or other data when it first starts, make sure that the software with which it
communicates waits a second after opening the connection and before sending this
data.

The Uno contains a trace that can be cut to disable the auto-reset. The pads on either
side of the trace can be soldered together to re-enable it. It's labeled "RESET-EN". You
may also be able to disable the auto-reset by connecting a 110 ohm resistor from 5V to
the reset line; see this forum thread for details.

USB Overcurrent Protection

The Arduino Uno has a resettable polyfuse that protects your computer's USB ports
from shorts and overcurrent. Although most computers provide their own internal
protection, the fuse provides an extra layer of protection. If more than 500 mA is
applied to the USB port, the fuse will automatically break the connection until the short
or overload is removed.

REGULATED POWER SUPPLY:

The power supplies are designed to convert high voltage AC mains electricity to a
suitable low voltage supply for electronic circuits and other devices. A RPS (Regulated Power
Supply) is the Power Supply with Rectification, Filtering and Regulation being done on the AC
mains to get a Regulated power supply for Microcontroller and for the other devices being
interfaced to it.

A power supply can by broken down into a series of blocks, each of which performs a
particular function. A d.c power supply which maintains the output voltage constant irrespective of
a.c mains fluctuations or load variations is known as “Regulated D.C Power Supply”

For example a 5V regulated power supply system as shown below:


Transformer:
A transformer is an electrical device which is used to convert electrical power from
one Electrical circuit to another without change in frequency.

Transformers convert AC electricity from one voltage to another with little loss of power. Transformers
work only with AC and this is one of the reasons why mains electricity is AC. Step-up transformers increase in output
voltage, step-down transformers decrease in output voltage. Most power supplies use a step-down transformer to reduce
the dangerously high mains voltage to a safer low voltage. The input coil is called the primary and the output coil is
called the secondary. There is no electrical connection between the two coils; instead they are linked by an alternating
magnetic field created in the soft-iron core of the transformer. The two lines in the middle of the circuit symbol represent
the core. Transformers waste very little power so the power out is (almost) equal to the power in. Note that as voltage
is stepped down current is stepped up. The ratio of the number of turns on each coil, called the turn’s ratio, determines
the ratio of the voltages. A step-down transformer has a large number of turns on its primary (input) coil which is
connected to the high voltage mains supply, and a small number of turns on its secondary (output) coil to give a low
output voltage.
An Electrical Transformer

Turns ratio = Vp/ VS = Np/NS

Power Out= Power In

VS X IS=VP X IP

Vp = primary (input) voltage


Np = number of turns on primary coil
Ip = primary (input) current

RECTIFIER:

A circuit which is used to convert ac to dc is known as RECTIFIER. The process


of conversion ac to dc is called “rectification”

TYPES OF RECTIFIERS:

 Half wave Rectifier


 Full wave Rectifier

1. Centre tap full wave rectifier.

2. Bridge type full bridge rectifier.


Comparison of rectifier circuits:

Type of Rectifier

Parameter Half wave Full wave


Bridge

Number of diodes 1 2 4

PIV of diodes Vm 2Vm Vm

D.C output voltage Vm/z 2Vm/ 2Vm/

Vdc at no-load 0.318Vm 0.636Vm 0.636Vm

Ripple factor 1.21 0.482 0.482

Ripple frequency f 2f 2f

Rectification efficiency 0.406 0.812 0.812

Transformer Utilization
Factor(TUF)
0.287 0.693 0.812

RMS voltage Vrms Vm/2 Vm/√2 Vm/√2


Full-wave Rectifier:
From the above comparison we came to know
that full wave bridge rectifier as more advantages than the other two rectifiers. So, in our
project we are using full wave bridge rectifier circuit.

Bridge Rectifier:
A bridge rectifier makes use of four diodes in a bridge arrangement to achieve
full-wave rectification. This is a widely used configuration, both with individual diodes
wired as shown and with single component bridges where the diode bridge is wired
internally.

A bridge rectifier makes use of four diodes in a bridge arrangement as shown in fig (a)
to achieve full-wave rectification. This is a widely used configuration, both with individual
diodes wired as shown and with single component bridges where the diode bridge is wired
internally.

Fig (A)

Operation: During positive half cycle of secondary, the diodes D2 and D3 are in forward
biased while D1 and D4 are in reverse biased as shown in the fig(b). The current flow direction
is shown in the fig (b) with dotted arrows.
Fig (B)

During negative half cycle of secondary voltage, the diodes D1 and D4 are in forward
biased while D2 and D3 are in reverse biased as shown in the fig(c). The current flow direction is
shown in the fig (c) with dotted arrows.

Fig(C)

Filter:
A Filter is a device which removes the ac component of rectifier output but allows the
dc component to reach the load.
Capacitor Filter:

We have seen that the ripple content in the rectified output of half wave rectifier is
121% or that of full-wave or bridge rectifier or bridge rectifier is 48% such high percentages of
ripples is not acceptable for most of the applications. Ripples can be removed by one of the
following methods of filtering.

(a) A capacitor, in parallel to the load, provides an easier by –pass for the ripples voltage
though it due to low impedance. At ripple frequency and leave the D.C. to appear at the load.

(b) An inductor, in series with the load, prevents the passage of the ripple current (due to high
impedance at ripple frequency) while allowing the dc (due to low resistance to dc).

(c) Various combinations of capacitor and inductor, such as L-section filter section filter,
multiple section filter etc. which make use of both the properties mentioned in (a) and (b)
above. Two cases of capacitor filter, one applied on half wave rectifier and another with full
wave rectifier.

Filtering is performed by a large value electrolytic capacitor connected across the DC


supply to act as a reservoir, supplying current to the output when the varying DC voltage from
the rectifier is falling. The capacitor charges quickly near the peak of the varying DC, and then
discharges as it supplies current to the output. Filtering significantly increases the average DC
voltage to almost the peak value (1.4 × RMS value).

To calculate the value of capacitor(C),

C = ¼*√3*f*r*Rl

Where,

f = supply frequency,

r = ripple factor,

Rl = load resistance

Note: In our circuit we are using 1000µF hence large value of capacitor is placed to reduce ripples and to
improve the DC component.
Regulator:
Voltage regulator ICs is available with fixed (typically 5, 12 and 15V) or variable
output voltages. The maximum current they can pass also rates them. Negative voltage
regulators are available, mainly for use in dual supplies. Most regulators include some
automatic protection from excessive current ('overload protection') and overheating ('thermal
protection'). Many of the fixed voltage regulators ICs have 3 leads and look like power
transistors, such as the 7805 +5V 1A regulator shown on the right. The LM7805 is simple to use.
You simply connect the positive lead of your unregulated DC power supply (anything from 9VDC
to 24VDC) to the Input pin, connect the negative lead to the Common pin and then when you
turn on the power, you get a 5 volt supply from the output pin.

Fig 6.1.6 A Three Terminal Voltage Regulator

The Bay Linear LM78XX is integrated linear positive regulator with three terminals. The
LM78XX offer several fixed output voltages making them useful in wide range of applications.
When used as a zener diode/resistor combination replacement, the LM78XX usually results in
an effective output impedance improvement of two orders of magnitude, lower quiescent
current. The LM78XX is available in the TO-252, TO-220 & TO-263packages,

Features:

• Output Current of 1.5A

• Output Voltage Tolerance of 5%

• Internal thermal overload protection

• Internal Short-Circuit Limited

• Output Voltage 5.0V, 6V, 8V, 9V, 10V, 12V, 15V, 18V, 24V.
LM78XX Series Voltage Regulators

General Description

The LM78XX series of three terminal regulators is available with several fixed

output voltages making them useful in a wide range of applications. One of these is local on

card regulation, eliminating the distribution problems associated with single point regulation.

The voltages available allow these regulators to be used in logic systems, instrumentation, Hi-Fi,

and other solid state electronic equipment. Although designed primarily as fixed voltage

regulators these devices can be used with external components to obtain adjustable voltages

and currents.

The LM78XX series is available in an aluminum TO-3 package which will allow over 1.0A load

current if adequate heat sinking is provided. Current limiting is included to limit the peak output

current to a safe value. Safe area protection for the output transistor is provided to limit

internal power dissipation. If internal power dissipation becomes too high for the heat sinking

provided, the thermal shutdown circuit takes over preventing the IC from overheating.

Considerable effort was expanded to make the LM78XX series of regulators easy to use and

minimize the number of external components. It is not necessary to bypass the output,

although this does improve transient response. Input bypassing is needed only if the regulator

is located far from the filter capacitor of the power supply. For output voltage other than 5V,

12V and 15V the LM117 series provides an output voltage range from 1.2V to 57V.
SCHEMATIC AND CONNECTION DIAGRAM
LCD interfacing with MICROCONTROLLER (89c51)

Basics of LCD

►DDRAM - Display Data RAM

Display data RAM (DDRAM) stores display data represented in 8-bit


character codes. Its extended capacity is 80 X 8 bits, or 80 characters. The
area in display data RAM (DDRAM) that is not used for display can be used
as general data RAM. So whatever you send on the DDRAM is actually
displayed on the LCD. For LCDs like 1x16, only 16 characters are visible, so
whatever you write after 16 chars is written in DDRAM but is not visible to
the user.

Figures below will show you the DDRAM addresses of 1 Line, 2 Line and 4
Line LCDs.

Figure 2: DDRAM Address for 1 Line LCD

Figure 3: DDRAM Address for 2 Line LCD

Figure 4: DDRAM Address for 4 Line LCD


►CGROM - Character Generator ROM

Now you might be thinking that when you send an ascii value to DDRAM,
how the character is displayed on LCD? so the answer is CGROM. The
character generator ROM generates 5 x 8 dot or 5 x 10 dot character
patterns from 8-bit character codes (see Figure 5 and Figure 6 for more
details). It can generate 208 5 x 8 dot character patterns and 32 5 x 10 dot
character patterns. User defined character patterns are also available by
mask-programmed ROM.

Figure 5: LCD characters code map for 5x8 dots


Figure 6: LCD characters code map for 5x10 dots

1) As you can see in both the code maps, the character code from 0x00 to
0x07 is occupied by the CGRAM characters or the user defined
characters. If user wants to display the fourth custom character then
the code to display it is 0x03 i.e. when users send 0x03 code to the LCD
DDRAM then the fourth user created character or pattern will be
displayed on the LCD.
►CGRAM - Character Generator RAM

As clear from the name, CGRAM area is used to create custom characters
in LCD. In the character generator RAM, the user can rewrite character
patterns by program. For 5 x 8 dots, eight character patterns can be
written, and for 5 x 10 dots, four character patterns can be written. Later in
this tutorial i will explain how to use CGRAM area to make custom
character and also making animations to give nice effects to your
application.

Busy Flag

Busy Flag is an status indicator flag for LCD. When we send a command or
data to the LCD for processing, this flag is set (i.e. BF =1) and as soon as the
instruction is executed successfully this flag is cleared (BF = 0). This is
helpful in producing and exact amount of delay. for the LCD processing.

To read Busy Flag, the condition RS = 0 and R/W = 1 must be met and The
MSB of the LCD data bus (D7) act as busy flag. When BF = 1 means LCD is
busy and will not accept next command or data and BF = 0 means LCD is
ready for the next command or data to process.

►Instruction Register (IR) and Data Register (DR)

There are two 8-bit registers in HD44780 controller Instruction and Data
register. Instruction register corresponds to the register where you send
commands to LCD e.g. LCD shift command, LCD clear, LCD address etc. and
Data register is used for storing data which is to be displayed on LCD.
When send the enable signal of the LCD is asserted, the data on the pins is
latched in to the data register and data is then moved automatically to the
DDRAM and hence is displayed on the LCD.
Data Register is not only used for sending data to DDRAM but also for
CGRAM, the address where you want to send the data, is decided by the
instruction you send to LCD. We will discuss more on LCD instruction set
further in this tutorial.
Introduction
The most commonly used Character based LCDs are based on Hitachi's
HD44780 controller or other which are compatible with HD44580. In this
tutorial, we will discuss about character based LCDs, their interfacing with
various microcontrollers, various interfaces (8-bit/4-bit), programming,
special stuff and tricks you can do with these simple looking LCDs which
can give a new look to your application.

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

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

Figure 1: Character LCD type HD44780 Pin diagram


Pin No. Name Description

Pin no. 1 VSS Power supply (GND)

Pin no. 2 VCC Power supply (+5V)

Pin no. 3 VEE Contrast adjust

0 = Instruction input
Pin no. 4 RS
1 = Data input

0 = Write to LCD module


Pin no. 5 R/W
1 = Read from LCD module

Pin no. 6 EN Enable signal

Pin no. 7 D0 Data bus line 0 (LSB)

Pin no. 8 D1 Data bus line 1

Pin no. 9 D2 Data bus line 2

Pin no. 10 D3 Data bus line 3

Pin no. 11 D4 Data bus line 4

Pin no. 12 D5 Data bus line 5

Pin no. 13 D6 Data bus line 6

Pin no. 14 D7 Data bus line 7 (MSB)

Table 1: Character LCD pins with 1 Controller

►LCD Initialization
before using the LCD for display purpose, LCD has to be initialized either by
the internal reset circuit or sending set of commands to initialize the LCD. It
is the user who has to decide whether an LCD has to be initialized by
instructions or by internal reset circuit. we will dicuss both ways of
initialization one by one.
Initialization by internal Reset Circuit
An internal reset circuit automatically initializes the HD44780U when the
power is turned on. The following instructions are executed during the
initialization. The busy flag (BF) is kept in the busy state until the
initialization ends (BF = 1). The busy state lasts for 10 ms after VCC rises to
4.5 V.

 Display clear
 Function set:
DL = 1; 8-bit interface data
N = 0; 1-line display
F = 0; 5 x 8 dot character font
 Display on/off control:
D = 0; Display off
C = 0; Cursor off
B = 0; Blinking off
 Entry mode set:
I/D = 1; Increment by 1
S = 0; No shift
Wi-Fi 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.

Alternately, serving as a Wi-Fi adapter, wireless internet access can be added to any
microcontroller-based design with simple connectivity through UART interface or the
CPU AHB bridge interface.
Overview

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.

Alternately, serving as a Wi-Fi adapter, wireless internet access can be added to any
microcontroller-based design with simple connectivity through UART interface or the
CPU AHB bridge interface.

ESP8266 on-board processing and storage capabilities allow it to be integrated with the
sensors and other application specific devices through its GPIOs with minimal
development up-front and minimal loading during runtime. With its high degree of
on-chip integration, which includes the antenna switch balun, power management
converters, it requires minimal external circuitry, and the entire solution, including
front-end module, is designed to occupy minimal PCB area.

Sophisticated system-level features include fast sleep/wake context switching for


energy-efficient VoIP, adaptive radio biasing for low-power operation, advance signal
processing, and spur cancellation and radio co-existence features for common cellular,
Bluetooth, DDR, LVDS, LCD interference mitigation.
Features
802.11 b/g/n protocol

Wi-Fi Direct (P2P), soft-AP

Integrated TCP/IP protocol stack

Integrated TR switch, balun, LNA, power amplifier and matching network

Integrated PLL, regulators, and power management units

+19.5dBm output power in 802.11b mode

Integrated temperature sensor

Supports antenna diversity

Power down leakage current of < 10uA

Integrated low power 32-bit CPU could be used as application processor

SDIO 2.0, SPI, UART

STBC, 1×1 MIMO, 2×1 MIMO

A-MPDU & A-MSDU aggregation & 0.4 s guard interval


Wake up and transmit packets in < 2ms

Application Notes
Smart power plugs

Home automation

Mesh network

Industrial wireless control

Baby monitors

IP Cameras

Sensor networks

Wearable electronics

Wi-Fi location-aware devices

Security ID tags

Wi-Fi position system beacons


CO2 sensor

CO2 sensor Carbon monoxide sensor, suitable for sensing CO2 concentration in air. The
MQ-7 can sense CO-gas concentration somewhere in the range of 20 to 2000ppm. This
sensor has a high affectability and quick reaction time. The sensor's yield is a analog
resistance. The drive circuit is exceptionally straightforward; you should simply control
the heater curl with 5V, include a load resistance, and associate the output to an
ADC[6]. The standard reference strategy for the estimation of carbon monoxide
concentration in air depends on the ingestion of infrared radiation by the gas in a no
dispersive photometer. This technique is reasonable for stable establishments at fixed
site monitoring stations. All the more as of late, convenient carbon monoxide analyzers
with data-logging have turned out to be accessible for individual presentation
observing. These estimations depend on the electrochemical responses between
carbon monoxide and de-ionized water, which are detected by exceptionally planned
sensors. These days the determination, strength and affectability of the electrochemical
analyzers are inside the details of the reference technique and, together with the
data-logging systems, they fit into a little rucksack or even a pocket.
DHT11 Temperature and Humidity Sensor

DHT11 is a part of DHTXX series of Humidity sensors. The other sensor in this series is
DHT22. Both these sensors are Relative Humidity (RH) Sensor. As a result, they will
measure both the humidity and temperature. Although DHT11 Humidity Sensors are
cheap and slow, they are very popular among hobbyists and beginners.

The DHT11 Humidity and Temperature Sensor consists of 3 main components. A


resistive type humidity sensor, an NTC (negative temperature coefficient) thermistor (to
measure the temperature) and an 8-bit microcontroller, which converts the analog
signals from both the sensors and sends out single digital signal. This digital signal can
be read by any microcontroller or microprocessor for further analysis.
DHT11 Humidity Sensor consists of 4 pins: VCC, Data Out, Not Connected (NC) and
GND. The range of voltage for VCC pin is 3.5V to 5.5V. A 5V supply would do fine. The
data from the Data Out pin is a serial digital data.

The following image shows a typical application circuit for DHT11 Humidity and
Temperature Sensor. DHT11 Sensor can measure a humidity value in the range of 20 –
90% of Relative Humidity (RH) and a temperature in the range of 0 – 500C. The sampling
period of the sensor is 1 second i.e.
All the DHT11 Sensors are accurately calibrated in the laboratory and the results are
stored in the memory. A single wire communication can be established between any
microcontroller like Arduino and the DHT11 Sensor.

Also, the length of the cable can be as long as 20 meters. The data from the sensor
consists of integral and decimal parts for both Relative Humidity (RH) and temperature.
Applications:-

1) Industrial perimeter monitoring

2) Indoor air quality monitoring.

3) Site selection for reference monitoring stations.

4) Making data available to users.

Advantages:-

1) Easy to Install

2) Updates On mobile phone directly

3) Accurate Pollution monitoring

4) Remote location monitoring


Conclusion:-

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

[1] https://securedstatic.greenpeace.org/india/Global/India/Airpoclypse--Not-just-

Delhi--Air-in-mostIndian-cities-hazardous--Greenpeace-report.pdf

[2] content/uploads/2008/04/5v-regulator-using7805.JPG

[3] https://store.arduino.cc/arduino-uno-rev3 [4]https://www.arduino.cc/

[5]https://www.aliexpress.com/item/1PCS-LOTSolution-PH-valuo-Temperature-detecto
r-sensormodule-for-arduino-Freeshipping/32620995019.html?spm=2114.401

You might also like