SlideShare a Scribd company logo
1 of 50
Download to read offline
Title
Gas detection using Arduino microcontroller
By
Ahmed Waheed
Ali Shadaa
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
ii
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:
iii
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
Ali Shadaa
2023
iv
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.
v
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 (Compressed natural gas), buses cars where appliances and heaters that use
natural gas and liquid petroleum gas (LPG) may be a source of risk. 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,
type of gas module will send emergency alarm to service station or personal invoice,
emergency measure the power line automatically cut-off. The device was tested using
LPG gas, smoke , putan 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.
vi
Table of Contents
Declaration ii
Dedication iii
Acknowledgements iv
Abstract v
Table of Contents vi
List of Tables viii
List of Figures ix
List of Abbreviations x
List of Symbols xi
CHAPTER 1 INTRODUCTION 1
1.1 Problem Statement 3
1.2 Motivations 4
1.3 Aims and Objectives 5
1.4 Project Contribution 5
1.4.1 Contributions 5
1.5 Thesis Organisation 5
CHAPTER 2 LITERATURE REVIEW 7
2.1. Project Review 7
vii
CHAPTER 3 THEORETICAL APPROACH 11
3.1 Microcontroller 16
3.2 Why Arduino 19
3.3 The LCD 16×2 23
3.4 Variable Resistors 24
3.4.1 Potentiometer 25
3.4.2 Trimmer Potentiometer 26
3.4.3 Slider Potentiometer 26
CHAPTER 4 EXPERIMENTAL WORK 27
4.1 DETECTORCIRCUIT PRENCIPLE 27
4.2 Working of Arduino based Smoke & Gas Detector 28
CHAPTER 5 RESULTS AND DISCUSSION 30
5.1 Result and Disscution 30
CHAPTER 6 CONCLUSIONS AND FUTUREWORK 34
6.1 Conclusion 34
6.2 Future Work 34
References 36
Appendix 1 37
viii
List of Tables
Table 1.The table caption 4
ix
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
x
List of Abbreviations
LPG LIQUID PETRULIUM GAS
LCD LIQUID CRYSTAL DISPLAY
NGC NORTH GAS COMPANY
xi
List of Symbols
ABC The full name of the symbol, in Sentence Case.
Abc ………………………………………………………….
Ab Cd …………………………………………………...……..
1
CHAPTER 1 INTRODUCTION
This 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 Iraq approxmitly. 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 Bagdad
on Oct 6 2022, causing suspension of traffic movement on the busy AL-qasim
highway for about three and a half hours. Gas from the 10-inch tank leaked near
check point around 9:00 am[12].
The woman who was burnt in a fire at a car in Baghdad has succumbed to her
injuries. Afire had broken out at the car of in street on the morning of Feb 26,
leaving five— the couple and their three sons—injured [13].
One killed, 6 others injured in gas cylinder tank blast in Basra. The accident
occurred on Friday 16 November 2021. An eight-year-old child has been killed,
and six people have sustained burn injuries, in a gas cylinder explosion [14].
In Iraq, 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
North Gas Company (NGC) 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 that almost 80% of the cylinders of NGC are unusable after an
explosion that took place at a NGC depot in Kirkuk in last year that completely
destroyed 300 cylinders and burnt 3 trucks and luckily no human was injured in
that incident [15].
2
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 is not 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 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
3
to design a gas leakage detector which has to work on 5 stages of gas leakage,
those are,
a. First gas 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 change the sensitivity of sensor to
measure the data.
To develop this project, have to use Arduino UNO board, LED, Brazzers, MQ2
module, LCD Display and variable resistance with air vacuumed.
1.1 Problem Statement
Clearly here 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 alert automatically to the owner with guess the gas
type.
1.2 Motivations
In this section, 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, and
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 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
2022.
• 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.
According to the data from 2016 to the 2022 year from the IMO, around 500
hundred people were killed on IRAQ due to LPG gas leakage.
5
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 alert to emergency
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 multi projects 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 control based alert system which
was not found the existing system. We are working to develop a unique ideas
which helps people in many ways
1.5 Thesis Organisation
• Chapter 2: In this chapter, have to describe the literature review, the
research gap and proposed solution of our developing system.
• Chapter 3: Used Technologies: In this chapter, have to describe the
technologies we used described our front end and back-end technologies.
6
• Chapter 4: Design and implementation: In this chapter, 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
This chapter presents related work, Literature review, Research gap and our
movement that 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 alert to the nearest home owner and constraction
of gas.
2.1. Project Review
IoT (Internet of things) 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 gas.
8
Figure 2.1: Block Diagram of Gas Leakage Detector
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 monoxide Metal Oxide
Semiconductor sensors-used for both to sensor-used for combustible gases such
hydrocarbon gases Infrared Sensors-used for combustible gases [5]. The 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 (300PPM)
9
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-2 sensor offers a [6]High Sensitivity to LPG gas A Detection Range: 300 -
10,000 PPM Fast Response Time: 10sSimple drive circuit Heater 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 6
alarm 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
10
the gas concentration.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-
2 sensor which uses Tin Oxide as the sensing material. The micro-controller being
used is the ATMEGA328 microcontroller by Microchip. The LCD being used is the
display the result .The detector will use variable resistance to increase or decrease
the sensitvity and Buzzer as the alarm. All these components are powered using a
5V supply. The 5V is supplied using available 5V voltage regulatorsICs and a 9V
battery [5].the analyser is Arduino Uno.
Gas sensor
Input to MQ2
via pipe
Vacuum
motor with
variable
resistance
11
CHAPTER 3 THEORETICAL APPROACH
MQ2 gas sensor is a widely used gas sensor for detecting a variety of gases
including smoke, methane, propane, butane, alcohol, and carbon monoxide. The
sensor works on the principle of detecting the changes in the resistance of the
metal oxide semiconductor (MOS) when exposed to a particular gas. In this article,
we will discuss the methodology for detecting different types of gases using the
MQ2 gas sensor.
1) Smoke Detection: The MQ2 gas sensor detects smoke by measuring the
resistance changes when it is exposed to smoke. The sensor has a built-in
heater that heats the metal oxide semiconductor (MOS) inside the sensor.
When smoke is present in the air, it absorbs the infrared radiation emitted
by the heater, which causes a drop in temperature and a corresponding
increase in resistance. The increase in resistance is detected by the sensor
and converted into a signal that can be processed by a microcontroller.
2) Methane and Propane Detection: The MQ2 gas sensor detects methane
and propane by measuring the resistance changes when it is exposed to
these gases. Both methane and propane are combustible gases that can be
found in natural gas and liquefied petroleum gas (LPG) systems. When
methane or propane is present in the air, it oxidizes on the surface of the
metal oxide semiconductor (MOS), causing a drop in resistance. The
decrease in resistance is detected by the sensor and converted into a signal
that can be processed by a microcontroller.
3) Butane and Alcohol Detection: The MQ2 gas sensor detects butane and
alcohol by measuring the resistance changes when it is exposed to these
gases. Both butane and alcohol are highly flammable and can be found in
fuels, solvents, and cleaning agents. When butane or alcohol is present in
the air, it reacts with the metal oxide semiconductor (MOS), causing a drop
in resistance. The decrease in resistance is detected by the sensor and
converted into a signal that can be processed by a microcontroller.
12
4) Carbon Monoxide Detection: The MQ2 gas sensor detects carbon
monoxide by measuring the resistance changes when it is exposed to this
gas. Carbon monoxide is a colorless, odorless, and poisonous gas that can
be found in combustion fumes from vehicles, generators, and stoves. When
carbon monoxide is present in the air, it reduces the oxygen content on the
surface of the metal oxide semiconductor (MOS), causing a drop in
resistance. The decrease in resistance is detected by the sensor and
converted into a signal that can be processed by a microcontroller.
In conclusion, the MQ2 gas sensor is a versatile gas sensor that can detect a
variety of gases by measuring the changes in resistance when exposed to these
gases. The sensor is widely used in applications such as gas leak detection, smoke
detection, and air quality monitoring.The MQ2 gas sensor is a commonly used gas
detector that can detect a variety of gases such as smoke, methane, propane,
alcohol, and hydrogen. The sensor works by detecting changes in the resistance
of a metal oxide semiconductor when it comes into contact with a target gas.
To use the MQ2 gas sensor, you will need to connect it to a microcontroller or
other electronic device that can read its output. The output signal from the sensor
is an analog voltage that corresponds to the concentration of the target gas in the
air. To control the gas detected by the MQ2 sensor, you will need to take action
based on the output signal from the sensor. For example, if the sensor detects a
high concentration of gas, you may want to activate an alarm or turn on a
ventilation system to reduce the concentration of the gas in the air.
It's important to note that the MQ2 gas sensor is a qualitative sensor and does not
provide precise measurements of gas concentrations. Therefore, it's
recommended to calibrate the sensor before use to ensure accurate results.
Calibration involves exposing the sensor to a known concentration of the target
gas and adjusting the output signal accordingly. Overall, the MQ2 gas sensor can
be a useful tool for detecting the presence of various gases, but it's important to
use it in conjunction with other safety measures to ensure proper control.
13
In this part, will discuss how to interface the MQ-2 gas sensor with an Arduino
Uno and read the gas concentration levels.
Requirements: To interface the MQ-2 gas sensor with an Arduino Uno, you will
need the following components:
1) MQ-2 gas sensor
2) Arduino Uno
3) Breadboard
4) Liquid crystal display
5) Jumper wires
6) 10kΩ resistor
7) Vacumm motor
8) LED light emitting diode
MQ-2 Gas Sensor Pinout:The MQ-2 gas sensor has four pins:
VCC: Connect this pin to the 5V pin of the Arduino Uno
GND: Connect this pin to the GND pin of the Arduino Uno
A0: Connect this pin to the analog input pin A0 of the Arduino Uno
D0: Digital output pin, which can be used to trigger an alarm when a certain gas
concentration level is reached. We won't be using this pin in this article.
Circuit Diagram: Connect the MQ-2 gas sensor to the breadboard and then connect
the pins as follows:
Connect the VCC pin of the MQ-2 gas sensor to the 5V pin of the Arduino Uno
Connect the GND pin of the MQ-2 gas sensor to the GND pin of the Arduino Uno
Connect the A0 pin of the MQ-2 gas sensor to the A0 pin of the Arduino Uno
Connect a 10kΩ resistor between the A0 pin and the GND pin of the MQ-2 gas
sensor
14
An Arduino based MQ2 sensor which will detect gas leakage. As we have seen the
use of various gases in various fields, if there is any leakage of any such gases, then
it can be detected and a harm can be minimized. It has a high response for LPG and
natural gases. It also detects smoke but has a small sensitivity towards it. As any of
these gases are detected the sensor will sense those and the buzzer alarm will be
turned on. Alarm will inform the locals that there is leakage of gas somewhere so
that they will take steps to minimize the harm. If the problem rises even after the
alarm and no steps are taken then owner of the place will be informed and if still no
action is taken then emergency services will be informed so as to minimize the
disaster.
Figure 3-1 MQ2 sensor
What is ppm for gas :Parts-per-million, or “ppm”, is commonly used as a fractional
unit of measure for concentration. As an example, a methane (molecular)
concentration of 2% means that 2 out of every 100 air molecules is methane.
Similarly, a methane concentration of 2 ppm means that 2 out of every 1 million air
molecules is methane.
Can MQ-2 detect CO2:A short and simple answer to this question is yes, it can
detect CO2. but before making any projects with this sensor please refer to the
datasheet of the module to know all outer pareamerts and conditions that are
required to measure CO2.
15
What is the difference between MQ-2 and MQ-5:MQ-2 can sense methane(CH4)
upto 20000 ppm whereas MQ5 can sense methane(CH4) only upto 10000 ppm.Is
this gas sensor analog or digital
Most of the gas sensors which are available in the market are mostly analog, but it
can be made digital with a Op-amp IC and a handful of digital components. You can
check out the schematic down below for more clarification.
Internal Schematics for MQ-2 Gas Sensor ModuleThe Circuit Diagram for the MQ-2
Gas and Smoke Detection Sensor Module is shown below. The schematic for this
module is very simple and needs a handful of components to build. If you are in a
hurry to build this circuit, the schematic shown below will come in handy.
Figure 3-2 MQ2 sensor connection circuit
16
3.1 Microcontroller
In Hardware section thoroughly discuss about the comparator circuit and the
following parts.
Arduino: To take the outputs from comparator circuit & compute the data for
calculation and to control the LCD, here we use a microcontroller atmega 238p
which comes with Arduino which is an open-source electronics prototyping
platform. Arduino can sense the environment by receiving input from a variety
of sensors and can affect its surroundings by controlling lights, motors, and
other actuators. The microcontroller on the board is programmed using the Arduino
programming language (based on Wiring) and the Arduino development
environment (based on Processing). Arduino projects can be standalone or they can
communicate with software running on a computer (e.g. Flash, Processing,
MaxMSP).We use Arduino uno to make our task easy. The Arduino Uno is a
microcontroller board based on the ATmega328 (datasheet). It has 14 digital
input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16
MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a
reset button. It contains everything needed to support the microcontroller;
Simply connect it to a computer with a USB cable or power it with a AC-to-DC
adapter or battery to get started. “Uno" means one in Italian and is named to mark
the upcoming release of Arduino.
A microcontroller (sometimes abbreviated µC, uC or MCU) is a small computer on a
single integrated circuit containing a processor core, memory, and
programmable input/output peripherals. Program memory in the form
of Ferroelectric RAM, NOR flash or OTP ROMis also often included on chip, as well
as a typically small amount of RAM. Microcontrollers are designed for embedded
applications, in contrast to the microprocessors used in personal computers or
other general purpose applications. Microcontrollers are used in automatically
controlled products and devices, such as automobile engine control systems,
implantable medical devices, remote controls, office machines, appliances, power
tools, toys and other embedded systems. By reducing the size and cost compared to
17
a design that uses a separate microprocessor, memory, and input/output devices,
microcontrollers make it economical to digitally control even more devices and
processes. Mixed signal microcontrollers are common, integrating analog
components needed to control non-digital electronic systems.
Some microcontrollers may use four-bit words and operate at clock
rate frequencies as low as 4 kHz, for low power consumption (single-digit mill watts
or microwatts). They will generally have the ability to retain functionality while
waiting for an event such as a button press or other interrupt; power consumption
while sleeping (CPU clock and most peripherals off) may be just nanosats, making
many of them well suited for long lasting battery applications. Other
microcontrollers may serve performance-critical roles, where they may need to act
more like a digital signal processor (DSP), with higher clock speeds and power
consumption.
The heart of Adriano is a microcontroller. Practically everything else on the board is
concerned with providing the board with power and allowing it to communicate
with desktop computers, what exactly do get when buy one of these little computers
to use in the projects.
The answer is that really do get a little computer on a chip. It has everything and
more than the first home computers had. It has a processor, a kilobyte of random
access memory (RAM) for holding data, a few kilobytes of erasable programmable
read-only memory (EPROM) or Flash memory for holding our programs, and it has
input and output pins. These input/output pins are what link the microcontroller to
the rest of our electronics. Inputs can read both digital (is the switch on or off) and
analog (what is the voltage at a pin).
This enables us to connect many different types of sensors for light, temperature,
sound, etc. Outputs can also be analog or digital. So, you can set a pin to be on or off
(0V or 5V) and this can turn LEDs on and off directly, or you can use the output to
control higher-power devices such as motors. They can also provide an analog
output voltage. That is, you can set the output of a pin to some particular voltage,
allowing you to control the speed of a motor or the brightness of a light.
18
Figure 3-3 Types of microcontrollers
Arduino is an open-source platform used for building electronics projects. Arduino
consists of both a physical programmable circuit board (often referred to as
a microcontroller) and a piece of software, or IDE (Integrated Development
Environment) that runs on your computer, used to write and upload computer code
to the physical board.
The Arduino platform has become quite popular with people just starting out with
electronics, and for good reason. Unlike most previous programmable circuit
boards, the Arduino does not need a separate piece of hardware (called a
programmer) in order to load new code onto the board – you can simply use a USB
cable. Additionally, the Arduino IDE uses a simplified version of C++, making it
easier to learn to program. Finally, Arduino provides a standard form factor that
breaks out the functions of the micro-controller into a more accessible package.
Arduino is a tool for making computers that can sense and control more of the
physical world than your desktop computer. It's an open-source physical computing
platform based on a simple microcontroller board, and a development environment
for writing software for the board.
Arduino can be used to develop interactive objects, taking inputs from a variety of
switches or sensors, and controlling a variety of lights, motors, and other physical
outputs. Arduino projects can be stand-alone, or they can communicate with
19
software running on your computer (e.g. Flash, Processing, MaxMSP.) The boards
can be assembled by hand or purchased preassembled; the open-source IDE can be
downloaded for free.
The Arduino programming language is an implementation of Wiring, a similar
physical computing platform, which is based on the Processing multimedia
programming environment.
3.2 Why Arduino
There are many other microcontrollers and microcontroller platforms available for
physical computing. Parallax Basic Stamp, Netmedia's BX-24, Phidgets, MIT's Handy
board, and many others offer similar functionality. All of these tools take the messy
details of microcontroller programming and wrap it up in an easy-to-use package.
Arduino also simplifies the process of working with microcontrollers, but it offers
some advantage for teachers, students, and interested amateurs over other systems:
Inexpensive - Arduino boards are relatively inexpensive compared to other
microcontroller platforms. The least expensive version of the Arduino module can
be assembled by hand, and even the pre-assembled Arduino modules cost less than
$50$.Cross-platform - The Arduino software runs on Windows, Macintosh OSX, and
Linux operating systems. Most microcontroller systems are limited to Windows.
Simple, clear programming environment - The Arduino programming environment
is easy-to-use for beginners, yet flexible enough for advanced users to take
advantage of as well. For teachers, it's conveniently based on the Processing
programming environment, so students learning to program in that environment
will be familiar with the look and feel of Arduino
Open source and extensible software- The Arduino software is published as open
source tools, available for extension by experienced programmers. The language can
be expanded through C++ libraries, and people wanting to understand the technical
details can make the leap from Arduino to the AVR C programming language on
which it's based. Similarly, you can add AVR-C code directly into your Arduino
programs.
20
Open source and extensible hardware - The Arduino is based on
Atmel's ATMEGA8 and ATMEGA168 microcontrollers. The plans for the modules
are published under a Creative Commons license, so experienced circuit designers
can make their own version of the module, extending it and improving it. Even
relatively inexperienced users can build the breadboard version of the module in
order to understand how it works and save money.The Uno is one of the more
popular boards in the Arduino family and a great choice for beginners.
Figure 3-4 shown Adriano UNO board
Figure 3-5 shown software of Arduino
21
In this practical over line the following:
1) What projects can be accomplished using an Arduino.
2) What is on the typical Arduino board and why.
3) The different varieties of Arduino boards.
4) Some useful widgets to use with board Arduino.
5) What is on the board
There are many varieties of Arduino boards that can be used for different
purposes. Some boards look a bit different from the one below, but most Arduinos
have the majority of these components in common:
Figure 3-6 Shawn construction of Adriano
Power (USB / Barrel Jack).Every Arduino board needs a way to be connected to a
power source. The Arduino UNO can be powered from a USB cable coming from your
computer or a wall power supply that is terminated in a barrel jack. In the picture
above the USB connection is labelled and the barrel jack is labelled .The USB
connection is also how is will load code onto your Arduino board. More on how to
program with Arduino can be found in this chapter. Do NOT use a power supply
greater than 20 Volts as you will overpower (and thereby destroy) Arduino. The
recommended voltage for most Arduino models is between 6 and 12 Volts. Pins (5V,
3.3V, GND, Analog, Digital, PWM, AREF) the pins on Arduino are the places where is
connect wires to construct a circuit (probably in conjunction with a bread-
board and some wire. They usually have black plastic ‘headers’ that allow you to just
plug a wire right into the board. The Arduino has several different kinds of pins, each
of which is labelled on the board and used for different functions.
22
GND (3): Short for ‘Ground’. There are several GND pins on the Arduino, any of
which can be used to ground your circuit.
5V (4) & 3.3V (5): As you might guess, the 5V pin supplies 5 volts of power, and the
3.3V pin supplies 3.3 volts of power. Most of the simple components used with the
Arduino run happily off of 5 or 3.3 volts.
Analog (6): The area of pins under the ‘Analog In’ label (A0 through A5 on the UNO)
are Analog In pins. These pins can read the signal from an analog sensor (like
a temperature sensor) and convert it into a digital value that we can read.
Digital (7): Across from the analog pins are the digital pins (0 through 13 on the
UNO). These pins can be used for both digital input (like telling if a button is pushed)
and digital output (like powering an LED).
PWM (8): You may have noticed the tilde (~) next to some of the digital pins (3, 5,
6, 9, 10, and 11 on the UNO). These pins act as normal digital pins, but can also be
used for something called Pulse-Width Modulation (PWM). We have but for now,
think of these pins as being able to simulate analog output (like fading an LED in and
out).
AREF (9): Stands for Analog Reference. Most of the time can leave this pin alone. It
is sometimes used to set an external reference voltage (between0 and 5 Volts) as the
upper limit for the analog input pins.
Reset Button: The Arduino has a reset button. Pushing it will temporarily connect
the reset pin to ground and restart any code that is loaded on the Arduino. This can
be very useful if your code doesn’t repeat, but you want to test it multiple times.
Unlike the original Nintendo however, blowing on the Arduino doesn’t usually fix
any problems.
Power LED Indicator: Just beneath and to the right of the word “UNO” on your
circuit board, there’s a tiny LED next to the word ‘ON’. This LED should light up
whenever you plug your Arduino into a power source. If this light doesn’t turn on,
there’s a good chance something is wrong. Time to re-check your circuit!
23
TX RX LEDs: TX is short for transmit, RX is short for receive. These markings appear
quite a bit in electronics to indicate the pins responsible for serial communication.
In our case, there are two places on the Arduino UNO where TX and RX appear –
once by digital pins 0 and 1, and a second time next to the TX and RX indicator LEDs.
These LEDs will give us some nice visual indications whenever our Arduino is
receiving or transmitting data (like when we’re loading a new program onto the
board).
Main IC: The black thing with all the metal legs is an IC, or Integrated Circuit .Think
of it as the brains of our Arduino. The main IC on the Arduino is slightly different
from board type to board type, but is usually from the AT mega line of IC’s from the
ATMEL Company. This can be important, as you may need to know the IC type (along
with your board type) before loading up a new program from the Arduino software.
This information can usually be found in writing on the top side of the IC. If you want
to know more about the difference between various IC’s, reading the datasheets is
often a good idea.
Voltage Regulator: The voltage regulator is not actually something can (or should)
interact with on the Arduino. But it is potentially useful to know that it is there and
what it’s for. The voltage regulator does exactly what it says – it controls the amount
of voltage that is let into the Arduino board. Think of it as a kind of gatekeeper; it
will turn away an extra voltage that might harm the circuit. Of course, it has its limits,
so don’t hook up your Arduino to anything greater than 20 volts.
3.3 The LCD 16×2
The term LCD stands for liquid crystal display. It is one kind of electronic display
module used in an extensive range of applications like various circuits & devices like
mobile phones, calculators, computers, TV sets, etc. These displays are mainly
preferred for multi-segment light-emitting diodes and seven segments. The main
benefits of using this module are inexpensive; simply programmable, animations,
and there are no limitations for displaying custom characters, special and even
animations, etc.
24
Figure 3-7 Shawn construction of LCD
A 16×2 LCD has two registers like data register and command register. The RS
(register select) is mainly used to change from one register to another. When the
register set is ‘0’, then it is known as command register. Similarly, when the register
set is ‘1’, then it is known as data register.
Command Register
The main function of the command register is to store the instructions of command
which are given to the display. So that predefined tasks can be performed such as
clearing the display, initializing, set the cursor place, and display control. Here
commands processing can occur within the register.
Data Register
The main function of the data register is to store the information which is to be
exhibited on the LCD screen. Here, the ASCII value of the character is the information
which is to be exhibited on the screen of LCD. Whenever we send the information to
LCD, it transmits to the data register, and then the process will be starting there.
When register set =1, then the data register will be selected.
3.4 Variable Resistors
Variable resistors are intended for use in applications where the equipment user has
frequent requirement for adjusting the resistance, as in tone, volume, focus, and
brightness controls.
25
There are two basic types of variable resistors, one called a potentiometer and the
other a rheostat. An example of the potentiometer is the volume control on your
radio, and an example of the rheostat is the dimmer control for the dash lights in an
automobile. There is a slight difference between them. Rheostats usually have two
connections, one fixed and the other moveable. Any variable resistor can properly
be called a rheostat. The potentiometer always has three connections, two fixed and
one moveable. Generally, the rheostat has a limited range of values and a high
current-handling capability. The potentiometer has a wide range of values, but it
usually has a limited current-handling capability. Potentiometers are usually
connected as voltage dividers.
3.4.1 Potentiometer
An example of a potentiometer is shown in the figure below, view A. Potentiometers
are made with either composition or wire wound resistance elements, and all
considerations to be mentioned in connection with fixed resistors having those
types of elements also apply to potentiometers.
Figure 3-8 Shawn construction of resistance
26
The basic components of the most widely used types of potentiometers are
shown in the figure above, views B and C. Although the shapes and sizes of the
various parts may vary with the wattage rating and with the particular production
techniques of the various manufacturers, the general arrangement is nearly always
the same. The only fundamental differences are in the types of resistance elements
used. The figure above (view B) shows construction with a wire wound resistance
element, and view C shows the same with a composition element. Both
constructions consist of a base, a resistance element with a terminal at each end, a
sliding contact arm (wiper) connected to the center terminal, a rotatable shaft
fastened to the contact arm, a threaded bushing, and a cover. The shaft can be turned
so that the contact arm can be set to any desired portion of the resistance element.
With different settings of the shaft, there are different resistances between either
end terminal and the contact-arm terminal. As is the case with fixed resistors, there
are a limited number of different wattage ratings available for potentiometer.
3.4.2 Trimmer Potentiometer
There are applications, in which the exact value of resistance required in the
circuit cannot be predicted or controlled with the required accuracy. In such
applications, it is helpful to have available a resistor (called trimmer potentiometer
or simply trimmer) which can be adjusted to the exact required value when the
equipment is aligned after assembly. Adjustment by the equipment user is
unnecessary, although a later adjustment may have to be made by a service
technician during equipment servicing. Since the resistor does not require frequent
resetting, no special pains are taken to make this adjustment particularly
convenient. One type of trimmer potentiometer is shown in the figure below. A
screw adjustment is used to change the resistance of this potentiometer.
3.4.3 Slider Potentiometer
A potentiometer that is adjusted by sliding the wiper along a straight resistance
element instead of rotating.
27
CHAPTER 4 EXPERIMENTAL WORK
System detects the level of gas in the air that exceeds the safety level it will
activate the alarm which includes the buzzer to alert the users at home of the
abnormal condition and to take any necessary action. The most tell-tale sign of a leak
is the smell of gas in the home. However, in the case of a carbon monoxide leak, there
are also particular physical symptoms you may suffer from if there is a leak. The
output result of this paper is that the leakage will be detected and stopped within 2
sec after the leakage starts. This system can even detect the level of gas leakage. This
is an efficient method for automatically detecting and controlling the gas leakage.
Moreover, the fire accidents are also prevented by switching off the power supply.
The idea for gas detection and control can be implemented at a large scale for
various industries. This system can be installed in a kitchen, at a hostel cafeteria, and
any other areas. This can be helpful in reducing accidents caused by gas leakage in
household as well as in any similar commercial set up. In our country there are 180
million people, and due to its low cost this product is affordable and will prevent
many accidents and save many properties and human lives
4.1 DETECTORCIRCUIT PRENCIPLE
In this project, we will make a smoke and gas leakage detector using Arduino.
We have used the MQ2 Gas sensor module to detect Smoke and carbon monoxide
concentrations present in Air. MQ2 is a versatile sensor that can detect LPG, smoke,
alcohol, propane, hydrogen, methane, carbon monoxide, etc. This makes the MQ2
Gas Sensor Module an excellent choice for building an indoor air quality monitoring
system, a Breathalyzer, or an early fire detection system.
Smoke and gas leakage detectors are really useful in detecting smoke or fire
in buildings. They are important safety parameters in order to avoid disasters.
Exploding cylinders and accidental fires have caused lots of damage to houses in the
past. This circuit triggers the alarm system when smoke or gas leakage is detected.
28
4.2 Working of Arduino based Smoke & Gas Detector
First, let’s see how this project works. The MQ2 sensor detects smoke and
Carbon Monoxide values and sends them to Arduino. Arduino then processes these
values and displays these values on the LCD 4X20 display. It also checks if these
values are above the safe level then it sends a command to the buzzer and a LED.
Then the buzzer starts alarming with a flashing LED.
Figure 4.1 algorthim of gas detecter
29
If the system detects the level of gas in the air that exceeds the safety level it
will activate the alarm which includes the buzzer to alert the users at home of the
abnormal condition and to take any necessary action. The most tell-tale sign of a leak
is the smell of gas in the home. However, in the case of a carbon monoxide leak, there
are also particular physical symptoms you may suffer from if there is a leak. The
output result of this paper is that the leakage will be detected and stopped within 2
s after the leakage starts. This system can even detect the level of gas leakage. This
is an efficient method for automatically detecting and controlling the gas leakage.
Moreover, the fire accidents are also prevented by switching off the power supply.
The idea for gas detection and control can be implemented at a large scale for
various industries. This system can be installed in a kitchen, at a hostel cafeteria, and
any other areas. This can be helpful in reducing accidents caused by gas leakage
This project can be used to detect gas leakages at home, in a car, storage tank
environment or in a service station. It can be easily implemented to industrial level
by upgrading its ranges. The implementation of this project is important in every
home, office and industries because there are many gases that can be harmful to
organic life, such as humans or animals. This project helps people to upgrade their
safety standards, comply statutory even though it has small sensitivity to detect
alcohol, it can be used as liquor tester. The project has excellent sensitivity
combined with a quick response time. It’s most important and basic function is to
prevent accidents and protect life and property from disaster. It provides along
lasting safety means for detecting the leakage of gas into the area of an appliance
when the appliance is in a shutdown condition or not in operation. It provide a novel
gas detection and monitoring system which is economical to manufacture and which
may be readily installed in conventional trailers, boats or the like which are
normally dependent upon a stored supply of pressurized gas.
30
CHAPTER 5 RESULTS AND DISCUSSION
5.1 Result and Disscution
The results obtain from the implemented of the gas leakage system. The
lighter was used as a gas that be detect by the detector and using the hairdryer to
get the changes of the temperature. The response of the reading was obtained using
the liquid crystal display. The sensitivity of the MQ-2 sensor to detect the
concentration of the gas is by changing the sensor resistance value. The resistor
value obtains from the serial monitor display by Arduino Ide.
The resistor value (RO) that be testing is from 6.00 Ω to 9.30 Ω. From the result
obtained, the relationship between the resistance value and the concentration of gas
per time. The result that show by the lcd is real-time response. The MQ-2 sensor not
only detect the concentration of the gas but it’s also detect the concentration of the
smoke. The result of the relationship was showed in table 4.1 and table 4.2.
31
cocentration of gas at safe (green on the left) & dangerous (red on the right)
level. Temperature at safe (left), medium (middle), & dangerous (right) level.
Recording to the Table 4.1 and Table 4.2 the higher the value of resistance
that adjusted by potentiometer, the low sensitive for the MQ2 gas sensor to detect
leakage gas. Based on the Figure 4.2, 4.3, 4.4, 4.5 and 4.6 the project was success
because the system can detect the leakage of gasses and the changes of temperature.
The concentration of gas and smoke reading changes the colour from the
green level or safe level to the red level or dangerous level when the reading of the
concentration in ppm unit is more than 100ppm. While the meter reading for the
temperature changes from safe level or green to the red when the reading of
temperature exceeds 32oC. A human nose has around 400 different types of scent
receptors that enable us to smell approx. 1 trillion different odors. But still, most of
us cannot identify the type of gas present in the atmosphere. Hence, there are
different sensors to measure accurate gas concentration in the atmosphere. Gas
detection sensors are most commonly used to develop an IoT-powered system and
32
identify the variation of toxic gases around an industrial facility. It helps benefit the
factories and refineries by keeping them safe against any unexpected threats like
explosions. Let's talk more about the applications and benefits of a gas monitoring
solution:
Applications:
Harmful Gas Detection : The sensing of toxic gases such as H2S, Methane, and CO
is of great importance in any industry to avoid unwanted leakage and consequences
like poisoning or explosions. The presence of these gases can be easily detected in
the industrial facilities and commercial buildings with the help of IoT-powered gas
monitoring solution. Moreover, a gas detector or sensor device is a crucial part to
carry out safe industrial operations. The sensor-enabled solution helps prevent the
high risk of gas explosions and affecting any casualties within and outside the
premises.
Fire Hazard Prevention: The gas sensors help detect the concentration of the gases
present in the atmosphere to avoid hazardous consequences like fire breakouts.
Also, it is an imperative solution to keep the plant workers and equipment safe from
fire hazards. It effectively detects the presence of hazardous gases like propane and
methane and alerts the plant authorities, preventing the premises from unexpected
ignition. Moreover, a gas monitoring solution uses gas analyzers to generate alerts
regarding the temperature increase. This allows the management to take immediate
actions to curb harmful fire explosions.
Oxygen Level Measurement: Sensing the presence of gases is a necessity to
conduct industrial operations as several pitmen had lost their lives due to lack of
oxygen in the process of mining explorations. A sudden decrease in the oxygen levels
can result in dizziness, brain damage, or even death among the workers working in
mines or close-packed industrial premises. A gas monitoring system significantly
benefits the industries by maintaining proper oxygen levels that reflect the optimal
performance of your workers. This system also creates alerts in real-time about the
decreasing oxygen levels, which gives enough time to take necessary measures to
evacuate the facilities much before the health gets affected.
33
Benefits
Get real-time alerts about the gaseous presence in the atmosphere
Prevent fire hazards and explosions
Supervise gas concentration levels
Ensure worker’s health
Real-time updates about leakages
Cost-effective installation
Data analytics for improved decisions
Measure oxygen level accuracy
Get immediate gas leak alerts
IoT networks are well-known for their low energy consumption and low power
transmission, which allows the assets to operate for a longer duration and generate
precise data information. An IoT-powered gas monitoring solution works through
sensors that provide accurate data regarding the presence of toxic gases in the
atmosphere. It is a very useful system to implement in the industries or plant
facilities to avoid catastrophic explosions. With the help of a gas monitoring solution,
you can successfully measure temperature and humidity in the atmosphere, which
results in improved plant facilities and ensures employee health safety.
34
CHAPTER 6 CONCLUSIONS AND FUTUREWORK
6.1 Conclusion
The design of a sensor-based automatic gas leakage detector with an alert
and control system has been proposed and discussed . This is a low-cost, low power,
lightweight, portable, safe, user friendly, efficient, multi featured and simple system
device for detecting gas. Gas leakage detection will not only provide us with
significance in the health department but it will also lead to raise our economy,
because when gas leaks it not only contaminates the atmosphere but also wastage
of gases will hurt our economy. In the open literatures it is noticed that much work
has not been done for a smart gas detection system. In future, more advanced
features will be integrated with this system which will provide users with more
safety and relaxation. The proliferation of handheld devices has led to developments
in the field of smart gas sensors, which has considerably widened their scope of
application. The need for ensuring safety in workplaces is expected to be the key
driving force for the market over the coming years.
6.2 Future Work
Overall, software and hardware parts of the systems have been developed
and tested by introducing a small amount of LPG near gas sensor module. The
authors of this project are currently working to include multi functions with this
device. One of the notable future functions of this system is to add a sub system
where wastage of gas and the uses of gas can be monitored using this system.
The system is flexible as a greater number of sensors and relays can be added
to it according to the whole LPG supply setup in those premises. The author is adding
more software based intelligent functions with this system. This is an automatic gas
detection, control and alert system. In future this system will have a feature where
it can notify the emergency services if any accidents happen. A mobile app and web-
based app for real time monitoring also will be added. In the user app for this system
many smart features will be added.
35
The overall features will make the system safer for the users. The system will
be optimized for use in many places like the car, the home, industries and many
other places. After designing the final prototype with smart multifunctional features,
the system will be implemented in real life scenarios as a pilot project. A survey will
be done soon before using the system and another one will be done after
implementing the system to discover the KPI. Summarizing all the results, finding
and analysing a research article will be done and author has plans to submit into the
MDPI sensors journal for review. In the future project the features of this final
product will be compared with the available gas detector systems presented in other
articles.
36
References
[1] B. Sonkar, A. Sood, A. Ranjan, and A. Faisal, "Microcontroller Based LPG Leakage Detector Using
GSM Module," International Journal of Electrical and Electronics Research, vol. III, pp. 264-269, 2015.
[2] G. Arturson, "The tragedy of San Juanico—the most severe LPG disaster in history," Burns, vol. 13,
pp. 87-102, 1987.
[3] KHK, "Annual Report on Liquefied Petroleum Gas," The High-Pressure Gas Institute of Japan,
Tokyo2013.
[4] P. Petlee and R. Deepa, "Fires from LPG leaks on the rise; police cite negligence," in The Hindu, ed:
The Hindu, 2015.
[5] S. Eno-Abasi and G. Akutu, "Stemming cooking gas-related accidents/deaths," in The Guardian, ed:
The Guardian, 2017.
[6] G. Akhras, "Smart Materials and Smart Systems for The Future," Canadian Military Journal, 2000.
[7] Paul Fanning. (2012, March 15). Smart systems bring benefits to industrial applications. Available:
http://www.eurekamagazine.co.uk/design-engineeringfeatures/technology/smart-systems-bring
benefits-to-industrial-applications/40993/
[8] E. Adel and L. Micheal, "Smart cities: safety, security and privacy," Journal of Advanced Research,
2014.
[9] O. Osemwegie, S. John, K. Okokpujie, and I. Shorinwa, "Development of an electronic fare collection
system using stationary tap-out devices," in Proceedings - 2016 International Conference on
Computational Science and Computational Intelligence, CSCI 2016, 2017, pp. 234-236.
[10] V. O. Matthews, A. O. Ajala, S. I. Popoola, and A. A. Atayero, "Smart vehicular traffic management
system using RFID technology," in Lecture Notes in Engineering and Computer Science, 2017, pp. 414-
417.
[11] T. O. Takpor, J. Ademola, S. I. Popoola, J. A. Badejo, and A. A. Atayero, "Smart assistive mHealth
system for medication adherence in patients with Alzheimer's disease," in Lecture Notes in
Engineering and Computer Science, 2017, pp. 1076-1080.
[12] A. U. Adoghe, S. I. Popoola, O. M. Chukwuedo, A. E. Airoboman, and A. A. Atayero, "Smart weather
station for rural agriculture using meteorological sensors and solar energy," in Lecture Notes in
Engineering and Computer Science, 2017, pp. 323-326.
[13] V. Carmela and I. Ana, "Smart gas detection system," Institute of Electrical and Electronics
Engineering, 2017.
[14] A. Falohun, A. Oke, and B. Abolaji, "Dangerous Gas Detection using an Integrated Circuit and MQ-
9," International Journal of Computer Applications, 2016.
[15] R. Sushma and R. Manohar, "An Android Based Automatic Gas Detection and Indication Robot,"
International Journal of Computer Engineering and Applications, 2014.
[16] H. Mujawar, D. Bachuwar, and S. Kasbe, "Design and development of LPG gas leakage detection
and controlling system," Solapur University Research Journal, vol. IV, 2015.
[17] S. Rajitha and T. Swapna, "Security alert system using GSM for gas leakage," International Journal
of VLSI and Embedded Systems-IJVES, vol. 3, pp. 173-175, 201
37
Appendix 1
#include <MQ2.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
//I2C pins declaration
LiquidCrystal_I2C lcd(0x27, 16, 2);
int Analog_Input = A0;
int lpg, co, smoke;
MQ2 mq2(Analog_Input);
void setup(){
Serial.begin(9600);
lcd.begin();//Defining 16 columns and 2 rows of lcd display
lcd.backlight();
mq2.begin();
}
void loop(){
38
float* values= mq2.read(true); //set it false if you don't want to print the values in
the Serial
//lpg = values[0];
lpg = mq2.readLPG();
//co = values[1];
co = mq2.readCO();
//smoke = values[2];
smoke = mq2.readSmoke();
lcd.setCursor(0,0);
lcd.print("LPG:");
lcd.print(lpg);
lcd.print(" CO:");
lcd.print(co);
lcd.setCursor(0,1);
lcd.print("SMOKE:");
lcd.print((smoke*100)/1000000);
lcd.print(" %");
delay(1000);
}
39

More Related Content

What's hot

Solar tracking system
Solar tracking systemSolar tracking system
Solar tracking system
Parviz Bora
 
Zeroth Review Model Slide
Zeroth Review Model SlideZeroth Review Model Slide
Zeroth Review Model Slide
enggshankar
 
Solar tracking system by naidu
Solar tracking system by naiduSolar tracking system by naidu
Solar tracking system by naidu
Naidu Turpati
 

What's hot (20)

Solar Charge Controller
Solar Charge ControllerSolar Charge Controller
Solar Charge Controller
 
SolaR charger
SolaR chargerSolaR charger
SolaR charger
 
Smart grid
Smart gridSmart grid
Smart grid
 
Iitbombay report
Iitbombay reportIitbombay report
Iitbombay report
 
Heart rate monitoring system using arduino
Heart rate monitoring system using  arduinoHeart rate monitoring system using  arduino
Heart rate monitoring system using arduino
 
Smart irrigation system using Internet Of Things
Smart irrigation system using Internet Of ThingsSmart irrigation system using Internet Of Things
Smart irrigation system using Internet Of Things
 
Finger print authentication for bikes
Finger print authentication for bikes Finger print authentication for bikes
Finger print authentication for bikes
 
ELECTROMAGNETIC BOMB (EMB) SEMINAR PRESENTATION
ELECTROMAGNETIC BOMB (EMB) SEMINAR PRESENTATIONELECTROMAGNETIC BOMB (EMB) SEMINAR PRESENTATION
ELECTROMAGNETIC BOMB (EMB) SEMINAR PRESENTATION
 
Mine workers protection slides
Mine workers protection slidesMine workers protection slides
Mine workers protection slides
 
Smart Grid ppt
Smart Grid pptSmart Grid ppt
Smart Grid ppt
 
IR proximity sensor report file.
IR proximity sensor report file.IR proximity sensor report file.
IR proximity sensor report file.
 
Solar tracking system
Solar tracking systemSolar tracking system
Solar tracking system
 
Zeroth Review Model Slide
Zeroth Review Model SlideZeroth Review Model Slide
Zeroth Review Model Slide
 
GSM Based SMS fire alert system
GSM Based SMS fire alert systemGSM Based SMS fire alert system
GSM Based SMS fire alert system
 
cours de rayonnement x
cours de  rayonnement xcours de  rayonnement x
cours de rayonnement x
 
Solar tracking system by naidu
Solar tracking system by naiduSolar tracking system by naidu
Solar tracking system by naidu
 
Power Theft Identification and Monitoring using GSM module
Power Theft Identification and Monitoring using GSM modulePower Theft Identification and Monitoring using GSM module
Power Theft Identification and Monitoring using GSM module
 
RECENT TRENDS IN MICRO GRIDS
     RECENT TRENDS IN MICRO GRIDS     RECENT TRENDS IN MICRO GRIDS
RECENT TRENDS IN MICRO GRIDS
 
Solar tracking system
Solar tracking systemSolar tracking system
Solar tracking system
 
@Smart farming using io t
@Smart farming using io t@Smart farming using io t
@Smart farming using io t
 

Similar to gas detction final thesis.pdf

Design_and_Development_of_Fire_and_Gas_L.pdf
Design_and_Development_of_Fire_and_Gas_L.pdfDesign_and_Development_of_Fire_and_Gas_L.pdf
Design_and_Development_of_Fire_and_Gas_L.pdf
OJAlazzawi
 
Design_and_Development_of_Fire_and_Gas_L.pdf
Design_and_Development_of_Fire_and_Gas_L.pdfDesign_and_Development_of_Fire_and_Gas_L.pdf
Design_and_Development_of_Fire_and_Gas_L.pdf
OJAlazzawi
 
Innovative Smart Gas Accident Detection and Prevention System for Nigeria
Innovative Smart Gas Accident Detection and Prevention System for NigeriaInnovative Smart Gas Accident Detection and Prevention System for Nigeria
Innovative Smart Gas Accident Detection and Prevention System for Nigeria
ijtsrd
 
Smart Automation Gas Level Monitoring with Gas Leakage Deduction and Refill B...
Smart Automation Gas Level Monitoring with Gas Leakage Deduction and Refill B...Smart Automation Gas Level Monitoring with Gas Leakage Deduction and Refill B...
Smart Automation Gas Level Monitoring with Gas Leakage Deduction and Refill B...
ijtsrd
 
consequence analysis & risk assessment of lpg transportation through rail an...
consequence analysis & risk assessment of lpg transportation through rail  an...consequence analysis & risk assessment of lpg transportation through rail  an...
consequence analysis & risk assessment of lpg transportation through rail an...
Amaldas P K
 

Similar to gas detction final thesis.pdf (20)

Design_and_Development_of_Fire_and_Gas_L.pdf
Design_and_Development_of_Fire_and_Gas_L.pdfDesign_and_Development_of_Fire_and_Gas_L.pdf
Design_and_Development_of_Fire_and_Gas_L.pdf
 
Design_and_Development_of_Fire_and_Gas_L.pdf
Design_and_Development_of_Fire_and_Gas_L.pdfDesign_and_Development_of_Fire_and_Gas_L.pdf
Design_and_Development_of_Fire_and_Gas_L.pdf
 
LPG Detection Mechatronic System
LPG Detection Mechatronic SystemLPG Detection Mechatronic System
LPG Detection Mechatronic System
 
GAS LEAKAGE DETECTOR
GAS LEAKAGE DETECTORGAS LEAKAGE DETECTOR
GAS LEAKAGE DETECTOR
 
Gas Leakage Detection, Prediction & Alert System Using Raspberry Pi & Cloud C...
Gas Leakage Detection, Prediction & Alert System Using Raspberry Pi & Cloud C...Gas Leakage Detection, Prediction & Alert System Using Raspberry Pi & Cloud C...
Gas Leakage Detection, Prediction & Alert System Using Raspberry Pi & Cloud C...
 
Final Year Project Idea
Final Year Project IdeaFinal Year Project Idea
Final Year Project Idea
 
LPG GAS DETECTOR presentation for engineers
LPG GAS DETECTOR presentation for engineersLPG GAS DETECTOR presentation for engineers
LPG GAS DETECTOR presentation for engineers
 
IRJET - IoT based LPG Gas Leakage Detection
IRJET - IoT based LPG Gas Leakage DetectionIRJET - IoT based LPG Gas Leakage Detection
IRJET - IoT based LPG Gas Leakage Detection
 
DESIGN AND IMPLEMENTATION OF AN INTELLIGENT GAS CYLINDER VALVE REGULATING SYS...
DESIGN AND IMPLEMENTATION OF AN INTELLIGENT GAS CYLINDER VALVE REGULATING SYS...DESIGN AND IMPLEMENTATION OF AN INTELLIGENT GAS CYLINDER VALVE REGULATING SYS...
DESIGN AND IMPLEMENTATION OF AN INTELLIGENT GAS CYLINDER VALVE REGULATING SYS...
 
DESIGN AND IMPLEMENTATION OF AN INTELLIGENT GAS CYLINDER VALVE REGULATING SYS...
DESIGN AND IMPLEMENTATION OF AN INTELLIGENT GAS CYLINDER VALVE REGULATING SYS...DESIGN AND IMPLEMENTATION OF AN INTELLIGENT GAS CYLINDER VALVE REGULATING SYS...
DESIGN AND IMPLEMENTATION OF AN INTELLIGENT GAS CYLINDER VALVE REGULATING SYS...
 
Innovative Smart Gas Accident Detection and Prevention System for Nigeria
Innovative Smart Gas Accident Detection and Prevention System for NigeriaInnovative Smart Gas Accident Detection and Prevention System for Nigeria
Innovative Smart Gas Accident Detection and Prevention System for Nigeria
 
A FUSION OF IoT BASED GAS LEAKAGE DETECTION
A FUSION OF IoT BASED GAS LEAKAGE DETECTIONA FUSION OF IoT BASED GAS LEAKAGE DETECTION
A FUSION OF IoT BASED GAS LEAKAGE DETECTION
 
Embedding Realtime Multilevel Gas Leakage Control System
Embedding Realtime Multilevel Gas Leakage Control SystemEmbedding Realtime Multilevel Gas Leakage Control System
Embedding Realtime Multilevel Gas Leakage Control System
 
Design of Advanced LPG Leakage Detection And Gas Leakage Accident Prevention ...
Design of Advanced LPG Leakage Detection And Gas Leakage Accident Prevention ...Design of Advanced LPG Leakage Detection And Gas Leakage Accident Prevention ...
Design of Advanced LPG Leakage Detection And Gas Leakage Accident Prevention ...
 
Smart Automation Gas Level Monitoring with Gas Leakage Deduction and Refill B...
Smart Automation Gas Level Monitoring with Gas Leakage Deduction and Refill B...Smart Automation Gas Level Monitoring with Gas Leakage Deduction and Refill B...
Smart Automation Gas Level Monitoring with Gas Leakage Deduction and Refill B...
 
GAS LEAKAGE DETECTION AND PREVENTION SYSTEM
GAS LEAKAGE DETECTION AND PREVENTION SYSTEMGAS LEAKAGE DETECTION AND PREVENTION SYSTEM
GAS LEAKAGE DETECTION AND PREVENTION SYSTEM
 
consequence analysis & risk assessment of lpg transportation through rail an...
consequence analysis & risk assessment of lpg transportation through rail  an...consequence analysis & risk assessment of lpg transportation through rail  an...
consequence analysis & risk assessment of lpg transportation through rail an...
 
Smart LPG System
Smart LPG SystemSmart LPG System
Smart LPG System
 
Automated Unified Trolley System for LPG Leakage Detection with Safety Measur...
Automated Unified Trolley System for LPG Leakage Detection with Safety Measur...Automated Unified Trolley System for LPG Leakage Detection with Safety Measur...
Automated Unified Trolley System for LPG Leakage Detection with Safety Measur...
 
3Gass .pptx
3Gass .pptx3Gass .pptx
3Gass .pptx
 

Recently uploaded

Recently uploaded (20)

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

gas detction final thesis.pdf

  • 1. Title Gas detection using Arduino microcontroller By Ahmed Waheed Ali Shadaa 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. ii 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. iii 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 Ali Shadaa 2023
  • 4. iv 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. v 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 (Compressed natural gas), buses cars where appliances and heaters that use natural gas and liquid petroleum gas (LPG) may be a source of risk. 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, type of gas module will send emergency alarm to service station or personal invoice, emergency measure the power line automatically cut-off. The device was tested using LPG gas, smoke , putan 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. vi Table of Contents Declaration ii Dedication iii Acknowledgements iv Abstract v Table of Contents vi List of Tables viii List of Figures ix List of Abbreviations x List of Symbols xi CHAPTER 1 INTRODUCTION 1 1.1 Problem Statement 3 1.2 Motivations 4 1.3 Aims and Objectives 5 1.4 Project Contribution 5 1.4.1 Contributions 5 1.5 Thesis Organisation 5 CHAPTER 2 LITERATURE REVIEW 7 2.1. Project Review 7
  • 7. vii CHAPTER 3 THEORETICAL APPROACH 11 3.1 Microcontroller 16 3.2 Why Arduino 19 3.3 The LCD 16×2 23 3.4 Variable Resistors 24 3.4.1 Potentiometer 25 3.4.2 Trimmer Potentiometer 26 3.4.3 Slider Potentiometer 26 CHAPTER 4 EXPERIMENTAL WORK 27 4.1 DETECTORCIRCUIT PRENCIPLE 27 4.2 Working of Arduino based Smoke & Gas Detector 28 CHAPTER 5 RESULTS AND DISCUSSION 30 5.1 Result and Disscution 30 CHAPTER 6 CONCLUSIONS AND FUTUREWORK 34 6.1 Conclusion 34 6.2 Future Work 34 References 36 Appendix 1 37
  • 8. viii List of Tables Table 1.The table caption 4
  • 9. ix 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
  • 10. x List of Abbreviations LPG LIQUID PETRULIUM GAS LCD LIQUID CRYSTAL DISPLAY NGC NORTH GAS COMPANY
  • 11. xi List of Symbols ABC The full name of the symbol, in Sentence Case. Abc …………………………………………………………. Ab Cd …………………………………………………...……..
  • 12. 1 CHAPTER 1 INTRODUCTION This 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 Iraq approxmitly. 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 Bagdad on Oct 6 2022, causing suspension of traffic movement on the busy AL-qasim highway for about three and a half hours. Gas from the 10-inch tank leaked near check point around 9:00 am[12]. The woman who was burnt in a fire at a car in Baghdad has succumbed to her injuries. Afire had broken out at the car of in street on the morning of Feb 26, leaving five— the couple and their three sons—injured [13]. One killed, 6 others injured in gas cylinder tank blast in Basra. The accident occurred on Friday 16 November 2021. An eight-year-old child has been killed, and six people have sustained burn injuries, in a gas cylinder explosion [14]. In Iraq, 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 North Gas Company (NGC) 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 that almost 80% of the cylinders of NGC are unusable after an explosion that took place at a NGC depot in Kirkuk in last year that completely destroyed 300 cylinders and burnt 3 trucks and luckily no human was injured in that incident [15].
  • 13. 2 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 is not 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 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
  • 14. 3 to design a gas leakage detector which has to work on 5 stages of gas leakage, those are, a. First gas 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 change the sensitivity of sensor to measure the data. To develop this project, have to use Arduino UNO board, LED, Brazzers, MQ2 module, LCD Display and variable resistance with air vacuumed. 1.1 Problem Statement Clearly here 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.
  • 15. 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 alert automatically to the owner with guess the gas type. 1.2 Motivations In this section, 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, and 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 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 2022. • 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. According to the data from 2016 to the 2022 year from the IMO, around 500 hundred people were killed on IRAQ due to LPG gas leakage.
  • 16. 5 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 alert to emergency 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 multi projects 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 control based alert system which was not found the existing system. We are working to develop a unique ideas which helps people in many ways 1.5 Thesis Organisation • Chapter 2: In this chapter, have to describe the literature review, the research gap and proposed solution of our developing system. • Chapter 3: Used Technologies: In this chapter, have to describe the technologies we used described our front end and back-end technologies.
  • 17. 6 • Chapter 4: Design and implementation: In this chapter, 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. .
  • 18. 7 CHAPTER 2 LITERATURE REVIEW This chapter presents related work, Literature review, Research gap and our movement that 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 alert to the nearest home owner and constraction of gas. 2.1. Project Review IoT (Internet of things) 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 gas.
  • 19. 8 Figure 2.1: Block Diagram of Gas Leakage Detector 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 monoxide Metal Oxide Semiconductor sensors-used for both to sensor-used for combustible gases such hydrocarbon gases Infrared Sensors-used for combustible gases [5]. The 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 (300PPM)
  • 20. 9 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-2 sensor offers a [6]High Sensitivity to LPG gas A Detection Range: 300 - 10,000 PPM Fast Response Time: 10sSimple drive circuit Heater 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 6 alarm 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
  • 21. 10 the gas concentration.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- 2 sensor which uses Tin Oxide as the sensing material. The micro-controller being used is the ATMEGA328 microcontroller by Microchip. The LCD being used is the display the result .The detector will use variable resistance to increase or decrease the sensitvity and Buzzer as the alarm. All these components are powered using a 5V supply. The 5V is supplied using available 5V voltage regulatorsICs and a 9V battery [5].the analyser is Arduino Uno. Gas sensor Input to MQ2 via pipe Vacuum motor with variable resistance
  • 22. 11 CHAPTER 3 THEORETICAL APPROACH MQ2 gas sensor is a widely used gas sensor for detecting a variety of gases including smoke, methane, propane, butane, alcohol, and carbon monoxide. The sensor works on the principle of detecting the changes in the resistance of the metal oxide semiconductor (MOS) when exposed to a particular gas. In this article, we will discuss the methodology for detecting different types of gases using the MQ2 gas sensor. 1) Smoke Detection: The MQ2 gas sensor detects smoke by measuring the resistance changes when it is exposed to smoke. The sensor has a built-in heater that heats the metal oxide semiconductor (MOS) inside the sensor. When smoke is present in the air, it absorbs the infrared radiation emitted by the heater, which causes a drop in temperature and a corresponding increase in resistance. The increase in resistance is detected by the sensor and converted into a signal that can be processed by a microcontroller. 2) Methane and Propane Detection: The MQ2 gas sensor detects methane and propane by measuring the resistance changes when it is exposed to these gases. Both methane and propane are combustible gases that can be found in natural gas and liquefied petroleum gas (LPG) systems. When methane or propane is present in the air, it oxidizes on the surface of the metal oxide semiconductor (MOS), causing a drop in resistance. The decrease in resistance is detected by the sensor and converted into a signal that can be processed by a microcontroller. 3) Butane and Alcohol Detection: The MQ2 gas sensor detects butane and alcohol by measuring the resistance changes when it is exposed to these gases. Both butane and alcohol are highly flammable and can be found in fuels, solvents, and cleaning agents. When butane or alcohol is present in the air, it reacts with the metal oxide semiconductor (MOS), causing a drop in resistance. The decrease in resistance is detected by the sensor and converted into a signal that can be processed by a microcontroller.
  • 23. 12 4) Carbon Monoxide Detection: The MQ2 gas sensor detects carbon monoxide by measuring the resistance changes when it is exposed to this gas. Carbon monoxide is a colorless, odorless, and poisonous gas that can be found in combustion fumes from vehicles, generators, and stoves. When carbon monoxide is present in the air, it reduces the oxygen content on the surface of the metal oxide semiconductor (MOS), causing a drop in resistance. The decrease in resistance is detected by the sensor and converted into a signal that can be processed by a microcontroller. In conclusion, the MQ2 gas sensor is a versatile gas sensor that can detect a variety of gases by measuring the changes in resistance when exposed to these gases. The sensor is widely used in applications such as gas leak detection, smoke detection, and air quality monitoring.The MQ2 gas sensor is a commonly used gas detector that can detect a variety of gases such as smoke, methane, propane, alcohol, and hydrogen. The sensor works by detecting changes in the resistance of a metal oxide semiconductor when it comes into contact with a target gas. To use the MQ2 gas sensor, you will need to connect it to a microcontroller or other electronic device that can read its output. The output signal from the sensor is an analog voltage that corresponds to the concentration of the target gas in the air. To control the gas detected by the MQ2 sensor, you will need to take action based on the output signal from the sensor. For example, if the sensor detects a high concentration of gas, you may want to activate an alarm or turn on a ventilation system to reduce the concentration of the gas in the air. It's important to note that the MQ2 gas sensor is a qualitative sensor and does not provide precise measurements of gas concentrations. Therefore, it's recommended to calibrate the sensor before use to ensure accurate results. Calibration involves exposing the sensor to a known concentration of the target gas and adjusting the output signal accordingly. Overall, the MQ2 gas sensor can be a useful tool for detecting the presence of various gases, but it's important to use it in conjunction with other safety measures to ensure proper control.
  • 24. 13 In this part, will discuss how to interface the MQ-2 gas sensor with an Arduino Uno and read the gas concentration levels. Requirements: To interface the MQ-2 gas sensor with an Arduino Uno, you will need the following components: 1) MQ-2 gas sensor 2) Arduino Uno 3) Breadboard 4) Liquid crystal display 5) Jumper wires 6) 10kΩ resistor 7) Vacumm motor 8) LED light emitting diode MQ-2 Gas Sensor Pinout:The MQ-2 gas sensor has four pins: VCC: Connect this pin to the 5V pin of the Arduino Uno GND: Connect this pin to the GND pin of the Arduino Uno A0: Connect this pin to the analog input pin A0 of the Arduino Uno D0: Digital output pin, which can be used to trigger an alarm when a certain gas concentration level is reached. We won't be using this pin in this article. Circuit Diagram: Connect the MQ-2 gas sensor to the breadboard and then connect the pins as follows: Connect the VCC pin of the MQ-2 gas sensor to the 5V pin of the Arduino Uno Connect the GND pin of the MQ-2 gas sensor to the GND pin of the Arduino Uno Connect the A0 pin of the MQ-2 gas sensor to the A0 pin of the Arduino Uno Connect a 10kΩ resistor between the A0 pin and the GND pin of the MQ-2 gas sensor
  • 25. 14 An Arduino based MQ2 sensor which will detect gas leakage. As we have seen the use of various gases in various fields, if there is any leakage of any such gases, then it can be detected and a harm can be minimized. It has a high response for LPG and natural gases. It also detects smoke but has a small sensitivity towards it. As any of these gases are detected the sensor will sense those and the buzzer alarm will be turned on. Alarm will inform the locals that there is leakage of gas somewhere so that they will take steps to minimize the harm. If the problem rises even after the alarm and no steps are taken then owner of the place will be informed and if still no action is taken then emergency services will be informed so as to minimize the disaster. Figure 3-1 MQ2 sensor What is ppm for gas :Parts-per-million, or “ppm”, is commonly used as a fractional unit of measure for concentration. As an example, a methane (molecular) concentration of 2% means that 2 out of every 100 air molecules is methane. Similarly, a methane concentration of 2 ppm means that 2 out of every 1 million air molecules is methane. Can MQ-2 detect CO2:A short and simple answer to this question is yes, it can detect CO2. but before making any projects with this sensor please refer to the datasheet of the module to know all outer pareamerts and conditions that are required to measure CO2.
  • 26. 15 What is the difference between MQ-2 and MQ-5:MQ-2 can sense methane(CH4) upto 20000 ppm whereas MQ5 can sense methane(CH4) only upto 10000 ppm.Is this gas sensor analog or digital Most of the gas sensors which are available in the market are mostly analog, but it can be made digital with a Op-amp IC and a handful of digital components. You can check out the schematic down below for more clarification. Internal Schematics for MQ-2 Gas Sensor ModuleThe Circuit Diagram for the MQ-2 Gas and Smoke Detection Sensor Module is shown below. The schematic for this module is very simple and needs a handful of components to build. If you are in a hurry to build this circuit, the schematic shown below will come in handy. Figure 3-2 MQ2 sensor connection circuit
  • 27. 16 3.1 Microcontroller In Hardware section thoroughly discuss about the comparator circuit and the following parts. Arduino: To take the outputs from comparator circuit & compute the data for calculation and to control the LCD, here we use a microcontroller atmega 238p which comes with Arduino which is an open-source electronics prototyping platform. Arduino can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights, motors, and other actuators. The microcontroller on the board is programmed using the Arduino programming language (based on Wiring) and the Arduino development environment (based on Processing). Arduino projects can be standalone or they can communicate with software running on a computer (e.g. Flash, Processing, MaxMSP).We use Arduino uno to make our task easy. The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller; Simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. “Uno" means one in Italian and is named to mark the upcoming release of Arduino. A microcontroller (sometimes abbreviated µC, uC or MCU) is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Program memory in the form of Ferroelectric RAM, NOR flash or OTP ROMis also often included on chip, as well as a typically small amount of RAM. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal computers or other general purpose applications. Microcontrollers are used in automatically controlled products and devices, such as automobile engine control systems, implantable medical devices, remote controls, office machines, appliances, power tools, toys and other embedded systems. By reducing the size and cost compared to
  • 28. 17 a design that uses a separate microprocessor, memory, and input/output devices, microcontrollers make it economical to digitally control even more devices and processes. Mixed signal microcontrollers are common, integrating analog components needed to control non-digital electronic systems. Some microcontrollers may use four-bit words and operate at clock rate frequencies as low as 4 kHz, for low power consumption (single-digit mill watts or microwatts). They will generally have the ability to retain functionality while waiting for an event such as a button press or other interrupt; power consumption while sleeping (CPU clock and most peripherals off) may be just nanosats, making many of them well suited for long lasting battery applications. Other microcontrollers may serve performance-critical roles, where they may need to act more like a digital signal processor (DSP), with higher clock speeds and power consumption. The heart of Adriano is a microcontroller. Practically everything else on the board is concerned with providing the board with power and allowing it to communicate with desktop computers, what exactly do get when buy one of these little computers to use in the projects. The answer is that really do get a little computer on a chip. It has everything and more than the first home computers had. It has a processor, a kilobyte of random access memory (RAM) for holding data, a few kilobytes of erasable programmable read-only memory (EPROM) or Flash memory for holding our programs, and it has input and output pins. These input/output pins are what link the microcontroller to the rest of our electronics. Inputs can read both digital (is the switch on or off) and analog (what is the voltage at a pin). This enables us to connect many different types of sensors for light, temperature, sound, etc. Outputs can also be analog or digital. So, you can set a pin to be on or off (0V or 5V) and this can turn LEDs on and off directly, or you can use the output to control higher-power devices such as motors. They can also provide an analog output voltage. That is, you can set the output of a pin to some particular voltage, allowing you to control the speed of a motor or the brightness of a light.
  • 29. 18 Figure 3-3 Types of microcontrollers Arduino is an open-source platform used for building electronics projects. Arduino consists of both a physical programmable circuit board (often referred to as a microcontroller) and a piece of software, or IDE (Integrated Development Environment) that runs on your computer, used to write and upload computer code to the physical board. The Arduino platform has become quite popular with people just starting out with electronics, and for good reason. Unlike most previous programmable circuit boards, the Arduino does not need a separate piece of hardware (called a programmer) in order to load new code onto the board – you can simply use a USB cable. Additionally, the Arduino IDE uses a simplified version of C++, making it easier to learn to program. Finally, Arduino provides a standard form factor that breaks out the functions of the micro-controller into a more accessible package. Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It's an open-source physical computing platform based on a simple microcontroller board, and a development environment for writing software for the board. Arduino can be used to develop interactive objects, taking inputs from a variety of switches or sensors, and controlling a variety of lights, motors, and other physical outputs. Arduino projects can be stand-alone, or they can communicate with
  • 30. 19 software running on your computer (e.g. Flash, Processing, MaxMSP.) The boards can be assembled by hand or purchased preassembled; the open-source IDE can be downloaded for free. The Arduino programming language is an implementation of Wiring, a similar physical computing platform, which is based on the Processing multimedia programming environment. 3.2 Why Arduino There are many other microcontrollers and microcontroller platforms available for physical computing. Parallax Basic Stamp, Netmedia's BX-24, Phidgets, MIT's Handy board, and many others offer similar functionality. All of these tools take the messy details of microcontroller programming and wrap it up in an easy-to-use package. Arduino also simplifies the process of working with microcontrollers, but it offers some advantage for teachers, students, and interested amateurs over other systems: Inexpensive - Arduino boards are relatively inexpensive compared to other microcontroller platforms. The least expensive version of the Arduino module can be assembled by hand, and even the pre-assembled Arduino modules cost less than $50$.Cross-platform - The Arduino software runs on Windows, Macintosh OSX, and Linux operating systems. Most microcontroller systems are limited to Windows. Simple, clear programming environment - The Arduino programming environment is easy-to-use for beginners, yet flexible enough for advanced users to take advantage of as well. For teachers, it's conveniently based on the Processing programming environment, so students learning to program in that environment will be familiar with the look and feel of Arduino Open source and extensible software- The Arduino software is published as open source tools, available for extension by experienced programmers. The language can be expanded through C++ libraries, and people wanting to understand the technical details can make the leap from Arduino to the AVR C programming language on which it's based. Similarly, you can add AVR-C code directly into your Arduino programs.
  • 31. 20 Open source and extensible hardware - The Arduino is based on Atmel's ATMEGA8 and ATMEGA168 microcontrollers. The plans for the modules are published under a Creative Commons license, so experienced circuit designers can make their own version of the module, extending it and improving it. Even relatively inexperienced users can build the breadboard version of the module in order to understand how it works and save money.The Uno is one of the more popular boards in the Arduino family and a great choice for beginners. Figure 3-4 shown Adriano UNO board Figure 3-5 shown software of Arduino
  • 32. 21 In this practical over line the following: 1) What projects can be accomplished using an Arduino. 2) What is on the typical Arduino board and why. 3) The different varieties of Arduino boards. 4) Some useful widgets to use with board Arduino. 5) What is on the board There are many varieties of Arduino boards that can be used for different purposes. Some boards look a bit different from the one below, but most Arduinos have the majority of these components in common: Figure 3-6 Shawn construction of Adriano Power (USB / Barrel Jack).Every Arduino board needs a way to be connected to a power source. The Arduino UNO can be powered from a USB cable coming from your computer or a wall power supply that is terminated in a barrel jack. In the picture above the USB connection is labelled and the barrel jack is labelled .The USB connection is also how is will load code onto your Arduino board. More on how to program with Arduino can be found in this chapter. Do NOT use a power supply greater than 20 Volts as you will overpower (and thereby destroy) Arduino. The recommended voltage for most Arduino models is between 6 and 12 Volts. Pins (5V, 3.3V, GND, Analog, Digital, PWM, AREF) the pins on Arduino are the places where is connect wires to construct a circuit (probably in conjunction with a bread- board and some wire. They usually have black plastic ‘headers’ that allow you to just plug a wire right into the board. The Arduino has several different kinds of pins, each of which is labelled on the board and used for different functions.
  • 33. 22 GND (3): Short for ‘Ground’. There are several GND pins on the Arduino, any of which can be used to ground your circuit. 5V (4) & 3.3V (5): As you might guess, the 5V pin supplies 5 volts of power, and the 3.3V pin supplies 3.3 volts of power. Most of the simple components used with the Arduino run happily off of 5 or 3.3 volts. Analog (6): The area of pins under the ‘Analog In’ label (A0 through A5 on the UNO) are Analog In pins. These pins can read the signal from an analog sensor (like a temperature sensor) and convert it into a digital value that we can read. Digital (7): Across from the analog pins are the digital pins (0 through 13 on the UNO). These pins can be used for both digital input (like telling if a button is pushed) and digital output (like powering an LED). PWM (8): You may have noticed the tilde (~) next to some of the digital pins (3, 5, 6, 9, 10, and 11 on the UNO). These pins act as normal digital pins, but can also be used for something called Pulse-Width Modulation (PWM). We have but for now, think of these pins as being able to simulate analog output (like fading an LED in and out). AREF (9): Stands for Analog Reference. Most of the time can leave this pin alone. It is sometimes used to set an external reference voltage (between0 and 5 Volts) as the upper limit for the analog input pins. Reset Button: The Arduino has a reset button. Pushing it will temporarily connect the reset pin to ground and restart any code that is loaded on the Arduino. This can be very useful if your code doesn’t repeat, but you want to test it multiple times. Unlike the original Nintendo however, blowing on the Arduino doesn’t usually fix any problems. Power LED Indicator: Just beneath and to the right of the word “UNO” on your circuit board, there’s a tiny LED next to the word ‘ON’. This LED should light up whenever you plug your Arduino into a power source. If this light doesn’t turn on, there’s a good chance something is wrong. Time to re-check your circuit!
  • 34. 23 TX RX LEDs: TX is short for transmit, RX is short for receive. These markings appear quite a bit in electronics to indicate the pins responsible for serial communication. In our case, there are two places on the Arduino UNO where TX and RX appear – once by digital pins 0 and 1, and a second time next to the TX and RX indicator LEDs. These LEDs will give us some nice visual indications whenever our Arduino is receiving or transmitting data (like when we’re loading a new program onto the board). Main IC: The black thing with all the metal legs is an IC, or Integrated Circuit .Think of it as the brains of our Arduino. The main IC on the Arduino is slightly different from board type to board type, but is usually from the AT mega line of IC’s from the ATMEL Company. This can be important, as you may need to know the IC type (along with your board type) before loading up a new program from the Arduino software. This information can usually be found in writing on the top side of the IC. If you want to know more about the difference between various IC’s, reading the datasheets is often a good idea. Voltage Regulator: The voltage regulator is not actually something can (or should) interact with on the Arduino. But it is potentially useful to know that it is there and what it’s for. The voltage regulator does exactly what it says – it controls the amount of voltage that is let into the Arduino board. Think of it as a kind of gatekeeper; it will turn away an extra voltage that might harm the circuit. Of course, it has its limits, so don’t hook up your Arduino to anything greater than 20 volts. 3.3 The LCD 16×2 The term LCD stands for liquid crystal display. It is one kind of electronic display module used in an extensive range of applications like various circuits & devices like mobile phones, calculators, computers, TV sets, etc. These displays are mainly preferred for multi-segment light-emitting diodes and seven segments. The main benefits of using this module are inexpensive; simply programmable, animations, and there are no limitations for displaying custom characters, special and even animations, etc.
  • 35. 24 Figure 3-7 Shawn construction of LCD A 16×2 LCD has two registers like data register and command register. The RS (register select) is mainly used to change from one register to another. When the register set is ‘0’, then it is known as command register. Similarly, when the register set is ‘1’, then it is known as data register. Command Register The main function of the command register is to store the instructions of command which are given to the display. So that predefined tasks can be performed such as clearing the display, initializing, set the cursor place, and display control. Here commands processing can occur within the register. Data Register The main function of the data register is to store the information which is to be exhibited on the LCD screen. Here, the ASCII value of the character is the information which is to be exhibited on the screen of LCD. Whenever we send the information to LCD, it transmits to the data register, and then the process will be starting there. When register set =1, then the data register will be selected. 3.4 Variable Resistors Variable resistors are intended for use in applications where the equipment user has frequent requirement for adjusting the resistance, as in tone, volume, focus, and brightness controls.
  • 36. 25 There are two basic types of variable resistors, one called a potentiometer and the other a rheostat. An example of the potentiometer is the volume control on your radio, and an example of the rheostat is the dimmer control for the dash lights in an automobile. There is a slight difference between them. Rheostats usually have two connections, one fixed and the other moveable. Any variable resistor can properly be called a rheostat. The potentiometer always has three connections, two fixed and one moveable. Generally, the rheostat has a limited range of values and a high current-handling capability. The potentiometer has a wide range of values, but it usually has a limited current-handling capability. Potentiometers are usually connected as voltage dividers. 3.4.1 Potentiometer An example of a potentiometer is shown in the figure below, view A. Potentiometers are made with either composition or wire wound resistance elements, and all considerations to be mentioned in connection with fixed resistors having those types of elements also apply to potentiometers. Figure 3-8 Shawn construction of resistance
  • 37. 26 The basic components of the most widely used types of potentiometers are shown in the figure above, views B and C. Although the shapes and sizes of the various parts may vary with the wattage rating and with the particular production techniques of the various manufacturers, the general arrangement is nearly always the same. The only fundamental differences are in the types of resistance elements used. The figure above (view B) shows construction with a wire wound resistance element, and view C shows the same with a composition element. Both constructions consist of a base, a resistance element with a terminal at each end, a sliding contact arm (wiper) connected to the center terminal, a rotatable shaft fastened to the contact arm, a threaded bushing, and a cover. The shaft can be turned so that the contact arm can be set to any desired portion of the resistance element. With different settings of the shaft, there are different resistances between either end terminal and the contact-arm terminal. As is the case with fixed resistors, there are a limited number of different wattage ratings available for potentiometer. 3.4.2 Trimmer Potentiometer There are applications, in which the exact value of resistance required in the circuit cannot be predicted or controlled with the required accuracy. In such applications, it is helpful to have available a resistor (called trimmer potentiometer or simply trimmer) which can be adjusted to the exact required value when the equipment is aligned after assembly. Adjustment by the equipment user is unnecessary, although a later adjustment may have to be made by a service technician during equipment servicing. Since the resistor does not require frequent resetting, no special pains are taken to make this adjustment particularly convenient. One type of trimmer potentiometer is shown in the figure below. A screw adjustment is used to change the resistance of this potentiometer. 3.4.3 Slider Potentiometer A potentiometer that is adjusted by sliding the wiper along a straight resistance element instead of rotating.
  • 38. 27 CHAPTER 4 EXPERIMENTAL WORK System detects the level of gas in the air that exceeds the safety level it will activate the alarm which includes the buzzer to alert the users at home of the abnormal condition and to take any necessary action. The most tell-tale sign of a leak is the smell of gas in the home. However, in the case of a carbon monoxide leak, there are also particular physical symptoms you may suffer from if there is a leak. The output result of this paper is that the leakage will be detected and stopped within 2 sec after the leakage starts. This system can even detect the level of gas leakage. This is an efficient method for automatically detecting and controlling the gas leakage. Moreover, the fire accidents are also prevented by switching off the power supply. The idea for gas detection and control can be implemented at a large scale for various industries. This system can be installed in a kitchen, at a hostel cafeteria, and any other areas. This can be helpful in reducing accidents caused by gas leakage in household as well as in any similar commercial set up. In our country there are 180 million people, and due to its low cost this product is affordable and will prevent many accidents and save many properties and human lives 4.1 DETECTORCIRCUIT PRENCIPLE In this project, we will make a smoke and gas leakage detector using Arduino. We have used the MQ2 Gas sensor module to detect Smoke and carbon monoxide concentrations present in Air. MQ2 is a versatile sensor that can detect LPG, smoke, alcohol, propane, hydrogen, methane, carbon monoxide, etc. This makes the MQ2 Gas Sensor Module an excellent choice for building an indoor air quality monitoring system, a Breathalyzer, or an early fire detection system. Smoke and gas leakage detectors are really useful in detecting smoke or fire in buildings. They are important safety parameters in order to avoid disasters. Exploding cylinders and accidental fires have caused lots of damage to houses in the past. This circuit triggers the alarm system when smoke or gas leakage is detected.
  • 39. 28 4.2 Working of Arduino based Smoke & Gas Detector First, let’s see how this project works. The MQ2 sensor detects smoke and Carbon Monoxide values and sends them to Arduino. Arduino then processes these values and displays these values on the LCD 4X20 display. It also checks if these values are above the safe level then it sends a command to the buzzer and a LED. Then the buzzer starts alarming with a flashing LED. Figure 4.1 algorthim of gas detecter
  • 40. 29 If the system detects the level of gas in the air that exceeds the safety level it will activate the alarm which includes the buzzer to alert the users at home of the abnormal condition and to take any necessary action. The most tell-tale sign of a leak is the smell of gas in the home. However, in the case of a carbon monoxide leak, there are also particular physical symptoms you may suffer from if there is a leak. The output result of this paper is that the leakage will be detected and stopped within 2 s after the leakage starts. This system can even detect the level of gas leakage. This is an efficient method for automatically detecting and controlling the gas leakage. Moreover, the fire accidents are also prevented by switching off the power supply. The idea for gas detection and control can be implemented at a large scale for various industries. This system can be installed in a kitchen, at a hostel cafeteria, and any other areas. This can be helpful in reducing accidents caused by gas leakage This project can be used to detect gas leakages at home, in a car, storage tank environment or in a service station. It can be easily implemented to industrial level by upgrading its ranges. The implementation of this project is important in every home, office and industries because there are many gases that can be harmful to organic life, such as humans or animals. This project helps people to upgrade their safety standards, comply statutory even though it has small sensitivity to detect alcohol, it can be used as liquor tester. The project has excellent sensitivity combined with a quick response time. It’s most important and basic function is to prevent accidents and protect life and property from disaster. It provides along lasting safety means for detecting the leakage of gas into the area of an appliance when the appliance is in a shutdown condition or not in operation. It provide a novel gas detection and monitoring system which is economical to manufacture and which may be readily installed in conventional trailers, boats or the like which are normally dependent upon a stored supply of pressurized gas.
  • 41. 30 CHAPTER 5 RESULTS AND DISCUSSION 5.1 Result and Disscution The results obtain from the implemented of the gas leakage system. The lighter was used as a gas that be detect by the detector and using the hairdryer to get the changes of the temperature. The response of the reading was obtained using the liquid crystal display. The sensitivity of the MQ-2 sensor to detect the concentration of the gas is by changing the sensor resistance value. The resistor value obtains from the serial monitor display by Arduino Ide. The resistor value (RO) that be testing is from 6.00 Ω to 9.30 Ω. From the result obtained, the relationship between the resistance value and the concentration of gas per time. The result that show by the lcd is real-time response. The MQ-2 sensor not only detect the concentration of the gas but it’s also detect the concentration of the smoke. The result of the relationship was showed in table 4.1 and table 4.2.
  • 42. 31 cocentration of gas at safe (green on the left) & dangerous (red on the right) level. Temperature at safe (left), medium (middle), & dangerous (right) level. Recording to the Table 4.1 and Table 4.2 the higher the value of resistance that adjusted by potentiometer, the low sensitive for the MQ2 gas sensor to detect leakage gas. Based on the Figure 4.2, 4.3, 4.4, 4.5 and 4.6 the project was success because the system can detect the leakage of gasses and the changes of temperature. The concentration of gas and smoke reading changes the colour from the green level or safe level to the red level or dangerous level when the reading of the concentration in ppm unit is more than 100ppm. While the meter reading for the temperature changes from safe level or green to the red when the reading of temperature exceeds 32oC. A human nose has around 400 different types of scent receptors that enable us to smell approx. 1 trillion different odors. But still, most of us cannot identify the type of gas present in the atmosphere. Hence, there are different sensors to measure accurate gas concentration in the atmosphere. Gas detection sensors are most commonly used to develop an IoT-powered system and
  • 43. 32 identify the variation of toxic gases around an industrial facility. It helps benefit the factories and refineries by keeping them safe against any unexpected threats like explosions. Let's talk more about the applications and benefits of a gas monitoring solution: Applications: Harmful Gas Detection : The sensing of toxic gases such as H2S, Methane, and CO is of great importance in any industry to avoid unwanted leakage and consequences like poisoning or explosions. The presence of these gases can be easily detected in the industrial facilities and commercial buildings with the help of IoT-powered gas monitoring solution. Moreover, a gas detector or sensor device is a crucial part to carry out safe industrial operations. The sensor-enabled solution helps prevent the high risk of gas explosions and affecting any casualties within and outside the premises. Fire Hazard Prevention: The gas sensors help detect the concentration of the gases present in the atmosphere to avoid hazardous consequences like fire breakouts. Also, it is an imperative solution to keep the plant workers and equipment safe from fire hazards. It effectively detects the presence of hazardous gases like propane and methane and alerts the plant authorities, preventing the premises from unexpected ignition. Moreover, a gas monitoring solution uses gas analyzers to generate alerts regarding the temperature increase. This allows the management to take immediate actions to curb harmful fire explosions. Oxygen Level Measurement: Sensing the presence of gases is a necessity to conduct industrial operations as several pitmen had lost their lives due to lack of oxygen in the process of mining explorations. A sudden decrease in the oxygen levels can result in dizziness, brain damage, or even death among the workers working in mines or close-packed industrial premises. A gas monitoring system significantly benefits the industries by maintaining proper oxygen levels that reflect the optimal performance of your workers. This system also creates alerts in real-time about the decreasing oxygen levels, which gives enough time to take necessary measures to evacuate the facilities much before the health gets affected.
  • 44. 33 Benefits Get real-time alerts about the gaseous presence in the atmosphere Prevent fire hazards and explosions Supervise gas concentration levels Ensure worker’s health Real-time updates about leakages Cost-effective installation Data analytics for improved decisions Measure oxygen level accuracy Get immediate gas leak alerts IoT networks are well-known for their low energy consumption and low power transmission, which allows the assets to operate for a longer duration and generate precise data information. An IoT-powered gas monitoring solution works through sensors that provide accurate data regarding the presence of toxic gases in the atmosphere. It is a very useful system to implement in the industries or plant facilities to avoid catastrophic explosions. With the help of a gas monitoring solution, you can successfully measure temperature and humidity in the atmosphere, which results in improved plant facilities and ensures employee health safety.
  • 45. 34 CHAPTER 6 CONCLUSIONS AND FUTUREWORK 6.1 Conclusion The design of a sensor-based automatic gas leakage detector with an alert and control system has been proposed and discussed . This is a low-cost, low power, lightweight, portable, safe, user friendly, efficient, multi featured and simple system device for detecting gas. Gas leakage detection will not only provide us with significance in the health department but it will also lead to raise our economy, because when gas leaks it not only contaminates the atmosphere but also wastage of gases will hurt our economy. In the open literatures it is noticed that much work has not been done for a smart gas detection system. In future, more advanced features will be integrated with this system which will provide users with more safety and relaxation. The proliferation of handheld devices has led to developments in the field of smart gas sensors, which has considerably widened their scope of application. The need for ensuring safety in workplaces is expected to be the key driving force for the market over the coming years. 6.2 Future Work Overall, software and hardware parts of the systems have been developed and tested by introducing a small amount of LPG near gas sensor module. The authors of this project are currently working to include multi functions with this device. One of the notable future functions of this system is to add a sub system where wastage of gas and the uses of gas can be monitored using this system. The system is flexible as a greater number of sensors and relays can be added to it according to the whole LPG supply setup in those premises. The author is adding more software based intelligent functions with this system. This is an automatic gas detection, control and alert system. In future this system will have a feature where it can notify the emergency services if any accidents happen. A mobile app and web- based app for real time monitoring also will be added. In the user app for this system many smart features will be added.
  • 46. 35 The overall features will make the system safer for the users. The system will be optimized for use in many places like the car, the home, industries and many other places. After designing the final prototype with smart multifunctional features, the system will be implemented in real life scenarios as a pilot project. A survey will be done soon before using the system and another one will be done after implementing the system to discover the KPI. Summarizing all the results, finding and analysing a research article will be done and author has plans to submit into the MDPI sensors journal for review. In the future project the features of this final product will be compared with the available gas detector systems presented in other articles.
  • 47. 36 References [1] B. Sonkar, A. Sood, A. Ranjan, and A. Faisal, "Microcontroller Based LPG Leakage Detector Using GSM Module," International Journal of Electrical and Electronics Research, vol. III, pp. 264-269, 2015. [2] G. Arturson, "The tragedy of San Juanico—the most severe LPG disaster in history," Burns, vol. 13, pp. 87-102, 1987. [3] KHK, "Annual Report on Liquefied Petroleum Gas," The High-Pressure Gas Institute of Japan, Tokyo2013. [4] P. Petlee and R. Deepa, "Fires from LPG leaks on the rise; police cite negligence," in The Hindu, ed: The Hindu, 2015. [5] S. Eno-Abasi and G. Akutu, "Stemming cooking gas-related accidents/deaths," in The Guardian, ed: The Guardian, 2017. [6] G. Akhras, "Smart Materials and Smart Systems for The Future," Canadian Military Journal, 2000. [7] Paul Fanning. (2012, March 15). Smart systems bring benefits to industrial applications. Available: http://www.eurekamagazine.co.uk/design-engineeringfeatures/technology/smart-systems-bring benefits-to-industrial-applications/40993/ [8] E. Adel and L. Micheal, "Smart cities: safety, security and privacy," Journal of Advanced Research, 2014. [9] O. Osemwegie, S. John, K. Okokpujie, and I. Shorinwa, "Development of an electronic fare collection system using stationary tap-out devices," in Proceedings - 2016 International Conference on Computational Science and Computational Intelligence, CSCI 2016, 2017, pp. 234-236. [10] V. O. Matthews, A. O. Ajala, S. I. Popoola, and A. A. Atayero, "Smart vehicular traffic management system using RFID technology," in Lecture Notes in Engineering and Computer Science, 2017, pp. 414- 417. [11] T. O. Takpor, J. Ademola, S. I. Popoola, J. A. Badejo, and A. A. Atayero, "Smart assistive mHealth system for medication adherence in patients with Alzheimer's disease," in Lecture Notes in Engineering and Computer Science, 2017, pp. 1076-1080. [12] A. U. Adoghe, S. I. Popoola, O. M. Chukwuedo, A. E. Airoboman, and A. A. Atayero, "Smart weather station for rural agriculture using meteorological sensors and solar energy," in Lecture Notes in Engineering and Computer Science, 2017, pp. 323-326. [13] V. Carmela and I. Ana, "Smart gas detection system," Institute of Electrical and Electronics Engineering, 2017. [14] A. Falohun, A. Oke, and B. Abolaji, "Dangerous Gas Detection using an Integrated Circuit and MQ- 9," International Journal of Computer Applications, 2016. [15] R. Sushma and R. Manohar, "An Android Based Automatic Gas Detection and Indication Robot," International Journal of Computer Engineering and Applications, 2014. [16] H. Mujawar, D. Bachuwar, and S. Kasbe, "Design and development of LPG gas leakage detection and controlling system," Solapur University Research Journal, vol. IV, 2015. [17] S. Rajitha and T. Swapna, "Security alert system using GSM for gas leakage," International Journal of VLSI and Embedded Systems-IJVES, vol. 3, pp. 173-175, 201
  • 48. 37 Appendix 1 #include <MQ2.h> #include <Wire.h> #include <LiquidCrystal_I2C.h> //I2C pins declaration LiquidCrystal_I2C lcd(0x27, 16, 2); int Analog_Input = A0; int lpg, co, smoke; MQ2 mq2(Analog_Input); void setup(){ Serial.begin(9600); lcd.begin();//Defining 16 columns and 2 rows of lcd display lcd.backlight(); mq2.begin(); } void loop(){
  • 49. 38 float* values= mq2.read(true); //set it false if you don't want to print the values in the Serial //lpg = values[0]; lpg = mq2.readLPG(); //co = values[1]; co = mq2.readCO(); //smoke = values[2]; smoke = mq2.readSmoke(); lcd.setCursor(0,0); lcd.print("LPG:"); lcd.print(lpg); lcd.print(" CO:"); lcd.print(co); lcd.setCursor(0,1); lcd.print("SMOKE:"); lcd.print((smoke*100)/1000000); lcd.print(" %"); delay(1000); }
  • 50. 39