SlideShare a Scribd company logo
1 of 61
Download to read offline
Title
Gas detection using Arduino microcontroller
By
Ahmed Waheed
Supervisor
Asst. Prof. Hamza M. Khuder
A thesis submitted in partial fulfilment of the requirements for the degree of
Computer Engineering Techniques Department
College of Information Technology
Imam Ja'afar Al-Sadiq University
April 2023
Kirkuk, Iraq
i
Declaration
I hereby declare that this thesis entitled: “Gas detection using Arduino microcontroller
“is my own original work and hereby certify that unless stated, all work contained
within this is my own independent research and has not been submitted for the award
of any other degree at any institution, except where due acknowledgement is made in
the text.
Signature
Name:
Date:
Signature
Name:
Date:
Signature
Name:
Date:
Signature
Name:
Date:
ii
Dedication
I dedicate this dissertation as a tribute to my numerous friends and family. I am
incredibly grateful to my loving parents, our university stuff and classmate, whose
inspiration and drive for persistence continue reverberating in my ears.
My soulmate (my wife) is treasured and have never left my side. I also dedicate this
dissertation to my close friends and university whom was part of it also my family for
their help and encouragement during the writing process.
Ahmed Waheed
2023
iii
Acknowledgements
Here we would like to thank my supervisor Assistant professor Hamza M. Khuder.
For his dedicated support and guidance. Our university stuff continuously provided
encouragement and were always willing and enthusiastic to assist in any way could
throughout the research project. I would also like to thank our family and soulmate for
supporting during these years. Our department members for providing advice regarding
study journey. Finally, many thanks to all participants that took part in the study and
enabled this research to be possible.
iv
Abstract
Gas leakage is a major problem for our country. Our device is intended for use in
household safety, Industrial sector, residential premises and gas-powered vehicles like
CNG, buses cars where appliances and heaters that use natural gas and liquid petroleum
gas (LPG) may be a source of risk. Nimtoli and Old Dhaka gas tragedy was an example
of gas leakage accident in Bangladesh. Unfortunately, gas leakage detection devices
aren’t that much available in our country. In our project, we focused on developing such
a device. We made this device based on two main sectors: the transmission and
detection module, and receiving module. The detection and transmitting module detects
the gas leakage using a sensing circuit built for this purpose. If the sensor detects a gas
leakage, it provides an alarm and sends a signal to another module. GSM module will
send emergency SMS to fire service station, emergency contacts numbers and power
line automatically cutoff. The device was tested using LPG gas and the alarm was
activated as a result of gas leakage. However, the former gas leakage system cannot
react in time. This project provides the design approach on both software and hardware.
v
TABLE OF CONTENTS
Declaration ………………………………………………………………………………………………………… i
Certificate …………………………………………………………………………………………………………..ii
Acknowledgments ……………………………………………………………………………………………...iii
Abstract………………………………………………………………………………………………………………iv
List of Figures…………………………………………………………………………………………………...viii
1 Introduction ……………………………………………………………………………………………………1
1.1 Problem Statement ……………………………………………………………...3
1.2 Motivations……………………………………………………………………...4
1.3 Aims and Objectives ………………………………………………………...….5
1.4 Project Contribution …………………………………………………………….6
1.4.1 Contributions………………………………………………………………….6
1.5 Organization of the chapters ……………………………………………………6
2 System Review……………………………………………………………………………………………….7
2.1 Introduction……………………………………………………………………..7
2.2 Project Review …………………………………………………………………7
3 The Design Methodology ……………………………………………………………………………..11
3.1 Introduction……………………………………………………………………11
3.2 System Design ………………………………………………………………...11
3.2.1 Technical Terms…………………………………………………………….12
3.2.2 A Gas Leakage Detector ……………………………………………………12
3.2.3 Burst Detection……………………………………………………………...13
3.2.4 Nearest Fire Service Detection………………………………………………13
3.2.5 Advantage……………………………………………………………………14
3.2.6 Challenges…………………………………………………………………...14
vi
3.2.7 Block Diagram of Gas Leakage Detector…………………………………….14
3.3 Hardware Implementation……………………………………………………...16
3.4 Software Requirement………………………………………………………….17
3.4.1 Arduino IDE-(Sketch)……………………………………………………….17
3.4.2 Blynk ………………………………………………………………………..18
3.5 Conclusion ……………………………………………………………………..18
3.6 Technologies and Implementation…………………………………………….. 20
3.7 Introduction…………………………………………………………………….20
3.8 System Design …………………………………………………………………20
3.8.1 Flame Sensor ………………………………………………………………...21
3.8.2 NodeMCU…………………………………………………………………...22
3.8.3 GSM Module………………………………………………………………...22
3.8.4 MQ-2Gas Sensor…………………………………………………………,….25
3.8.5 Arduino Mega 2560………………………………………………………….25
3.8.6 Arduino UNO ………………………………………………………………..34
4 System Simulation…………………………………………………………………………………………42
4.1 Overview ………………………………………………………………………42
4.2 Project View……………………………………………………………………42
5 Conclusion, Limitations and Future Work ……………………………………….49
5.1 Conclusion ……………………………………………………………………..49
5.2 Limitations ……………………………………………………………………..50
5.3 Future Works …………………………………………………………………..51
Bibliography……………………………………………………………………………………………………….54
vii
List of Figures
1.1 Gas Leakage Detector System . . . . . . . . . . . . . . . . . . . . . 2
2.1 Block Diagram of Gas Leakage Detector . . . . . . . . . . . . . . . . 8
2.2 Block Diagram of Gas Leakage Detector . . . . . . . . . . . . . . . . 10
3.1 Circuit Diagram of Gas Leakage Detector. . . . . . . . . . . . . . . . 12
3.2 Working Mode of Gas Leakage Detector . . . . . . . . . . . . . . . . 13
3.3 Block Diagram of Gas Leakage Detector . . . . . . . . . . . . . . . . 15
3.4 Flow chart of Gas Leakage Detector . . . . . . . . . . . . . . . . . . 15
3.5 Physical Configuration of Gas Leakage Detector [1]. . . . . . . . . . 17
3.6 Arduino IDE-Sketch [2] . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.7 Blynk APP View . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.1 Flame Sensor (MQ-6 Sensor) [1] . . . . . . . . . . . . . . . . . . . . 21
4.2 NodeMCU Micro-controller [3] . . . . . . . . . . . . . . . . . . . . 22
4.3 GSM Module [4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.4 GSM Antenna Breakout Board [5] . . . . . . . . . . . . . . . . . . . 24
4.5 MQ-6 Gas Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.6 Arduino Mega[6] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.7 Arduino Mega Specifications[2] . . . . . . . . . . . . . . . . . . . . 27
4.8 Arduino Mega 2560 Pinout[7] . . . . . . . . . . . . . . . . . . . . . 29
4.9 Arduino Mega Dimensions[8] . . . . . . . . . . . . . . . . . . . . . 31
4.10 Arduino Mega Sheild Compatibility[9] . . . . . . . . . . . . . . . . . 32
4.11 Arduino Uno [10] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.12 Arduino Uno Pin[11] . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.13 Arduino Uno Pinout[7] . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.1 Hardware Configuration . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.2 Hardware Assembling With Gas Detector . . . . . . . . . . . . . . . 43
viii
5.3 Smart House . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.4 GSM is in Working Mode . . . . . . . . . . . . . . . . . . . . . . . . 45
5.5 Gas Sensor is Working) . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.6 Display show the room temperature . . . . . . . . . . . . . . . . . . 46
5.7 Circuit Breaker off . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.8 Room 1 is in safe position . . . . . . . . . . . . . . . . . . . . . . . . 47
5.9 Room 2 is in safe position . . . . . . . . . . . . . . . . . . . . . . . . 47
5.10 Data Send to The Server . . . . . . . . . . . . . . . . . . . . . . . . 48
1
Chapter 1 Introduction
More and more people are getting injured, burnt and a large portion of them
eventually dying due to cylinder blasts that have been taking place in the country for
the last couple of years. At least 50 were injured and 10 died in last one-year time in
Bangladesh. In the last January alone, there were 4 huge cylinder blast incidents that
took place in the city [4].
A gas pipe leaked during a road development work in the capital’s Uttara on
Oct 6 2018, causing suspension of traffic movement on the busy Dhaka-Mymensingh
highway for about three and a half hours.Gas from the 10-inch pipe leaked near Mascot
Plaza in Uttara around 9:00 pm [12].
The woman who was burnt in a fire at an apartment in Dhaka’s Uttara has succumbed
to her injuries. Afire had broken out at the Uttara apartment of US embassy staffer Md
Shahnewaz on the morning of Feb 26, leaving five— the couple and their three sons—
injured [13].
One killed, 6 others injured in gas cylinder blast in Jatrabari. The accident
occurred on Friday 16 November 2018. An eight-year-old child has been killed, and six
people have sustained burn injuries, in a gas cylinder explosion in Dhalpur, Jatrabari
[14].
In Bangladesh, CNG and LPG cylinders are mostly metallic having a lifespan of
roughly 10 to 15 years. These cylinders must be destroyed after their expiry dates. But,
in reality, the cylinders are not abandoned or even tested after elapsing the granted
period thus, risking it to blow out at any time.
Moreover, the companies that are selling cylindered gas are also issuing the
fitness certificate of the cylinders and unfortunately, the government has no rigid policy
on the LPG and CNG. The most horrifying fact is that the state-owned Bangladesh
Petroleum Corporation (BPC) has a total of 11 thousands of cylinders and 8 thousands
of them are out of date! Directorate of the Explosive Detection has recently identified
2
that almost 80% of the cylinders of BPC are unusable after an explosion that took place
at a BPC depot in Bogra in last year that completely destroyed 300 cylinders and burnt
3 trucks and luckily no human was injured in that incident [15].
According to the reported incidents, cylinders are blowing out on a regular basis
throughout the country. The frequency of the blast is almost one at least in a month.
From the last June, there were at least 5-6 LPG and 2 CNG cylinders explosion incidents
that are reported at various dailies. Those explosions cost at least 7 human lives and left
5 burnt and injured severely while the financial loss was above 30 to 35 million BDT.
Experts have urged on setting up policy by the government to maintain the safety
standards in this sector. They are also encouraging the mass people to be cautious while
buying and using the cylinders and to conduct regular health check-ups of the cylinders
from a certified authority [3].
Figure 1.1: Gas Leakage Detector System
People had died on the gas or LPG blast. Looking for the reasons-
• Gas Burner is open all time.
• Gas cylinder isn’t test proper time.
• Proper alert system.
According to the reported incidents, cylinders are blowing out on a regular basis
throughout the country. The frequency of the blast is almost one at least in a month.
From the last June, there were at least 5-6 LPG and 2 CNG cylinders explosion incidents
3
that are reported at various dailies. Those explosions cost at least 7 human lives and left
5 burnt and injured severely while the financial loss was above 30 to 35 million BDT
[16]. To reduce the death rate of people we have to design a gas leakage detector which
has to work on 5 stages of gas leakage, those are,
a. First flame sensor detects the gas leak.
b. The numbers start at 1 with every call to the enumerate environment.
c. When the last sensor has given alert, that time 3 message send to different
numbers.
To develop this project, we have to use Arduino Mega board, LED, Brazzers, GSM
module and five different five sensors.
1.1 Problem Statement
Here we have described about problem statement.
• Natural gases such as Liquefied Petroleum Gas (LPG) are widely used in the
whole world. LPG is used for cooking in home or hotel. It is also used in certain
gas based industry. As for now, the use of natural gases instead of petroleum as
the alternative fuel for mobile cars also has been increased. Although the
procedure of installing LPG-based system is very tight, we could not give 100%
guaranteed that the LPG-system will not having leakage.
• Even though human is a perfect creation of God, they still have certain weakness.
Human cannot detect the presence of natural gases as fast as the sensor do. Thus,
the use of gas sensing system is hugely needed to give real-time monitoring of
the gas system.
• In certain cases, gas leakage can cause fire that will destroy human property. The
large scale of fire also could contribute to serious injury or death. This is due to
the fire station got delay information about the fire occurred.
4
Therefore, this project shall be able to resolve the problem stated. This is because this
project is able to sense the presence of natural gases as well as fire. Besides that, it is
also capable to send out an SMS alert automatically to the owner and also to the nearest
fire station.
1.2 Motivations
In this section, we have to describe the motivation of our gas leakage detector system.
• In recent times many cases of gas leakage accident can be seen around us. Day
by day peoples are increasing, people get injured or might be dead, one of the
biggest reason is emergency contact with the nearest firefighter station and track
the accident area.
• In our country, More than 500 hundred people have died in an accident for proper
medical attention.
• Tracking the nearest firefighter station and know the vital information for the
accidental place, given an important message to the house owner,
• Many people could save their life in accident case if we can take an immediate
decision to send news to fire service.
Experts have urged on setting up policy by the government to maintain the safety
standards in this sector. They are also encouraging the mass people to be cautious while
buying and using the cylinders and to conduct regular health check-ups of the cylinders
from a certified authority.
• People’s death rates increased among all people age group between 2016 to 2018.
• When gas leakage accident has occurred, women’s was the first victim.
• When the huge blast occurred, that time remaining of the family member was also
fallen, the victim.
5
According to the data from 2016 to the 2018 year from the NHTSA, around 500
hundred people were killed on Bangladesh due to LPG gas leakage.
1.3 Aims and Objectives
The main research objective of this project is to develop a gas leakage detector to reduce
the data rate of GAS cylinder blast.
• The main objective of this project is to design a gas leakage detector, that is
capable of identifying of the gas leakage and fire and send a message to
emergency contact numbers such as nearest fire service station and house owner.
• This system is capable of providing the correct information to ensure the security
and safety of the people against GAS cylinder blast.
• If we found any gas leakage for our home or restaurant kitchen, that time our
system has given the alert.That’s why we can easily identify the accident place
and taken the necessary steps to reduce the data rate.
1.4 Project Contribution
1.4.1 Contributions
There is only one project in our country, that was design only sensor based, their project
was given alert to the system. But our implemented system is different from that
existing system. We added an SMS based alert system which was not found the existing
system. We are working to develop a unique ideas which helps people in many ways.
6
1.5 Organization of the chapters
• Chapter 2: In this chapter, we have to describe the literature review, the research
gap and proposed solution of our developing system.
• Chapter 3: Used Technologies: In this chapter, we have to describe the
technologies we used described our front end and back-end technologies.
• Chapter 4: Design and implementation: In this chapter, we have to describe how
we design and implement our solutions and some project screenshots included
here.
• Chapter 5: Conclusion: In this chapter, we have to describe the challenges both
technical and non-technical we have.
7
Chapter 2 Literature review
2.1 Introduction
This chapter presents related work, Literature review, Research gap and our movement
that we have passed to solve the critical problems. The thought of making this project
comes from social awareness. To many GAS cylinder burst accident occurring around
us as we can see, for those reasons a lot of people lost their life. According to a report,
around 500 hundred people have died last year. Most of them died for proper fire service
attention, That means if we able to call fire service as soon as possible with information
death rate will decrease. So this is the basic idea to develop a gas leakage detector. If
hardware and software easily integrate with a sensor which sends the message to the
nearest fire service emergency contact number.
2.2 Project Review
IoT and accident administration are two places which first progress is becoming
produced.LPG gas is the main gas fuel used for cooking and other heating appliances.
This is because it is a stable, high energy content, relatively low Sulphur, clean-burning
fuel which can be transported economically as a liquid. It is a by-product of crude oil
and Natural Gas processing .LPG is primarily composed of propane, butane, is butane
or a mixture of these gases.It is stored in gas cylinders as the liquid under relatively low
pressure. It has a low boiling point and it will vaporize immediately it is released into
the air. It is relatively heavier compared to air. When it leaks, it will tend to flow close
to the ground and settle in low lying places on the premises if there is no adequate air
ventilation. LPG gas is highly flammable gas with Lower Explosive Limits of about
1.4%that is about14,000PPM. This is the property of LPG that makes us worried when
using the
8
Figure 2.1: Block Diagram of Gas Leakage Detector
gas. No matter the safety standards that are put in place in the usage of the gas to ensure
there is no gas leakage, there is always the danger of gas leakage. The human being is
prone to error. LPG gas is odourless and colourless and it would be impossible to detect
the presence of gas leakage. An odourant is normally added to the gas to help detect the
gas in case of a leakage but this is not enough as it would require person to be physically
present to detect the gas leakage and by the time the gas has built up enough to be
detected by smell it will have reached dangerous concentration level.Therefore, it is a
great risk to rely on our sense of smell to determine whether there is a gas leakage or
not.This has been a great concern for people over time and people have come up with a
gas leakage detector to solve this problem.The gas leakage detectors that have been
developed have been built around already existing different gas technology[4].The
different type of sensor are listed below. Electra chemical sensors-mostly used for toxic
gases such carbon monoxideMetal Oxide Semiconductor sensors-used for both to
sensor-used for combustible gases such hydrocarbon gasesInfrared Sensors-used for
combustible gases 5The choice of the sensor depends on the type of gas that is to be
detected among other factors such as the stability, sensitivity, selectivity, price and
durability of the sensor.For hydrocarbon gases such as LPG gas, metal oxide
semiconductor sensors are preferred over the rest of sensor because they are relatively
cheap and last for a long time being stable, sensitive to low gas concentrations
9
(300PPM) and detect a wide range of gas concentration (300-10000) resistant to
poisoning[4]. However, its performance is affected by exposure to high corrosive
gases(such as hydrogen chloride), organic silicon steam, halogen pollution and
water[6].Metal oxide semiconductor detects gases by means of their surface interaction
with the target gas which alters the conductivity of the semiconductor. The output
voltage signal is converted into gas concentration. Tin oxide and Tungsten Oxide are
kinds of metal oxide used as the sensing material in metal oxide semiconductor
sensor[4].TGS sensor by Figaro[7]and MQ-6 sensor[6]are metal oxide semiconductor-
based sensors that can be used for detecting LPG gas.The MQ-6 sensor offers a [6]High
Sensitivity to LPG gasA Detection Range: 300 -10,000
PPMFast Response Time: ¡10sSimple drive circuitHeater Voltage: 5.0VLong lifespan
Low cost A gas leakage detection system capable of raising an alarm has been
developed using the sensor and a comparator. The sensor output voltage is compared
with a reference voltage from a pedometer and if the voltage signal is higher the
reference voltage the comparator output a signal which can be used to drive a circuit
setting off an alarm and lit a number of LEDs. The potentiometer is used to set the
trigger level for the alarm[8].There is some commercial LPG gas detector in the market
that detect gas leakage and raise a warning in the form of an alarm and LED indicators.
However, these commercialized gas detectors come at a high price and not readily
available on the Kenya market[9], [10].Therefore, there is a need for designing a gas
leakage detector that can be readily available in the local market at an affordable price
[6]. The detector is based on a micro-controller with a high-resolution Analog to Digital
Converter (10 bits)[11]. The detector in addition to raising a 6alarm and having LED
indicators for status of the gas leakage it is capable of accurately displaying the
concentration of the gas on an LCD display. It also incorporates a button that can be
used for acknowledging the alarm. The micro-controller is programmed with an
algorithm for converting the voltage signal from the sensor to the respective gas
concentration according to the sensor data sheet.The data sheet outline the relationship
between the sensor voltage and the gas concentration.
10
Thus, gas concentration can be displayed with high accuracy. The micro-controller
Figure 2.2: Block Diagram of Gas Leakage Detector
runs at high frequency, thus the detector has a faster response time to changes in the
concentration of the gas.The specific sensor to be used for this detector is MQ-6 sensor
which uses Tin Oxide as the sensing material. The micro-controller being used is the
PIC16F690 microcontroller by Microchip. The LCD being used is the Hitachi
HD44780 LCD.The detector will use a Buzzer as the alarm. All these components are
powered using a 5V supply.The 5V is supplied using available 5V voltage regulators
ICs and a 9V battery [5].
11
Chapter 3 The Methodology
3.1 Introduction
This paper explains the model of the gas leakage detector. An incorporated network of
detectors, GSM-enabled processor chip and cloud processing in-fractures are utilized
to develop the gas leakage detector for incident and advertisement. The gas leakage
detector is developed to identify an incident and immediately notify unexpected
emergency contacts. A vibration sensor is utilized to identify the signal which usually
computed the possibility of a crash. When the threshold limits are surpassed a text
message that contains the incident area and initiated to the emergency contacts. The text
message is instantly started at normal time periods to enable the connection to find out
the victim quickly.
3.2 System Design
In this section, we have described our gas leakage detector and how we implement our
system.
3.2.1 Technical Terms:
Here we have described that how our systems connected to each other devices? How
sensors are connected? Everyone get clear idea to see this image about gas leakage
detector.
12
Figure 3.1: Circuit Diagram of Gas Leakage Detector.
3.2.2 A Gas Leakage Detector:
This circuit is designed for increasing life safety for the peoples. The GAS Leakage
Detector will help people to detect the gas which was spread out the home or restaurant
kitchen and send vital information and location to the emergency contact number. That
can help to get proper fire service attention. No need to call the fire service our system
will alert the fire station authority and forces to send the firefighters to the victim place.
13
Figure 3.2: Working Mode of Gas Leakage Detector
3.2.3 Burst Detection:
In our busy lives,it,s very difficult to help injured people on specific people. It,s also
difficult to contact relatives of the injured persons and know the vital information. If
we alert the fire service authority and forces to send the fire vehicals to the victim place.
Our gas leakage detector will help to get vital information and get SMS to nearby
firefighter station . It can save much more life’s [17].
3.2.4 Nearest Fire Service Detection:
It also detects nearest fire service and our system has given SMS to the firefighters
authority to send an emergency help to the victim place and also get ready to admit the
patents.
14
3.2.5 Advantage:
It is an automatic system which helps injured people to get emergency help from fire
service and relatives.
• To know the incident location immediately.
• To know about vital information of the injured person.
• To Know about the nearest fire service stations.
3.2.6 Challenges
During this project, we have faced several challenges, some of them are technical and
some of them are non-technical.
• It is a wireless device so every time it needs to connect the internet.
• When gas cylinder or gas line leakage found and the air was full of gas that time
our sensor reading time was not capable of to detect the accident
• All of the sensors needs to response the accident otherwise the system will not be
worked.
3.2.7 Block Diagram of Gas Leakage Detector
In today’s era especially in the women, the craze of gas leakage detector is really
remarkable. As the gas cylinder burst accident was increasing, due to which many death
occurs, most of them are caused not taking any security to detect the accident and also
due to the poor medical facility. So providing safety to a person while gas leakage
detector is a prime concern. Thus by considering this problem, the gas leakage detector
gives them necessary safety and they can easily understand the gas leakage detector is
essential needs to their home safety, if not the system won’t work [18].
15
Figure 3.3: Block Diagram of Gas Leakage Detector
Figure 3.4: Flow chart of Gas Leakage Detector Fig.3.1 describe the block diagram
of honour systems configure, here we integrate Arduino Mega, Servo Motor, GSM
16
Module, Flame sensor water pump and raspberry pi built in the sim card. Ignition
circuit will start after the gas burner will give gas leak on the flame sensor. GSM is
used to send or receive the message for the nearest firefighter
station.
3.3 Hardware Implementation:
We need below hardware to implement the gas leakage detector.
• Arduino UNO
• Arduino Mega(act as a motherboard to control the gas leakage detector)an
electronic prototyping platform/board based on Atmega AVR.
• Power Bank
• GSM Module
• Flame Sensor
• Water pump
• 16*2 LCD Display
• MQ6 Sensor
• Sound System
• NodeMCU
• Relay
• RFID
• Memory Card Reader
17
• Micro USB cable. Jumper wires
Figure 3.5: Physical Configuration of Gas Leakage Detector [1].
3.4 Software Requirement
• Arduino IDE-(Sketch)
• Blynk
3.4.1 Arduino IDE-(Sketch)
A sketch is a name that Arduino uses for a program. It’s the unit of code that is uploaded
to and runs on an Arduino board.
18
Figure 3.6: Arduino IDE-Sketch [2]
3.4.2 Blynk
Blynk is a Platform with IOS and Android apps to control Arduino, Raspberry Pi and
the likes over the Internet.
3.5 Conclusion
Here we described the proposed system which will help to implements the gas leakage
detector . We are clearly described our plan in this section smoothly. That should help
the people to understand easily.
19
Figure 3.7: Blynk APP View
20
Chapter 4 Technology and implentation
4.1 Introduction
The gas leakage detector is designed for proper medical attention. Gas cylinder and gas
burst is a common thing in our country. Our device can communicate with the nearest
hospital and nearest firefighter wirelessly. It can be used in home security, industrial
security and vehicle. It can be used in a rural area or highway area for ensuring safety
[19].
Our proposed system helps people into three categories:
• Proper fire service station attention
• Provide vital information
• Detects LPG from 200ppm to 10000ppm Our proposed proposal used:
• IoT based hardware technology
• Scripting programming language
4.2 System Design
In this section, we have discussed the hardware design of the gas leakage detector.
4.2.1 Flame Sensor :
• Detects a flame or a light source of a wavelength in the range of 760nm-1100 nm.
• Detection range: up to 100 cm.
• Adjustable detection range.
• Detection angle about 60 degrees, it is sensitive to the flame spectrum.
21
• Comparator chip LM393 makes module readings stable.
• Operating voltage 3.3V-5V. • Digital and Analog Output.
• Power indicator and digital switch output indicator.
4.2.1.1 Advantages
• High sensitivity to alcohol gas in a wide range.
• High sensitivity to alcohol gas.
• Fast response.
• Wide detection range.
• Stable performance, long life, low cost.
Figure 4.1: Flame Sensor (MQ-6 Sensor) [1]
4.2.2 NodeMCU
NodeMCU is an open source IoT platform. It includes firmware which runs on the
ESP8266 Wi-Fi SoC from Espressif Systems, and hardware which is based on the
ESP12 module. The term ”NodeMCU” by default refers to the firmware rather than the
development kits. The firmware uses the Lua scripting language [2].
4.2.2.1 Advantages
• High sensitivity
22
• Very fast response
• Stable performance
• Long life
• Simple circuit design
Figure 4.2: NodeMCU Micro-controller [3]
4.2.3 GSM Module
GSM/GPRS module is used to establish communication between a computer and a
GSM-GPRS system. Global System for Mobile communication (GSM) is an
architecture used for mobile communication in most of the countries. Global Packet
Radio Service (GPRS) is an extension of GSM that enables higher data transmission
rate [4].
4.2.3.1 Advantages
• High gain antenna. •
Very fast response.
• Fast satellite
acquisition.
23
• Stable performance.
• Long life
Figure 4.3: GSM Module [4]
Figure 4.4: GSM Antenna Breakout Board [5]
This GSM Module is based on the NEO-6M chip from U-blox. The onboard high
24
gain antenna supports fast satellite acquisition, keeping the GSM accuracy within 5m.
Unlike other generic ublox GSM Modules, there is a backup battery onboard that stores
the satellite ephemeris data when powered off and thus helps faster location estimation
as soon as the module powers on [20].
4.2.4 MQ-2 Gas Sensor
The MQ6 (LPG Gas Sensor) is a simple-to-use liquefied petroleum gas (LPG) sensor.
It can be used in gas leakage detecting equipment in consumer and industry
applications, this sensor is suitable for detecting LPG, iso-butane, propane, LNG. Avoid
the noise of alcohol, cooking fumes and cigarette smoke [21].
Figure 4.5: MQ-2 Gas Sensor
25
4.2.5 Arduino Mega 2560
• Arduino Mega 2560 is a Microcontroller board based on Atmega2560. It comes
with more memory space and I/O pins as compared to other boards available in
the market.
• There are 54 digital I/O pins and 16 analog pins incorporated on the board that
make this device unique and stand out from others.
• Out of 54 digital I/O, 15 are used for PWM (pulse width modulation).
• A crystal oscillator of 16MHz frequency is added on the board.
• This board comes with USB cable port that is used to connect and transfer code
from computer to the board.
• DC power jack is coupled with the board that is used to power the board. Some
version of Arduino board lacks this feature like Arduino Pro Mini doesn’t come
with DC power jack.
• ICSP header is a remarkable addition to Arduino Mega which is used for pro-
gramming the Arduino and uploading the code from the computer.
Figure 4.6: Arduino Mega[6]
26
• This board comes with two voltage regulator i.e. 5V and 3.3V which provides
the flexibility to regulate the voltage as per requirements as compared to Arduino
Pro Mini which comes with only one voltage regulator.
• There is no much difference between Arduino Uno and Arduino Mega except
later comes with more memory space, bigger size and more I/O pins.
• Arduino software called Arduino IDE is used to program the board which is a
common software used for all boards belonged to Arduino family.
• Availability of Atmega16 on the board makes it different than Arduino Pro Mini
which uses USB to serial converter to program the board.
• There is a reset button and 4 hardware serial port called USART which produces
a maximum speed for setting up communication.
• Following figure shows the specifications of Arduino mega 2560.
27
Figure 4.7: Arduino Mega Specifications[2]
• Arduino Mega is specially designed for the projects requiring complex circuitry
and more memory space. Most of the electronic projects can be done pretty well
by other boards available in the market which make Arduino Mega uncommon
for regular projects. However, there are some projects that are solely done by
Arduino Mega like making of 3D printers or controlling more than one motors,
because of its ability to store more instructions in the code memory and a number
of I/O digital and analog pins.
• There are three ways to power the board. You can either use a USB cable to power
the board and transfer code to the board or you can power it up using Vin of the
board or through Power jack or batter.
28
• Last two sources to power the board are required once you already built and
compile code into the board through USB cable.
• This board comes with resettable polyfuse that prevents the USB port of your
computer from overheating in the presence of high current flowing through the
board. Most of the computers come with an ability to protect themselves from
such devices, however, the addition of fuse provides an extra layer of protection.
• It can be used either way i.e. for creating stand-alone projects or in combination
with other Arduino boards. Most complex projects can be created using this
board.
4.2.5.1 Arduino Mega 2560 Pinout
Following figure shows the pinout of Arduino Mega 2560.
Figure 4.8: Arduino Mega 2560 Pinout[7]
• Each pin comes with a specific function associated with it. All analog pins can be
used as digital I/O pins.
• Designing of a project using Arduino Mega gives you the flexibility of working
with more memory space and processing power that allows you to work with a
number of sensors at once. This board is physically larger than other Arduino
boards.
29
4.2.5.2 Pin Descriptions
5V & 3.3V. This pin is used to provide output regulated voltage around 5V. This
regulated power supply powers up the controller and other components on the board. It
can be obtained from Vin of the board or USB cable or another regulated 5V voltage
supply. While another voltage regulation is provided by 3.3V pin. Maximum power it
can draw is 50mA.
GND. There are 5 ground pins available on the board which makes it useful when more
than one ground pins are required for the project.
Reset. This pin is used to reset the board. Setting this pin to LOW will reset the board.
Vin. It is the input voltage supplied to the board which ranges from 7V to 20V. The
voltage provided by the power jack can be accessed through this pin. However, the
output voltage through this pin to the board will be automatically set up to 5V.
Serial Communication. RXD and TXD are the serial pins used to transmit and receive
serial data i.e. Rx represents the transmission of data while Tx used to receive data.
There are four combinations of these serial pins are used where Serail 0 contains RX(0)
and TX(1), Serial 1 contains TX(18) and RX(19), Serial 2 contains TX(16) and RX(17),
and Serial 3 contains TX(14) and RX(15).
External Interrupts. Six pins are used for creating external interrupts i.e interrupt 0(0),
interrupt 1(3), interrupt 2(21), interrupt 3(20), interrupt 4(19), interrupt 5(18). These
pins produce interrupts by a number of ways i.e. providing LOW value, rising or falling
edge or changing value to the interrupt pins.
30
LED. This board comes with built-in LED connected to digital pin 13. HIGH value at
this pin will turn the LED on and LOW value will turn it off. This gives you the change
of nursing your programming skills in real time.
Analog Pins. There are 16 analog pins incorporated on the board labeled as A0 to A15.
It is important to note that all these analog pins can be used as digital I/O pins. Each
analog pin comes with 10-bit resolution. These pins can measure from ground to 5V.
However, the upper value can be changed using AREF and analogReference() function.
I2C. Two pins 20 and 21 support I2C communication where 20 represents SDA (Serial
Data Line mainly used for holding the data) and 21 represents SCL(Serial Clock Line
mainly used for providing data synchronization between the devices)
SPI Communication. SPI stands for Serial Peripheral Interface used for the transmission
of data between the controller and other peripherals components. Four pins i.e. 50
(MISO), 51 (MOSI), 52 (SCK), 53 (SS) are used for SPI communication.
4.2.5.3 Dimensions
Follwoing figure shows the dimensions of the Arduino Mega 2560.
31
Figure 4.9: Arduino Mega Dimensions[8]
• Arduino Mega is comparatively larger than other boards available in the market.
It comes 4-inch length and 2.1-inch width. However, USB port and power jack
are slightly extended from the given dimensions[11].
4.2.5.4 Sheild Compatibility
• Arduino Mega is compatible with most of the shields designed for other Arduino
boards.
• Before you intend to use a shield, make sure the operating voltage of the shield is
compatible with the board voltage. Most of the shields operate at 3.3V or 5V
which is compatible with this board, however, shields with higher operating
voltage can damage the board.
• Also, the header distribution of the shield must resonate with the pin distribution
of the board, so you can simply attach the shield with the board and make it in a
running condition.
32
Figure 4.10: Arduino Mega Sheild Compatibility[9]
4.2.5.5 Programming
• Arduino Mega 2560 can be programmed using Arduino Software called IDE
which supports C programming.
• The code you make on the software is called sketch which is burned in the
software and then transferred to the board through USB cable.
• This board comes with a built-in bootloader which rules out the usage of an
external burner for burning the code into the board.
• The bootloader communicates using STK500 protocol.
• Once you compile and burn the program on the board, you can unplug the USB
cable which eventually removes the power from the board. When you intend to
incorporate the board into your project, you can power it up using power jack or
Vin of the board.
• Multitasking is another feature where Arduino mega comes handy. However,
Arduino IDE Software doesn’t support multitasking feature but you can use other
operating systems like FreeRTOS and RTX to write C program for this purpose.
This gives you the flexibility of using your own custom build program using ISP
connector[7].
4.2.5.6 Applications
Arduino Mega 2560 is an ideal choice for the projects requiring more memory space to
used with more number of number pins on the board. Following are the main
applications of the Arduino mega boards.
33
• Developing 3D printer
• Controlling and handling more than one motors
• Interfacing of number of sensors
• Sensing and detecting temperature
• Water level detection projects
• Home automation and security systems
• Embedded Systems
• IoT applications
• Parallel programming and Multitasking
That’s all about Arduino Mega microcontroller [8].
4.2.6 Arduino UNO
• Arduino Uno is a microcontroller board developed by Arduino.cc which is an
open-source electronics platform mainly based on AVR microcontroller
Atmega328.
• First Arduino project was started in Interaction Design Institute Ivrea in 2003 by
David Cuartielles and Massimo Banzi with the intention of providing a cheap and
flexible way to students and professional for controlling a number of devices in
the real world.
• The current version of Arduino Uno comes with USB interface, 6 analog input
pins, 14 I/O digital ports that are used to connect with external electronic circuits.
Out of 14 I/O ports, 6 pins can be used for PWM output.
34
• It allows the designers to control and sense the external electronic devices in the
realworld[10].
Figure 4.11: Arduino Uno [10]
• This board comes with all the features required to run the controller and can be
directly connected to the computer through USB cable that is used to transfer the
code to the controller using IDE (Integrated Development Environment)
software, mainly developed to program Arduino. IDE is equally compatible with
Windows, MAC or Linux Systems, however, Windows is preferable to use.
Programming languages like C and C++ are used in IDE.
• Apart from USB, battery or AC to DC adopter can also be used to power the
board.
• Arduino Uno boards are quite similar to other boards in Arduino family in terms
of use and functionality, however, Uno boards don’t come with FTDI USB to
Serial driver chip.
35
• There are many versions of Uno boards available, however, Arduino Nano V3
and Arduino Uno are the most official versions that come with Atmega328 8-bit
AVR Atmel microcontroller where RAM memory is 32KB.
• When nature and functionality of the task go complex, Mirco SD card can be
added in the boards to make them store more information.
4.2.6.1 Features of Arduino UNO
• Arduino Uno comes with USB interface i.e. USB port is added on the board to
develop serial communication with the computer.
• Atmega328 microcontroller is placed on the board that comes with a number of
features like timers, counters, interrupts, PWM, CPU, I/O pins and based on a
16MHz clock that helps in producing more frequency and number of instructions
per cycle.
• It is an open source platform where anyone can modify and optimize the board
based on the number of instructions and task they want to achieve.
• This board comes with a built-in regulation feature which keeps the voltage under
control when the device is connected to the external device[9].
36
Figure 4.12: Arduino Uno Pin[11]
• Reset pin is added in the board that reset the whole board and takes the running
program in the initial stage. This pin is useful when board hangs up in the middle
of the running program; pushing this pin will clear everything up in the program
and starts the program right from the beginning.
• There are 14 I/O digital and 6 analog pins incorporated in the board that allows
the external connection with any circuit with the board. These pins provide the
flexibility and ease of use to the external devices that can be connected through
these pins. There is no hard and fast interface required to connect the devices to
the board. Simply plug the external device into the pins of the board that are laid
out on the board in the form of the header.
• The 6 analog pins are marked as A0 to A5 and come with a resolution of 10bits.
These pins measure from 0 to 5V, however, they can be configured to the high
range using analogReference() function and AREF pin.
• 13KB of flash memory is used to store the number of instructions in the code
37
• Only 5 V is required to turn the board on, which can be achieved directly using
USB port or external adopter, however, it can support external power source up
to 12 V which can be regulated and limit to 5 V or 3.3 V based on the requirement
of the project.
4.2.6.2 Arduino Uno Pinout
Arduino Uno is based on AVR microcontroller called Atmega328. This controller
comes with 2KB SRAM, 32KB of flash memory, 1KB of EEPROM. Arduino Board
comes with 14 digital pins and 6 analog pins. ON-chip ADC is used to sample these
pins. A 16 MHz frequency crystal oscillator is equipped on the board. Following figure
shows the pinout of the Arduino Uno Board.
Figure 4.13: Arduino Uno Pinout[7]
4.2.6.3 Pin Description
There are several I/O digital and analog pins placed on the board which operates at 5V.
These pins come with standard operating ratings ranging between 20mA to 40mA.
38
Internal pull-up resistors are used in the board that limits the current exceeding from
the given operating conditions. However, too much increase in current makes these
resisters useless and damages the device.
LED. Arduino Uno comes with built-in LED which is connected through pin 13.
Providing HIGH value to the pin will turn it ON and LOW will turn it OFF.
Vin. It is the input voltage provided to the Arduino Board. It is different than 5 V
supplied through a USB port. This pin is used to supply voltage. If a voltage is provided
through power jack, it can be accessed through this pin.
5V. This board comes with the ability to provide voltage regulation. 5V pin is used to
provide output regulated voltage. The board is powered up using three ways i.e. USB,
Vin pin of the board or DC power jack.USB supports voltage around 5V while Vin and
Power Jack support a voltage ranges between 7V to 20V. It is recommended to operate
the board on 5V. It is important to note that, if a voltage is supplied through 5V or 3.3V
pins, they result in bypassing the voltage regulation that can damage the board if voltage
surpasses from its limit.
GND. These are ground pins. More than one ground pins are provided on the board
which can be used as per requirement.
Reset. This pin is incorporated on the board which resets the program running on the
board. Instead of physical reset on the board, IDE comes with a feature of resetting the
board through programming.
IOREF. This pin is very useful for providing voltage reference to the board. A shield is
used to read the voltage across this pin which then select the proper power source.
PWM. PWM is provided by 3,5,6,9,10, 11pins. These pins are configured to provided
8-bit output PWM.
SPI. It is known as Serial Peripheral Interface. Four pins 10(SS), 11(MOSI), 12(MISO),
13(SCK) provide SPI communication with the help of SPI library.
AREF. It is called Analog Reference. This pin is used for providing a reference voltage
to the analog inputs.
39
TWI. It is called Two-wire Interface. TWI communication is accessed through Wire
Library. A4 and A5 pins are used for this purpose.
Serial Communication. Serial communication is carried out through two pins called Pin
0 (Rx) and Pin 1 (Tx).
Rx pin is used to receive data while Tx pin is used to transmit data.
External Interrupts. Pin 2 and 3 are used for providing external interrupts. An interrupt
is called by providing LOW or changing value.
4.2.6.4 Communication and Programming
Arduino Uno comes with an ability of interfacing with other other Arduino boards,
microcontrollers and computer. The Atmega328 placed on the board provides serial
communication using pins like Rx and Tx. The Atmega16U2 incorporated on the board
provides a pathway for serial communication using USB com drivers. Serial monitor is
provided on the IDE software which is used to send or receive text data from the board.
If LEDs placed on the Rx and Tx pins will flash, they indicate the transmission of data.
Arduino Uno is programmed using Arduino Software which is a cross-platform
application called IDE written in Java. The AVR microcontroller Atmega328 laid out
on the base comes with builtin bootloader that sets you free from using a separate burner
to upload the program on the board.
4.2.6.5 Applications
Arduino Uno comes with a wide range of applications. A larger number of people are
using Arduino boards for developing sensors and instruments that are used in scientific
research. Following are some main applications of the board.
• Embedded System
• Security and Defense System
• Digital Electronics and Robotics
40
• Parking Lot Counter
• Weighing Machines
• Traffic Light Count Down Timer
• Medical Instrument
• Emergency Light for Railways
• Home Automation
• Industrial Automation
Arduino comes with a big community that is developing and sharing the knowledge
with a wide range of audience. Quick support is available pertaining to technical aspects
of any electronic project. When you decide Arduino board over other controllers, you
don’t need to arrange extra peripherals and devices as most of the functions are readily
available on the board that makes your project economical in nature and free from a lot
of technical expertise [22].
41
Chapter 5 System simulation
5.1 Overview
In this section, we will discuss the design and implementation of the gas leakage
detector which ensures the medical safety for the users.
5.2 Project View
Hardware Configuration: Here we configure our hardware types of equipment with
Arduino Mega board. Here we include a GSM Module, Flame sensor, Gas sensor and
water pump. We connect USB to UART converter in a 3.3 v pin.
Figure 5.1: Hardware Configuration
Assembling with Arduino Mega: Here we have used a power bank to supply 5v power
on our small pc. On the other hand our gas leakage detector is ready to fix with our
hardware devices.
42
Figure 5.2: Hardware Assembling With Gas Detector
Monitoring Display show all condition of the room!
Data Sending: Here we are waiting for the signal. When gas or fire detect data send to
our server as shown in Figure.
Figure 5.3: Smart House
SMS: Emergency contact numbers and Fire Service will get SMS from our system
automatically.
43
Figure 5.4: GSM is in Working Mode
Figure 5.5: Gas Sensor is Working)
44
Figure 5.6: Display show the room temperature
Figure 5.7: Circuit Breaker off
45
Figure 5.8: Room 1 is in safe position
Figure 5.9: Room 2 is in safe position
46
Figure 5.10: Data Send to the Server
47
Chapter 6 Conclusion and Future work
First, introduce the work and then briefly state the major results, then state the major
points of the discussion. Finally, end with a statement of how this work contributes to
the overall field of study
6.1 Conclusion
The objective of the project was to design and implement a cooking gas detector capable
of giving an audiovisual warning when there is gas leakage. The detector has been
designed that uses a PIC16F690 microcontroller and an MQ-6 gas sensor. The detector
shows a green LED to show that there is no gas leakage. When there is a gas leakage
the detector flashes a red and sound an alarm. The detector has an alarm
acknowledgement button that can be used to put off the alarm when necessary. The
detector used an LCD to show the concentration of the gas leakage. The sensor is
capable of showing a gas concentration from 300ppm to 10,000ppm. The use of a
microcontroller makes the detector to have high accuracy in displaying the gas
concentration according to the relationship that exists between the sensor voltage and
gas concentration. The detector is low cost. The components that go into making the
detector does not exceed 1600KShs. If this is done with mass production then the
detector can go for a price of 1500ksh which would very easily affordable and
competitive in the market. The objective of designing a highly accurate low cost a
microcontroller based cooking gas leakage detector has been well achieved.
48
6.2 Limitations
Here we have described about limitation of our Fire and Gas leakage detector.
• Barriers such as closed or partially closed doors, walls, or chimneys may inhibit
flow.
• Smoke particles may become”cold” and stratify, and may not reach the ceiling or
upper walls where detectors are located.
• Smoke particles may be blown away from detectors by air outlets.
• Smoke particles may be drawn into air returns before reaching the detector.
Despite how this project might look good it is still wanting. The use of an alarm, LED
and LCD as the alarm system is not enough. This requires a personal presence in the
vicinity to be notified when there is gas leakage. This detection system can be improved
by including a GSM module for sending an SMS alert to a mobile phone. This way,
wherever someone is, he can be notified when there a gas leakage. To improve the
safety of people and property, the SMS alert can be sent to the relevant authority like
the fire brigade department to deal with the gas leakage issue if the gas leakage as
reached very high concentration. The inclusion of a fire detector would greatly improve
the performance of this gas detector system. There has been a gas leakage, has there
been a fire that has started? The fire detector can help to inform whether things have
gone worse for quick safety actions to be taken. To take this gas detection system to
new perfection, the gas can be supplied with a smart regulator which can be turned off
remotely or by sending a signal. Thus when the detector has detected gas leakage even
before it sounds the alarm and sends the alerts, the microcontroller should send a signal
to switch off the gas. To effectively implement all this good design features a higher
level of microcontroller would be useful. PIC16F690 microcontroller is a mid-range
microcontroller by Microchip. Microchip have PIC18 series which are a higher level
microcontroller with more pins and features such as priority interrupts which would
help to easily incorporate the improvement to this gas leakage detection system.
49
6.3 Future Works
There are many ways in which this gas leak detector can be modified and made more
complex by including more advanced features into it. The GSM module enables us to
send the gas leak message to the relevant stakeholders and hence it increases the
efficiency of this system [13-16]. Usage of GSM module for this detector prevents the
accidents from taking a hazardous turn. The other modification which can be
implemented in this gas leak detector is using a tripper circuit which will trip off the
main supply once the gas leak is detected. During a gas leak, it is dangerous to switch
any appliances as it may spark and this tripper circuit helps to reduce the electrical
hazards that can be caused due to a gas leak [17, 18]. Along with the tripping off of the
main supply, it is very much necessary to turn off the gas regulator so that no further
leakage of the gas occurs [19, 20, 21]. A robot has been used in replacing a human for
handling various tasks in a hazardous and dangerous workplace where human life may
at risk. A mobile gas sensing robot can be constructed to sense the leakage of gas
through pipelines as the robot can move on a track which is situated along the length of
the pipeline. This technique further increases the overall efficiency of the system and
makes the system a perfect gas leak detector providing overall safety of the residents.
50
Bibliography
[1] S. Belsito, P. Lombardi, P. Andreussi, and S. Banerjee, “Leak detection in
liquefied gas pipelines by artificial neural networks,” AIChE Journal, vol. 44, no.
12, pp. 2675–2688, 1998.
[2] F. W. Bernett and L. J. Fioravanti, “Early leak detection system for a disc drive
containing a low-density gas,” Nov. 11 2003, uS Patent 6,646,821.
[3] R. E. Hoffman, “Medical gas alarm system,” Oct. 15 1991, uS Patent 5,057,822.
[4] Z. Qu, H. Feng, Z. Zeng, J. Zhuge, and S. Jin, “A svm-based pipeline leakage
detection and pre-warning system,” Measurement, vol. 43, no. 4, pp. 513–519,
2010.
[5] J. Rajtar and R. Muthiah, “Pipeline leak detection system for oil and gas
flowlines,” Journal of Manufacturing Science and Engineering, Transactions of
the ASME, vol. 119, no. 1, pp. 105–109, 1997.
[6] T. Sato, T. Kanagawa, K. Sumida, and T. Nishio, “Gas visualizing apparatus and
method for detecting gas leakage from tanks or piping,” Jul. 4 1995, uS Patent
5,430,293.
[7] “Us4489239a - portable remote laser sensor for methane leak detection google
patents,” https://patents.google.com/patent/US4489239A/en, (Accessed on
04/09/2019).
[8] “Introduction to arduino mega 2560 - the
engineering projects,”
https://www.theengineeringprojects.com/2018/06/introduction-to-arduinomega-
2560.html, (Accessed on 04/09/2019).
51
[9] “Us5001346a - leak detection system with background
compensation -
google patents,” https://patents.google.com/patent/US5001346A/en, (Accessed
on 04/09/2019).
[10] “Us4919599a - pumping system for a leak detecting device - google patents,”
https://patents.google.com/patent/US4919599A/en, (Accessed on 04/09/2019).
[11] “Compact, stable and efficient all-fibre gas cells using hollow-core photonic
crystal fibres — nature,” https://www.nature.com/articles/nature03349,
(Accessed on 04/09/2019).
[12] L. Fraiwan, K. Lweesy, A. Bani-Salma, and N. Mani, “A wireless home safety gas
leakage detection system,” in 2011 1st Middle East Conference on Biomedical
Engineering. IEEE, 2011, pp. 11–14.
[13] P.-S. Murvay and I. Silea, “A survey on gas leak detection and localization
techniques,” Journal of Loss Prevention in the Process Industries, vol. 25, no. 6,
pp. 966–973, 2012.
[14] V. J. Diduck, “Integrated local or remote control liquid gas leak detection and
shut-off system,” Feb. 15 2000, uS Patent 6,025,788.
[15] A. Shrivastava, R. Prabhaker, R. Kumar, and R. Verma, “Gsm based gas leakage
detection system,” International Journal of Emerging Trends in Electrical and
Electronics (IJETEE-ISSN: 2320-9569), vol. 3, no. 2, 2013.
[16] K. Fukushima, R. Maeshima, A. Kinoshita, H. Shiraishi, and I. Koshijima, “Gas
pipeline leak detection system using the online simulation method,” Computers &
chemical engineering, vol. 24, no. 2-7, pp. 453–456, 2000.
[17] W. Liang, L. Zhang, Q. Xu, and C. Yan, “Gas pipeline leakage detection based on
acoustic technology,” Engineering Failure Analysis, vol. 31, pp. 1–7, 2013.
[18] T. G. McRae Jr, “Backscatter absorption gas imaging system,” Nov. 26 1985, uS
52
Patent 4,555,627.
[19] W. E. Lowry, S. D. Dunn, R. Walsh, D. Merewether, D. V. Rao et al., “Method
and system to locate leaks in subsurface containment structures using tracer
gases,” Mar. 14 2000, uS Patent 6,035,701.
[20] W. S. Cochran and J. A. Graeber, “Fluid delivery pipe with leak detection,” Mar.
7
2000, uS Patent 6,032,699.
[21] L. F. Donaghey, “Resistive hydrocarbon leak detector,” Dec. 30 1986, uS Patent
4,631,952.
[22] “Introduction to arduino uno - the engineering
projects,”
https://www.theengineeringprojects.com/2018/06/introduction-to-
arduinouno.html, (Accessed on 04/09/2019).

More Related Content

Similar to Design_and_Development_of_Fire_and_Gas_L.pdf

Building the hyperconnected society
Building the hyperconnected societyBuilding the hyperconnected society
Building the hyperconnected societyLittle Daisy
 
Maxime Javaux - Automated spike analysis
Maxime Javaux - Automated spike analysisMaxime Javaux - Automated spike analysis
Maxime Javaux - Automated spike analysisMaxime Javaux
 
TFG_Cristobal_Cuevas_Garcia_2018.pdf
TFG_Cristobal_Cuevas_Garcia_2018.pdfTFG_Cristobal_Cuevas_Garcia_2018.pdf
TFG_Cristobal_Cuevas_Garcia_2018.pdfGerard Labernia
 
Bx310x Product Specification
Bx310x Product SpecificationBx310x Product Specification
Bx310x Product SpecificationFrederic Petit
 
ImplementationOFDMFPGA
ImplementationOFDMFPGAImplementationOFDMFPGA
ImplementationOFDMFPGANikita Pinto
 
Emf2192 ib _ethercat aif module__v3-1__en
Emf2192 ib _ethercat aif module__v3-1__enEmf2192 ib _ethercat aif module__v3-1__en
Emf2192 ib _ethercat aif module__v3-1__enCharles Santos
 
Fulltext02
Fulltext02Fulltext02
Fulltext02Al Mtdrs
 
iGUARD: An Intelligent Way To Secure - Report
iGUARD: An Intelligent Way To Secure - ReportiGUARD: An Intelligent Way To Secure - Report
iGUARD: An Intelligent Way To Secure - ReportNandu B Rajan
 
Using gsm sim authentication in vp ns
Using gsm sim authentication in vp nsUsing gsm sim authentication in vp ns
Using gsm sim authentication in vp nsJamal Meselmani
 
final report (parking project).pdf
final report (parking project).pdffinal report (parking project).pdf
final report (parking project).pdfgamefacegamer
 
Towards Digital Twin of a Flexible manufacturing system with AGV
Towards Digital Twin of a Flexible manufacturing system with AGV Towards Digital Twin of a Flexible manufacturing system with AGV
Towards Digital Twin of a Flexible manufacturing system with AGV YasmineBelHajsalah
 
LPG Booking System [ bookmylpg.com ] Report
LPG Booking System [ bookmylpg.com ] ReportLPG Booking System [ bookmylpg.com ] Report
LPG Booking System [ bookmylpg.com ] ReportNandu B Rajan
 

Similar to Design_and_Development_of_Fire_and_Gas_L.pdf (20)

thesis
thesisthesis
thesis
 
Building the hyperconnected society
Building the hyperconnected societyBuilding the hyperconnected society
Building the hyperconnected society
 
z_remy_spaan
z_remy_spaanz_remy_spaan
z_remy_spaan
 
bachelor
bachelorbachelor
bachelor
 
Malware Analysis
Malware Analysis Malware Analysis
Malware Analysis
 
Maxime Javaux - Automated spike analysis
Maxime Javaux - Automated spike analysisMaxime Javaux - Automated spike analysis
Maxime Javaux - Automated spike analysis
 
TFG_Cristobal_Cuevas_Garcia_2018.pdf
TFG_Cristobal_Cuevas_Garcia_2018.pdfTFG_Cristobal_Cuevas_Garcia_2018.pdf
TFG_Cristobal_Cuevas_Garcia_2018.pdf
 
final_report
final_reportfinal_report
final_report
 
VENDING_MACHINE_2023-2024
VENDING_MACHINE_2023-2024VENDING_MACHINE_2023-2024
VENDING_MACHINE_2023-2024
 
Bx310x Product Specification
Bx310x Product SpecificationBx310x Product Specification
Bx310x Product Specification
 
ImplementationOFDMFPGA
ImplementationOFDMFPGAImplementationOFDMFPGA
ImplementationOFDMFPGA
 
Emf2192 ib _ethercat aif module__v3-1__en
Emf2192 ib _ethercat aif module__v3-1__enEmf2192 ib _ethercat aif module__v3-1__en
Emf2192 ib _ethercat aif module__v3-1__en
 
Tilak's Report
Tilak's ReportTilak's Report
Tilak's Report
 
Fulltext02
Fulltext02Fulltext02
Fulltext02
 
iGUARD: An Intelligent Way To Secure - Report
iGUARD: An Intelligent Way To Secure - ReportiGUARD: An Intelligent Way To Secure - Report
iGUARD: An Intelligent Way To Secure - Report
 
Using gsm sim authentication in vp ns
Using gsm sim authentication in vp nsUsing gsm sim authentication in vp ns
Using gsm sim authentication in vp ns
 
thesis
thesisthesis
thesis
 
final report (parking project).pdf
final report (parking project).pdffinal report (parking project).pdf
final report (parking project).pdf
 
Towards Digital Twin of a Flexible manufacturing system with AGV
Towards Digital Twin of a Flexible manufacturing system with AGV Towards Digital Twin of a Flexible manufacturing system with AGV
Towards Digital Twin of a Flexible manufacturing system with AGV
 
LPG Booking System [ bookmylpg.com ] Report
LPG Booking System [ bookmylpg.com ] ReportLPG Booking System [ bookmylpg.com ] Report
LPG Booking System [ bookmylpg.com ] Report
 

Recently uploaded

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 

Recently uploaded (20)

Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 

Design_and_Development_of_Fire_and_Gas_L.pdf

  • 1. Title Gas detection using Arduino microcontroller By Ahmed Waheed Supervisor Asst. Prof. Hamza M. Khuder A thesis submitted in partial fulfilment of the requirements for the degree of Computer Engineering Techniques Department College of Information Technology Imam Ja'afar Al-Sadiq University April 2023 Kirkuk, Iraq
  • 2. i Declaration I hereby declare that this thesis entitled: “Gas detection using Arduino microcontroller “is my own original work and hereby certify that unless stated, all work contained within this is my own independent research and has not been submitted for the award of any other degree at any institution, except where due acknowledgement is made in the text. Signature Name: Date: Signature Name: Date: Signature Name: Date: Signature Name: Date:
  • 3. ii Dedication I dedicate this dissertation as a tribute to my numerous friends and family. I am incredibly grateful to my loving parents, our university stuff and classmate, whose inspiration and drive for persistence continue reverberating in my ears. My soulmate (my wife) is treasured and have never left my side. I also dedicate this dissertation to my close friends and university whom was part of it also my family for their help and encouragement during the writing process. Ahmed Waheed 2023
  • 4. iii Acknowledgements Here we would like to thank my supervisor Assistant professor Hamza M. Khuder. For his dedicated support and guidance. Our university stuff continuously provided encouragement and were always willing and enthusiastic to assist in any way could throughout the research project. I would also like to thank our family and soulmate for supporting during these years. Our department members for providing advice regarding study journey. Finally, many thanks to all participants that took part in the study and enabled this research to be possible.
  • 5. iv Abstract Gas leakage is a major problem for our country. Our device is intended for use in household safety, Industrial sector, residential premises and gas-powered vehicles like CNG, buses cars where appliances and heaters that use natural gas and liquid petroleum gas (LPG) may be a source of risk. Nimtoli and Old Dhaka gas tragedy was an example of gas leakage accident in Bangladesh. Unfortunately, gas leakage detection devices aren’t that much available in our country. In our project, we focused on developing such a device. We made this device based on two main sectors: the transmission and detection module, and receiving module. The detection and transmitting module detects the gas leakage using a sensing circuit built for this purpose. If the sensor detects a gas leakage, it provides an alarm and sends a signal to another module. GSM module will send emergency SMS to fire service station, emergency contacts numbers and power line automatically cutoff. The device was tested using LPG gas and the alarm was activated as a result of gas leakage. However, the former gas leakage system cannot react in time. This project provides the design approach on both software and hardware.
  • 6. v TABLE OF CONTENTS Declaration ………………………………………………………………………………………………………… i Certificate …………………………………………………………………………………………………………..ii Acknowledgments ……………………………………………………………………………………………...iii Abstract………………………………………………………………………………………………………………iv List of Figures…………………………………………………………………………………………………...viii 1 Introduction ……………………………………………………………………………………………………1 1.1 Problem Statement ……………………………………………………………...3 1.2 Motivations……………………………………………………………………...4 1.3 Aims and Objectives ………………………………………………………...….5 1.4 Project Contribution …………………………………………………………….6 1.4.1 Contributions………………………………………………………………….6 1.5 Organization of the chapters ……………………………………………………6 2 System Review……………………………………………………………………………………………….7 2.1 Introduction……………………………………………………………………..7 2.2 Project Review …………………………………………………………………7 3 The Design Methodology ……………………………………………………………………………..11 3.1 Introduction……………………………………………………………………11 3.2 System Design ………………………………………………………………...11 3.2.1 Technical Terms…………………………………………………………….12 3.2.2 A Gas Leakage Detector ……………………………………………………12 3.2.3 Burst Detection……………………………………………………………...13 3.2.4 Nearest Fire Service Detection………………………………………………13 3.2.5 Advantage……………………………………………………………………14 3.2.6 Challenges…………………………………………………………………...14
  • 7. vi 3.2.7 Block Diagram of Gas Leakage Detector…………………………………….14 3.3 Hardware Implementation……………………………………………………...16 3.4 Software Requirement………………………………………………………….17 3.4.1 Arduino IDE-(Sketch)……………………………………………………….17 3.4.2 Blynk ………………………………………………………………………..18 3.5 Conclusion ……………………………………………………………………..18 3.6 Technologies and Implementation…………………………………………….. 20 3.7 Introduction…………………………………………………………………….20 3.8 System Design …………………………………………………………………20 3.8.1 Flame Sensor ………………………………………………………………...21 3.8.2 NodeMCU…………………………………………………………………...22 3.8.3 GSM Module………………………………………………………………...22 3.8.4 MQ-2Gas Sensor…………………………………………………………,….25 3.8.5 Arduino Mega 2560………………………………………………………….25 3.8.6 Arduino UNO ………………………………………………………………..34 4 System Simulation…………………………………………………………………………………………42 4.1 Overview ………………………………………………………………………42 4.2 Project View……………………………………………………………………42 5 Conclusion, Limitations and Future Work ……………………………………….49 5.1 Conclusion ……………………………………………………………………..49 5.2 Limitations ……………………………………………………………………..50 5.3 Future Works …………………………………………………………………..51 Bibliography……………………………………………………………………………………………………….54
  • 8. vii List of Figures 1.1 Gas Leakage Detector System . . . . . . . . . . . . . . . . . . . . . 2 2.1 Block Diagram of Gas Leakage Detector . . . . . . . . . . . . . . . . 8 2.2 Block Diagram of Gas Leakage Detector . . . . . . . . . . . . . . . . 10 3.1 Circuit Diagram of Gas Leakage Detector. . . . . . . . . . . . . . . . 12 3.2 Working Mode of Gas Leakage Detector . . . . . . . . . . . . . . . . 13 3.3 Block Diagram of Gas Leakage Detector . . . . . . . . . . . . . . . . 15 3.4 Flow chart of Gas Leakage Detector . . . . . . . . . . . . . . . . . . 15 3.5 Physical Configuration of Gas Leakage Detector [1]. . . . . . . . . . 17 3.6 Arduino IDE-Sketch [2] . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.7 Blynk APP View . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 4.1 Flame Sensor (MQ-6 Sensor) [1] . . . . . . . . . . . . . . . . . . . . 21 4.2 NodeMCU Micro-controller [3] . . . . . . . . . . . . . . . . . . . . 22 4.3 GSM Module [4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.4 GSM Antenna Breakout Board [5] . . . . . . . . . . . . . . . . . . . 24 4.5 MQ-6 Gas Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.6 Arduino Mega[6] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 4.7 Arduino Mega Specifications[2] . . . . . . . . . . . . . . . . . . . . 27 4.8 Arduino Mega 2560 Pinout[7] . . . . . . . . . . . . . . . . . . . . . 29 4.9 Arduino Mega Dimensions[8] . . . . . . . . . . . . . . . . . . . . . 31 4.10 Arduino Mega Sheild Compatibility[9] . . . . . . . . . . . . . . . . . 32 4.11 Arduino Uno [10] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 4.12 Arduino Uno Pin[11] . . . . . . . . . . . . . . . . . . . . . . . . . . 37 4.13 Arduino Uno Pinout[7] . . . . . . . . . . . . . . . . . . . . . . . . . 38 5.1 Hardware Configuration . . . . . . . . . . . . . . . . . . . . . . . . . 42 5.2 Hardware Assembling With Gas Detector . . . . . . . . . . . . . . . 43
  • 9. viii 5.3 Smart House . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 5.4 GSM is in Working Mode . . . . . . . . . . . . . . . . . . . . . . . . 45 5.5 Gas Sensor is Working) . . . . . . . . . . . . . . . . . . . . . . . . . 45 5.6 Display show the room temperature . . . . . . . . . . . . . . . . . . 46 5.7 Circuit Breaker off . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 5.8 Room 1 is in safe position . . . . . . . . . . . . . . . . . . . . . . . . 47 5.9 Room 2 is in safe position . . . . . . . . . . . . . . . . . . . . . . . . 47 5.10 Data Send to The Server . . . . . . . . . . . . . . . . . . . . . . . . 48
  • 10. 1 Chapter 1 Introduction More and more people are getting injured, burnt and a large portion of them eventually dying due to cylinder blasts that have been taking place in the country for the last couple of years. At least 50 were injured and 10 died in last one-year time in Bangladesh. In the last January alone, there were 4 huge cylinder blast incidents that took place in the city [4]. A gas pipe leaked during a road development work in the capital’s Uttara on Oct 6 2018, causing suspension of traffic movement on the busy Dhaka-Mymensingh highway for about three and a half hours.Gas from the 10-inch pipe leaked near Mascot Plaza in Uttara around 9:00 pm [12]. The woman who was burnt in a fire at an apartment in Dhaka’s Uttara has succumbed to her injuries. Afire had broken out at the Uttara apartment of US embassy staffer Md Shahnewaz on the morning of Feb 26, leaving five— the couple and their three sons— injured [13]. One killed, 6 others injured in gas cylinder blast in Jatrabari. The accident occurred on Friday 16 November 2018. An eight-year-old child has been killed, and six people have sustained burn injuries, in a gas cylinder explosion in Dhalpur, Jatrabari [14]. In Bangladesh, CNG and LPG cylinders are mostly metallic having a lifespan of roughly 10 to 15 years. These cylinders must be destroyed after their expiry dates. But, in reality, the cylinders are not abandoned or even tested after elapsing the granted period thus, risking it to blow out at any time. Moreover, the companies that are selling cylindered gas are also issuing the fitness certificate of the cylinders and unfortunately, the government has no rigid policy on the LPG and CNG. The most horrifying fact is that the state-owned Bangladesh Petroleum Corporation (BPC) has a total of 11 thousands of cylinders and 8 thousands of them are out of date! Directorate of the Explosive Detection has recently identified
  • 11. 2 that almost 80% of the cylinders of BPC are unusable after an explosion that took place at a BPC depot in Bogra in last year that completely destroyed 300 cylinders and burnt 3 trucks and luckily no human was injured in that incident [15]. According to the reported incidents, cylinders are blowing out on a regular basis throughout the country. The frequency of the blast is almost one at least in a month. From the last June, there were at least 5-6 LPG and 2 CNG cylinders explosion incidents that are reported at various dailies. Those explosions cost at least 7 human lives and left 5 burnt and injured severely while the financial loss was above 30 to 35 million BDT. Experts have urged on setting up policy by the government to maintain the safety standards in this sector. They are also encouraging the mass people to be cautious while buying and using the cylinders and to conduct regular health check-ups of the cylinders from a certified authority [3]. Figure 1.1: Gas Leakage Detector System People had died on the gas or LPG blast. Looking for the reasons- • Gas Burner is open all time. • Gas cylinder isn’t test proper time. • Proper alert system. According to the reported incidents, cylinders are blowing out on a regular basis throughout the country. The frequency of the blast is almost one at least in a month. From the last June, there were at least 5-6 LPG and 2 CNG cylinders explosion incidents
  • 12. 3 that are reported at various dailies. Those explosions cost at least 7 human lives and left 5 burnt and injured severely while the financial loss was above 30 to 35 million BDT [16]. To reduce the death rate of people we have to design a gas leakage detector which has to work on 5 stages of gas leakage, those are, a. First flame sensor detects the gas leak. b. The numbers start at 1 with every call to the enumerate environment. c. When the last sensor has given alert, that time 3 message send to different numbers. To develop this project, we have to use Arduino Mega board, LED, Brazzers, GSM module and five different five sensors. 1.1 Problem Statement Here we have described about problem statement. • Natural gases such as Liquefied Petroleum Gas (LPG) are widely used in the whole world. LPG is used for cooking in home or hotel. It is also used in certain gas based industry. As for now, the use of natural gases instead of petroleum as the alternative fuel for mobile cars also has been increased. Although the procedure of installing LPG-based system is very tight, we could not give 100% guaranteed that the LPG-system will not having leakage. • Even though human is a perfect creation of God, they still have certain weakness. Human cannot detect the presence of natural gases as fast as the sensor do. Thus, the use of gas sensing system is hugely needed to give real-time monitoring of the gas system. • In certain cases, gas leakage can cause fire that will destroy human property. The large scale of fire also could contribute to serious injury or death. This is due to the fire station got delay information about the fire occurred.
  • 13. 4 Therefore, this project shall be able to resolve the problem stated. This is because this project is able to sense the presence of natural gases as well as fire. Besides that, it is also capable to send out an SMS alert automatically to the owner and also to the nearest fire station. 1.2 Motivations In this section, we have to describe the motivation of our gas leakage detector system. • In recent times many cases of gas leakage accident can be seen around us. Day by day peoples are increasing, people get injured or might be dead, one of the biggest reason is emergency contact with the nearest firefighter station and track the accident area. • In our country, More than 500 hundred people have died in an accident for proper medical attention. • Tracking the nearest firefighter station and know the vital information for the accidental place, given an important message to the house owner, • Many people could save their life in accident case if we can take an immediate decision to send news to fire service. Experts have urged on setting up policy by the government to maintain the safety standards in this sector. They are also encouraging the mass people to be cautious while buying and using the cylinders and to conduct regular health check-ups of the cylinders from a certified authority. • People’s death rates increased among all people age group between 2016 to 2018. • When gas leakage accident has occurred, women’s was the first victim. • When the huge blast occurred, that time remaining of the family member was also fallen, the victim.
  • 14. 5 According to the data from 2016 to the 2018 year from the NHTSA, around 500 hundred people were killed on Bangladesh due to LPG gas leakage. 1.3 Aims and Objectives The main research objective of this project is to develop a gas leakage detector to reduce the data rate of GAS cylinder blast. • The main objective of this project is to design a gas leakage detector, that is capable of identifying of the gas leakage and fire and send a message to emergency contact numbers such as nearest fire service station and house owner. • This system is capable of providing the correct information to ensure the security and safety of the people against GAS cylinder blast. • If we found any gas leakage for our home or restaurant kitchen, that time our system has given the alert.That’s why we can easily identify the accident place and taken the necessary steps to reduce the data rate. 1.4 Project Contribution 1.4.1 Contributions There is only one project in our country, that was design only sensor based, their project was given alert to the system. But our implemented system is different from that existing system. We added an SMS based alert system which was not found the existing system. We are working to develop a unique ideas which helps people in many ways.
  • 15. 6 1.5 Organization of the chapters • Chapter 2: In this chapter, we have to describe the literature review, the research gap and proposed solution of our developing system. • Chapter 3: Used Technologies: In this chapter, we have to describe the technologies we used described our front end and back-end technologies. • Chapter 4: Design and implementation: In this chapter, we have to describe how we design and implement our solutions and some project screenshots included here. • Chapter 5: Conclusion: In this chapter, we have to describe the challenges both technical and non-technical we have.
  • 16. 7 Chapter 2 Literature review 2.1 Introduction This chapter presents related work, Literature review, Research gap and our movement that we have passed to solve the critical problems. The thought of making this project comes from social awareness. To many GAS cylinder burst accident occurring around us as we can see, for those reasons a lot of people lost their life. According to a report, around 500 hundred people have died last year. Most of them died for proper fire service attention, That means if we able to call fire service as soon as possible with information death rate will decrease. So this is the basic idea to develop a gas leakage detector. If hardware and software easily integrate with a sensor which sends the message to the nearest fire service emergency contact number. 2.2 Project Review IoT and accident administration are two places which first progress is becoming produced.LPG gas is the main gas fuel used for cooking and other heating appliances. This is because it is a stable, high energy content, relatively low Sulphur, clean-burning fuel which can be transported economically as a liquid. It is a by-product of crude oil and Natural Gas processing .LPG is primarily composed of propane, butane, is butane or a mixture of these gases.It is stored in gas cylinders as the liquid under relatively low pressure. It has a low boiling point and it will vaporize immediately it is released into the air. It is relatively heavier compared to air. When it leaks, it will tend to flow close to the ground and settle in low lying places on the premises if there is no adequate air ventilation. LPG gas is highly flammable gas with Lower Explosive Limits of about 1.4%that is about14,000PPM. This is the property of LPG that makes us worried when using the
  • 17. 8 Figure 2.1: Block Diagram of Gas Leakage Detector gas. No matter the safety standards that are put in place in the usage of the gas to ensure there is no gas leakage, there is always the danger of gas leakage. The human being is prone to error. LPG gas is odourless and colourless and it would be impossible to detect the presence of gas leakage. An odourant is normally added to the gas to help detect the gas in case of a leakage but this is not enough as it would require person to be physically present to detect the gas leakage and by the time the gas has built up enough to be detected by smell it will have reached dangerous concentration level.Therefore, it is a great risk to rely on our sense of smell to determine whether there is a gas leakage or not.This has been a great concern for people over time and people have come up with a gas leakage detector to solve this problem.The gas leakage detectors that have been developed have been built around already existing different gas technology[4].The different type of sensor are listed below. Electra chemical sensors-mostly used for toxic gases such carbon monoxideMetal Oxide Semiconductor sensors-used for both to sensor-used for combustible gases such hydrocarbon gasesInfrared Sensors-used for combustible gases 5The choice of the sensor depends on the type of gas that is to be detected among other factors such as the stability, sensitivity, selectivity, price and durability of the sensor.For hydrocarbon gases such as LPG gas, metal oxide semiconductor sensors are preferred over the rest of sensor because they are relatively cheap and last for a long time being stable, sensitive to low gas concentrations
  • 18. 9 (300PPM) and detect a wide range of gas concentration (300-10000) resistant to poisoning[4]. However, its performance is affected by exposure to high corrosive gases(such as hydrogen chloride), organic silicon steam, halogen pollution and water[6].Metal oxide semiconductor detects gases by means of their surface interaction with the target gas which alters the conductivity of the semiconductor. The output voltage signal is converted into gas concentration. Tin oxide and Tungsten Oxide are kinds of metal oxide used as the sensing material in metal oxide semiconductor sensor[4].TGS sensor by Figaro[7]and MQ-6 sensor[6]are metal oxide semiconductor- based sensors that can be used for detecting LPG gas.The MQ-6 sensor offers a [6]High Sensitivity to LPG gasA Detection Range: 300 -10,000 PPMFast Response Time: ¡10sSimple drive circuitHeater Voltage: 5.0VLong lifespan Low cost A gas leakage detection system capable of raising an alarm has been developed using the sensor and a comparator. The sensor output voltage is compared with a reference voltage from a pedometer and if the voltage signal is higher the reference voltage the comparator output a signal which can be used to drive a circuit setting off an alarm and lit a number of LEDs. The potentiometer is used to set the trigger level for the alarm[8].There is some commercial LPG gas detector in the market that detect gas leakage and raise a warning in the form of an alarm and LED indicators. However, these commercialized gas detectors come at a high price and not readily available on the Kenya market[9], [10].Therefore, there is a need for designing a gas leakage detector that can be readily available in the local market at an affordable price [6]. The detector is based on a micro-controller with a high-resolution Analog to Digital Converter (10 bits)[11]. The detector in addition to raising a 6alarm and having LED indicators for status of the gas leakage it is capable of accurately displaying the concentration of the gas on an LCD display. It also incorporates a button that can be used for acknowledging the alarm. The micro-controller is programmed with an algorithm for converting the voltage signal from the sensor to the respective gas concentration according to the sensor data sheet.The data sheet outline the relationship between the sensor voltage and the gas concentration.
  • 19. 10 Thus, gas concentration can be displayed with high accuracy. The micro-controller Figure 2.2: Block Diagram of Gas Leakage Detector runs at high frequency, thus the detector has a faster response time to changes in the concentration of the gas.The specific sensor to be used for this detector is MQ-6 sensor which uses Tin Oxide as the sensing material. The micro-controller being used is the PIC16F690 microcontroller by Microchip. The LCD being used is the Hitachi HD44780 LCD.The detector will use a Buzzer as the alarm. All these components are powered using a 5V supply.The 5V is supplied using available 5V voltage regulators ICs and a 9V battery [5].
  • 20. 11 Chapter 3 The Methodology 3.1 Introduction This paper explains the model of the gas leakage detector. An incorporated network of detectors, GSM-enabled processor chip and cloud processing in-fractures are utilized to develop the gas leakage detector for incident and advertisement. The gas leakage detector is developed to identify an incident and immediately notify unexpected emergency contacts. A vibration sensor is utilized to identify the signal which usually computed the possibility of a crash. When the threshold limits are surpassed a text message that contains the incident area and initiated to the emergency contacts. The text message is instantly started at normal time periods to enable the connection to find out the victim quickly. 3.2 System Design In this section, we have described our gas leakage detector and how we implement our system. 3.2.1 Technical Terms: Here we have described that how our systems connected to each other devices? How sensors are connected? Everyone get clear idea to see this image about gas leakage detector.
  • 21. 12 Figure 3.1: Circuit Diagram of Gas Leakage Detector. 3.2.2 A Gas Leakage Detector: This circuit is designed for increasing life safety for the peoples. The GAS Leakage Detector will help people to detect the gas which was spread out the home or restaurant kitchen and send vital information and location to the emergency contact number. That can help to get proper fire service attention. No need to call the fire service our system will alert the fire station authority and forces to send the firefighters to the victim place.
  • 22. 13 Figure 3.2: Working Mode of Gas Leakage Detector 3.2.3 Burst Detection: In our busy lives,it,s very difficult to help injured people on specific people. It,s also difficult to contact relatives of the injured persons and know the vital information. If we alert the fire service authority and forces to send the fire vehicals to the victim place. Our gas leakage detector will help to get vital information and get SMS to nearby firefighter station . It can save much more life’s [17]. 3.2.4 Nearest Fire Service Detection: It also detects nearest fire service and our system has given SMS to the firefighters authority to send an emergency help to the victim place and also get ready to admit the patents.
  • 23. 14 3.2.5 Advantage: It is an automatic system which helps injured people to get emergency help from fire service and relatives. • To know the incident location immediately. • To know about vital information of the injured person. • To Know about the nearest fire service stations. 3.2.6 Challenges During this project, we have faced several challenges, some of them are technical and some of them are non-technical. • It is a wireless device so every time it needs to connect the internet. • When gas cylinder or gas line leakage found and the air was full of gas that time our sensor reading time was not capable of to detect the accident • All of the sensors needs to response the accident otherwise the system will not be worked. 3.2.7 Block Diagram of Gas Leakage Detector In today’s era especially in the women, the craze of gas leakage detector is really remarkable. As the gas cylinder burst accident was increasing, due to which many death occurs, most of them are caused not taking any security to detect the accident and also due to the poor medical facility. So providing safety to a person while gas leakage detector is a prime concern. Thus by considering this problem, the gas leakage detector gives them necessary safety and they can easily understand the gas leakage detector is essential needs to their home safety, if not the system won’t work [18].
  • 24. 15 Figure 3.3: Block Diagram of Gas Leakage Detector Figure 3.4: Flow chart of Gas Leakage Detector Fig.3.1 describe the block diagram of honour systems configure, here we integrate Arduino Mega, Servo Motor, GSM
  • 25. 16 Module, Flame sensor water pump and raspberry pi built in the sim card. Ignition circuit will start after the gas burner will give gas leak on the flame sensor. GSM is used to send or receive the message for the nearest firefighter station. 3.3 Hardware Implementation: We need below hardware to implement the gas leakage detector. • Arduino UNO • Arduino Mega(act as a motherboard to control the gas leakage detector)an electronic prototyping platform/board based on Atmega AVR. • Power Bank • GSM Module • Flame Sensor • Water pump • 16*2 LCD Display • MQ6 Sensor • Sound System • NodeMCU • Relay • RFID • Memory Card Reader
  • 26. 17 • Micro USB cable. Jumper wires Figure 3.5: Physical Configuration of Gas Leakage Detector [1]. 3.4 Software Requirement • Arduino IDE-(Sketch) • Blynk 3.4.1 Arduino IDE-(Sketch) A sketch is a name that Arduino uses for a program. It’s the unit of code that is uploaded to and runs on an Arduino board.
  • 27. 18 Figure 3.6: Arduino IDE-Sketch [2] 3.4.2 Blynk Blynk is a Platform with IOS and Android apps to control Arduino, Raspberry Pi and the likes over the Internet. 3.5 Conclusion Here we described the proposed system which will help to implements the gas leakage detector . We are clearly described our plan in this section smoothly. That should help the people to understand easily.
  • 29. 20 Chapter 4 Technology and implentation 4.1 Introduction The gas leakage detector is designed for proper medical attention. Gas cylinder and gas burst is a common thing in our country. Our device can communicate with the nearest hospital and nearest firefighter wirelessly. It can be used in home security, industrial security and vehicle. It can be used in a rural area or highway area for ensuring safety [19]. Our proposed system helps people into three categories: • Proper fire service station attention • Provide vital information • Detects LPG from 200ppm to 10000ppm Our proposed proposal used: • IoT based hardware technology • Scripting programming language 4.2 System Design In this section, we have discussed the hardware design of the gas leakage detector. 4.2.1 Flame Sensor : • Detects a flame or a light source of a wavelength in the range of 760nm-1100 nm. • Detection range: up to 100 cm. • Adjustable detection range. • Detection angle about 60 degrees, it is sensitive to the flame spectrum.
  • 30. 21 • Comparator chip LM393 makes module readings stable. • Operating voltage 3.3V-5V. • Digital and Analog Output. • Power indicator and digital switch output indicator. 4.2.1.1 Advantages • High sensitivity to alcohol gas in a wide range. • High sensitivity to alcohol gas. • Fast response. • Wide detection range. • Stable performance, long life, low cost. Figure 4.1: Flame Sensor (MQ-6 Sensor) [1] 4.2.2 NodeMCU NodeMCU is an open source IoT platform. It includes firmware which runs on the ESP8266 Wi-Fi SoC from Espressif Systems, and hardware which is based on the ESP12 module. The term ”NodeMCU” by default refers to the firmware rather than the development kits. The firmware uses the Lua scripting language [2]. 4.2.2.1 Advantages • High sensitivity
  • 31. 22 • Very fast response • Stable performance • Long life • Simple circuit design Figure 4.2: NodeMCU Micro-controller [3] 4.2.3 GSM Module GSM/GPRS module is used to establish communication between a computer and a GSM-GPRS system. Global System for Mobile communication (GSM) is an architecture used for mobile communication in most of the countries. Global Packet Radio Service (GPRS) is an extension of GSM that enables higher data transmission rate [4]. 4.2.3.1 Advantages • High gain antenna. • Very fast response. • Fast satellite acquisition.
  • 32. 23 • Stable performance. • Long life Figure 4.3: GSM Module [4] Figure 4.4: GSM Antenna Breakout Board [5] This GSM Module is based on the NEO-6M chip from U-blox. The onboard high
  • 33. 24 gain antenna supports fast satellite acquisition, keeping the GSM accuracy within 5m. Unlike other generic ublox GSM Modules, there is a backup battery onboard that stores the satellite ephemeris data when powered off and thus helps faster location estimation as soon as the module powers on [20]. 4.2.4 MQ-2 Gas Sensor The MQ6 (LPG Gas Sensor) is a simple-to-use liquefied petroleum gas (LPG) sensor. It can be used in gas leakage detecting equipment in consumer and industry applications, this sensor is suitable for detecting LPG, iso-butane, propane, LNG. Avoid the noise of alcohol, cooking fumes and cigarette smoke [21]. Figure 4.5: MQ-2 Gas Sensor
  • 34. 25 4.2.5 Arduino Mega 2560 • Arduino Mega 2560 is a Microcontroller board based on Atmega2560. It comes with more memory space and I/O pins as compared to other boards available in the market. • There are 54 digital I/O pins and 16 analog pins incorporated on the board that make this device unique and stand out from others. • Out of 54 digital I/O, 15 are used for PWM (pulse width modulation). • A crystal oscillator of 16MHz frequency is added on the board. • This board comes with USB cable port that is used to connect and transfer code from computer to the board. • DC power jack is coupled with the board that is used to power the board. Some version of Arduino board lacks this feature like Arduino Pro Mini doesn’t come with DC power jack. • ICSP header is a remarkable addition to Arduino Mega which is used for pro- gramming the Arduino and uploading the code from the computer. Figure 4.6: Arduino Mega[6]
  • 35. 26 • This board comes with two voltage regulator i.e. 5V and 3.3V which provides the flexibility to regulate the voltage as per requirements as compared to Arduino Pro Mini which comes with only one voltage regulator. • There is no much difference between Arduino Uno and Arduino Mega except later comes with more memory space, bigger size and more I/O pins. • Arduino software called Arduino IDE is used to program the board which is a common software used for all boards belonged to Arduino family. • Availability of Atmega16 on the board makes it different than Arduino Pro Mini which uses USB to serial converter to program the board. • There is a reset button and 4 hardware serial port called USART which produces a maximum speed for setting up communication. • Following figure shows the specifications of Arduino mega 2560.
  • 36. 27 Figure 4.7: Arduino Mega Specifications[2] • Arduino Mega is specially designed for the projects requiring complex circuitry and more memory space. Most of the electronic projects can be done pretty well by other boards available in the market which make Arduino Mega uncommon for regular projects. However, there are some projects that are solely done by Arduino Mega like making of 3D printers or controlling more than one motors, because of its ability to store more instructions in the code memory and a number of I/O digital and analog pins. • There are three ways to power the board. You can either use a USB cable to power the board and transfer code to the board or you can power it up using Vin of the board or through Power jack or batter.
  • 37. 28 • Last two sources to power the board are required once you already built and compile code into the board through USB cable. • This board comes with resettable polyfuse that prevents the USB port of your computer from overheating in the presence of high current flowing through the board. Most of the computers come with an ability to protect themselves from such devices, however, the addition of fuse provides an extra layer of protection. • It can be used either way i.e. for creating stand-alone projects or in combination with other Arduino boards. Most complex projects can be created using this board. 4.2.5.1 Arduino Mega 2560 Pinout Following figure shows the pinout of Arduino Mega 2560. Figure 4.8: Arduino Mega 2560 Pinout[7] • Each pin comes with a specific function associated with it. All analog pins can be used as digital I/O pins. • Designing of a project using Arduino Mega gives you the flexibility of working with more memory space and processing power that allows you to work with a number of sensors at once. This board is physically larger than other Arduino boards.
  • 38. 29 4.2.5.2 Pin Descriptions 5V & 3.3V. This pin is used to provide output regulated voltage around 5V. This regulated power supply powers up the controller and other components on the board. It can be obtained from Vin of the board or USB cable or another regulated 5V voltage supply. While another voltage regulation is provided by 3.3V pin. Maximum power it can draw is 50mA. GND. There are 5 ground pins available on the board which makes it useful when more than one ground pins are required for the project. Reset. This pin is used to reset the board. Setting this pin to LOW will reset the board. Vin. It is the input voltage supplied to the board which ranges from 7V to 20V. The voltage provided by the power jack can be accessed through this pin. However, the output voltage through this pin to the board will be automatically set up to 5V. Serial Communication. RXD and TXD are the serial pins used to transmit and receive serial data i.e. Rx represents the transmission of data while Tx used to receive data. There are four combinations of these serial pins are used where Serail 0 contains RX(0) and TX(1), Serial 1 contains TX(18) and RX(19), Serial 2 contains TX(16) and RX(17), and Serial 3 contains TX(14) and RX(15). External Interrupts. Six pins are used for creating external interrupts i.e interrupt 0(0), interrupt 1(3), interrupt 2(21), interrupt 3(20), interrupt 4(19), interrupt 5(18). These pins produce interrupts by a number of ways i.e. providing LOW value, rising or falling edge or changing value to the interrupt pins.
  • 39. 30 LED. This board comes with built-in LED connected to digital pin 13. HIGH value at this pin will turn the LED on and LOW value will turn it off. This gives you the change of nursing your programming skills in real time. Analog Pins. There are 16 analog pins incorporated on the board labeled as A0 to A15. It is important to note that all these analog pins can be used as digital I/O pins. Each analog pin comes with 10-bit resolution. These pins can measure from ground to 5V. However, the upper value can be changed using AREF and analogReference() function. I2C. Two pins 20 and 21 support I2C communication where 20 represents SDA (Serial Data Line mainly used for holding the data) and 21 represents SCL(Serial Clock Line mainly used for providing data synchronization between the devices) SPI Communication. SPI stands for Serial Peripheral Interface used for the transmission of data between the controller and other peripherals components. Four pins i.e. 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS) are used for SPI communication. 4.2.5.3 Dimensions Follwoing figure shows the dimensions of the Arduino Mega 2560.
  • 40. 31 Figure 4.9: Arduino Mega Dimensions[8] • Arduino Mega is comparatively larger than other boards available in the market. It comes 4-inch length and 2.1-inch width. However, USB port and power jack are slightly extended from the given dimensions[11]. 4.2.5.4 Sheild Compatibility • Arduino Mega is compatible with most of the shields designed for other Arduino boards. • Before you intend to use a shield, make sure the operating voltage of the shield is compatible with the board voltage. Most of the shields operate at 3.3V or 5V which is compatible with this board, however, shields with higher operating voltage can damage the board. • Also, the header distribution of the shield must resonate with the pin distribution of the board, so you can simply attach the shield with the board and make it in a running condition.
  • 41. 32 Figure 4.10: Arduino Mega Sheild Compatibility[9] 4.2.5.5 Programming • Arduino Mega 2560 can be programmed using Arduino Software called IDE which supports C programming. • The code you make on the software is called sketch which is burned in the software and then transferred to the board through USB cable. • This board comes with a built-in bootloader which rules out the usage of an external burner for burning the code into the board. • The bootloader communicates using STK500 protocol. • Once you compile and burn the program on the board, you can unplug the USB cable which eventually removes the power from the board. When you intend to incorporate the board into your project, you can power it up using power jack or Vin of the board. • Multitasking is another feature where Arduino mega comes handy. However, Arduino IDE Software doesn’t support multitasking feature but you can use other operating systems like FreeRTOS and RTX to write C program for this purpose. This gives you the flexibility of using your own custom build program using ISP connector[7]. 4.2.5.6 Applications Arduino Mega 2560 is an ideal choice for the projects requiring more memory space to used with more number of number pins on the board. Following are the main applications of the Arduino mega boards.
  • 42. 33 • Developing 3D printer • Controlling and handling more than one motors • Interfacing of number of sensors • Sensing and detecting temperature • Water level detection projects • Home automation and security systems • Embedded Systems • IoT applications • Parallel programming and Multitasking That’s all about Arduino Mega microcontroller [8]. 4.2.6 Arduino UNO • Arduino Uno is a microcontroller board developed by Arduino.cc which is an open-source electronics platform mainly based on AVR microcontroller Atmega328. • First Arduino project was started in Interaction Design Institute Ivrea in 2003 by David Cuartielles and Massimo Banzi with the intention of providing a cheap and flexible way to students and professional for controlling a number of devices in the real world. • The current version of Arduino Uno comes with USB interface, 6 analog input pins, 14 I/O digital ports that are used to connect with external electronic circuits. Out of 14 I/O ports, 6 pins can be used for PWM output.
  • 43. 34 • It allows the designers to control and sense the external electronic devices in the realworld[10]. Figure 4.11: Arduino Uno [10] • This board comes with all the features required to run the controller and can be directly connected to the computer through USB cable that is used to transfer the code to the controller using IDE (Integrated Development Environment) software, mainly developed to program Arduino. IDE is equally compatible with Windows, MAC or Linux Systems, however, Windows is preferable to use. Programming languages like C and C++ are used in IDE. • Apart from USB, battery or AC to DC adopter can also be used to power the board. • Arduino Uno boards are quite similar to other boards in Arduino family in terms of use and functionality, however, Uno boards don’t come with FTDI USB to Serial driver chip.
  • 44. 35 • There are many versions of Uno boards available, however, Arduino Nano V3 and Arduino Uno are the most official versions that come with Atmega328 8-bit AVR Atmel microcontroller where RAM memory is 32KB. • When nature and functionality of the task go complex, Mirco SD card can be added in the boards to make them store more information. 4.2.6.1 Features of Arduino UNO • Arduino Uno comes with USB interface i.e. USB port is added on the board to develop serial communication with the computer. • Atmega328 microcontroller is placed on the board that comes with a number of features like timers, counters, interrupts, PWM, CPU, I/O pins and based on a 16MHz clock that helps in producing more frequency and number of instructions per cycle. • It is an open source platform where anyone can modify and optimize the board based on the number of instructions and task they want to achieve. • This board comes with a built-in regulation feature which keeps the voltage under control when the device is connected to the external device[9].
  • 45. 36 Figure 4.12: Arduino Uno Pin[11] • Reset pin is added in the board that reset the whole board and takes the running program in the initial stage. This pin is useful when board hangs up in the middle of the running program; pushing this pin will clear everything up in the program and starts the program right from the beginning. • There are 14 I/O digital and 6 analog pins incorporated in the board that allows the external connection with any circuit with the board. These pins provide the flexibility and ease of use to the external devices that can be connected through these pins. There is no hard and fast interface required to connect the devices to the board. Simply plug the external device into the pins of the board that are laid out on the board in the form of the header. • The 6 analog pins are marked as A0 to A5 and come with a resolution of 10bits. These pins measure from 0 to 5V, however, they can be configured to the high range using analogReference() function and AREF pin. • 13KB of flash memory is used to store the number of instructions in the code
  • 46. 37 • Only 5 V is required to turn the board on, which can be achieved directly using USB port or external adopter, however, it can support external power source up to 12 V which can be regulated and limit to 5 V or 3.3 V based on the requirement of the project. 4.2.6.2 Arduino Uno Pinout Arduino Uno is based on AVR microcontroller called Atmega328. This controller comes with 2KB SRAM, 32KB of flash memory, 1KB of EEPROM. Arduino Board comes with 14 digital pins and 6 analog pins. ON-chip ADC is used to sample these pins. A 16 MHz frequency crystal oscillator is equipped on the board. Following figure shows the pinout of the Arduino Uno Board. Figure 4.13: Arduino Uno Pinout[7] 4.2.6.3 Pin Description There are several I/O digital and analog pins placed on the board which operates at 5V. These pins come with standard operating ratings ranging between 20mA to 40mA.
  • 47. 38 Internal pull-up resistors are used in the board that limits the current exceeding from the given operating conditions. However, too much increase in current makes these resisters useless and damages the device. LED. Arduino Uno comes with built-in LED which is connected through pin 13. Providing HIGH value to the pin will turn it ON and LOW will turn it OFF. Vin. It is the input voltage provided to the Arduino Board. It is different than 5 V supplied through a USB port. This pin is used to supply voltage. If a voltage is provided through power jack, it can be accessed through this pin. 5V. This board comes with the ability to provide voltage regulation. 5V pin is used to provide output regulated voltage. The board is powered up using three ways i.e. USB, Vin pin of the board or DC power jack.USB supports voltage around 5V while Vin and Power Jack support a voltage ranges between 7V to 20V. It is recommended to operate the board on 5V. It is important to note that, if a voltage is supplied through 5V or 3.3V pins, they result in bypassing the voltage regulation that can damage the board if voltage surpasses from its limit. GND. These are ground pins. More than one ground pins are provided on the board which can be used as per requirement. Reset. This pin is incorporated on the board which resets the program running on the board. Instead of physical reset on the board, IDE comes with a feature of resetting the board through programming. IOREF. This pin is very useful for providing voltage reference to the board. A shield is used to read the voltage across this pin which then select the proper power source. PWM. PWM is provided by 3,5,6,9,10, 11pins. These pins are configured to provided 8-bit output PWM. SPI. It is known as Serial Peripheral Interface. Four pins 10(SS), 11(MOSI), 12(MISO), 13(SCK) provide SPI communication with the help of SPI library. AREF. It is called Analog Reference. This pin is used for providing a reference voltage to the analog inputs.
  • 48. 39 TWI. It is called Two-wire Interface. TWI communication is accessed through Wire Library. A4 and A5 pins are used for this purpose. Serial Communication. Serial communication is carried out through two pins called Pin 0 (Rx) and Pin 1 (Tx). Rx pin is used to receive data while Tx pin is used to transmit data. External Interrupts. Pin 2 and 3 are used for providing external interrupts. An interrupt is called by providing LOW or changing value. 4.2.6.4 Communication and Programming Arduino Uno comes with an ability of interfacing with other other Arduino boards, microcontrollers and computer. The Atmega328 placed on the board provides serial communication using pins like Rx and Tx. The Atmega16U2 incorporated on the board provides a pathway for serial communication using USB com drivers. Serial monitor is provided on the IDE software which is used to send or receive text data from the board. If LEDs placed on the Rx and Tx pins will flash, they indicate the transmission of data. Arduino Uno is programmed using Arduino Software which is a cross-platform application called IDE written in Java. The AVR microcontroller Atmega328 laid out on the base comes with builtin bootloader that sets you free from using a separate burner to upload the program on the board. 4.2.6.5 Applications Arduino Uno comes with a wide range of applications. A larger number of people are using Arduino boards for developing sensors and instruments that are used in scientific research. Following are some main applications of the board. • Embedded System • Security and Defense System • Digital Electronics and Robotics
  • 49. 40 • Parking Lot Counter • Weighing Machines • Traffic Light Count Down Timer • Medical Instrument • Emergency Light for Railways • Home Automation • Industrial Automation Arduino comes with a big community that is developing and sharing the knowledge with a wide range of audience. Quick support is available pertaining to technical aspects of any electronic project. When you decide Arduino board over other controllers, you don’t need to arrange extra peripherals and devices as most of the functions are readily available on the board that makes your project economical in nature and free from a lot of technical expertise [22].
  • 50. 41 Chapter 5 System simulation 5.1 Overview In this section, we will discuss the design and implementation of the gas leakage detector which ensures the medical safety for the users. 5.2 Project View Hardware Configuration: Here we configure our hardware types of equipment with Arduino Mega board. Here we include a GSM Module, Flame sensor, Gas sensor and water pump. We connect USB to UART converter in a 3.3 v pin. Figure 5.1: Hardware Configuration Assembling with Arduino Mega: Here we have used a power bank to supply 5v power on our small pc. On the other hand our gas leakage detector is ready to fix with our hardware devices.
  • 51. 42 Figure 5.2: Hardware Assembling With Gas Detector Monitoring Display show all condition of the room! Data Sending: Here we are waiting for the signal. When gas or fire detect data send to our server as shown in Figure. Figure 5.3: Smart House SMS: Emergency contact numbers and Fire Service will get SMS from our system automatically.
  • 52. 43 Figure 5.4: GSM is in Working Mode Figure 5.5: Gas Sensor is Working)
  • 53. 44 Figure 5.6: Display show the room temperature Figure 5.7: Circuit Breaker off
  • 54. 45 Figure 5.8: Room 1 is in safe position Figure 5.9: Room 2 is in safe position
  • 55. 46 Figure 5.10: Data Send to the Server
  • 56. 47 Chapter 6 Conclusion and Future work First, introduce the work and then briefly state the major results, then state the major points of the discussion. Finally, end with a statement of how this work contributes to the overall field of study 6.1 Conclusion The objective of the project was to design and implement a cooking gas detector capable of giving an audiovisual warning when there is gas leakage. The detector has been designed that uses a PIC16F690 microcontroller and an MQ-6 gas sensor. The detector shows a green LED to show that there is no gas leakage. When there is a gas leakage the detector flashes a red and sound an alarm. The detector has an alarm acknowledgement button that can be used to put off the alarm when necessary. The detector used an LCD to show the concentration of the gas leakage. The sensor is capable of showing a gas concentration from 300ppm to 10,000ppm. The use of a microcontroller makes the detector to have high accuracy in displaying the gas concentration according to the relationship that exists between the sensor voltage and gas concentration. The detector is low cost. The components that go into making the detector does not exceed 1600KShs. If this is done with mass production then the detector can go for a price of 1500ksh which would very easily affordable and competitive in the market. The objective of designing a highly accurate low cost a microcontroller based cooking gas leakage detector has been well achieved.
  • 57. 48 6.2 Limitations Here we have described about limitation of our Fire and Gas leakage detector. • Barriers such as closed or partially closed doors, walls, or chimneys may inhibit flow. • Smoke particles may become”cold” and stratify, and may not reach the ceiling or upper walls where detectors are located. • Smoke particles may be blown away from detectors by air outlets. • Smoke particles may be drawn into air returns before reaching the detector. Despite how this project might look good it is still wanting. The use of an alarm, LED and LCD as the alarm system is not enough. This requires a personal presence in the vicinity to be notified when there is gas leakage. This detection system can be improved by including a GSM module for sending an SMS alert to a mobile phone. This way, wherever someone is, he can be notified when there a gas leakage. To improve the safety of people and property, the SMS alert can be sent to the relevant authority like the fire brigade department to deal with the gas leakage issue if the gas leakage as reached very high concentration. The inclusion of a fire detector would greatly improve the performance of this gas detector system. There has been a gas leakage, has there been a fire that has started? The fire detector can help to inform whether things have gone worse for quick safety actions to be taken. To take this gas detection system to new perfection, the gas can be supplied with a smart regulator which can be turned off remotely or by sending a signal. Thus when the detector has detected gas leakage even before it sounds the alarm and sends the alerts, the microcontroller should send a signal to switch off the gas. To effectively implement all this good design features a higher level of microcontroller would be useful. PIC16F690 microcontroller is a mid-range microcontroller by Microchip. Microchip have PIC18 series which are a higher level microcontroller with more pins and features such as priority interrupts which would help to easily incorporate the improvement to this gas leakage detection system.
  • 58. 49 6.3 Future Works There are many ways in which this gas leak detector can be modified and made more complex by including more advanced features into it. The GSM module enables us to send the gas leak message to the relevant stakeholders and hence it increases the efficiency of this system [13-16]. Usage of GSM module for this detector prevents the accidents from taking a hazardous turn. The other modification which can be implemented in this gas leak detector is using a tripper circuit which will trip off the main supply once the gas leak is detected. During a gas leak, it is dangerous to switch any appliances as it may spark and this tripper circuit helps to reduce the electrical hazards that can be caused due to a gas leak [17, 18]. Along with the tripping off of the main supply, it is very much necessary to turn off the gas regulator so that no further leakage of the gas occurs [19, 20, 21]. A robot has been used in replacing a human for handling various tasks in a hazardous and dangerous workplace where human life may at risk. A mobile gas sensing robot can be constructed to sense the leakage of gas through pipelines as the robot can move on a track which is situated along the length of the pipeline. This technique further increases the overall efficiency of the system and makes the system a perfect gas leak detector providing overall safety of the residents.
  • 59. 50 Bibliography [1] S. Belsito, P. Lombardi, P. Andreussi, and S. Banerjee, “Leak detection in liquefied gas pipelines by artificial neural networks,” AIChE Journal, vol. 44, no. 12, pp. 2675–2688, 1998. [2] F. W. Bernett and L. J. Fioravanti, “Early leak detection system for a disc drive containing a low-density gas,” Nov. 11 2003, uS Patent 6,646,821. [3] R. E. Hoffman, “Medical gas alarm system,” Oct. 15 1991, uS Patent 5,057,822. [4] Z. Qu, H. Feng, Z. Zeng, J. Zhuge, and S. Jin, “A svm-based pipeline leakage detection and pre-warning system,” Measurement, vol. 43, no. 4, pp. 513–519, 2010. [5] J. Rajtar and R. Muthiah, “Pipeline leak detection system for oil and gas flowlines,” Journal of Manufacturing Science and Engineering, Transactions of the ASME, vol. 119, no. 1, pp. 105–109, 1997. [6] T. Sato, T. Kanagawa, K. Sumida, and T. Nishio, “Gas visualizing apparatus and method for detecting gas leakage from tanks or piping,” Jul. 4 1995, uS Patent 5,430,293. [7] “Us4489239a - portable remote laser sensor for methane leak detection google patents,” https://patents.google.com/patent/US4489239A/en, (Accessed on 04/09/2019). [8] “Introduction to arduino mega 2560 - the engineering projects,” https://www.theengineeringprojects.com/2018/06/introduction-to-arduinomega- 2560.html, (Accessed on 04/09/2019).
  • 60. 51 [9] “Us5001346a - leak detection system with background compensation - google patents,” https://patents.google.com/patent/US5001346A/en, (Accessed on 04/09/2019). [10] “Us4919599a - pumping system for a leak detecting device - google patents,” https://patents.google.com/patent/US4919599A/en, (Accessed on 04/09/2019). [11] “Compact, stable and efficient all-fibre gas cells using hollow-core photonic crystal fibres — nature,” https://www.nature.com/articles/nature03349, (Accessed on 04/09/2019). [12] L. Fraiwan, K. Lweesy, A. Bani-Salma, and N. Mani, “A wireless home safety gas leakage detection system,” in 2011 1st Middle East Conference on Biomedical Engineering. IEEE, 2011, pp. 11–14. [13] P.-S. Murvay and I. Silea, “A survey on gas leak detection and localization techniques,” Journal of Loss Prevention in the Process Industries, vol. 25, no. 6, pp. 966–973, 2012. [14] V. J. Diduck, “Integrated local or remote control liquid gas leak detection and shut-off system,” Feb. 15 2000, uS Patent 6,025,788. [15] A. Shrivastava, R. Prabhaker, R. Kumar, and R. Verma, “Gsm based gas leakage detection system,” International Journal of Emerging Trends in Electrical and Electronics (IJETEE-ISSN: 2320-9569), vol. 3, no. 2, 2013. [16] K. Fukushima, R. Maeshima, A. Kinoshita, H. Shiraishi, and I. Koshijima, “Gas pipeline leak detection system using the online simulation method,” Computers & chemical engineering, vol. 24, no. 2-7, pp. 453–456, 2000. [17] W. Liang, L. Zhang, Q. Xu, and C. Yan, “Gas pipeline leakage detection based on acoustic technology,” Engineering Failure Analysis, vol. 31, pp. 1–7, 2013. [18] T. G. McRae Jr, “Backscatter absorption gas imaging system,” Nov. 26 1985, uS
  • 61. 52 Patent 4,555,627. [19] W. E. Lowry, S. D. Dunn, R. Walsh, D. Merewether, D. V. Rao et al., “Method and system to locate leaks in subsurface containment structures using tracer gases,” Mar. 14 2000, uS Patent 6,035,701. [20] W. S. Cochran and J. A. Graeber, “Fluid delivery pipe with leak detection,” Mar. 7 2000, uS Patent 6,032,699. [21] L. F. Donaghey, “Resistive hydrocarbon leak detector,” Dec. 30 1986, uS Patent 4,631,952. [22] “Introduction to arduino uno - the engineering projects,” https://www.theengineeringprojects.com/2018/06/introduction-to- arduinouno.html, (Accessed on 04/09/2019).