REPORT (4)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 38

A Seminar Report

on
LPG Gas Leakage Detection and Protection using Arduino
to be Submitted by
Poorvi Gupta
Roll No. : 2216556
Presented to
School of Physical Sciences
Banasthali Vidyapith
For the partial fulfilment of the award of degree
of
B.Tech.
Electronics and Communication

SCHOOL OF PHYSICAL SCIENCES


BANASTHALI VIDYAPITH
Newai , Tonk District
Rajasthan, 304022
March,2024

1
ACKNOWLEDGEMENT

I would like to express my gratitude to Dr. Parvej Ahmad Alvi, Head of Department of Physical Sciences and
Prof. Ritu Vijay, Dean of School of Physical Sciences for providing me with this wonderful opportunity to
present on the topic LPG Gas Leakage Detection and Protection Using Arduino.

I wish to express my profound gratitude towards our mentors Shri Kamal Kumar Jain, Dr. Shekhar Yadav &
Smt. Pooja Srivastava , for their valuable guidance , suggestions and constant encouragement paved way for
the successful presentation of the Seminar and building my confidence. In this aspect, I am eternally grateful
to you.

I want to thank my parents for moral support , always made me aware of my mistakes , trusting in me ,
teaching me to always work hard , believe in my abilities and never lose hope.

I want to thank my mates for offering me their help.

POORVI GUPTA

2
INDEX

Abstract 4

CHAPTER 1 : Introduction 5

CHAPTER 2 : Previous Works 6-7

2.1 Block Diagram 6


2.1.1 Diagram 6
2.1.2 Description 6
2.2 Component Description 6
2.2.1 MQ-5 Gas Sensor 7
2.2.2 ATMEGA16 Microcontroller 7
2.2.3 Exhaust Fan 7

CHAPTER 3 : GSM-Based Model 8-30

3.1 Block Diagram 8

3.2 Hardware requirement 8

3.2.1 Arduino Board 8


3.2.2 MQ Gas Sensor 13
3.2.3 Servo Motor 16
3.2.4 LED(Light Emitting Diode) 18
3.2.5 Buzzer 18
3.2.6 GSM Module(SIM 900A) 19
3.3 Circuit 26
3.4 Working 26
3.5 Major Challenges 28
3.6 Applications 29
3.7Conclusion 30

CHAPTER 4 : IOT Based Model 31-34

4.1 Block Diagram 31

4.2 ESP8266 WiFi Module 31

4.3 Working 33

REFERENCES 35

APPENDIX 37

3
ABSTRACT
Leaking of gas is the major problem with industrial sector, domestic areas and vehicles run by CNG gas.
Many accidents occur in day to day life like explosion because of gas leakage. Major harm is caused, if gas
leakage is not detected early. One of the preventive measures to stop the explosion and danger is to install
the leakage detection kit.

In this study, we propose an innovative solution for detecting and preventing LPG gas leaks, employing
Arduino UNO , GSM module, buzzer, servo motor, and LED. The system operates by continuously
monitoring the LPG gas levels in real-time using gas sensor .When the gas levels rise beyond the threshold
value i.e 200ppm , the system triggers an alarm through a buzzer and visual indicator through LED. It
disables the gas supply from the source instantly once the leakage of gas is detected by rapid closure of
Regulator valve, directly tied with the servo motor and GSM module enables remote monitoring and control
capabilities, allowing users to receive instant notifications regarding gas leakage alerts via SMS or calls.

4
CHAPTER 1
INTRODUCTION

LPG (Liquefied Petroleum Gas) is a mixture of hydrocarbon gases. It consists of propane (C3H8), butane
(C4H10), propylene, butylene, isobutane and mixture of hydrocarbon gases. It is a non-renewable source of
energy since, it is extracted from crude oil and natural gas. It is generally used as industrial fuel, vehicle fuel,
cooking gas, agricultural and horticultural applications.

It is heavier than air , therefore it do not disperse easily and generally remain in down surfaces. It constitute
around 0.4% of its vapour volume but still about ½ of the density of water and can easily float on water before
vaporizing.

It is highly flammable , colourless and odourless gas. To make it an odorant gas , we add Ethyl Mercaptan to
it , so that it can be smelled and sensed. It may lead to suffocation when inhaled. But in absence of human
resources, it is important to have an alert system or if a person with weak sense of smell then he is too feeble
to smell any surrounding odour. When leakage occurs, it combines with air and replaces O2 causing
suffocation.

When leakage occurs, suddenly ignites which may lead to explosion, massive damage, accidents. Therefore,
one of the preventive measures to stop the danger by installing leakage detector.The gas will be detected by
MQ-6 gas sensor, it will immediately turn LED, buzzer on ; an alert message will be sent to the user & it will
also stop the gas supply by turning regulator off. Source:India Stat [6]

Figure 1: Number of persons injured and killed by LPG cylinder burst in India(1998-2018)

5
CHAPTER 2

PREVIOUS WORKS

2.1 BLOCK DIAGRAM

Figure2 : Block Diagram of Gas Leakage Detector

DESCRIPTION:

Microcontroller: Serving as the project's core, it oversees the operation of the exhaust fan, LED, and buzzer
in response to LPG leakage. Input/output ports of the microcontroller facilitate this functionality.

MQ-5 LPG Sensor: Utilized for detecting LPG leakage, this sensor typically outputs a 'high' signal under
normal conditions, transitioning to 'low' when LPG is detected.

Exhaust Fan: Employed to expel LPG into the surroundings, reducing its concentration in the vicinity of the
leak.

Buzzer: Signaling the presence of LPG leakage, a 12V DC-operated buzzer is activated for notification.

LED: Another indicator of LPG leakage, a 1.2V DC-operated LED illuminates to visually indicate the
occurrence.

2.2 COMPONENTS DESCRIPTION

6
2.2.1 MQ-5 GAS SENSOR:

The MQ-5 semiconductor sensor is highly sensitive to combustible gases. Constructed with SnO2, its
conductivity decreases in clean air. An uncomplicated electro-circuit translates the conductivity variations
into a proportional output signal reflecting gas concentration. This sensor effectively detects Methane,
Propane, and Butane due to its heightened sensitivity towards these gases. Moreover, it is affordable and
adaptable to various applications.

2.2.2 ATMEGA16 MICROCONTROLLER:

The ATMEGA16 is an advanced 8-bit microcontroller featuring high performance and low power
consumption. It boasts 16K bytes of Flash memory, which can be programmed and erased, utilizing Atmel's
cutting-edge nonvolatile memory technology. With compatibility to the widely used MCS-51 instruction set
and pin layout, this microcontroller offers versatility. Its onboard flash memory enables easy reprogramming
either in-system or through a traditional nonvolatile memory programmer. The ATMEGA16 presents a cost-
effective and highly adaptable solution for various embedded control applications, combining a versatile 8-
bit CPU with Flash memory on a single chip.

2.2.3 EXHAUST FAN:

When a leak is detected, the system activates the exhaust fans automatically. These fans are designed to
remove gas from the room by drawing it out. They're typically utilized to eliminate excess moisture and
undesirable odours from specific areas or rooms. Commonly found in industries and kitchens, they play a
crucial role in dissipating moisture accumulation caused by activities such as showering, washing, or
cooking.

7
CHAPTER 3

GSM-BASED MODEL

3.1 BLOCK DIAGRAM

Figure3:Block Diagram of LPG Gas Leakage Detection And Protection System using Arduino

3.2 HARDWARE REQUIREMENT

• Arduino Uno (MOD1)


• 12V, 2A adaptor
• SIM900A GSM module (MOD2)
• Buzzer (B1)
• MQ6 or MQ2 sensor (S2)
• MG996R high torque servo motor (S1)
• Breadboard

3.2.1 ARDUINO BOARD :

Arduino is an open-source platform for building electronics projects. It consists of both physical programmable
circuit board(based on microcontroller) or a piece of software , or IDE(Integrated Development Eniviorment)
, used to write and upload computer code to the physical board. Arduino does not need a separate piece of
hardware (programmer)in order to load new code onto the board , you can simply use a USB cable.

Arduino IDE uses a simplified version of C++. Program written with IDE for Arduino is called “sketch”.

8
Sketches are saved as file with the extension “.ino”. The various components present on the Arduino boards
are Microcontroller, Digital Input/output pins, USB Interface and Connector, Analog Pins, Reset Button,
Power button, LED's, Crystal Oscillator, and Voltage Regulator. Some components may differ depending on
the type of board.

Arduino can interact with LED’s , internet , smart phone , TV ,etc. Software is free and hardware boards are
cheap, and both are easy to learn that has led to large community of users.

There are different types of Arduino board, each offering unique features and capabilities. Many versions of
the official Arduino hardware have been commercially produced to date:

• Arduino MKR Zero


• Arduino Nano ESP32
• Arduino / Genuino MKR1000
• Arduino Uno WiFi rev 2
• Arduino Nano
• Arduino Pro Mini
• Arduino Micro
• Lily Pad Arduino
• Arduino Fio
• Arduino Pro
• Arduino Zero
• Arduino Yún
• Arduino Leonardo
• Arduino UNO
• Arduino Ethernet
• UNO R4 Minima
• UNO R4 WiFi
• Arduino 101/Genuino 101
• Arduino Due
• Arduino Mega2560
• Arduino Mega ADK
• Arduino Esplora

Since we have included Arduino UNO board in the model so, we are going to discuss Arduino UNO in detail.

9
ARDUINO UNO:

The Arduino UNO, named after the Italian word for 'one', signifies the initial release of Arduino Software.
Launched in 2010, it stands as a cornerstone in Arduino's lineup, being the first USB board introduced by
Arduino.cc. This open-source microcontroller board is built around the ATmega328P microcontroller and
boasts 14 digital I/O pins (six with PWM capability) and 6 analog I/O pins. It interfaces with the Arduino IDE
via a type-B USB cable, allowing for easy programming. Power options include USB connection or a barrel
connector accepting voltages ranging from 7 to 20 volts, accommodating various power sources such as a
rectangular 9-volt battery. Equipped with a bootloader, the ATmega328 can be programmed with new code
without requiring an external hardware programmer.

The components of Arduino UNO board are shown below :

Figure 4 : Components of Arduino UNO

• USB Socket :
It has two functions :
1. To connect the computer & load the firmware into the Arduino with the help of the bootloader.
2. To power the Arduino through USB port.
• ICSP (In Circuit Serial Programming) pins :
On the board there are two 6-pin connectors : first is near USB-TTL converter and another one is near
ATmega328P. The USB -TTL converter is ATMega16U.The first connector is used to program

10
• USB-
TTL firmware into this converter. Second connector is used to burn the bootloader into ATmega328P
microcontroller.
• Reset Button :
It is used to reset the ATmega328P microcontroller.
• USB-TTL Converter :
It is used to communicate with the computer. In Arduino UNO , ATMega16U with custom firmware
act as a USB-TTL converter.
• Crystal Oscillator/Ceramic Resonator :

Figure 5 : Internal RC oscillator and external clock generator

To work Microcontroller needs a clock source, it determines microcontroller operational speed.


Execution of instructions per second is dependent on frequency of clock. The ATMega series
microcontroller can use two types of clock sources. One is internal RC oscillator which is already
built into the microcontroller but the problem with this is that it has limited maximum frequency
and it is not that accurate as well. So there is the need of second clock source, i.e external clock
generator.In this case we will be using a Quartz crystal oscillator or a ceramic resonator for this
purpose. In the picture above ,first one is 16MHz crystal oscillator used for ATMega16U2
microcontroller and second one is 16MHz resonator used for ATMega328P microcontroller.
• Power path control :
It is used as a comparator to control the input power path. When the input power is provided through
the barrel jack or Vin pin the power path control circuit will cut off the USB power pin from the circuit
which in fact will protect the USB port.

11
Figure6 : LM358

• Voltage Regulation: The maximum input voltage for the ATMega328P and ATmega16U2
microcontrollers is approximately 5V. However, the Arduino can accept 7-12V through the Vin pin or
the DC barrel jack. To regulate this voltage, there are two onboard regulators. One is a 5V regulator
dedicated to powering the microcontrollers, while the other is a 3.3V regulator providing power
through the 3.3V pin.
• DC Barrel Jack: This jack serves as the primary power input for the board, allowing for a voltage
range of 7-12V. Users can utilize a 12V or 9V DC adapter with this jack to power the Arduino.
• Digital and Analog I/O: The Arduino UNO features 14 digital I/O pins and 6 analog input pins. These
digital I/O pins operate at a 5V logic level. Additionally, the analog pins can be repurposed as digital
I/O pins. The UNO supports 6 channels of 10-bit ADC inputs accessible through pins A0-A5.
• Status LEDs and Inbuilt LED: The UNO is equipped with four onboard LEDs. One serves as a power
indicator, while two indicate activity on the Rx and Tx pins. The fourth LED is connected to Digital
Pin 13, serving as a convenient tool for testing the Arduino board.

Figure 7 : Inbuilt LED , TX & RX LED’s , Power LED

12
• The Brain-ATMega328P :
This is the main component on the Arduino board. UNO uses a 28 Pin DIP version of ATMega328P.
Atmega328P is pre-programmed with a bootloader that allows you to directly upload the program to
Arduino through USB without the need for an external programmer.

The USB port in the Arduino board is used to connect the board to the computer using the USB cable. The
cable acts as a serial port and as the power supply to interface the board. Such dual functioning makes it unique
to recommend and easy to use for beginners. the main difference between Arduino UNO and Arduino Nano
is that The Arduino Nano has a compact size and mini USB cable than the Arduino UNO and the main
difference between Arduino UNO and Arduino Mega is that The Arduino UNO is a standard board
recommended to beginners, while Arduino Mega is used for complex projects due to its greater memory space.

3.2.2 MQ GAS SENSOR:

The MQ series gas sensor is a revolutionary technology designed for detection of combustible gases which
are used in industries and manufacturing. Its working principle involves when specific gases comes in contact
with sensor’s sensing element , detecting changes into electrical conductivity. MQ sensor full form refers to
“Methane/CH4 Quality Sensor” in the context of gas sensor. These are capable of detecting even minute
amount of gases without any false alarms. These sensors consists of an electrode that has a sensing substance
placed on the top and heated to increase it reactivity and sensitivity when the type of gas comes in range, these
electrode determine by decreasing the resistance.

The combination of advanced sensing technologies with an innovative design allow users to quickly identify
potentially hazardous conditions before they lead to serious problems. It has long term stability due to its self
compensating properties which protect it against various environmental factors.

Therefore it provides reliable monitoring while reducing maintenance costs significantly over time and
increasing safety. Due to simple installation process coupled with low cost makes it highly attractive .

13
Below is the list of different types of gas sensors and what gases the sense :

Sensor Name Detection of Gas


MQ-2 Methane, Butane, LPG, Smoke
MQ-3 Alcohol, Ethanol, Smoke
MQ-4 Methane, CNG Gas
MQ-5 Natural gas, LPG
MQ-6 LPG, butane
MQ-7 Carbon Monoxide
MQ-8 Hydrogen Gas
MQ-9 Carbon Monoxide, flammable gases
MQ131 Ozone
MQ135 Air Quality (CO, Ammonia, Benzene,
Alcohol, Smoke)
MQ136 Hydrogen Sulphide gas
MQ137 Ammonia
MQ138 Benzene, Toluene, Alcohol, Propane,
Hydrogen & Formaldehyde gas
MQ214 Methane, Natural Gas
MQ216 Natural gas, Coal Gas
MQ303A Alcohol, Ethanol, smoke
MQ306A LPG, butane
MQ307A Carbon Monoxide
MQ309A Carbon Monoxide, flammable gas
Table 1 : MQ Series Gas Sensors and their sensitivity

Since we are using MQ-6 Gas Sensor in the model so let’s discuss it in detail.

MQ-6 GAS SENSOR:

This is a simple-to-use liquefied petroleum gas (LPG) sensor, MQ-6 is suitable for sensing LPG concentrations
in the air. The MQ-6 can detect gas concentrations anywhere from 200 to 10,000ppm.It has high sensitivity and
fast response time. The sensor’s output is an analog resistance. The drive circuit is very simple; all we have to
do is power the heater coil with 5V, add a load resistance, and connect the output to an ADC.

14
Pin Configuration:

Figure 8 :MQ-6 Gas Sensor

• Vcc: This pin supplies power to the module, typically operating at +5V.
• Ground: Connects the module to the system ground
• Digital Output: This pin can provide digital output by setting a threshold value using the
potentiometer.
• Analog Output: Outputs analog voltage in the range of 0-5V based on the gas intensity

Features:

• Operating voltage: 5V & Heater Voltage: 5.0V


• Highly sensitive to iso-butane, propane, and LPG gas
• Detection range: 100-10,000 ppm
• Fast Response Time: <10s
• Lower sensitivity to alcohol and smoke

15
3.2.3 SERVO MOTOR:

Figure 9 :Servo Motor

A servo motor is a type of motor that can rotate with great precision. It is just made up of a simple motor which
runs through a servo mechanism. If motor is powered by a DC power supply then it is called DC servo motor,
and if it is AC-powered motor then it is called AC servo motor.We are discussing DC powered motor here as
we are using it in this model. Apart from this major classification, there are many other types of servo motors
based on the type of gear arrangement and operating characteristics. These are being used in many applications
like toy car, RC helicopters, Robotics, etc.

Servo motors are rated in kg/cm most hobby servo motors are rated at 2kg/cm or 5kg/cm or 10kg/cm. This
tells us that, how much weight your servo motor can lift at a particular distance from the motor shaft, the
greater the distance the lesser the weight carrying capacity.

DC Motor :The heart of a servo motor is a regular DC motor, which turns shafts to create movement.

Gear Assembly: The motor's output shaft is connected to a set of gears. It is used to reduce RPM and to
increase torque of the motor.

Circuit Board : DC motor is connected to circuit board. This controls rotation of motor as well as direction of
rotation.

Potentiometer :It is connected to the output gear of the servo as well as circuit board.It is a variable resistor ,
when the final gear rotates it rotates the potentiometer which changes the resistance and the circuit board
reads this to know the position of the output.

16
Figure 10: Components of Servo Motor

The controller, whether it's an Arduino or a Servo Tester, transmits a signal to the servo motor, specifying the
position it should rotate to. This signal is Pulse Width Modulation (PWM), meaning the angle of rotation is
determined by the duration of the applied pulse. The width of the pulse dictates the servo's position, and as
long as the pulse remains consistent, the motor will maintain its position. Adjusting the voltage of the power
supply alters the height of the pulse, while the width of the pulse remains constant. Position control can be
achieved by programming in the Arduino IDE.Features of MG996R high torque servo motor :

• Operating voltage: 4.8 ~ 6.6V


• Gear Type: Metal gear
• Operating speed: 0.19sec/60degree (4.8V) ; 0.15sec/60degree (6.0V)

Figure 11 : Relation between Width of Pulse and position of Servo

17
Wire Configuration :

• Brown : Ground wire


• Red : +5V powers the motor
• Orange : PWM signal is given in through this wire to drive the motor

3.2.4 LED (Light Emitting Diode):

An LED is a semiconductor device that emits light upon the passage of an electric current. In this
application, it serves as a visual indicator to convey the detector's status, facilitating user comprehension.
LEDs come in various colors, with red and green being the most prevalent, enabling users to discern the
detector's condition effortlessly. These devices boast low power consumption, extended lifespan, rapid

response times, and swift switching capabilities.

Figure 12 : LED Bulb

LEDs are the diodes that only allow electrical current to flow in one direction. This means that they are
polarized, with the positive pin being the Anode (+) and the negative pin being the Cathode (-).

3.2.5 BUZZER :

A buzzer is an audio signalling device which can be mechanical, electromechanical or piezoelectric. In this
model we are using it as an alarm to alert the user for LPG gas leaks. We are using 2 pin buzzer.

Figure 13 : Buzzer

18
The loud sound produced by the buzzer ensures that the user is alerted even in noisy environment. It is also
resistant to vibration, shock and humidity, making it a durable and reliable sound producing option. Buzzers
have two pins: a positive (anode) pin and a negative (cathode) pin.

3.2.6 GSM MODULE (SIM 900A) :

Figure 14 : GSM Module

A GSM module serves as a communication tool for accessing the Global System for Mobile
Communications (GSM) network, enabling devices to transmit and receive data, voice calls, and SMS
messages. Among the array of GSM modules available in the market, the SIM900A module stands out for its
dependable performance and adaptability.

With the SIM900A module, users can engage in GPRS data transmission, SMS communication, and and
voice call functionalities. Utilizing USART (Universal Synchronous/Asynchronous Receiver/Transmitter)
communication, this module establishes a connection with a microcontroller or PC terminal. It relies on AT
(Attention) commands to configure operational modes and execute various tasks such as making calls (ATD)
and sending SMS messages (+CMGS).

19
Figure15 : SIM900A pin configuration

SIM900A GSM Module Pin Configuration Description:

GPIO Pins:

The GPIO pins helps in performing simple and advance I/O function. The GPIO pins in SIM900A are :

• GPIO1 – Pin40
• GPIO2 – Pin41
• GPIO3 – Pin42
• GPIO4 – Pin43
• GPIO5 – Pin44
• GPIO6 – Pin47
• GPIO7 – Pin48
• GPIO8 – Pin49
20
• GPIO9 – Pin50
• GPIO10 – Pin51
• GPIO11 – Pin67
• GPIO12 – Pin68
Status Pins :
The module has two status pins the first one is for, the working status of the module & the second for
communication status. Status means either the module is connecting to the network or other network
functions etc.
• STATUS – Pin52
• NIGHTLIGHT – Pin66
SIM900A Display Interface Pins :

The device offers a four pin display interface. The use of interface helps to get the visualization. The display
pins are:

• DISP_DATA – Pin12 – For Display Data


• DISP_CLK – Pin11 – For Clock Input
• DISP_CS – Pin14 – To enable the display
• DISP_D/C – Pin13 – To select between data and command

I2C Pins

I2C is one of the multiple kinds of communication SIM 900A has , SIM900A has a single I2C protocol pin.
• SCL – Pin38
• SDA – Pin37
SCL for clock pulse & SDA for data.

SIM900A GSM Module Keypad Interface Pins

The module will take the keypad data as a 2D matrix value from the KCB pins for each value. The keypad
interface pins in the module are:

• KBR0~KBR4 (ROWS) – Pin40~Pin44


• KBC0~KBC4 (COLUMN) – Pin47~Pin51

21
Serial Port

The UART (Universal Asynchronous Receiver-Transmitter) serial interface relies on two dedicated pins, RX
and TX, for effective data communication. These pins operate independently of any other pins or modules.
However, in addition to RX and TX, this module also incorporates extra pins designated for status and data
indication purposes. Through the integration of these pins, the serial port functionality extends to facilitating
the generation of the RS-232 connector. In summary, the serial pins include RX, TX, and supplementary pins
for status and data indication. All the serial pins are:

• RXD – Pin10 – To receive the data


• TXD – Pin 9- To send the data
• RTS – Pin8 – To send the request of data transmission
• CTS – Pin7 – To clear the send request
• RI – Pin4 – Ring indicator
• DSR – Pin6 – To indicate that data set ready
• DCD – Pin5 – To indicate data carry detect
• DTR – Pin3 – To indicate data terminal ready
Debug Interface

Debugging is essential for developers to identify and rectify issues within the module and to update its
firmware . This module features dedicated serial interface pins specifically allocated for debugging purposes.
Both pins are:

• DBG_TXD – Pin27 – For Data Transmission


• DBG_RXD – Pin28 – For Data receiving
SIM Interface

The module relies on various devices for certain functionalities, with the SIM being the most crucial
component. To enable full operation of GPRS/GSM functions, the SIM must establish a connection with the
module. All interfaces related to the SIM within the module need to be properly configured. All the sim
interface of the module is:

• SIM_VDD – Pin30 – Power Supply of the SIM


• SIM_DATA – Pin31 – For data output
• SIM_CLK – Pin32 – For clock pulse
• SIM_RST – Pin33 – For reset
• SIM_PRESENCE – Pin34 – To detect the SIM

22
SIM900A Analog to Digital converter Pins

The module has a single A-D pin. The voltage range on the ADC pin is from 0-3

• ADC – Pin25
PWM Pins

Due to IoT, the module offers two PWM pins which helps to make the IoT and PWM based device without
using any third interface.

• PWM1 – Pin35
• PWM2 – Pin36
Audio Interface

The audio interface facilitates the connection of both the microphone and speaker to the module. By linking
the Line, Audio, and Speaker connections, users can utilize the module to make phone calls.

• MIC_P – Pin19
• MIC_N – Pin20
• SPK_P – Pin21
• SPK_N – Pin22
• LINEIN_R – Pin23
• LINE_L – Pin24
Control Pin

The device has two power-on pins designed to facilitate external activation. The first pin, PWRKEY,
necessitates a LOW signal to initiate the system's power on/off functions. Activation of this pin requires a
sustained input signal for a brief duration. The second pin, PWRKEY_OUT, is connected in parallel with
PWRKEY and serves to control the device's power state.

• PWRKEY – Pin1
• PWRKEY_OUT – Pin2
Reset pins

The device has an external LOW input signal reset pin to reset the device with the use of an external signal.

• NRESET – Pin16

23
SIM900A GSM Module RF Antenna

To increase the range of the SIM900A module, it is necessary to connect the antenna pin to an external wire.
Additionally, an official antenna designed for the module is readily available.

• RF_ANT – Pin60

Power Pins

The module features various types of I/O power pins, among which VRTC stands out as crucial. It serves as
the power supply for the RC circuit within the device. All power & ground pins of the module are:

• VBAT(Input) – Pin55, Pin56, Pin57


• VRTC (Input/Output) – Pin26
• VDD_EXT(OUTPUT) – Pin15
• GND – Pin17, Pin18, Pin29, Pin39, Pin45, Pin46, Pin53, Pin54, Pin58, Pin59, Pin61, Pin62,
Pin63, Pin64, Pin65

UART stands for Universal Asynchronous Receiver/Transmitter. It's a communication protocol facilitating
serial data exchange between two devices. Manufactured by SIMCom, the SIM900A is a GSM/GPRS
module enabling device communication via the GSM (Global System for Mobile Communications) network.
Typically, the SIM900A module communicates with a microcontroller or another device via serial
communication, with UART being a prevalent interface utilized.

UART serves as the communication protocol utilized by the module to interact with the host device, be it a
microcontroller or a computer. Through UART, the host device transmits commands and data to the
SIM900A module, which responds accordingly. This communication enables the host device to manage the
SIM900A module, facilitating actions like sending and receiving SMS messages, making phone calls, and
accessing the internet via the GSM network.

AT commands provide a standardized interface for managing and engaging with GSM modules. When
transmitted from a microcontroller or computer to a GSM module via a serial interface like UART, these
commands are interpreted by the module, prompting it to execute the relevant actions. For instance, issuing
an AT command to initiate a call instructs the GSM module to dial the specified phone number.

Here's a basic list of common AT commands:

1. AT – This command verifies the communication link between the module and the computer.
24
2. +CMGF – This command is employed to configure the SMS mode, allowing for the selection of
either text or PDU mode by assigning a value of 1 or 0, respectively.
3. +CMGW – This command is utilized to save messages in the SIM card.
4. +CMGS – This command is employed to transmit an SMS message to a specified phone number.
5. ATD – This command is utilized to initiate a call to a specified phone number.
6. ATA – This command is employed to respond to an incoming call. The arrival of an incoming call is
signified by the message "RING," repeated for each ring. Upon the termination of the call, the screen

displays "NO CARRIER."


7. ATH – This command is utilized to sever the connection between the remote user and the GSM
module.

Key Features :

• Single supply voltage: 3.4V – 4.5V


• Power saving mode: Typical power consumption in SLEEP mode is 1.5mA
• Frequency bands:SIM900A Dual-band: EGSM900, DCS1800. The SIM900A can search the two
frequency bands automatically. The frequency bands also can be set by AT command.
• GSM class: Small MS
• GPRS connectivity:GPRS multi-slot class 10 (default) , GPRS multi-slot class 8 (option)
• Transmitting power: Class 4 (2W) at EGSM 900, Class 1 (1W) at DCS 1800
• Operating Temperature: -30ºC to +80ºC
• Storage Temperature: -5ºC to +90ºC
• DATA GPRS: download transfer max is 85.6KBps, Upload transfer max 42.8KBps
• Supports CSD, USSD, SMS, FAX
• Supports MIC and Audio Input
• Speaker Input
• Features keypad interface
• Features display interface
• Features Real Time Clock
• Supports UART interface
• Supports single SIM card
• Firmware upgrade by debug port
• Communication by using AT command

25
3.3 CIRCUIT

Figure 16 : Circuit

3.4 WORKING

ATmega328P have several input/output (I/O) pins. These pins can be configured as digital inputs or outputs,
analog inputs, or specialized communication interfaces like UART(Universal Asynchronous
Receiver/Transmitter), SPI(Serial Peripheral Interface), or I2C(Inter-Integrated Circuit). The microcontroller
interacts with external devices or sensors through these pins, receiving inputs from sensors or controlling
actuators like LEDs, motors.

At the heart of the microcontroller is the central processing unit (CPU), responsible for executing
instructions. In Arduino UNO board, the CPU is typically an Atmel 8-bit microcontroller based on the AVR
architecture. It fetches instructions from memory, decodes them, and executes them sequentially.
Microcontrollers have different types of memory:

• Flash Memory :This is where the program code (sketch) is stored. In Arduino, you upload your code
to the flash memory.
• SRAM(Static Random Access Memory): Used for storing variables and data during program
execution. It's volatile memory, meaning its contents are lost when power is turned off.
• EEPROM(Electrically Erasable Programmable Read-Only Memory): EEPROM: memory whose
values are kept when the board is turned off (like a tiny hard drive).Microcontrollers have an
internal clock that generates clock pulses for synchronizing operations. Timers are used for
generating precise time intervals, PWM (Pulse Width Modulation) signals, or forcounting external
26
events. The ATmega328P features built-in PWM functionality on some of its digital pins. PWM
signals can be used to control the intensity of LEDs, the speed of motors, or the position of servo
motors.

Microcontrollers can respond to external events asynchronously through interrupts. When an interrupt
occurs, the CPU temporarily suspends its current task to handle the interrupt service routine (ISR). Interrupts
are commonly used for time-critical tasks or for handling external events like button press or sensor reading.

In the Arduino environment, developers write programs called sketches using the Arduino Integrated
Development Environment (IDE). These sketches are written in C/C++ and are compiled into machine code
that can be executed by the microcontroller.

MQ-6 gas sensor, works based on the principle of detecting changes in electrical conductivity in the presence
of a target gas. The sensor typically consists of a sensing element made of a metal oxide semiconductor
material, which changes its resistance when exposed to different gases. It is connected to an analog pin of the
Arduino for reading the voltage across its sensing element.

Before use, the sensor may require calibration to establish a baseline resistance value in clean air. This can
be done by exposing the sensor to clean air for a specific period and recording the analog voltage output
from the sensor. When LPG gas is present in the environment, it interacts with the sensing element of the
MQ sensor, causing a change in its resistance. This change in resistance results in a corresponding change in
the analog voltage output from the sensor. Arduino continuously reads the analog voltage output from the
sensor and convering it inn digital value using ADC (Analog-to-Digital Converter).

System enables the buzzer sound ‘ON’, Blinking of Red LED and the Servo motor turns the knob of the Gas
regulator to ‘OFF’ state to terminate the LPG supply and avoid any disastrous condition.

Then the servo motor will trip the knob of regulator, Arduino sends the PWM signal to servo motor which
determines which position it should rotates to. The width of the pulse determines the position of the servo.
By decreasing the width of pulse the servo knob rotates from 90 degree to 0 degree making regulator OFF
and hence preventing further leakage.

27
Figure 18 : Flowchart

3.5 MAJOR CHALLENGES

1. Accuracy and Reliability: Different environmental factors such as temperature, humidity, and
interference from other gases can affect sensor readings, leading to false alarms or missed
detections.
2. Calibration : Ensuring proper calibration procedures and scheduling regular maintenance can be
challenging, especially in remote or inaccessible locations.
3. Response time : Achieving a fast response time from sensor detection to triggering alarms or
shutdown mechanisms can be challenging, especially with varying gas concentrations and sensor
technologies.
4. Integration Complexity : Integrating multiple components such as gas sensors, Arduino
microcontrollers, GSM modules, and actuators (e.g., buzzers, servo motors) into a cohesive system
can be complex. Ensuring seamless communication and compatibility between different
components requires careful planning and programming.

28
5. Cost : Developing cost-effective solutions for LPG gas leakage detection and prevention is crucial,
especially for widespread adoption in various settings. Balancing the cost of components, sensors,
and communication modules with system performance and reliability poses a challenge.
6. Power Consumption : Minimizing power consumption is essential, particularly for systems
intended for continuous monitoring in remote or battery-operated applications. Optimizing the
power usage of sensors, microcontrollers, and communication modules while maintaining
functionality can be challenging.
7. Data Management and Communication : Managing and transmitting data from the gas detection
system to monitoring centers or users' devices securely and reliably can be challenging, particularly
in remote or constrained environments with limited connectivity.
3.6 APPLICATIONS :
• Home Safety Systems : Implementing LPG gas leakage detection systems in homes ensures the
safety of occupants by promptly alerting them in case of a gas leak. Arduino-based detectors can be
connected to alarms, sirens, or even IoT devices to send notifications to smartphones.
• Commercial Kitchens : Restaurants and other food establishments that use LPG for cooking can
deploy Arduino-based gas leak detection systems to prevent accidents in their kitchens. Such systems
can automatically shut off gas supplies and notify staff in the event of a leak.
• Industrial Environments : Industries that use LPG for various processes can benefit from gas leakage
detection systems to prevent accidents and ensure workplace safety. Arduino-based solutions can
integrate with existing industrial control systems for seamless operation.
• Transportation : LPG-powered vehicles can also benefit from gas leakage detection systems to
prevent accidents during refueling or due to leaks in the vehicle's fuel system. Arduino-based
detectors can be integrated into the vehicle's onboard electronics for real-time monitoring.
• Laboratories and Research Facilities : Laboratories and research facilities that use LPG for
experiments or as a fuel source can enhance safety by deploying gas leak detection systems. Arduino-
based solutions can provide cost-effective monitoring in such environments.
• Greenhouses : LPG is sometimes used in greenhouses for heating purposes. Implementing gas
leakage detection systems using Arduino can help prevent accidents and ensure the safety of workers
and plants in greenhouse environments.
• Remote Monitoring : Arduino-based gas leakage detection systems can be equipped with wireless
communication modules (such as GSM or Wi-Fi) for remote monitoring. This allows users to receive
alerts and monitor gas levels from anywhere, enhancing convenience and safety.
• 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
29
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 7 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.

CONCLUSION :

After assessing the project's capabilities, it's evident that the LPG gas leakage detection system is remarkable
and essential for safeguarding both industrial and domestic users in their daily activities. This system proves
invaluable in potentially life-threatening situations, offering timely alerts through the GSM module. Utilizing
a sensor node capable of detecting gases like CO2, oxygen, and propane, the system accurately identifies
leaks. It also provides crucial data on transmission range and power consumption.

Looking ahead, the system holds vast potential for expansion across various sectors. With the capacity to
detect a broader range of gases, it can offer enhanced safety measures. Upon detection of gas leaks, prompt
action can prevent further accidents, offering significant benefits in safety management. Moreover, plans are
underway to make the system portable, enabling users to carry it anywhere for added convenience. By
integrating advanced technologies such as GSM or Raspberry PI, the system aims to automatically
incorporate local fire service details via the internet, enhancing its effectiveness in any location.

Considering these opportunities, the system could find valuable application in poultry farms, where gas leaks
in enclosed spaces pose significant risks. By addressing these challenges, the system contributes to a safer
environment for users across various industries and settings.

30
CHAPTER 4

IOT BASED MODEL

4.1 FLOWCHART :

Figure 19: Block Diagram

4.2 ESP8266WIFI MODULE :

An ESP8266 Wi-Fi module is a SOC microchip mainly used for the development of end-point IoT (Internet
of things) applications. It is referred to as a standalone wireless transceiver, available at a very low price. It
is used to enable the internet connection to various applications of embedded systems.
ESP8266 Wi-Fi module is designed to support both the TCP/IP capability and the microcontroller access to
any Wi-Fi network. It provides the solutions to meet the requirements of industries of IoT such as cost,
performance , power, and design.

It can be used as either a slave or a standalone application. If it runs as a slave to a microcontroller host, then
it can be used as a Wi-Fi adaptor to any type of microcontroller using UART/SPI. If the module is used as a
standalone application, then it provides the functionality of the microcontroller and Wi-Fi network both.

The ESP8266 Wi-Fi module is am microchip which is highly integrated with RF balun, power modules, RF
transmitter & receiver, analog transmitter & receiver, amplifiers, external circuitry, filters, power modules,
digital baseband, and other necessary components.

A series of AT commands are required by the microcontroller to establish communication with the ESP8266
Wi-Fi module. Consequently, it is equipped with AT command software, facilitating Arduino Wi-Fi
functionalities and allowing the loading of various software for custom application development directly
onto the module's memory and processor.

31
The processor of this module is based on the Tensilica Xtensa Diamond Standard 106 micro and operates
easily at 80 MHz. Different ESP modules, designed by third-party manufacturers, include:

• ESP8266-01 designed with 8 pins (GPIO pins -2)


• ESP8266-02 designed with 8 pins (GPIO pins -3)
• ESP8266-03 designed with 14 pins ( GPIO pins- 7)
• ESP8266-04 designed with 14 pins (GPIO pins- 7)
The ESP8266 Wi-Fi module boasts a boot ROM of 64 KB, user data RAM of 80 KB, and instruction RAM
of 32 KB. It supports 802.11 b/g/n Wi-Fi networks at 2.4 GHz, along with I2C, SPI, I2C interfacing with
DMA, and a 10-bit ADC. Connecting this module to a microcontroller is straightforward via a serial port. An
external voltage converter is necessary only if the operating voltage exceeds 3.6 Volts. It is most widely
used in robotics and IoT applications due to its low cost and compact size.

The pin configuration of the ESP8266 Wi-Fi module operates in two modes:

Figure20 : Pin Configuration of ESP8266 Wifi Module

1. Flash Mode: When GPIO-0 and GPIO-1 pins are active high, then the module runs the program,
which is uploaded into it.
2. UART Mode: Activated when GPIO-0 is active low and GPIO-1 is active high, enabling
programming mode via either serial communication or an Arduino board.

Key specifications/features of the ESP8266 Wi-Fi module include:

• Compact size and affordability


• Based on the L106 RISC 32-bit microprocessor core running at 80 MHz
• Requires a 3.3 Volts power supply with a current consumption of 100 mA
• Supports less than 10 microAmps deep sleep
• Compatible with various developmental platforms such as Arduino, programmed using AT
commands, Arduino IDE, or Lua script

32
• Operates on a 2.4 GHz Wi-Fi network, supporting WPA/WPA2, WEP authentication, and open
networks
• Incorporates I2C and SPI serial communication protocols
• Offers 10-bit analog to digital conversion and PWM modulation
• Includes GPIO pins - 17, instruction RAM of 32 KB, user-data RAM of 80 KB, and ETS systems-
data RAM of 16 KB.

4.3 WORKING :

The LPG gas sensor continuously monitors the surrounding air for the presence of LPG gas. When the
sensor detects LPG gas above a certain threshold level, it sends a signal to the Arduino board. Upon
receiving the signal from the gas sensor, the Arduino triggers the buzzer and LED to activate. The Arduino
board is equipped with an ESP8266 Wi-Fi module, which allows it to connect to the internet. The ESP8266
establishes a connection to the local Wi-Fi network, enabling communication with external services and
platforms.

The system utilizes the Blynk IoT platform for remote monitoring and control. The Arduino board
communicates with the Blynk cloud server using the ESP8266 module. Through the Blynk mobile app or
web interface, users can receive real-time alerts about gas leakage and take necessary actions.

In addition to receiving alerts, users can remotely control the system via the Blynk app.

The servo motor is connected to the gas supply valve and can be controlled by the Arduino board. the
Arduino activates the servo motor. The servo motor rotates to close the gas valve, cutting off the supply and
preventing further leakage.

33
Figure 21: Blynk showing LPG detection

Figure 22: Blynk showing normal condition

34
REFERENCES

[1] Mohammad Abas Malik, Magray Abrar Hassan and Adnan Shafi , “ IOT Based LPG Leakage Detection
System With Prevention Compensation”, EasyChair Preprint № 3917 , , July 21, 2020.

[2] https://www.javatpoint.com/arduino-uno ,accessed on 18/02/2024.

[3] https://en.wikipedia.org/wiki/List_of_Arduino_boards_and_compatible_systems , accessed on


21/02/2024.

[4] https://circuitdigest.com/article/everything-you-need-to-know-about-arduino-uno-board-hardware ,
accessed on 21/02/2024.

[5] https://learn.sparkfun.com/tutorials/what-is-an-arduino/all , accessed on 17/02/2024.

[6] https://robocraze.com/blogs/post/mq-series-gas-sensor , accessed on 26/02/2024.

[7] https://www.flyrobo.in/blog/mq-sensor-series , accessed on 26/02/2024.

[8]https://www.electronicwings.com/arduino/sim900a-gsm-module-interfacing-with-arduino-uno , accessed
on 03/03/2024.

[9]https://microcontrollerslab.com/sim900a-gsm-module-pinout-examples-applications-datasheet/ ,accessed
on 03/03/2024.

[10] https://quartzcomponents.com/products/sim900-gsm-module ,accessed on 04/03/2024.

[11] https://www.engineersgarage.com/at-commands-gsm-at-command-set/ , accessed on 04/0/2024.

[12] Rakesh Jain ,” Automatic LPG Gas Leakage Detection using Arduino” Electronics For You , Page No.
104-105 ,August 10, 2023.

[13] https://kitsguru.com/products/mq-6-sensor-module , accessed on 02/03/2024.

[14] https://electronicsprojects.in/lpg-gas-leakage-detector-using-arduino-mq6-gas-sensor-led-and-buzzer/ ,
accessed on 22/01/2024.

[15] https://www.engineersgarage.com/microcontroller-based-lpg-gas-leakage-detector-using-gsm-module/
,accessed 01/03/2024.

[16] Mr. Sivaprasad Lebaka, M. Ganga Rami Reddy, K. Devi Priya, N.V. Charan, B. Chandana,” Gas
Leakage Detection Using GSM Module & Arduino with SMS Alert”, Journal of Electronics and
Communication Engineering Research , Volume 8 ~ Issue 5 , pp: 06-11 (2022).

[17] https://www.electronicwings.com/sensors-modules/esp8266-wifi-module , accessed on 04/03/2024.

35
[18] https://www.elprocus.com/esp8266-wi-fi-module/ , accessed on 04/03/2024.

36
APPENDIX

CODE

#include <Servo.h>; //library for controlling servo motor

#include <SoftwareSerial.h>; //library for software serial communication

SoftwareSerial mySerial (7, 8); // allowing Arduino to communicate with external devices using these pins.

Servo myservo;// declares a Servo object named ‘myservo’

int pos = 20;//declaring variables to represent the pin numbers

int LED = 12;

int BUZZER = 13;

int LPG_sensor = 3;// MQ-6 SENSOR

int LPG_detected;

char msg;

void setup() // initial configuration of arduino

mySerial.begin (9600) ;

Serial.begin (9600) ; // start serial debugging

myservo.attach(11); //attached servo motor to pin 11

Serial.begin(9600);

pinMode(LED, OUTPUT);

pinMode(BUZZER, OUTPUT);

pinMode(LPG_sensor, INPUT);

myservo.write(pos);// servo position initialization

void loop(){

LPG_detected = digitalRead(LPG_sensor); //reads status of LPG sensor

37
Serial.println(LPG_detected);

if (LPG_detected == 1)

Serial.println("LPG detected...");

digitalWrite(LED, HIGH);

digitalWrite(BUZZER, HIGH);

myservo.write(pos+160);

delay(1000);

mySerial.println("AT+CMGF=1"); //command to set the GSM module in SMS Text Mode

delay(1000);

// command use to send SMS message

mySerial.println("AT+CMGS=\"+91**********\"\r");//10-digit mobile number

delay(1000);

mySerial.println("GAS LEAKAGE");//message which we want to send as an alert

delay(100);

mySerial.println((char)26); //indicate the end of an SMS message while communicating with a GSM module

delay(1000);

else

Serial.println("No LPG detected");

digitalWrite(LED, LOW);

digitalWrite(BUZZER, LOW);

myservo.write(pos);

38

You might also like