Showing posts with label Automation. Show all posts
Showing posts with label Automation. Show all posts

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++);
                }



Saturday, August 31, 2013

Cell Phone Operated Landrover or Robot - Electronics Engineering Project

INTRODUCTION: 
                                   In this project, the robot is controlled by a mobile phone that makes a call to the mobile phone attached to the robot. In the coarse of a call, if any button is pressed, a tone corresponding to the button pressed is heard at the other end. This tone is called ‘dual-tone multiple-frequency’ (DTMF) tone. The robot perceives this DTMF tone with the help of the phone stacked in the robot.

                          The received tone is processed by the P89V51RD2 microcontroller with the help of DTMF decoder CM8870. The decoder decodes the DTMF tone into its equivalent binary digit and this binary number is sent to the microcontroller. The microcontroller is preprogrammed to take a decision for any given input and outputs its decision to motor drivers in order to drive the motors for forward or backward motion or a turn.

Free directory submissions
                           The mobile that makes a call to the mobile phone stacked in the robot acts as a remote. So this simple robotic project does not require the construction of receiver and transmitter units.

If you need further guidance for this project please post a comment or contact immediate solutions would be provided with handy tips and programming algorithm and code.

BLOCK DIAGRAM:
                            
             The CM8870 is Dual Tone Multi Frequency Receiver (DTMF Decoder). The CM8870/70C decoder uses digital counting techniques for the detection and decoding of all 16 DTMF tone pairs into a 4-bit code. The filter section uses a switched capacitor technique for both high and low group filters and dial tone rejection. The CM8870/70C’s internal architecture consists of a band split filter section which separates the high and low tones of the received pair, followed by a digital decode (counting) section which verifies both the frequency and duration of the received tones before passing the resultant 4-bit code to the output bus.


         The microcontroller output is not sufficient to drive the DC motors, a high voltage and high current drivers are required. The L293 and L293D are quadruple high-current half-H drivers. The L293 is designed to provide bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V. It will become easier to drive DC motors with such drivers. Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3,4EN. When an enable input is high, the associated drivers are enabled and their outputs are active and in phase with their inputs. external high-speed output clamp diodes should be used for inductive transient suppression.
    
              CIRCUIT DIAGRAM:

PROGRAM:
                org 20h
                mov p3,#0ffh      
L1: mov a,p3
                anl a,#0fh
                cjne a,#04h,L2
                mov p0,#81h  
                ljmp L1
L2: cjne a,#01h,L3 
                mov p0,#42h
                ljmp L1
L3: cjne a,#02h,L4
                mov p0,#41h   
                ljmp L1
L4:          cjne a,#06h,L5
                mov p0,#82h   
                ljmp L1
L5: cjne a,#0ah,L1 
                mov p0,#00h     
                ljmp L1

                end