LPG Gas Detector and Diffusion System
LPG Gas Detector and Diffusion System
This project is submitted in partial fulfillment of requirement for the Mount Kenya
University award of Degree in computer and electronics systems.
1
DECLARATION
I hereby declare that this project report is based on my original work except for citations and
quotations which have been duly acknowledged. I also declare that it has not been previously and
concurrently submitted for any other degree or award at Mount Kenya University.
Signature: _________________________
Name: ________________________
ID No.: _________________________
Date: _________________________
SUPERVISOR
I the undersigned do hereby certify that this is a true report for the project undertaken by the
above-named student under my supervision and that it has been submitted to Mount Kenya
University with my approval
Signature……………………………………………………. Date…………………………….
2
DEDICATION
Specially dedicated to my beloved grandmother, mother and father.
3
ACKNOWLEDGEMENTS
I would like to thank everyone who had contributed to the successful completion of this project.
I would like to express my gratitude to my research supervisor, Dr. Madam Alice Kasera for her
invaluable advice, guidance and his enormous patience throughout the development of the
research.
In addition, I would also like to express my gratitude to my loving parent and friends who had
helped and given me encouragement to exploit my project.
4
ABSTRACT
Gas has become the common mode of cooking in the era we are in. This is as a result of the
advancement in technology. This has also subjected us to several hazards, which include loss of
life and property due to poor emergency facilities.
My project provides a solution to the losses that result from cases of unwanted and unexpected
gases leakage and aiming to improving levels of human life safety and security. The system is
divided into four modules based on functionality. These modules are designed to build up and
integrated to cover various aspects by using the Arduino, Mq2, LCD and a servo motor attached
to the window.
The LPG gas detector and diffusion system is meant to operate in such a way that in case there is
gas leakages in a house the device is able to activate the windows open so that they can help
diffuse the gas before help is in place while also the system issues an alarm for notification. In
cases of other premises such as the industries the device can be configured to activate other
peripheral.
5
TABLE OF CONTENTS
ACKNOWLEDGEMENTS4
ABSTRACT5
LIST OF TABLES7
LIST OF FIGURES7
1.0 CHAPTER 18
1.1 INTRODUCTION.8
1.3 Objectives9
1.3.1 Main Objectives9
1.3.2 Specific Objectives10
1.3.3 Research Question10
1.4 Justification10
6
5.0 CHAPTER 5: LIMITATIONS, CONCLUSION AND RECOMMENDATION27
5.1 LIMITATIONS27
5.2 CONCLUSION27
5.3 RECOMENDATIONS28
6.0 REFERENCES29
7.0. APPENDIX30
LIST OF TABLES
Table 1: Tools Required24
Table 2: Cost34
LIST OF FIGURES
Figure 1: Block Diagram11
Figure 2:Arduino UNO16
Figure 3: MQ-2 Gas Sensor17
Figure 4: Light Emitting Diodes18
Figure 5: Resistors19
Figure 6: Capacitor20
Figure 7: Simplified Block Diagram.21
Figure 8: Circuit Diagram22
Figure 9: Graph of output voltage against distance25
Figure 10: Graph of concentration against distance26
Figure 11: Experimental photos34
7
1.0 CHAPTER 1
1.1 INTRODUCTION.
The invention of LPG gas as mode of cooking has impacts on the lives of people. It is becoming
the progressive symbol of modern society. Not only the demand on performance and quality of
gas usage increase rapidly, but there is also demand on safety measures in place to help reduce
disasters that result from mishandle of the gas. Even though some sophisticated system put in
place can help in the detection of the leakage of the gases, but people do not use it due to their
high cost. By using the form whereby, the systems activate some components in the house,
hospital, laboratory or in the industries, the cost is lower compare to the one in place which
usually use GSM to send notification messages in case of such cases.
The LPG gas detector and diffusion system is meant to operate in such a way that in case there is
gas leakages in a house of laboratory or even hospitals, the device is able to activate the windows
open so that they can help diffuse the gas before help is in place. In cases of other premises such
as the industries the device can be configured to activate other peripherals. The system is
composed of a gas sensor (MQ2), Arduino microcontroller, 2x16LCD screen, buzzers
(alarm).The idea of using MQ2 gas sensor is simple, and that’s the presence of the LPG gas
increases the conduction level of the sensor. Sensitive material of MQ-2 gas sensor is SnO2,
which with lower conductivity in clean air. When the target combustible gas exists, the sensor’s
conductivity is higher along with the gas concentration rising. MQ-2 gas sensor has high
sensitivity to LPG, Propane and Hydrogen, also could be used to Methane and other combustible
steam, it is with low cost and suitable for different application.Generally, the working principle
of the whole system is: the gas sensor detects the leaking gas sends the data into the
microcontroller for processing and comparing with the required threshold. If it’s beyond it then
activates alarm and activates other diffusion systems to help curb the situation, at the same time
LCD shows the level the gas has detected and also are danger message.
The project is depicted from the previous done work that aimed at solving the risk from gas
leakage. This includes the samples below;
8
A “GSM Based Gas leakage Detection System” by Srivastava and Prabhakar provides a cost
effective and highly accurate system, which not only detects the gas leakage but also alert and
turn off the mains power and gas supplies and sends a SMS. Rammaya and Palaniappen reported
an “Embedded System for Hazardous Gas Detection and Alerting”. The alerting of gas
leakage is through buzzer and SMS.
A “WSN based Smart System for Detection of LPG and Combustible Gases” has been
proposed by Hema et al, which identifies potentially hazardous gas leak within an area by means
of various sensors based electronic systems. These systems also employ an audible alarm to alert
the people whenever a dangerous gas is detected. These gas detection systems are of immense
use because they can be used to detect a wide range of combustible, flammable and toxic gases
which have hazardous effects on human health.
1.3 OBJECTIVES
9
1.3.2 Specific Objectives
To layout and acquire a project that will fabricate a sound alarm during gas outflow and
rest the alarm once gas outflow is regulated.
To develop a program in C language and upload it in the microcontroller for it to process
the sensors signals and trigger the alarm.
Thus, with this project the above question is the main research question behind the project and
the project tries to answer the question.
1.4 JUSTIFICATION
Our population is crowded and therefore there is need to value life, protect our property and
environment at large. Reviewing technological innovations attempting to solve the same problem
of gas outflow, there has been a number of them. However, the issue of the distance of the
concerned from where the leakage has taken place is the main case in this project. That’s, the
project conveys the advantage of despite an alarm alert but also windows are also set open to
help diffuse the gas from the house or hospital before the concerned arrives in the place of scene.
The gas detector device does not have any harm or any risk to an individual. It’s a cheaper
device and easy installation at homes and different places.
The intelligent machine gas detector could address prevention of explosion of LPG gases in their
houses by means of a sound alarm. Thus, residents can prevent the transpiration of accidents
which can lead to drastic loss and untimely deaths. In the labs also it can help in the prevention
of explosion since most laboratory uses toxic and explosive gas/fumes. Thus, lab users could
10
prevent a potential explosion. Considering the various factories, it is also recommendable since
the device can give warning ahead of time and prevent such explosion. Along with the
development of the project, researchers will be able to familiarize the basics of programming
since conducting this study requires such skills. This study will serve as basis and source of
information to other researchers if in case they have a study related to this research
11
by the controller, the microcontroller compares the input data to the set threshold levels set. If the
level exceeds the required normal standards, the alarm is activated and set on while the servo
motor is set on to open the window while the display unit shows a message of “GAS IS
LEAKING”. Otherwise, if the data decoded doesn’t exceed the set normal threshold no alarm or
windows are activated to open and the display system displays are state of “NORMAL
CONDITION” in the room. Hence, in case the gas leaks in the absence of the home’s owner the
wind through the window into the house is able to diffuse the gas out of the house. In companies
the issued alarm helps to alert the concerned in the area in case of gas leakage in their systems.
The LCD display is used at the output section to display the status of the system while indicating
the level. The maximum power supply required to operate the hardware circuitry is +5V DC
voltage. Finally, all the components are interfaced precisely so that the incident detection and
alert sending are fully automated, so that the warning time is reduced significantly and the
operation of the system is real time.
12
2.0 CHAPTER 2: LITERATURE REVIEW
The LPG gas detection and diffusion system provides the concerned with crucial information at
the earliest possible time. Reducing the time between when gas outflow takes place and when it
is detected can greatly help reduce disaster that can result from leakage of the gas. The entire
works have to be integrated with the peripheral component’s automation based on the area of
application to validate its functionality and reliability. Thus, this work will reduce the gas
disaster ratio in considerable amount even in several areas in the society. Then it has a great
importance in day to day life of the people in the country like Kenya where gas has become the
most common mode of cooking to several people in the country. This proposed work will
provide vital information about the gas outflow even in unpopulated areas. The LPG gas detector
and diffusion system is designed and implemented using technologies of automation like the
ALARM to send out a sound alarm when the gas is detected, WINDOWS which as linked to the
device and set open when gas is detected to help in diffusing the gas. The proposed model for
gas detection system can prove to be an important aid in setting constructive measures in the near
future to help reduces disasters that result from the leaking of gas.
To work against the dangerous effects of gas leakage, significant efforts have carried out in
manipulative and miniaturizing the gas leak sighting technique. The occurrences of gas leak-
related incidents are studied by several researchers and have published statistical data incidents.
A “GSM Based Gas leakage Detection System” by Srivastava and Prabhakar provides a cost
effective and highly accurate system, which not only detects the gas leakage but also alert and
turn off the mains power and gas supplies and sends a SMS. Rammaya and Palaniappen reported
an “Embedded System for Hazardous Gas Detection and Alerting”. The alerting of gas
leakage is through buzzer and SMS.
A “WSN based Smart System for Detection of LPG and Combustible Gases” has been
proposed by Hema et al, which identifies potentially hazardous gas leak within an area by means
of various sensors based electronic systems. These systems also employ an audible alarm to alert
the people whenever a dangerous gas is detected. These gas detection systems are of immense
use because they can be used to detect a wide range of combustible, flammable and toxic gases
which have hazardous effects on human health.
13
” Design Implementation of an Economic Gas Leakage Detector” by Mahalingam et al
provided a cost-effective audio-visual solution for LPG leakage detection in homes and
commercial premises and audibly alert the users in case of a hazardous situation and provide
warning signals, that’s it beeps.
In 2012, Somov et al reported “Energy-Aware Gas Sensing Using Wireless Sensor
Networks” focusing on a sensor node, a relay node, a wireless actuator and a network
coordinator. The network coordinator is the main unit of the WSN. It supports the network
operation by wireless communication based on the IEEE 802.15.4 standard and the ZigBee
specifications. The network coordinator is also responsible for alerting a network operator or an
emergency service using the Ethernet network or sending a SMS using a GSM/GPRS modem.
Upon receiving the alert message from the sensor node, the network coordinator can perform the
first counter action by deactivating the source of gas emission via the wireless actuator.
In 2011, Bhattacharjee et al designed a system entitled “Design and Development of a Flexible
Reliable Smart Gas Detection System”. The system composed of three modules; the base
station, wireless sensor array and an intelligent wireless alarm unit, which offers high reliability,
flexibility and uninterrupted sensing. These are achieved by incorporating various intelligent
protocols like auto sensor calibration, sensor handover, wireless threshold fixation and intelligent
alarm mechanism. The sensor node consists of three gas sensors, one temperature sensor and one
pyro-electric infrared sensor (PIR) which enhances the sensing intelligence. The sensed data are
digitized and processed by the peripheral interface controller (PIC) 16f877A based centralized
embedded platform and wireless communication is achieved with a pair of 433 and 315 MHz
amplitude shift keying (ASK) wireless module. The encoding and decoding of sensed data offer
a high secured gas detection system.
14
Peijiang and Xuehhua developed a system namely “Design and Implementation of Remote
Monitoring System Based on GSM”, which has focused on the wireless monitoring system; a
remote monitoring system based on SMS through GSM. The hardware and software
architectures of the system are designed. In this system, the remote signal is transmitted through
GSM network. The system includes mainly two parts; the monitoring center and the remote
monitoring station. The monitoring center consists of a computer and a TC35 communication
module for GSM. The computer and the TC35 are interfaced by RS232. The remote monitoring
station consists of a TC35 communication module for GSM, a MSP430F149 MCU, a display
unit, sensors and a data gathering and processing unit. The software for the monitoring center
and the remote monitoring station were designed using Visual Basic.
A low-cost automotive localization system using GPS and GSM-SMS services was proposed by
Lita et al concerning “A New Approach of Automatic Localization System Using GPS and
GSM/GPRS Transmission”, which provides the position of the vehicle on the driver’s or
owner’s mobile phone as a short message (SMS).The system can be interconnected with the car
alarm system that alerts the owner, on his mobile phone, about the events that occurs with his car
when it is parked. The system is composed by a GPS receiver, a microcontroller and a GSM
phone. In addition, the system can be settled for acquiring and transmitting the information,
whenever requested about automobiles status and alerts the user about the vehicle’s started
engine. The system can be used as a low-cost solution for automobiles position localizing as well
as in car tracking system applications.
Investigation on vehicle cabin air quality monitoring system with metal oxide semiconductor gas
sensor was the breakthrough in this field by Galitsis et al. Herein, commercially available gas
sensors are compared with the fabricated M0O3 based sensors. The sensor has a response of 74%
or higher relative to the host commercial sensor tested. The same authors have also contributed
to the added vehicle safety through a vehicle cabin air quality monitor using carbon monoxide
(CO) and oxygen (02) gas sensors system designed, developed and on-road tested. The
continuous monitoring of oxygen and carbon monoxide provides added vehicle safety as alarm
could be set off when dangerous gas concentrations are reached, preventing driver fatigue, and
drowsiness and exhaust gas suicides. CO concentrations of 30 ppm and oxygen levels lower than
19.5% were experienced whilst driving.
15
3.0 CHAPTER 3: SYSTEM DESIGN
16
2. MQ2 Gas Sensor:
The Grove - Gas Sensor (MQ2) module is useful for gas leakage detecting (in home and
industry). It can detect H2, LPG, CH4, CO, Alcohol, Smoke, and Propane. Based on it’s
fast response time. Measurements can be taken as soon as possible. Also the sensitivity
can be adjusted by the potentiometer. Normally a gas sensor is made up of transducer that
senses the gas molecules. It sends electrical signals as the output which is proportional to
the gas concentration. The gas sensors do not sense a particular gas; thus, they must tend
to employ analytical techniques to adopt to identify a particular gas. However, these
analytical methods suffer from many disadvantages of skilled operator, specially
designed PC’s and slows response time etc., and the proposed system does not suffer
such disadvantages.
17
3. Light Emitting diodes:
18
4. Resistors:
A resistor is a passive two-terminal electrical component that implements electrical
resistance as a circuit element. Resistors may be used to reduce current flow, and, at the
same time, may act to lower voltage levels within circuits. In electronic circuits, resistors
are used to limit current flow, to adjust signal levels, bias active elements, and terminate
transmission lines among other uses. High-power resistors, that can dissipate many watts
of electrical power as heat, may be used as part of motor controls, in power distribution
systems, or as test loads for generators.
Figure 5: Resistors
19
5. Capacitors:
Figure 6: Capacitor
20
3.2 METHODS USED
The methods used to achieve this work are through the hardware with some software programs.
Hardware Design:
The hardware design consists of Arduino Microcontroller, LCD Display, buzzer, MQ-2 gas
sensor, LED’s, 10k Resistors, 10microfarad Capacitors. All these hardware’s are interfaced with
each other. A coding in embedded C is developed through the Arduino IDE software.
21
4.0 CHAPTER 4: SYSTEM IMPLEMENTATION AND TESTING
First the microcontroller initializes the LCD display and starts reading the analog voltage from
the MQ2 sensor. The MQ2 sensor gas module has 4 pins. Two pins are used for interfacing with
development board and other two pins are VCC and ground. Out of two interfacing pins one pin
is analog output and other is digital pin. The analog output pin of the module is used for
detecting concentration level of gas leakage and interfaced with the A0 analog input pin of the
Arduino board. The analog voltage from the sensor is digitized using the in-built ADC channel
and stored in a variable as a 10-bit value. The 16X2 LCD display is used to display the value of
22
gas concentration. It is connected to the Arduino board by connecting its data pins to pins 9-13 of
the Arduino board. The RS and E pins of the LCD are connected to pin8 and pin9 of the Arduino
UNO respectively. The RW pin of the LCD is connected to the ground. The sensor value is
compared with a calibrated threshold and if the sensor value exceeds that value, the buzzer gets
activated. The buzzer is connected to the digital pin of the Arduino. A 10k potentiometer is also
connected to the LCD pin VD, the battery and the ground. This is used for the contrast on the
LCD display of the written alphabets or digits.
When the leakage of the gas is within a limit or there is no leakage, the circuit detects and it
displays the ADC value or the numerical value which is less than 200. A message showing
"NORMAL CONDITION" keeps on displaying on the LCD screen .The buzzer is kept off for
the condition. The green LED is set on while the red LED is off. The servo motor remains at zero
thus window remains closed.
If the leakage level is higher above the threshold i.e. in the danger level, the circuit detects and it
displays the ADC value or the numerical value greater than 200 on the display message showing
“GAS IS LEAKING” keeps on displaying on the LCD screen. The buzzer alerts the surrounding
by producing a high frequency sound which is audible to all. The green LED is set off while the
red LED is on. The servo motor moves at 180 degrees thus having the window open for air
circulation.
The circuit is first designed using Easy EDA software, which is really needed in PCB
fabrication. The 9V of power source is used in the circuit work. The maximum range of detection
can be as far as 1 meter. The red LED is used as the indication of the leakage. If the leakage has
occurred and detected by the MQ2, the red LED will be turned on and the green LED turned off
while the motor attached to the window is set on and moves at 180 degrees to set the window
open.
23
4.2 TOOLS REQUIRED
In order to observe the voltage variation of the circuit, a diode and 100 ohm Resistor is place at
the A0 analog terminal of the MQ2 sensor. This is for the purpose of smoothing the voltage and
connecting the circuit to the oscilloscope. The experiment is conducted in the confined area, thus
the result is shown below:
The voltage reading is taken from the oscillator. From the graph obtained as shown in Figure 11,
the time taken for the circuit to detect the leakage at the distance of 10 cm is 10 second. This is
obviously shown when there was a sudden drop in the voltage after the LPG gas was released
into the chamber. The voltage began to be at its steady state value when the LPG started to
disperse in the surrounding which had reduced its concentration almost getting into normal air
conditions.
24
LPG Experimental Results with Distance Variation
9
8.8
Final Output Voltage(V)
8.6
8.4
8.2
8
Series 1
7.8
7.6
7.4
7.2
0 1 2 3 4 5 6 7 8 9
Distance in cm
From this result, I can conclude that the greater the distance between the gas sensor and the gas
leakage point, the lesser the capability of the circuit to detect the leakage. As a result, the voltage
drop difference will also decrease due to the increment in the final voltage drop.
25
4.4 A GRAPH OF GAS CONCENTRATION AGAINST DISTANCE .
300
Below point 200p
250 this is when the
alarm is set OFF
200
150 Series 1
100
Normal
50 condition
zone
0
0 1 2 3 4 5 6 7 8 9 10 11
DISTANCE IN CM
The plotted graph is of the concentration levels denoted in ppm units (parts per million) against
distance in cm. The values are obtained by varying the distance between the sensor and the point
of leaking.
At 1cm distance of the sensor from the gas point, the sensor recorded a gas concentration of
320ppm which was beyond the normal threshold of 200ppm. At that point the alarm was set ON.
Therefore, above 200ppm the buzzer was ON while below 200ppm the buzzer was off because
the gas concentration recorded was below threshold. Between point 9cm and 11cm the sensor
recorded a constant value of 100ppm because at that distance there was no gas sensed, the
condition was normal. In conclusion, the far the sensor is from the leakage point the less gas is
sensed due to decrease in concentration as you more away from the point of leakage.
26
5.0 CHAPTER 5: LIMITATIONS, CONCLUSION AND RECOMMENDATION
5.1 LIMITATIONS
Along the design of my project, several limitations have contributed to imperfection on my
project. Some of the limitations include;
i. In terms of cost, most of the components were so expensive. This made completions of the
project not on time. This also made me go for cheaper components which were of low
quality.
ii. During the design of the project, several times I had the system not respond as expected
despite everything well connected. That’s when I powered the design via my laptop
everything worked perfectly unlike when I power it using my 12v power supplier.
5.2 CONCLUSION
Finally, we conclude in recent households, the use of LPG is taking a big troll. The biggest threat
in using this technology is security. And my project will prove to be boom for households and
industries. A wide variety of leak detecting techniques is available for gas households and
industries. Some techniques have been improved since their first proposal and some new ones
were designed as a result of advances in sensor manufacturing and computing power. However,
each detection method comes with its advantages and disadvantages. Leak detection techniques
in each category share some advantages and disadvantages. For example, all external techniques
which involve detection done from outside the pipeline by visual observation or portable
detectors are able to detect very small leaks and the leak location, but the detection time is very
long. Methods based on the mathematical model of the pipe have good results at high flow rates
while at low flow rates a mass balance based detection system would be more suitable. A device
that can detect such leakages and issue an alarm while at the same time set the window on for air
circulation was designed and developed. It was observed that when the LPG device was tested by
placing it at different distances from the gas source, the response time of the LPG system
decreased as the distance from the gas source increased and vice versa. The gas sensor’s
sensitivity varied with temperature while the reference voltage remained constant over time. This
device can be deployed anywhere cooking place or in kitchen .This system will ensure that
explosions resulting from leakages of cooking gas from the cylinders are averted.
27
5.3 RECOMENDATIONS
The section highlights suggestions and recommendations for further improvements in the system.
For improvement in the future, some additional feature could be added in order to make increase
the performance and capability of the circuit. Some recommendations are briefly explained
below:
This model can only detect various combustible gasses at certain distance. Most cases LPG and
others gases. The future improvement of this project will help to improve the functionality of this
model.
When the LPG has dispersed into the surrounding, its concentration will be decreased. Therefore,
this model will not be able to detect the leakage appropriately. The design of this model has to be
improved so that it can detect the leakage just as the leakage had occurred.
28
6.0 REFERENCES
i. Ch. Manohar Raju, N. Sushma Rani. An android based automatic gas detection and
indication robot. In International Journal of Computer Engineering and Applications. 2014;
8(1).
ii. Zhao Yang, Mingliang Liu, Min Shao, Yingjie Ji Research on leakage detection and analysis
of leakage point in the gas pipeline system. In Open Journal of Safety Science and
Technology; 2011.
iv. Pal-Stefan Murvaya, Ioan Sileaa. A survey on gas leak detection and localization techniques.
v. Falohun A.S., Oke A.O., Abolaji B.M. Dangerous gas detection using an integrated circuit
and MQ-9. In International Journal of Computer Applications. 2016; 135(7).
vi. Ashish Shrivastava, Ratnesh Prabhaker, Rajeev Kumar, Rahul Verma. GSM based gas
leakage detection system. In International Journal of Technical Research and Applications.
2013; 1(2).
29
7.0. APPENDIX
//john-tech codes
//pin declaration
int servoPin = 4;
Servo Servo1;
int ledPin1 = 6;
int buzzer = 7;
void setup() {
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(gasSensor, INPUT);
Servo1.write(0);
Servo1.attach(servoPin);
30
}
//loop
void loop() {
lcd.setCursor(0,0);
lcd.setCursor(0,1);
lcd.print("Level>> ");
lcd.print( analogSensor);
delay(500);
digitalWrite(ledPin2,LOW);
delay(500);
lcd.setCursor(0,0);
lcd.print("GAS IS LEAKING");
lcd.setCursor(0,1);
lcd.print("Level>> ");
lcd.print(analogSensor);
delay(2000);
31
Servo1.write(180);
delay(1000);
else
digitalWrite(ledPin2,LOW);
/*..............................*/
noTone(buzzer);
lcd.setCursor(0,0);
lcd.print("NORMAL CONDITION");
lcd.setCursor(0,1);
lcd.print("Level>> ");
lcd.print(analogSensor);
delay(2000);
Servo1.write(0);
delay(1000);
delay(1000);
32
7.2 APPENDIX B: FEATURES OF ARDUINO
33
7.3 APPENDIX C: COMPONENTS COST
Table 2: Cost
Component Cost
Arduino Sh. 1200
Mq2 Sh.500
Jumpers Sh. 100
Resistors Sh. 5 *5
Capacitor Sh. 50 *3
Strip board Sh. 150
34