Sunday, September 8, 2013

LPG LEAKAGE DETECTION AND VALVE CONTROL

INTRODUCTION:

In today’s world we see that there are many accidents caused due to LPG gas leakage. Gases like LPG, butane and propane are widely used in homes and industry as a fuel. Slight leakage of these gases can lead to fire which can cause immense loss in life and property.

Our project titled “LPG detection and valve control” deals with the detection of LPG leakage at an initial stage and valve control to stop any further leakage of the gas.

The circuit consists of a sensor which detects gases like LPG, butane and propane. As soon as even the minutest quantities of the gas is detected in the surroundings, the power supply is switched off and exhaust fan is started to throw out the excess of gas in the surroundings.

BLOCK DIAGRAM:


LPG SENSOR : -

It senses the leakage of LPG. The output of this sensor is ‘low’ at normal condition. The output goes high, when it senses the LPG. The output of sensor depends on the LPG concentration. The higher the concentration more is the voltage.

ADC : -


It is used to convert analog voltage to digital voltage.

MICROCONTROLLER : -

 It is the whole control of the project. It controls the  relay unit, when LPG leak occurs. The input/ output ports of the microcontroller is used for this.

LCD : -

It is used for displaying welcome notification, project name and detection of the gas.

RELAY UNIT : -

Relays are not directly driven by the microcontroller. Hence relay drivers are used for this purpose. Relays are used to cut off the electric supply.

STEPPER MOTOR : -

It is used to control the regulator or valve.

EXHAUST FAN : -


This is used to send out the LPG to space and then the concentration of LPG is reduced.

CIRCUIT DESCRIPTION


Circuit Diagram of Power supply:
AC 230v, 50Hz power supply is applied to the step down transformer it will give 15v, 1amp output. The output of transformer is rectified by using bridge Rectifier. Rectifier gives pulsating DC supply which is then filtered by using capacitor filter. The output of filter is then regulated by using LM7805 and LM7812 +voltage regulator & the output of regulator is pure DC which is applied to entire circuit. 12V is used to drive stepper motor and audio amplifier while 5v is used for microcontroller circuitry. Here for project we are using 230V supply but we can also operate it on 12V lead acid cell.

CIRCUIT DIAGRAM OF VOICE IC:
Here we are using only two message pins when a low signal is applied to the message pin through microcontroller and if RE pin is high it will playback the recorded message. The two LED’s when glowing indicates that the ic is busy. Mic is used to record the message. For recording the message RE pin should be held low and the corresponding message pin is to be held low until the message is recorded. The output pins SP+ and SP- are the output pins that are to be given to the speaker but as we want the volume of message to be high hence we are giving it to the audio amplifier circuit and then to the speaker.

AUDIO AMPLIFIER CIRCUIT DIAGRAM:

Here the amplifier is used in the differential mode. The gain of the amplifier is set to 20. The speaker used is of 8ohms. 

SERIAL COMMUNICATION CIRCUIT
Microcontroller operates on the TTL logic whereas PC operates on the RS standard. When we need to connect microcontroller with the PC we use MAX 232 IC. The compatibility of the two communication standards is done by this IC. As the microcontroller used  supports In System programming hence we can program it through serial communication. Also if we want to send message to someone after the leakage appears then we can connect the GSM modem to the DB9 connector.

CIRCUIT DIAGRAM FOR INTERFACING LCD, ADC AND ULN2003 WITH P89V51RD2
Sensor input is analog. Hence to convert it into digital ADC 0808 is used. ADC 0808 requires clock of 640KHz and to generate that clock from the crystal of 11.0592Mhz we have used D-flipflops. The digital data is then given to the microcontroller. LCD is used to display messages. As port0 is opendrain we need to connect pull up resistors of 10Kohm to it. We need to drive stepper motor to turn off the regulator valve, but motor requires heavy current and 12V voltage. Microcontrollers output current is only upto 15mA hence ULN 2003 is used to boost the current. Power on reset circuit is used to reset the microcontroller when it is switched on from off state. Crystal in combination with internal oscillator circuit generates clock which is required for the operation of uC. Capacitors connected to the crystal are called loading capacitors and are used for stability and initial triggering of the crystal. As we want to handle 230V equipment we require a relay which is driven by ULN2003. Here relay is used as a switch.

flowchart
PROGRAM
#include <reg51.h>
sfr ldata = 0x80;
sbit rs = P2^5;
sbit m1 =P3^6;
sbit rw = P2^6;
sbit en = P2^7;
sbit busy = P0^7;
sbit fan= P2^0;
sbit m2=P3^7;
sbit ale=P3^5;
sbit sc=P3^4;
sbit eoc=P3^3;
sbit oe=P3^2;
sbit rotate = P3^0;
sfr mydata=0x90;
void lcdcmd (unsigned char);
void msdelay (unsigned int);
void lcdready ();
void lcddata (unsigned char );
void stepperfanoff ();
unsigned char adc ();
void stepper ();
void msdelay1 (unsigned int itime);
void main()
                {
                unsigned char lcd;
                unsigned char i;
                unsigned char msg1[]="welcome....";
                unsigned char msg2[]="LPG detection";
                unsigned char msg3[]="& valve control";
                unsigned char msg4[]="LPG detected=NO";
                unsigned char msg5[]="Valve=ON";
                unsigned char msg6[]="LPG detected=YES";
                unsigned char msg7[]="Valve = OFF";
                fan=0;
                lcdcmd (0x38);                                                                                                  
                lcdcmd (0x0c);
                lcdcmd (0x01);
                lcdcmd (0x80);
                for (i=0;msg1[i]!='\0';i++)
                lcddata (msg1[i]);
                m1=0;
                msdelay (3000);
                lcdcmd (0x80);
                for (i=0;msg2[i]!='\0';i++)
                lcddata (msg2[i]);
                lcdcmd (0xc0);
                for (i=0;msg3[i]!='\0';i++)
                lcddata (msg3[i]);
                m1=1;
                msdelay (4000);
above:      lcdcmd (0x01);
                lcdcmd (0x80);
                for (i=0;msg4[i]!='\0';i++)
                lcddata (msg4[i]);
                lcdcmd (0xc0);
                for (i=0;msg5[i]!='\0';i++)
                lcddata (msg5[i]);
up:           lcd=adc();
                while (lcd >= 0xc8)
                {
                m2=0;
                fan=1;
                stepper();
                lcdcmd (0x01);
                lcdcmd (0x80);
                for (i=0;msg6[i]!='\0';i++)
                lcddata (msg6[i]);
                lcdcmd (0xc0);
                for (i=0;msg7[i]!='\0';i++)
                lcddata (msg7[i]);
                goto down;
                }
                goto up;
down:       lcd=adc();
                while (lcd >= 0x96)
                goto down;
                fan = 0;
                while (rotate == 1);
                {
                m2 = 1;
                stepperfanoff ();
                goto above;
                }
                }
void  lcdcmd (unsigned char value)
                {
                lcdready ();
                ldata = value;
                rs = 0;
                rw = 0;
                en = 1;
                msdelay (1);
                en = 0;
                }
void lcddata (unsigned char value)
                {
                lcdready ();
                ldata = value;
                rs = 1;
                rw = 0;
                en =1;
                msdelay (1);
                en = 0;
                }
void lcdready ()
                {
                busy = 1;
                rs = 0;
                rw = 1;
                while(busy == 1)
                                {
                                en = 0;
                                msdelay (1);
                                en = 1;
                                }
                }
void msdelay (unsigned int itime)
                {
                unsigned int i, j;
                for (i=0;i<itime;i++)
                for (j=0;j<115;j++);
                }
unsigned char adc ()
{
mydata = 0xff;
eoc=1;
ale=0;
oe=0;
sc=0;
ale = 1;
msdelay(1);
sc=1;
msdelay (1);
ale=0;
sc=0;
while(eoc==1);
while(eoc==0)
oe=1;
msdelay (1);
oe=1;
return (mydata);
}
void stepperfanoff ()
{
unsigned int step;
for(step=0;step<260;step++)
{
P2=0x0e;
msdelay1(2);
P2=0x06;
msdelay1(2);
P2=0x16;
msdelay1(2);
P2=0x12;
msdelay1(2);
P2=0x1a;
msdelay1(2);
P2=0x18;
msdelay1(2);
P2=0x1c;
msdelay1(2);
P2=0x0c;
msdelay1(2);
}
}
void stepper ()
{
unsigned int step;
for(step=0;step<260;step++)
{
P2=0x0d;
msdelay1(2);
P2=0x1d;
msdelay1(2);
P2=0x19;
msdelay1(2);
P2=0x1b;
msdelay1(2);
P2=0x13;
msdelay1(2);
P2=0x17;
msdelay1(2);
P2=0x07;
msdelay1(2);
P2=0x0f;
msdelay1(2);
}
}
void msdelay1 (unsigned int itime)
                {
                unsigned int i, j;
                for (i=0;i<itime;i++)
                for (j=0;j<70;j++);
                }



11 comments:

  1. Thanks for sharing this projects details..Its really useful for me..Keep posting..

    Final Year Projects for IT

    ReplyDelete
  2. It’s absolutely nice and expects full. It’s really cool blog. Associating is very useful thing blog.You have really benefited lots of This blog encourage people and provide them useful information.
    Dot Net Training in Chennai
    Dot Net Training in Velachery
    Dot Net Training Institute in Chennai

    ReplyDelete
  3. Great post, however, I was wondering if you could write a little more on this subject?
    fire and safety course in chennai

    ReplyDelete
  4. Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
    Java Training in Chennai | J2EE Training in Chennai | Advanced Java Training in Chennai | Core Java Training in Chennai | Java Training institute in Chennai

    ReplyDelete
  5. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    Dot Net training in Electronic City

    ReplyDelete
  6. Thanks for such a wonderful help...Keep posting...This Blogs are a part of others Enhancement in Their careers...Well Done works
    Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

    ReplyDelete
  7. Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.



    Dot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery







    ReplyDelete
  8. Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Java Training in Chennai

    Java Training in Velachery

    Java Training in Tambaram

    Java Training in Porur

    Java Training in OMR

    Java Training in Annanagar


    ReplyDelete