AUTOMATIC GAS LEAKAGE DETECTION USING GSM Project report submitted to Birla Institute of Technology, Technology, Mesra, Ranchi, India in partial fulfilment of the requirements for the award of the degree of BA!"#$R $% "&'I&""RI&' I& "#"TR$&I( A&) $MM*&IATI$& "&'I&""RI&' By Tushya Tushya (harma + B"-./012-0., ""+3II4 )eepi5a Agarwal + B"-./06.-0., ""+3II4
BIR#A I&(TIT*T" $% T"!&$#$'7 M"(RA+68/.0/, RA&!I "9tension entre, :aipur )ecember .;0/4
1
DECLARATION CERTIFICATE CERTIFICATE This is to certify that the project entitled < Automatic Gas Leakage Detection Using GSM = submitted submitted by Tushya Tushya (harma B"-./012 B"-./012-0.4, -0.4,)eepi5 )eepi5aa Agarwal Agarwal B"-./06. B"-./06.-0.4 -0.4 in partial fulfilment of the requirements for the award of the degree of Bachelor of "ngineering in "lectronics and ommunication "ngineering of Birla Institute of Technology Mesra, Ranchi is an authentic wor5 carried out under my super>ision and guidance? To the the best of my 5nowledge, 5nowledge, the content of this project report does not form a basis for the award of any pre>ious degree to anyone else?
)ate@+
Project 'uide4 Mr?)eepa5 Mr?)eepa5 hatur>edi Asst?Professor )epartment of "lectronics and ommunication "ngineering Birla Institute of Technology Technology Mesra, Ranchi "9tension entre, :aipur Ms :yoti (harma )epartment In charge Birla Institute of Technology Technology Mesra, Ranchi "9tension entre, :aipur
2
STUDENT DECLARATION e, Tushya (harma B"-./012-0.4 and )eepi5a AgarwalB"-./06.-0.4, hereby declare that the project entitled < Automatic Gas Leakage Detection Using GSM =, submitted in partial fulfilment of the requirements for the award of the degree of Bachelor of "ngineering In "lectronics and ommunication "ngineering of Birla Institute of Technology Mesra, Ranchi, India is an authentic wor5 carried out by us under the super>ision of Mr )eepa5 hatur>edi? e also declare that the content of this project report does not form a basis for the award of any pre>ious degree to anyone else?
)ate@+ (tudents name and signature4 0 Tushya (harma B"-./012-0.4 .? )eepi5a Agarwal B"-./06.-0.4
3
ACKNOWLEDGMENT e would li5e to gratefully ac5nowledge the 5ind guidance and e9pert super>ision of Mr? )eepa5 hatur>edi throughout this project wor5? !is consistent support has always been an immense source of moti>ation and encouragement? e sincerely e9press our than5fulness to Mrs? :yoti (harma, )epartment In charge+ "" for allotting us this project and also for resources that were made a>ailable to us whene>er we needed them? e would li5e to than5 all the lab in+charges for bearing with us e>ery now and then for the wor5? #astly, we would li5e to than5 all the people who ha>e contributed to the successful completion of this project?
4
CONTENTS 0? AB(TRAT
C
.? I&TR$)*TI$&
C
8? PR$:"T BAD'R$*&)
C
E? (7(T"M (P"I%IATI$&
1
/? (7(T"M A&A#7(I( and )"(I'&
0.
C? (7(T"M PR$")*R" A&) R"(*#T(
0/
1? PB )"(I'&
01
6? R"(*#T( $BTAI&")
01
2? %*T*R" $RD
02
0;? BIB#I$'RAP!7 and R"%"R"&"(
.;
5
0? AB(TRAT 'as lea5age is a major problem with industrial sector, residential premises and gas powered >ehicles li5e &' compressed natural gas4 buses, cars? $ne of the pre>enti>e methods to stop accident associated with the gas lea5age is to install gas lea5age detection 5it at >ulnerable places? The aim of this project is to present such a design that can automatically detect gas lea5age in >ulnerable premises? In particular gas sensor has been used which has high sensiti>ity for propane 8!6 4 and butane E!0;4? 'as lea5age system consists of '(M 'lobal (ystem for mobile communications4 module, which warns by sending (M( ?
.? I&TR$)*TI$& #P' consists of mi9ture of propane and butane which is highly flammable chemical? It is odorless gas due to which "thaneth oil is added as powerful odorant, so that lea5age can be easil y detected? There are other international standards li5e "&/62, amyl mercaptane and tetrahydrothiophene which are most commonly used as odorants? #P' is one of the alternate fuels us ed now days? (ometimes liquefied petroleum gas is also 5nown as #P', #P gas, Auto gas etc? This gas is commonly used for heating appliances, hot water, coo5ing, and >arious other purposes also? #P' is also used as an alternate fuel in >ehicles due to soaring in the prices of petrol and diesel? (ome people ha>e low sense of smell, may or may not respond on low concentration of gas lea5age? In such a case, gas lea5age security s ystems become an essential and help to protect from gas lea5age accidents? "mbedded system for !aFardous gas detection and Alerting has been proposed in which the alarm is acti>ate immediately, if the gas concentration e9ceeds normal le>el? Bhopal gas tragedy was an e9ample of gas lea5age accident in India? This was world=s worst gas lea5age industrial accident
8? PR$:"T BAD'R$*&) Microcontroller has been used o>er decades to automate the different de>ices and
machines in the
factories and offices etc? It was during 021; and 0210 when the first microcontroller was in>ented? (ince then there has been a lot of de>elopment in the field of microcontrollers? There are >ery different microcontrollers in this mar5et since then? The present day microcontrollers ha>e become smaller and slee5er yet more and more powerful? The microcontroller used in this project is ATM"'A6 microcontroller? The microcontroller ta5es the input from MG+C sensor and gi>es output to #"), buFFer and '(M module?
6
E? (7(T"M (P"I%IATI$& Basic components used in our project are E?0 'A( ("&($R MG+C A LPG SENSOR is ideal sensor for use to detect the presence of a dangerous #P' lea5 in 5itchen, your car or in a ser>ice station, storage tan5 en>ironment? This unit can be easily incorporated into an alarm unit, to sound an alarm or gi>e a >isual indication of the #P' concentration? The sensor has e9cellent sensiti>ity combined with a quic5 response time? The sensor can also sense iso+butane, propane, #&' and cigarette smo5e?
%"AT*R"(@
•
!igh sensiti>ity to #P', iso+butane, propane (mall sensiti>ity to alcohol, smo5e? %ast response?
•
(imple dri>e circuit
• •
(TR*T*R" A&) $&%I'*RATI$&@ (ensor composed by micro A#.$8 ceramic tube, Tin )io9ide (n$.4 sensiti>e #ayer , measuring electrode and heater are fi9ed into a crust made by plastic and stainless steel net? The heater pro>ides necessary wor5 conditions for wor5 of sensiti>e components? The en>eloped MG+C ha>e C pin ,E of them are used to fetch signals, and other . are used for pro>iding heating current?
PR"A*TI$&( T$ B" TAD"& !"& 'A( #"ADA'" )"T"T")@ hat to do if your gas detector alerts you to a natural gas lea5 0
#ea>e the house immediately?
.
)$ &$T ma5e calls from your home? Phones are capable of producing a spar5, which could start a fire or e9plosion? ontact your local gas utility company or call 200 from a phone outside and away from your home?
8
)$ &$T light a match or other combustible material? #i5ewise, )$ &$T turn any light switches on or off, and )$ &$T plug or unplug electrical appliances such as a tele>ision or >acuum cleaner? These acti>ities also can produce a spar5 that could start a fire or e9plosion?
7
E
)o not re+enter the house until the gas company finds the source of the lea5 and corrects it?
($*R"( $% &AT*RA# 'A( ("&($R(@ 0
#ea5s from gas appliances, heating systems, and water heaters
.
#ea5s from interior natural gas piping systems
8
Migration of natural gas indoors from lea5s in outdoor piping systems
E?. '(M M$)*#" The Global System for Mobile Commui!atios GSM@ originally from 'roup (pecial Mobile4 is the most popular standard for mobile phones in the world? '(M ser>ice is used by o>er . billion people across more than .0. countries and territories? The ubiquity of the '(M standard ma5es international roaming >ery common between mobile phone operators, enabling subscribers to use their phones in many parts of the world? '(M differs significantly from its predecessors in that both signaling and speech channels are )igital call quality, which means that it is considered a second generation .'4 mobile phone system? %rom the point of >iew of the consumers, the 5ey ad>antage of '(M systems has been higher digital >oice quality and low cost alternati>es to ma5ing calls such as te9t messaging? The ad>antage for networ5 operators has been the ability to deploy equipment from different >endors because the open standard allows easy inter+operability? #i5e other cellular standards '(M allows networ5 operators to offer roaming ser>ices which mean subscribers can use their phones all o>er the world?
AT $MMA&)(@ 0? HM') + )elete (M( Message
"9ec ommand@ HM')Jinde9K "9ecution command deletes message from preferred message storage Jmem0K Jmem0K is the selected message storage from the HPM( command4 location Jinde9K .? HM'% + (M( Message %ormat (et ommand@ HM'% LJmodeK
8
(et command tells the phone, which input and output format of messages to use? JModeK indicates the format of messages used with send, list, read and write commands and unsolicited result codes resulting from recei>ed messages? Mode can be either P)* mode entire TP data units used4 or te9t mode headers and body of the messages gi>en as separate parameters4? $nly P)* mode is supported at this time? 3alid >alues for JmodeK are@ •
; P)* mode default4
•
Read ommand@ HM'%N
•
Read command returns the current JmodeK set? Response is in the form
8? HM'R + Read (M( Message "9ec ommand@ HM'RJinde9K "9ecution command returns the (M( message with location >alue Jinde9K from message storage Jmem0K Jmem0K is the selected message storage from the HPM( command? E?T$ ("&) A M"((A'" I& T"OT M$)"@ To send an (M( message in te9t mode use the ATHM'( command? The format of this command is@+ ATHM'(Jdestination numberK L, Jtype of destination JRK The '(M engine will then respond with a K prompt, ne9t enter the message to send followed by ontrol+Q? The "ngine will then respond with a reference number or and error?
"9ample@ AtHcmgsHC0E06E;;.;; K testSQ HM'(@066 $D
4.3 AVR MICROCONTROLLER ATMEGA 8 9
Features: ! "#$%&er'(r)a*+e, L(-&(-er AVR 8/#t M#+r(+(*tr(00er ! Aa*+e RIC Ar+%#te+ture 13 (-er'u0 I*stru+t#(*s M(st #*$0e+0(+ C+0e Ee+ut#(* 32 8 Ge*era0 ur&(se (r#*$ Re$#sters Fu00 tat#+ O&erat#(* ;& t( 16 MI T%r(u$%&ut at 16 M"< ! "#$% E*ura*+e N(*(0at#0e Me)(r se$)e*ts 8= >tes (' I*ste) e0'&r($ra))a/0e F0as% &r($ra) )e)(r 512 >tes EEROM 1= >te I*ter*a0 RAM ! er#&%era0 Features T-( 8/#t T#)er?C(u*ters -#t% e&arate res+a0er, (*e C()&are M(e O*e 16/#t T#)er?C(u*ter -#t% e&arate res+a0er, C()&are M(e, a* Ca&ture M(e >te(r#e*te T-(-#re er#a0 I*ter'a+e r($ra))a/0e er#a0 ;ART Master?0ae I er#a0 I*ter'a+e O*+%#& A*a0($ C()&arat(r ! &e+#a0 M#+r(+(*tr(00er Features (-er(* Reset a* r($ra))a/0e >r(-*(ut @ete+t#(* ! I?O a* a+a$es 23 r($ra))a/0e I?O L#*es 280ea @I, 320ea TF, a* 32&a FN?MLF ! O&erat#*$ V(0ta$es 2.7 5.5V BAT)e$a8L 4.5 5.5V BAT)e$a8
E?E B*QQ"R 1
hen buFFer is blowing, this indicates the lea5age of #P' gas? It is 0.3 ) operated buFFer?
E?/ #") hen #") is glowing, this indicates the lea5age of #P' gas? It is 0?.3 ) operated #")?
4.6 AVR T;@IO 4 OFTARE A3R (tudio is a )e>elopment Tool for the AT2;( (eries of A3R microcontrollers? A3R (tudio enables the user to fully control e9ecution of programs on the AT2;( In+ircuit "mulator or on the built+in A3R Instruction (et (imulator? A3R (tudio supports source le>el e9ecution of Assembly programs assembled with the Atmel orporations A3R Assembler and programs compiled with IAR (ystems= IA2; ompiler for the A3R microcontrollers? A3R (tudio runs under Microsoft indows2/ and Microsoft indows &T? A3R (tudio enables e9ecution of A3R programs on an A3R In+ircuit "mulator or the built+in A3R Instruction (et (imulator? In order to e9ecute a program using A3R (tudio, it must first be compiled with IAR (ystems ompiler or assembled with Atmels A3R Assembler to generate an object file which can be read by A3R (tudio?
E?1 $MPI#"R I& A3R inA3R TM pronounced whene>er4 is a suite of e9ecutable, open source software de>elopment tools for the Atmel A3R series of RI( microprocessors hosted on the indows platform? It includes the '&* ' compiler for and HH? inA3R TM contains all the tools for de>eloping on the A3R? This includes a>r+gcc compiler4, a>rdude programmer4, a>r+gdb debugger4, and more inA3R is used all o>er the world from hobbyists sitting in their damp basements, to schools, to commercial projects? inA3R TM is comprised of many open source projects? If anyone feel ad>enturous, >olunteers are always welcome to help with fi9ing bugs, adding features, porting, writing documentation and many other tas5s on a >ariety of projects?
E?6 "OPR"(( PB ($%TAR" E"PRESS PC# is a free and open+source software suite for electronic design automation")A4 + for printed circuit board PB4 layout? It uses 'TDH for its '*I widgets?
%"AT*R"(@+ •
(calable fonts
•
#ayer groups to 5eep signals together?
•
entroid O+74 data output
•
Post(cript and "ncapsulated Post(cript output
11
•
Rats+nest generation from simple net lists
•
Automatic clearance around pins that pierce a polygon
•
%lags for pins and >ias
•
'roups of action commands can be undone by a single undo
•
(imple design rule chec5er )R4 + chec5s for minimum spacing and o>erlap rules
•
)rawing directly on the sil5 layer
•
3iewable solder+mas5 layers and editing
•
&etlist window
•
&etlist entry by drawing rats
•
Auto router
•
(nap to pins and pads
•
"lement files and libraries that can contain whole sub+layouts, metric grids
•
*p to 0C copper layer designs by default
•
Trace optimiFer
•
Rats nest
/? (7(T"M A&A#7(I( A&) )"(I'& In the initial step, the gas lea5age is det ected by the gas sensor MG+C? This detects the gas lea5age and gi>es the signal to the microcontroller with the help of A)? After that in second step the microcontroller recei>e the signal, send b y gas sensor? It sends acti>ation signal to other e9ternal de>ices attached with it? (uch as #"), buFFer and '(M module ? In the last step, many tas5s ha>e been performed such as buFFer acti>ates, '(M module acti>ated, which send warning (M( to the user .
12
Microcontroller used here is ATmega6? Its pin diagram and description is gi>en below+
13
$CC
)igital supply >oltage?
GND
'round?
Port #
PB1??PB;4
"TAL%&"TAL'&TOSC%& TOSC' Port # is an 6+bit bi+directional I-$ port with internal pull+up resistors selected for each bit4?
Port # output buffers ha>e symmetrical dri>e characteristics with both high sin5 and source
capability? As inputs, Port B pins that are e9ternally pulled low will source current if the pull+up resistors are acti>ated? The Port B pins are tri+stated when a reset condition becomes acti>e, e>en if the cloc5 is not running? e ha>e used port B for programming?
14
Port C P/??P;4 Port is an 1+bit bi+directional I-$ port with internal pull+up resistors selected
for each bit4? The Port C output buffers ha>e symmetrical dri>e characteristics with both high sin5 and source capability? As inputs, Port pins that are e9ternally pulled low will source current if the pull+up resistors are acti>ated? The Port pins are tri+stated when a reset condition becomes acti>e, e>en if the cloc5 is not running? e ha>e used it for con>erting analog output of MG+C sensor to digital input for microcontroller ATM"'A6? Port D P)1??P);4 Port ) is an 6+bit bi+directional I-$ port with internal pull+up resistors selected
for each bit4? The Port D output buffers ha>e symmetrical dri>e characteristics with both high sin5 and source capability? As inputs, Port ) pins that are e9ternally pulled low will source current if the pull+up resistors are acti>ated? The Port ) pins are tri+stated when a reset condition becomes acti>e, e>en if the cloc5 is not running? RESET input? A low le>el on this pin for longer than the minimum pulse length will generate a reset
e>en if the cloc5 is not running?
15
C? (7(T"M T"(T PR$")*R" A&) R"(*#T(
PR$'RAMMI&'@
At the first step programming is done for the calculation of re>olution per minute? ? Programming has been done on A3R studio E?
A3R (T*)I$ E@ A3R studio is an integrated de>elopment en>ironment I)"4 for writing and debugging A3R applications in windows en>ironments? A3R studio pro>ides a project management tool, source file editor, simulator, assembler and front end for -HH, programming, emulation and on+chip debugging? The programming in A3R studio is done as follows@
•
%irst A3R studio is opened and select project+K new project from the menu, and the dialog bo9 below will appear ?
16
17
•
)"3I" ("#"TI$& )ebug platform and de>ice selection can be done by selection debug+Kselect debug platform and de>ice? All on system debug platforms and de>ices are listed? (elect ATmega6 in the de>ice menu?
•
RIT" A PR$'RAM &ow, write the code into open editor window? 7ou should now be ready to start debugging the code by pressing the
18
•
After program is written select build option from menu? The software will compile the program and will gi>e errors if any? $nce the program is compiled we need to simulate it to see the results?
1? PB )"(I'& A printed circuit board PB4 mechanically supports and electrically connects electronic components using conducti>e trac5s, pads and other features etched from copper sheets laminated onto a non+ conducti>e substrate? PBs can be single sided one copper layer4, double sided two copper layers4 or multi+layer outer and inner layers4? Multi+layer PBs allow for much higher component density? onductors on different layers are connected with plated+through holes called >ias? Ad>anced PBs may contain components + capacitors, resistors or acti>e de>ices + embedded in the substrate? (oftware used for PB designing is "OPR"(( PB? The first step is to ma5e the schematics? &ow we need to draw the circuit board and we need to draw the wires that connect the different components? hen we drew the circuit diagram in the pre>ious step, we tell the program which components are going to be connected? &ow we connect e>erything by drawing lines, and the program will tell if we did it correctly?
6? R"(*#T( $BTAI&") The message has been send to user and led and buFFer gets acti>ated .
19
2
2? %*T*R" $RD •
In future, more detection systems li5e any gas detection system can be implemented?
•
Additional features include more secure systems li5e a call will be gone to a telephone number if a gas lea5age and fire in a networ5 area li5e #A& and internet used to worldwide?
•
The detection system can upgraded to control system as well?
21
0;? BIB#I$'RAP!7 A&) R"%"R"&"( •
%raiwan #, #weesy D, Bani+(alma, A Mani & .;004, UA ireless !ome (afety 'as #ea5age )etection (ystem, Proc? of 0st Middle "ast,
•
? A he(oh, M D !assan, and A : Ishak “Vehicle Gas Leakage Detector ?
•
) M !an and : ! #im .;0;4, U(mart !ome "nergy Management (ystem *sing I""" 6;.?0/?E and Qigbee”, IEEE Trans. on onsumer Electronics, Vol. !", #o. $, %%. &'($)&'&(
•
•
' 3 !ippel .;;/4, U)emocratiFing Inno>ation, MIT %ress, am*ri+ge, MA. an-ei Electronics o. Lt+ /((/0, M1)" GasSensor Technical Data?
•
Del>in R (ulli>an, U*nderstanding Relays, A tutorial on relays?
•
M B %ish, R T ainer, U(tandoff 'as #ea5age )etectors Based on Tunable )iodes #aser Absorption (pectroscopy?
•
&asaruddin & M B, "lam>aFuthi I, !anif & ! ! B M .;;24, U$>ercoming 'as )etector %ault Alarm )ue to Moisture”, 2roc. o3 IEEE Stu+ent on3erence on 4esearch an+ De5elo%ment, %%. '/")'/6.
•
? &ational Institute of !ealth .;;E4, Uhat 7ou &eed to Dnow About &atural 'as )etectors, htt%788---.ni+c+.nih.go58health8smelltaste8 gas
22