0% found this document useful (0 votes)
79 views8 pages

LPG Gas Leak Detection System

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)
79 views8 pages

LPG Gas Leak Detection System

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/ 8

ESD MINI PROJECT

LPG GAS DETECTION


ABSTRACT:
LPG gas detection project’s main idea is to implement security
system for detecting leakage of gas in closed environment. In this
project, gas leakage is identified by using sensors which work only in
closed environment. There have been many cases related to gas
leakage which have caused damage to life and property.
Implementing this application can be useful for companies, houses,
which can save lives of people. This can be used as an application in
chemical and hazardous industries where there is a continuous need of
monitoring the gas leaks. By using different kinds of sensors for every
gas we can almost identify leaks for various kinds of gases. The gas
sensor is interfaced with LPC2148 and an LCD module, indicating
whenever the gas is detected.

COMPONENTS REQUIRED:

• LPC2148 Development Board


• LCD Module (To print the Sensor output)
• Gas sensor module

BLOCK DIAGRAM:
LPC2148
The LPC2148 is a 16 bit or 32 bit ARM7 family based
microcontroller and available in a small LQFP64 package. ARM is an
advanced reduced instruction set computer (RISC) machine, and it is
a 32-bit processor architecture expanded by ARM holdings. ARM7
processor is commonly used in embedded system applications. The
LPC2148 microcontroller is designed by Philips (NXP
Semiconductor) with several in-built features & peripherals. Due to
these reasons, it will make more reliable as well as the efficient option
for an application developer. For LPC2148, the on-chip static RAM is
8 kB-40 kB, on-chip flash memory is 32 kB-512 kB, the wide
interface is 128 bit, or accelerator allows 60 MHz high-speed
operation.

LCD
The term LCD stands for liquid crystal display. An LCD is an
electronic display module which uses liquid crystal to produce a
visible image An LCD is an electronic display module which uses
liquid crystal to produce a visible image It is on used in an extensive
range of applications like various circuits & devices like mobile
phones, calculators, computers, TV sets, etc The 16×2 LCD display is
a very basic module commonly used in DIYs and circuits. The 16×2
translates o a display 16 characters per line in 2 such lines. In
this LCD each character is displayed in a 5×7 pixel matrix.

GAS SENSOR
A gas detector is a device that detects the presence of gases in an area,
often as part of a safety system. This type of equipment is used to
detect a gas leak or other emissions and can interface with a control
system so a process can be automatically shut down.
The MQ Gas sensor range have a high sensitivity and fast response
time. The MQ Gas sensor range have a high sensitivity and fast
response time. The sensor's output is an analog resistance. The drive
circuit is very simple; all you need to do is power the heater coil with
5V, add a load resistance, and connect the output to an ADC.
WORKING:
A wide range of sensors are available in order to detect the gases
available in the environment. To detect LPG gas, we use MQ 2 or MQ
5 sensor. The module is powered with a 5V supply and the power
LED glows. When no gas is detected, the output LED remains turned
off, meaning the digital output pin will be low. The sensor has to be
kept on for a certain pre-heating time before one can actually work
with it. When the sensor is introduced to the gas that is to be detected,
the output LED glows or the digital output goes high. Every time the
sensor gets introduced to this gas at this particular concentration the
digital pin will go high (5V) else it will remain low (0V). The output
of the sensor is interfaced with LPC2148 and the LCD. Based on the
status of the output or digital pin, the LCD displays whether or not the
gas has been detected.
CONNECTIONS:

LPG Gas Sensor- MQ 5


Vcc – 5v
Gnd – Ground
DO – P1.24

LCD
RS – P0.8
RW – P0.9
EN – P0.10
Data Lines – P0.0 – P0.7
Note:
Since the detection of the gas is not physically possible using Proteus,
a logic state has been used for simulation purposes. The logic state 1
implies that the gas to be detected has been introduced while 0
indicates otherwise.

SOURCE CODE:

#include<lpc21xx.h>
#define bit(x) (1<<x)
#define delay for(i=0;i<7000;i++);
#define GAS (IO1PIN & (1<<24))

unsigned int i;
void lcd_int();
void dat(unsigned char);
void cmd(unsigned char);
void string(unsigned char *);
int main()
{
IO0DIR =0XFFF;
IO1DIR = 0x0;
lcd_int();
cmd(0x80);
while(1) {
if(GAS)
{
string("Gas Detected");
}
else
{
string("Gas not detected");
}
delay;delay;
cmd(0x01);
}
}
void lcd_int()
{
cmd(0x38);
cmd(0x0c);
cmd(0x06);
cmd(0x01);
cmd(0x80);
}
void cmd(unsigned char a)
{
IO0PIN&=0x00;
IO0PIN|=(a<<0);
IO0CLR|=bit(8); //rs=0
IO0CLR|=bit(9); //rw=0
IO0SET|=bit(10); //en=1
delay;
IO0CLR|=bit(10); //en=0
}
void dat(unsigned char b)
{
IO0PIN&=0x00;
IO0PIN|=(b<<0);
IO0SET|=bit(8); //rs=1
IO0CLR|=bit(9); //rw=0
IO0SET|=bit(10); //en=1
delay;
IO0CLR|=bit(10); //en=0
}
void string(unsigned char *p)
{
while(*p!='\0')
dat(*p++);
}

OUTPUT:

RESULT:
The LCD has displayed a message “Gas detected” when the gas has
been detected and “Gas not detected” otherwise. This can be used for
a variety of applications which include detection and measuring of
gases like LPG, alcohol, propane, CO, air qualiy monitoring, gas
leakage alarm as well as in maintaining environment standards in
hospitals and industries.
- 160117735079,080,081

You might also like