You are on page 1of 15

ii

EMBEDDED SYSTEM BASED LPG LEAKAGE


DTECTION USING GSM MODULE

By

Umair Farooq
Syed Mubashir Hussain
Danial Waheed
Ghazenfar Abbas

2010-EE-10
2010-EE-15
2010-EE-16
2010-EE-37

A thesis submitted to the


Department of Electrical Engineering
in partial fulfillment of the requirements for the degree of
BACHELOR OF SCIENCE IN ELECTRICAL ENGINEERING
UNIVERSITY COLLEGE OF ENGINEERING & TECHNOLOGY
BAHAUDDIN ZAKARIYA UNIVERSITY
MULTAN
iii

C E RTI F I C ATE O F AP P R O VAL


It is certified that the project work titled Embedded Systems based LPG Leakage
Detection using GSM Module carried out by Umair Farooq, Syed Mubashir
Hussain, Danial Waheed and Ghazenfar Abbas, under the supervision of Engr. Amna
Riaz, at Bahauddin Zakariya University, Multan. It is fully adequate, in scope and in
quality, as a thesis for the degree of BSc Electrical Engineering.

Supervisor:
.

Engr. Amna Riaz


Lecturer
Dept. of Electrical Engineering
University College of Engineering & Technology
Bahauddin Zakariya University, Multan

External Examiner:

Engr. Mirza Tariq Baig


Deputy Chief Engineer SNGPL Multan

Head of Department:
Dr. Abdul Sattar Malik
Assistant Professor
Dept. of Electrical Engineering
University College of Engineering & Technology
Bahauddin Zakariya University, Multan

iv

ACKNOWLEDGMENT
In the name of Allah Al-Mighty, the most Beneficent, the most Merciful, Who has
given us the knowledge, strength and ability to complete this project.
We feel honored in expressing our deep and sincere gratitude to our supervisor Engr.
Amna Riaz for her commendable efforts, invaluable guidance, continuous
encouragement and support in making this project possible. We really appreciate her
services from the initial to the final level that enabled us to transform theoretical facts
and ideas into an organized working project. Surely, without her advice and assistance
the target would not have been achieved.
We acknowledge our heart-felt indebtedness and gratefulness to Engr. Muhammad
Adil Bashir who developed our vivid concepts about embedded systems, polished our
practical skills and equipped us with knowledge and techniques to troubleshoot our
project. We also offer special thanks to Engr. Sohail Afzal who broadened our vision
by giving us valuable suggestions in improving our project.
Our sincere thanks goes to all worthy lecturers of Electrical Engineering Department,
UCE&T,B.Z.U, Multan who imparted us useful knowledge and made our academic
journey at UCE&T pleasant and unforgettable.
Our appreciation and gratitude goes to our parents for their prayers, moral support and
motivation not only during this project but throughout our lives. There are no suitable
words which could truly convey our thanks to them.
Lastly we would like to extend our thanks to all those who contributed to our final
year project directly or indirectly and helped in its successful completion.

DECLARATION
It is declared that this is an original piece of our own work, except where
otherwise acknowledged in text and references. This work has not been submitted in
any form for another degree or diploma at any university or other institution for
tertiary education and shall not be submitted by us in future for obtaining any degree
from this or any other University or Institution.
Umair Farooq
2010-EE-10
Syed Mubashir Hussain
2010-EE-15
Danial Waheed
2010-EE-16
Ghazaenfar Abbas
2010-EE-37

December 2014

ABSTRACT
The aim and objective behind developing this project is to design and
implement an efficient LPG detection system using a gas sensor, microcontroller and
GSM module. The project ensures human life safety and prevents hazards by
performing different actions based on the concentration of LPG being leaked. On
lower concentration leakage, only the LED is turned on. Further increase in leakage
leads to the activation of buzzer to alert the people around to leave the place.
If the leakage concentration continues to increase even more, then exhaust fan is
turned on to reduce the concentration of LPG in the area it leaked. An alert SMS is
sent to the mobile of the person in charge of the system and the valve of the LPG is
closed automatically to prevent any further leakage. The project employs MQ-5
sensor which not only senses LPG but other gases like CNG, iso-butane and even
cigarette smoke. The microcontroller used is ATMEGA-16 that provides fast
instruction execution. The project is cost effective, portable and can be set up
anywhere where it is required to monitor LPG leakage.

TABLE OF CONTENTS
Acknowledgment.....................................................................................................v
Declaration..............................................................................................................vi
Abstract..................................................................................................................vii
Table of Contents..................................................................................................viii
List of Figures..........................................................................................................x
List of Tables...........................................................................................................xi
List of Acronyms/Abbreviations............................................................................xii

Chapter 1
Introduction 1
1.1

Overview......................................................................................................1

1.2

Statement of Problem...................................................................................2

1.3

Applications of the research.........................................................................2

1.4

Summary......................................................................................................3

Chapter 2
Literature review ..4
2.1

The hazardous gases.....................................................................................4

2.2

History OF Gas leakage Detection...............................................................4


2.2.1

Technologies focusing on LPG leakage detection...5

2.3

Related Projects............................................................................................5

2.4

Related Studies.6

2.5

Their Limitations and Bottlenecks...............................................................6

2.6

Summary......................................................................................................6

Chapter 3
Tools and techniques .
3.1

Hardware used with complete technical specifications................................7


3.1.1

MQ-5 LP Sensor...7
3.1.1.1 Features of MQ-5 Sensor..7
3.1.1.2 Construction of MQ-5 Sensor...8

3.1.1.3 Working Principle......10


3.1.2 ATmega AVR Microcontroller10
3.1.2.1 Whats special about AVR....11
3.1.2.2 Various microcontrollers of MegaAVR series..12
3.1.2.3 ATmega 16 AVR Microcontroller.12
3.1.2.4 Naming convention12
3.1.2.5 ATmega 16 Microcontroller Description.......13
3.1.2.6 Pin Configuration.......13
3.1.2.7 Features and Architecture..14
3.1.3 16*2 LCD.17
3.1.3.1 Pin Configuration...17
3.1.3.2 Pin Description...17
3.1.3.3 Initialization of LCD with ATmega 16..18
3.1.4 Indicators...20
3.1.4.1 Buzzer 20
3.1.4.2 LED20
3.1.4.3 Exhaust Fan21
3.1.5 Gas Valve.....21
3.1.6 DC Power Supply.....22
3.1.7 Sony Ericsson T230 Mobile GSM...24
3.1.7.1 Introduction..24
3.1.7.1.1 Historical Background of GSM24
3.1.7.1.2 T230mobile instead of GSM Module...25
3.1.7.1.3 GSM Modem25
3.1.7.2 Features and Construction...26
3.1.7.2.1 Features.26

3.1.7.2.2 Pin Description of Phone Connector.27


3.1.7.3 Working of Sony Ericsson T230 mobile GSM27

3.1.7.3.1 Getting Started..27


3.1.7.3.2 AT Commands..28
3.1.7.3.3 GSM AT command set.28
3.1.7.3.4 Types of AT Commands..28
3.1.7.3.5 Explanation of AT commands29
3.1.7.3.6 List of AT commands..31
3.1.7.4 T230 Mobile Interfacing With ATMEGA-1633
3.1.7.4.1 Sony Ericsson T230 Mobile GSM..33
3.1.7.4.2 SIM900 AT-Command set..33
3.2 Software(s), simulation tool(s) used38
3.2.1 Atmel Studio 6.1..38
3.2.1.1 Getting start programming with Atmel Studio..38
3.3

Summary43

Chapter 4
Methodologies and Implementation..44
4.1

Design of the Hardware.44


4.1.1 Interfacing of LCD with ATmega16....................................44
4.1.2 Interfacing of Indicators with ATmega1645
4.1.3 Interfacing of MQ-5 with ATmega16..46
4.1.4 Interfacing of T230 Mobile Phone with ATmega 16...46
4.1.5 Interfacing of Gas valve with ATmega 16...47

4.2

Implementation procedure.47
4.2.1

Details about software...47


4.2.1.1 Pony Prog Program47

4.2.2

Details about hardware.55


4.2.2.1 MQ-5 Sensor adjustment.55
4.2.2.2 ATmega working circuit..55
4.2.2.3 Complete Hardware set up..56

4.3 Details about Flow Chart and Schematic..57


4.4

Summary..59

Chapter 5
Results and Analysis60
5.1

Presentation of the findings.60


5.1.1

Hardware results...60
5.1.1.1 LCD Output60
5.1.1.2 Indicators Output62
5.1.1.3 Gas Valve Output62
5.1.1.4 T230 Mobile Output62

5.2

Discussion of the findings...62


5.2.1

Comparison with initial GOAL....62

5.2.2

Limitations62

5.3

Future Research and Improvements63

5.4

Summary..63

Chapter 6
Conclusion64
References.65
Appendices..66
Appendix - A..66
Datasheet of MQ-5 Sensor.66
Datasheet of 1602A LCD ....68

Datasheet of ATmega 16..70

LIST OF FIGURES

Figure-3.1 Configuration of MQ-5 sensor..8


Figure-3.2 Electric parameter measurement circuit of MQ-5..9
Figure 3.3Naming Convention of AVR Family.12
Figure 3.4 Pin configuration of ATmega1613
Figure 3.5 Architecture Diagram of Atmega16..15
Figure 3.6 LCD Pin Configration17
Figure 3.7 Buzzer model..20
Figure 3.8 LEDs image20
Figure 3.9 Exhaust fan model..21
Figure 3.10 Solenoid Gas Valve..22
Figure 3.11 Internal circuit of DC power supply.22
Figure 3.12 DC power Supply.24
Figure 3.13 GSM Module26
Figure 3.14 Phone Connector ..27
Figure 3.15 AT commands classification.28
Figure 3.16 Atmel Studio Icon.38
Figure 3.17 staring view of Atmel Studio39
Figure 3.18 Screen shot1 of Atmel Studio39
Figure 3.19 Screen shot2 of Atmel Studio40
Figure 3.20 Screen shot3 of Atmel Studio40
Figure 3.21 Screen shot4 of Atmel Studio41
Figure 3.22 Screen shot5 of Atmel Studio41
Figure 3.23 Screen shot6 of Atmel Studio42
Figure 3.24 Screen shot7 of Atmel Studio42
Figure 3.25 Screen shot8 of Atmel Studio43
Figure 3.26 Screen shot9 of Atmel Studio43
Figure 4.1 LCD Interfacing..44
Figure 4.2 Exhaust Fan Interfacing..45
Figure 4.3 Buzzer and LED Interfacing...45
Figure 4.4 MQ-5 sensor Interfacing 46
Figure 4.5 Mobile connection with AVR..46
Figure 4.6 Gas Valve Interfacing...47

Figure 4.7 Screen shot1 of Pony Prog48


Figure 4.8 Screen shot2 of Pony Prog48
Figure 4.9 Screen shot3 of Pony Prog49
Figure 4.10 Screen shot4 of Pony Prog..49
Figure 4.11 Screen shot5 of Pony Prog..50
Figure 4.12 Screen shot6 of Pony Prog..50
Figure 4.13 Screen shot7 of Pony Prog..51
Figure 4.14 Screen shot8 of Pony Prog..52
Figure 4.15 Screen shot9 of Pony Prog..52
Figure 4.16 Screen shot10 of Pony Prog53
Figure 4.17 Screen shot11 of Pony Prog54
Figure 4.18 Screen shot12 of Pony Prog54
Figure 4.19 Reset circuit of ATmega 16..55
Figure 4.20 Complete hardware interfacing....56
Figure 4.21 Complete Schematic.57

Figure 5.1 Initial message on LCD....60


Figure 5.2 0% concentration on LCD....61
Figure 5.3 Leakage % concentration on LCD....61

LIST OF TABLES

Table 3.1 AVR series of microcontrollers..11


Table 3.2 comparison between families of microcontrollers..11
Table 3.3 comparison between different members of MegaAVR family..12
Table 3.4 Pin Description of LCD .18
Table 3.5 Call control AT commands 32
Table 3.6 SMS text Mode AT commands ..32
Table 3.7 AT-Command set overview ...33
Table 3.8 AT command and possible responses..34
Table 3.9 ATE0 command and possible responses..35
Table 3.10 AT+CNMI command and possible responses35
Table 3.11 AT+CMGF command and possible responses...36
Table 3.12 AT+CMGR command and possible responses...36
Table 3.13 AT+CMGS command and possible responses37
Table 3.14 AT+CMGS command and possible responses37

LIST OF ACRONYMS
GSM

Global System for Mobile

FYP

Final Year Project

LPG

Liquid Petrolium Gas

MCU

Microcontroller

LED

Light Emmiting Diode

LCD

Liquid Crystal Display

LNG

Liquid Naturl Gas

You might also like