Acknowledgment
In the name of ALLAH
the most kind and most merciful we are thankful to almighty Allah for blessing
us with the strength and the courage to
complete this project.
We whould like to thank
our parents who kept backing us in all the time.we are also thankful to our
project supervisor “Engr Dr Sheraz Ahmad” under whose supervision,concern and
guadince we have
been able to
complete the project.
Certificate
I hereby declare and
certify that this thesis sis my own work and that, to the best of my knowledge
and belief, it contain no material previously written by another person nor
material which to a substantial extent has been accepted for the award of any
other degree or diploma of the university or other institute of high learning,
except where due acknowledgement has been made in the text.
Declaration
“
no
portion of the worked referred in the dissertation has beeb submitted in support
of an application for another degree or qualification of this or any other
university /institute or other institution
of learning”
Abstract
Liquefied Petroleum Gas (LPG) and Compressed natural gas (CNG) is
an inevitable on in day-to- day life.LPG is used in many range of applications
like cooking appliances, industrial appliances, in vehicles and as a propellant
and refrigerator. Due to leakage of LPG, it produces hazardous and toxic impact
on human begins and also other living creatures. To over this predicament, we
need quittance. There by, we speculate some solution to detect the LPG gas
leakage and make alert to users of it.
A dangerous LPG and CNG leak in your car, at a gas station, or
around a storage tank can be found with an ideal gas sensor. This device is
simple to integrate into an alarm system and can be used to sound an alarm or
provide a visual cue. The sensor has great sensitivity mixed with a short
response time. Additionally, the sensor can detect cigarette smoke, LNG
alcohol, iso-butane, and propane.
Here we are using MQ5 gas sensor for sensing the
leakage and produce the sound alarm by buzzer sound when it crosses the
threshold value of >400ppm.It switch on the fan to spread out compressed
gas. Once again it recheck the value if it crosses >700ppm it will setup a
SMS based alert mechanism by GSM module SIM900A.
The controller used here is Arduino. The sensor has excellent
sensitivity combined with a quick requital time. This paper provides design
approach on both software and hardware. Here for this purpose an embedded
system comprising of “Arduino controllers”, “Embedded C”, Gas sensor, “GSM
MODULE SIM900A”.
Table of contents
AKNOWLEDGMENT…………………………………………….….(2) CERTIFICATE……………………………………………………………...(3)
DECLARATION…………………………………………………………..(4) ABSTRACT…………………………………………………………………..(5)
TABLE OF CONTENTS………………………………………….…(6)
Chapter 1: Introduction………………………………………………………….9
1.1 Background…………………………………………………………9
1.2 Literature review………………………………………………….10
1.3 Aim of the
project…………………………………………………11
1.4 Methodology……………………………………………………….11
1.5 Significance of this
work………………………………………….12
1.6 Outline of this report……………………………………………...12
1.7 Conclusion…………………………………………………………13
Chapter 2: Project devices
used……..………………………………………….14
2.1
Ardunio……………………………………………………………….14
v Overview………………………………………………………..…14
v Schematic and reference design………………………………....15
v Summary………………………………………………..………...15
v Power……………………………………………………………...16
v Memory…………………………………………………………...16
v input & output……………………………………………….…...16
v communication…………………………………………………...17
v programming………………………………………………….….18
v Automatic reset……………………………………………….…..18
v Usb over current protection………………………………….….19
v Physical Characteristics………………………………………....19
2.2: GSM
Module…………………………………………………..……..20
v Overview……………………………………………………….20
v Feature…………………………………………….…………...20
v Specifications……………………………………………….….21
v Operating Condition…………………………………...……...23
v Pin Configuration……………………………………………..24
v Commands………………………………………………..…....27
2.3 Gas Sensor……………………………………………………………..……..29
v overview……………………………………………………..29
v Applications…………………………………………………30
v Dimension…………………………………………………...30
v Features……………………………………………….…..…31
v Specifications………………………………………………..31
v Descriptions…………………………………………………31
2.4 Buzzer………………………………………………………………………..33
v Overview……………………………………..………....33
v Applications………………………………………..…...33
v Dimensions………………………………………..…….34
v Features………………………………….……………...34
v Specifications…………………………………………...35
v Descriptions…………………......................................35
2.5 LCD………………………………………………………………………….36
v Overview……………………………………………...….36
v Features…………………………………........................37
v Specifications…………………………………………….37
v Dimensions…………………………………………........38
v Pin Descriptions…………………………………………38
2.6 LED…………………………………………………………………………..40
v Overview………………………………………………………...….40
v Characteristic………………………………………………………41
v Types…………………………………...........................................41
Chapter 3: Block Diagram and Flow Chart………………….………………...42
Chapter 4: Programming
Coding...………………….………………………...44
Chapter 5: Results and discussion……………………………..........................49
Chapter 6: Conclusion and Future Scope……………………………………...53
6.1 Conclusion………………………………………………………......53
6.2 Future
Scope……………………………………………………......53
References……………….………………………………………………….……54
Chapter 1
Introduction
1.1 Background :
Environment has the
most influence on people's health problems in their daily lives. As a result,
it is important to critically address environmental and industrial air quality
issues in order to raise awareness of the harm that the environment poses to
the health of the general public and workers. The majority of harmful gases,
including carbon monoxide (CO), refrigerant gas, and liquefied petroleum gas
(LPG), are odourless, colourless compounds that result from incomplete
combustion. Therefore, a gas detection device is required to continuously warn
the user of the safety status. Long-term exposure to the harmful chemical
carbon monoxide (CO), also known as the "silent killer," can cause
brain damage and even death in living things. The harmfulness of CO is based on
both, the concentration of the gas and the exposure time. As a result, exposure
to low levels of CO for an extended period of time can be just as deadly as
exposure to high levels of CO for a short time. Fires are the most prevalent
source of CO [1]. After a few hours of exposure, it may result in a headache
and lightheadedness in lesser concentrations (such as 100 ppm). Higher
concentrations (for instance, 3200 ppm) may result in mortality within 30
minutes, headaches, and dizziness within 5–10 minutes. The most dangerous
interior sources are the leak sources of CO, CO2 and CH4, which can be gas
tanks or the fire site and result in unconsciousness after a few breaths and
death in less than three minutes [2]. Alkanes gas or CO is the primary
constituent of coal gas or natural gas. Alkanes gas, CO, and CO2 are released
when chemical or ornamental materials are burned. The toxicity of these gases
themselves and the ease with which their buildup might catch fire are the two
main reasons why these gases are dangerous. The position of gas tank or
pipeline is normally permanent, so it is easy to inspect, however the fire site
is random, therefore it will be tough for inspection. [3] The threat posed by
CO gas is same to that posed by LPG and other environmentally hazardous gases.
Gas detector is a gas detection instrument. Only a gas leak or the
concentration of a leak can be detected. This is the dilemma we face on a daily
basis, and in an effort to find a solution, someone came up with the notion of
immediately alerting the public of gas leaks. Thus, the idea for our invention,
"MICROCONTROLLER BASED GASLEAKAGE ALERT SYSTEM VIA SMS," resulted
from accepting responsibility for society.
1.2 LITERATURE REVIEW:
The presence of dangerous LPG leakage in the
cars, service station or in the storage tank environment can be detected using
the Ideal Gas Sensor. This LPG gas leakage detector unit can be easily
integrated into a unit that can sound an alarm or give a visual suggestion of
the LPG concentration. The sensor has both admirable sensitivity and rapid
response time. This sensor can also be used to sense other gases like
iso-butane, propane, LNG and even cigarette smoke.
“Design and Implementation of an Economic Gas Leakage Detector”,
this project is developed to detect the gas leakage and providing immediate
alarm or intimation to the user. Developed the design proposed for home safety.
This system detects the leakage of the LPG and alerts the consumer about the
leak by buzzer. This project was developed using microcontroller ARM version7
processor and simulated using Keil software. Controller based LPG gas
Monitoring & Automatic Cylinder booking with Alert System [1].
This paper consists same like previous paper but here arduino
controller is used and detects the lpg gas leakage by gas sensor mq2 and within
a few minutes automatically switch on the exhaust fan and buzzer to provide the
alertness to the people. Here GSM SIM900A module is used to send the message to
the predefined number so information can be sent and can prevent fire accidents
[2].
This paper involves like previous paper but involves, they
provided security issues against thieves, leakage and fire accidents. In those
cases their system sends SMS to the emergency number provided to it. In the
proposed system we have designed “LPG gas monitoring and automatic cylinder
booking with alert system”. These report focus on detection of economic fuels
like petroleum, liquid petroleum gas, alcohol etc., and alert the surrounding
people about the leakage through SMS. It also sense surrounding temperature, so
that no fire accidents occurs. The one more important feature is automatic
cylinder booking by noticing the current expenditure of LPG gas in our daily
life. These projects alert the user by sending message to mobile through SMS in
three conditions. They are
When LPG gas
weight reaches to maximum threshold value.
·
When the LPG gas exceed its peak value.
·
When the temperature exceed more than room temperature.
· This project gives alert message
by buzzing the buzzer and through SMS to the house holders.
We also provide automatic doors and windows opening, so that the
compressed gas can spread in to air freely. Hence a fire accident does not
occur [3].
1.3 Aim of the project :
1. To examine how well
a gas sensor can detect alcohol and LPG smoke.
2. To create a gas
control system with an alarm indication and buzzer.
3. To
create a system that can send out automatic SMS alerts.
1.4 Methodology:
The development of an
alert system for a gas detector is the goal of this project. This project makes
use of the MQ6 gas sensor, which can identify the presence of smoke, alcohol,
and liquefied petroleum gas (LPG). These sensors will determine the gas
concentration based on their voltage output. The Arduino Uno served as the
system's microcontroller and was used to control the sensors in the alarm and
data monitoring systems. The circuit also incorporates LED GSM and buzzer.GSM
will deliver the alarm as SMS from gas sensor to a remote mobile.
1.5 Significance of this
work :
This project is very useful in day to
day life and adds extra safety,Use of this project makes your remote place
secure from GAS Leakage by taking proper action when we get alert.
1.6
Outline of this report :
This report offers a complete information about all the components used in this project. The components utilised are:
Arduino UNO
Gas sensor
LCD
GSM module
Buzzer
LEDS
Chapter 2 of its own
contains a detailed report on each and every component.
1.7 Conclusion:
The
"MICROCONTROLLER BASED GAS LEAKAGE ALERT SYSTEM VIA SMS" is finally
finished to my satisfaction. I've come to the conclusion that attaining our
goal will be really satisfying after gaining more knowledge and having more
experiences. I've prepared to meet my technological criteria. The information I
have obtained with this assignment genuinely will follow till the conclusion of
our profession. This technology is designed to let users feel at ease at work
and make it simple to monitor the range of air quality in the area from a
distance. The ability to easily obtain information about the air quality in a
building or industrial area by monitoring the system is another benefit of this
system device.
Chapter 2
Project Devices used
2.1 Ardunio
Overview:
·
Arduino Mega 2560 is a Microcontroller board based on
Atmega2560. It comes with more memory space and I/O pins as compared to other
boards available in the market.
·
There are 54 digital I/O pins and 16 analog pins incorporated on
the board that make this device unique and stand out from others.
·
Out of 54 digital I/O, 15 are used for PWM (pulse width
modulation).
·
A crystal oscillator of 16MHz frequency is added on the board.
·
This board comes with USB cable port that is used to connect and
transfer code from computer to the board.
·
DC power jack is coupled with the board that is used to power
the board. Some version of Arduino board lacks this feature like Arduino Pro
Mini doesn’t come with DC power jack.
·
ICSP header is a remarkable addition to Arduino Mega which is
used for programming the Arduino and uploading the code from the computer.
Figure 2.1.1 Ardunio Mega 2560
Schematic
and reference design :
Figure 2.1.2
Schematic Design
Summary:
Figure
2.1.3 Summary
POWER:
The Arduino Uno can be powered via the USB connection or with an external power supply. The power source is selected automatically. External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER connector. The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may be unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts. The power pins are as follows:
VIN: The input voltage to the Arduino board when it's using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
5V: This pin outputs a regulated 5V from the regulator on the board. The board can be supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it.
3V3: A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50mA.
GND: Ground pins.
IOREF: This pin on the Arduino board provides the voltage reference with which the microcontroller operates. A properly configured shield can read the IOREF pin voltage and select the appropriate power source or enable voltage translators on the outputs for working with the 5V or 3.3V.
Memory :
The ATmega2560 has 256 KB of flash memory for storing code (of
which 8 KB is used for the boot loader), 8 KB of SRAM and 4 KB of EEPROM (which can be read
and written with the EEPROM Library).
Input & Output :
Using pin Mode, digital Write, and digital read operations, each
of the 54 digital pins on the Mega can be utilised as an input or output. They
use 5 volts to work. Each pin contains an inbuilt pull-up resistor of 20–50 k
Ohms that is unconnected by default and has a maximum current capacity of 40
mA. Additionally, several pins perform specific tasks:
Serial 0 (RX) and 1 (TX) are followed by Serial 1 (19 RX and 18
TX), Serial 2 (17 RX and 16 TX), and Serial 3 (15 RX and
14 (TX) (TX). used to transmit and receive TTL serial data (RX and
TX). The corresponding pins of the ATmega8U2 USB-to-TTL Serial chip are also
connected to pins 0 and 1.
External Interrupts: 2 (Interrupt 0), 3, 18, 19, 4, 20, and 21
(Interrupt 5, Interrupt 4, and Interrupt 3).
(Interrupt 2, 2). These pins can be set up to initiate an
interrupt in response to low values, rising or falling edges, or value changes.
For more information, see the attach Interrupt function.
PWM: 0 to 13. Provide analogue Write function with 8-bit PWM
output.
52 (SCK), 53 (MISO), 51 (MOSI), and 50 (SPI) (SS). These pins
enable SPI communication, which the underlying hardware supports but is not yet
supported by the Arduino language. Additionally, the ICSP header, which is
physically compatible, has the SPI pins separated.
with the Diecimila and Duemilanove.
LED: 13. Digital pin 13 is wired to a built-in LED. the pin's HIGH
value causes the
When the pin is HIGH, the LED is on; LOW turns it off.
20 (SDA) and 21 on I2C (SCL). support I2C (TWI) wired connection
library(documentation on the Wiring website) (documentation on the
Wiring website). Keep in mind that these pins are not located where the
Duemilanove's I2C pins are.
The Mega2560 features 16 analogue inputs with a resolution of 10 bits
each (i.e. 1024 different values). They measure from ground to 5 volts by
default, but the AREF pin and analogue Reference() function let you to adjust
the top limit of their range. There are a few other pins on the board:
AREF. The analogue inputs' reference voltage. Combined with an
analogue reference.
Reset. For the microcontroller to be reset, bring this line LOW.
commonly used to include a reset button in
shields that obstruct the board's one.
Communication :
A computer, another Arduino, or other microcontrollers can all be
reached using a number of facilities included into the Arduino Mega2560. Four
hardware UARTs for TTL (5V) serial connection are provided by the ATmega2560.
The Arduino software includes a serial monitor that enables simple
textual data to be sent to and from the board; the RX and TX LEDs on the board
will flash when data is being transmitted via the ATmega8U2 chip and USB
connection to the computer; and the ATmega8U2 on the board channels one of
these over USB and provides a virtual com port to software on the computer (but
not for serial communication on pins 0 and 1).
On any of the digital pins of the Mega, a Software Serial library
enables serial communication.
SPI and I2C (TWI) communication are also supported by the
ATmega2560. You can use the Wire library, which is part of the Arduino
software, to make using the I2C bus simpler; for more information, check the
Wiring website's documentation. View the ATmega2560 datasheet for instructions
on how to use SPI communication.
Programming:
The Arduino software can be used to programme the Arduino Mega2560
(download). See the reference and tutorials for more information.
The boot loader that comes preburned with the Atmega2560 on the
Arduino Mega enables you to upload new code to it without using an external
hardware programmer.
It uses the original STK500 protocol for communication (reference,
C header files).
For further information, check these instructions. You can
alternatively avoid the boot loader and directly programme the microcontroller
using the ICSP (In-Circuit Serial Programming) header.
Automatic
(Software) Reset:
The Arduino Mega2560 is made in a way that enables it to be reset
by software running on a connected computer, as opposed to needing a physical
click of the reset button before an upload. A 100 nano farad capacitor is used
to connect one of the ATmega8U2's hardware flow control lines (DTR) to the
ATmega2560's reset line. The reset line lowers for a long enough period of time
when this line is asserted (taken low) to reset the chip. You can upload code
using the upload button in the Arduino environment by using this feature of the
Arduino programme. As a result, the boot loader's timeout can be shortened
because the upload's beginning and the lowering of DTR can be perfectly timed.
This configuration has additional effects. The Mega2560 resets each time a connection
is made to it from software when it is connected to a computer running either
Mac OS X or Linux (via USB). For the next half-second or so, the Mega2560's
boot loader is active. The initial few bytes of data transmitted to the board
after a connection is established will be intercepted, despite the fact that it
is configured to disregard invalid data (i.e., anything other than an upload of
new code). The Mega features a trace that can be cut to prevent the auto-reset.
If a sketch running on the board needs one-time setup or other data when it
first starts, ensure sure the programme with which it communicates waits a
second after initiating the connection and before delivering this data. To
re-enable the trace, solder the pads on either side of it together. It has the
label "RESET-EN." See this forum thread for more information on how
to disable the auto-reset by adding a 110 ohm resistor from 5V to the reset
line.
USB Overcurrent Protection:
The
USB ports on your computer are safeguarded from shorts and overcurrent by a
resettable polyfuse built into the Arduino Mega. The fuse offers an additional
layer of safety even though the majority of computers have their own internal
safeguards. The fuse will immediately cut off the connection if more than 500 mA
is applied to the USB port until the short or overload is resolved.
Physical
Characteristics:
The
Mega PCB has a maximum length and breadth of 4 and 2.1 inches, respectively,
with the power jack and USB connector extending past the former. The board can
be fastened to a surface or container using the three screw holes. In contrast
to the other pins' 100 mil spacing, digital pins 7 and 8 are separated by 160
mil (0.16"), which is not an even multiple.
The
majority of shields made for the Diecimila or Duemilanove are compatible with
the Mega. Analog inputs 0 to 5, the power header, and the ICSP header are all
situated in the same positions as the digital pins 0 to 13 (and the nearby AREF
and GND pins). Additionally, the main UART (serial port) and external
interrupts 0 and 1 are both situated on the same pins (0 and 1). (pins 2 and 3
respectively). SPI is accessible on both the Mega and Duemilanove/Diecimila via
the ICSP header. Please be aware that the Mega (20 and 21) and the Duemilanove
/ Diecimila do not share the same pins for I2C. (analog inputs 4 and 5).
2.2
GSM Module(Sim 900 TTL UART)
Overview:
GSM/GPRS TTL –Modem is built with SIMCOM Make SIM900
Quad-band GSM/GPRS engine, works on frequencies 850 MHz, 900 MHz, 1800 MHz and
1900 MHz. It is very compact in size and easy to use as plug in GSM Modem. The
Modem is designed with 3V3/5V TTL interfacing circuitry, which allows you to directly
interface to 5V microcontrollers(PIC,Arduino,AVRect)as well as 3V3
Microcontrollers ( ARM,ARM Cortex XX, ect) .The baud rate can be configurable
from9600-115200 through AT command. Initially Modem is in Auto baud mode. This
GSM/GPRS TTL Modem is having internal TCP/IP stack to enable you to connect
with internet via GPRS. It is suitable for SMS as well as DATA transfer
application in M2M interface. The modem needed only two wires (Tx,Rx) except
Power supply to interface with microcontroller/Host. The built in Low Dropout
Linear voltage regulator allows you to connect wide range of unregulated power
supply (4.2V -13V). Yes, 5 V is in between !! .Using this modem, you will be
able to send& Read SMS, connect to internet via GPRS through simple AT commands.
Features:
Ø High Quality Product (Not hobby grade)
Ø Quad-Band GSM/GPRS 850/ 900/ 1800/ 1900 MHz
Ø 3V3 or 5V interface for direct communication with MCU kit
Ø Configurable baud rate
Ø SMA connector with GSM
L Type Antenna.
Ø Built in SIM Card holder.
Ø Built in Network Status LED
Ø Inbuilt Powerful TCP/IP protocol stack for internet data
transfer over GPRS.
Ø Audio interface Connector
Ø Most Status & Controlling Pins are available at Connector
Ø Normal operation temperature: -20 °C to+55 °C
Ø Input
Voltage: 5V-12V DC
Specifications:
Ø Quad-Band 850/ 900/ 1800/ 1900 MHz
Ø GPRS multi-slot class 10/8
Ø GPRS mobile station class B
Ø Compliant to GSM phase 2/2+
Class 4 (2 W @850/ 900 MHz)
Class 1 (1 W @ 1800/1900MHz)
Ø Dimensions: 24*24*3mm
Ø Weight: 3.4g
Ø Control via AT commands (GSM 07.0707.05 and SIMCOM enhanced ATCommands)
Ø Low power consumption: 1.0mA (sleep mode)
Ø Operation temperature: -40°C to +85 °C\
Specifications
for Data :
Ø GPRS class 10: max. 85.6 kbps (downlink)
Ø PBCCH support
Ø Coding schemes CS 1, 2, 3, 4
Ø CSD up to 14.4 kbps
Ø USSD
Ø Non transparent mode
Ø PPP-stack
Specifications
for SMS via GSM/GPRS:
Ø Point to point MO and MT
Ø SMS cell broadcast
Ø Text and PDU mode
Software
features:
Ø 0710 MUX protocol
Ø embedded TCP/UDP protocol
Ø FTP/HTTP
Special
firmware:
Ø FOTA
Ø MMS
Ø Java (cooperate with Iasolution)
Ø Embedded AT
Specifications for Voice:
Ø Tricodec
Half rate (HR)
Full rate (FR)
Enhanced Full rate (EFR)
Ø Hands-free operation
Ø (Echo suppression)
Ø AMR
Half rate (HR)
Full rate (FR)
Interfaces:
Ø Analog audio interface.
Ø Serial interface.
Ø SMA Antenna Connector.
Ø Seriel Port Pins (RXD,TXD)
at 2mm Pitch RMC.
Ø Seriel Port Status and
Controlling Pins at2mm Pitch RMC.
Ø DC Power pins at 2mm Pitch
RMC.
Dimensions:
Figure 2.2.1 Dimensions
Operating Conditions:
Figure 2.2.2
Pin
Descriptions:
Figure 2.2.3 Pin Descriptions
Interfacing
Arduino With GSM Modem:
Figure 2.2.4
Getting Started
1) Insert SIM card
Open the SIM cardholder by sliding it as per the arrow mark and lift up. Insert the SIM card , so as to alignthe chamfered corner suits in card holder .After inserting the SIM card, lock the holder by sliding it to theopposite direction of arrow mark.
2) Connect The Antenna
Fix the Supplied RF antenna to the SMA Antennae connector and tighten it by Rotating the Nut (Never rotate the antennae for tightening ).
3) Connect the Pins
Connect the GSM modem as per the circuit diagram provided
4) Power the Modem
Power the modem from suitable power supply, which is having enough current capacity(>1A).
5) Check the Status of the LEDs
PWR LED - Red LED will lit
immediately STS LED - Green LED will lit after 1-2 seconds NET LED -Blue LED
will starts to blink in fast for few seconds(Searching For Network) And becomes
slow blinking once the Modem registers with the Network.
6)Network LED
The Network LED indicates the various
status of GSM module eg. Power on, Network registration & GPRS
connectivity. When the modem is powered up, the status LED will blink every
second. After the Modem registers in the network (takes between 10-60 seconds),
LED will blink in step of 3 seconds. At this stage you can start using Modem
for your application.
7) Baud rate
The Baud rate supported by the modem is between 9600 and 115200. Make sure the host system is set to the supported baud rate.
Ø The modem automatically sets to the baud rate of the first command sent by the host system after it is powered up. User must first send “A” to synchronize the baud rate. It is recommended to wait 2 to 3seconds before sending “AT” character. After receiving the “OK” response, Your Device and GSM Modem are correctly synchronized. So there is no need for setting the baud rate using commands.
Ø Before You Start using the modem, please make sure that the SIM card you inserted support the needed features and there is enough balance in SIM.!!!
EXPLANATION OF COMMONLY USED AT COMMANDS
v AT - This command is used to check communication between the module and the computer. For example,
AT OK The command returns a result code OK if the computer (serial port) and module are connected properly. If any of module or SIM is not working, it would return a result code ERROR.
v +CMGF - This command is used to set the SMS mode. Either text or PDU mode can be selected by assigning 1 or 0 in the command.
SYNTAX: AT+CMGF=<mode> 0: for PDU mode 1: for text mode The text mode of SMS is easier to operate but it allows limited features of SMS. The PDU (protocol data unit) allows more access to SMS services but the operator requires bit level knowledge of TPDUs. The headers and body of SMS are accessed in hex format in PD U mode so it allows availing more features. For example, AT+CMGF=1 OK
v 3) +CMGW - This command is used to store message in the SIM.
SYNTAX: AT+CMGW=” Phone number”> Message to be stored Ctrl+z As one types AT+CMGW and phone number, „>‟ sign appears on next line where one can type the message. Multiple line messages can be typed in this case. This is why the message is terminated by providing a „Ctrl+z‟ combination. As Ctrl+z is pressed, the following information response is displayed on the screen. +CMGW: Number on which message has been stored
v +CMGS - This command is used to send a SMS message to a phone number.
SYNTAX: AT+CMGS= serial number of
message to be send. As the command AT+CMGS and serial number of message are
entered, SMS is sent to the particular SIM. For example, AT+CMGS=1 OK
v ATD - This
command is used to dial or call a number.
SYNTAX: ATD<Phone number>(Enter)For example, ATD123456789
v ATA - This command is used to answer a call. An incoming call is indicated by a message „RING‟ which is repeated for every ring of the call. When the call ends „NO CARRIER‟ is displayed on the screen.
2.3 GAS SENSOR(MQ5)
Overview:
LPG/CNG Gas Sensor Module is intended to interface with Microcontroller without ADC Channels and programming to detect the existence of a dangerous LPG/CNG leak in your home, car, or in a service station, storage tank environment. Two pots are provided in this version of the LPG/CNG Gas sensor module, one for setting the trigger level and the other for the sensor's sensitivity. It enables detection of the occurrence or exacerbation of a predetermined LPG/CNG gas level. The module detects LPG/CNG leaks using a MQ-5 sensor. The MQ-5 is capable of detecting gas concentrations between 200 and 10,000 ppm.
One I/O pin from the host microcontroller is needed for the interface with the sensor module, which is done through a 4-pin SIP header that is compatible with breadboards. If the LPG/CNG concentration is higher than the preset value, the onboard microcontroller will inform the host controller by pulling the output pin to high and beginning to blink an onboard status LED. The onboard microcontroller provides an initial heating interval after power-up and then starts to measure LPG/CNG sensor output.
The sensor module's main purpose is to give users a way to compare LPG sources and set an alarm limit when the source exceeds predetermined levels. If you have a piped gas connection, it is advisable to fix the Gas Sensor Module close to the Gas Cylinder or next to the pipeline. Due to the fact that LPG and CNG are heavier than air, when a leak of either substance occurs, the gas will gravitate toward the floor. Therefore, it would be recommended to install the Gas Sensor Module almost 1 m above the ground for best results.
Figure 2.3.1 MQ5 Sensor
APPLICATIONS:
They are suitable for detecting gas leaks and are utilised in household and industrial gas leak detection systems.
Avoid alcoholic beverages, culinary odours, and cigarette smoke. Use LPG, CNG, iso-butane, propane, and LNG instead.
Dimensions(in mm):
Figure 2.3.2(a)
Figure 2.3.2(b)
FEATURES:
§ High quality dual panel design
§ Dual signal output (analog, TTL level)
§ Onboard LED indicator
§ Higher voltage when concentration is higher
§ Higher sensitivity to liquefied petroleum gas, natural gas
§ Reliable stability and long life
§ Adjustable sensitivity via potentiometer
Performance
specifications:
§ Detecting
Concentration: 300 to 10000 ppm
§ Input Voltage: 5 VDC
§ Power: 150 mA
§ Digital Output
Voltage: TTL digital 0 and 1 (0.1 V and 5 V)
§ Analog Output Voltage
(relatively clean): 0.1 V to 0.3 V
§ Analog Output Voltage
(highest concentration): 4 V
§ PCB Size: 32 x 20 x 22
mm
Functional
description:
In
a crust made of plastic and stainless steel net, a sensor formed of a micro
AL2O3 ceramic tube, a T in Dioxide (SnO2) sensitive layer, a measuring
electrode, and a heater is fixed. The heater offers the ideal working
environment for delicate components. Four of the six pins on the wrapped MQ-6
are used to retrieve signals, and the remaining two are utilised to supply
heating current.
Figure 2.3.3
According to the figure, we can see that the minimum concentration we can test is 200ppm and the maximum is 10000ppm, in a other word, we can get a concentration of gas between 0.02% and 1%. However, we can't provide a formula because the relation between ratio and concentration is nonlinear.
2.4Buzzer(Piezo)
Overview
:
A buzzer is an aural signalling device, as represented in the following figure. Buzzers are frequently used as alarms, timers, and confirmation devices for user input such mouse clicks and keystrokes. A piezoelectric device utilised in the project was an electrical buzzer that was powered by signals from an Arduino microcontroller.
Figure 2.4.1 Buzzer
Applications:
Electric electric ovens
washing machines
computer terminals
various devices that require speech synthesis output.
Dimensions:
Figure 2.4.2 Dimensions
Features
:
High-performance buzzers from the PS series use unimorph piezoelectric elements and are simple to integrate into a variety of circuits. • In comparison to electromagnetic units, they consume an incredibly small amount of electricity. • Since these buzzers are made for external stimulation, a single component can perform the functions of both a buzzer and an oscillator that produces musical tones. • They are compatible with robotic inserters. There are also models that can withstand moisture. • Lead wire type (PS1550L40N) with readily placed double-sided adhesive tape is ready.
5.5
Performance specifications:
Figure 2.4.3 Specifications
5.6
Functional description:
Figure 2.4.4
2.5 L C D (16*2)
Overview:
LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments and other multi segment LEDs. The reasons being: LCDs are economical; easily programmable; have no limitation of displaying special & even custom characters (unlike in seven segments), animations and so on.
A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command and Data.
The
command register stores the command instructions given to the LCD. A command is
an instruction given to LCD to do a predefined task like initializing it,
clearing its screen, setting the cursor position, controlling display etc. The
data register stores the data to be displayed on the LCD. The data is the ASCII
value of the character to be displayed on the LCD. Click to learn more about
internal structure of a LCD.
Figure 2.5.1 LCD
FEATURES:
•
5 x 8 dots with cursor
•
Built-in controller (KS 0066 or Equivalent)
•
+ 5V power supply (Also available for + 3V)
•
1/16 duty cycle
•
B/L to be driven by pin 1, pin 2 or pin 15, pin 16 or A.K (LED)
• N.V. optional for + 3V power supply
Specifications:
Figure 2.5.2 Specifications
Dimensions:
Figure 2.5.3 Dimensions
Pin Description:
Figure 2.5.4 (a) Pin
Description
Figure 2.5.4 (b)
2.6
LED
Overview:
A light-emitting diode (LED) is a semiconductor light source that emits light when current flows through it. Electrons in the semiconductor recombine with electron holes, releasing energy in the form of photons. This effect is called electroluminescence.[5] The color of the light (corresponding to the energy of the photons) is determined by the energy required for electrons to cross the band gapof the semiconductor.[6] White light is obtained by using multiple semiconductors or a layer of light-emitting phosphor on the semiconductor device.[7]
Appearing as practical electronic components in 1962, the earliest LEDs emitted low-intensity infrared light.[8] Infrared LEDs are used in remote-control circuits, such as those used with a wide variety of consumer electronics. The first visible-light LEDs were of low intensity and limited to red. Modern LEDs are available across the visible, ultraviolet, and infrared wavelengths, with high light output.
Early LEDs were often used as indicator lamps, replacing small incandescent bulbs, and in seven-segment displays. Recent developments have produced white-light LEDs suitable for room lighting. LEDs have led to new displays and sensors, while their high switching rates are useful in advanced communications technology.
LEDs have many advantages over incandescent light sources, including lower energy consumption, longer lifetime, improved physical robustness, smaller size, and faster switching. Light-emitting diodes are used in applications as diverse as aviation lighting, automotive headlamps, advertising, general lighting, traffic signals, camera flashes, lighted wallpaper and medical devices.
Figure 2.6.1 LEDS
Characteristics:
Types:
§
Gallium Arsenide (GaAs) – infra-red
§
Gallium Arsenide Phosphide (GaAsP) – red to infra-red,
orange
§
Aluminium Gallium Arsenide Phosphide
(AlGaAsP) – high-brightness red, orange-red, orange, and yellow
§
Gallium Phosphide (GaP) – red, yellow and green
§
Aluminium Gallium Phosphide (AlGaP) – green
§
Gallium Nitride (GaN) – green, emerald green
§
Gallium Indium Nitride (GaInN) – near ultraviolet,
bluish-green and blue
§
Silicon Carbide (SiC) – blue as a substrate
§
Zinc Selenide (ZnSe) – blue
§
Aluminium Gallium Nitride (AlGaN) – ultraviolet
Chapter
3
Block Diagram & Flow chart
3.1
Block Diagram:
Figure 3.1 Block Diagram
3.2
Flow Chart:
Figure 3.2 Flow Chart
Chapter 4
Programming
Program:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(9, 10);
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
const int analogInPin = A1;
const int red = A2;
const int green = A3;
const int yellow = A4;
const int buzzer = A5;
int sensorValue = 0;
void setup()
{
pinMode(red,OUTPUT);
pinMode(green,OUTPUT);
pinMode(yellow,OUTPUT);
pinMode(buzzer,OUTPUT);
pinMode(A1,INPUT);
Serial.begin(9600);
mySerial.begin(9600);
lcd.begin(); // initialize the lcd
// lcd.init();
// Print a message to the LCD.
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("SYSTEM READY...");
digitalWrite(buzzer, LOW);
Serial.println("msg send");
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
mySerial.println("AT+CMGS=\"03451519861\"\r"); // Replace x with mobile number
delay(1000);
mySerial.println("SYSTEM READY.... ");// The SMS text you want to send
delay(1000);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
digitalWrite(green,HIGH);
digitalWrite(yellow, LOW);
}
void loop()
{
sensorValue = analogRead(analogInPin);
if (sensorValue <180)
{
lcd.setCursor(0,0);
lcd.print(" GAS SCAN ON ");
lcd.setCursor(0,1);
lcd.print(" No Gas Leaking ");
Serial.println(" GAS SCAN ON ");
digitalWrite(yellow, LOW);
digitalWrite(red, LOW);
}
if (sensorValue >190&&sensorValue<195)
{
lcd.setCursor(0,0);
lcd.print("LOW GAS DETECTED ");
Serial.println("LOW GAS DETECTED ");
lcd.setCursor(0,1);
lcd.print("Message Sent ");
digitalWrite(yellow, HIGH);
digitalWrite(red, LOW);
digitalWrite(buzzer,HIGH);
delay(5000);
digitalWrite(buzzer,LOW);
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
mySerial.println("AT+CMGS=\"03451519861\"\r"); // Replace x with mobile number
delay(1000);
mySerial.println("LOW GAS DETECTED PLEASE CLOSE THE GAS VALVE.... ");// The SMS text you want to send
delay(1000);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
lcd.setCursor(0,1);
lcd.print(" ");
}
if (sensorValue >300&&sensorValue<305)
{
lcd.setCursor(0,0);
lcd.print("HIGH GAS DETECT ");
Serial.println("HIGH GAS DETECT ");
lcd.setCursor(0,1);
lcd.print(" Message Sent ");
digitalWrite(yellow, LOW);
digitalWrite(red, HIGH);
digitalWrite(buzzer,HIGH);
delay(5000);
digitalWrite(buzzer,LOW);
Serial.println("MSG SENT");
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
mySerial.println("AT+CMGS=\"03451519861\"\r"); // Replace x with mobile number
delay(1000);
mySerial.println("HIGH GAS DETECTED PLEASE CLOSE THE GAS VALVE.... ");// The SMS text you want to send
delay(1000);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
lcd.setCursor(0,1);
lcd.print(" ");
}
Serial.println("sensor");
Serial.println(sensorValue);
delay(50);
}
Chapter 5
Results
Result
This project deals with
the detection of LPG leakage and alert by giving buzzer sound, glowing of three
LED and sending an alert message to the
person for the precaution to be taken further. For this purpose gas leakage is
sensed by gas sensor MQ5 and sends the information to arduino by that firstly
it switch ON the LEDS and buzzer to give
the alertness in the industry or home. If it continues it again check the
threshold gas value and sends the message to the user. To prevent the gas
leakage accidents.
Case 1:
When there is no gas leakeage
the a message will be send to the user/owner through GSM and will display also
on the LCD as shown in figure 5.1, The green LED will be glow until there is no
any detection of gas.
Figure 5.1
Case 2:
When there is low gas leakage, the sensor will detect the gas and send the
message to the owner through GSM and Yellow LED will glow with along to display
the message also on LCD as shown in figure 5.2.
Figure 5.2
Case 3:
when there is high level gas leakage the sensor will detect the gas and send the
message to the owner through GSM and Red LED will glow with along to display
the message also on LCD as shown in figure 5.3.
Figure 5.3
In all these case the message will be send like this as shown in Figure
5.4
Figure 5.4
The laptop screen will show the gas level in PPM like as shown in Figure 5.5
Figure 5.5
Chapter 6
Conclusion and Future Scope
9.1 Conclusion:
Project
uses arduino controller at the gas sensor to sense the leakage of the gas,
detects it and send the information to the users by SMS. GSM module is used as
the communication purpose for sending the information to predefined number
which can alert to prevent the accident. Gas sensor is used to detect the gas
leakage. LEDS is used to to show the gas is of high level or low level. Buzzer
is used to buzzing the sound which can also alert the people nearby.
9.2 Future Scope:
In
future we will add automatic door opening application when LPG leakage has
sensed. Using DC motor control automatically turns off the knob of the
cylinder. To continuously monitoring the level of the LPG present in the
cylinder using weight sensor and automatically books the cylinder using a GSM
module.
References
[1].V.Naren, P.Indrajith²,
R.Aravind Prabhu³, C S Sundar GaneshI “ntelligent Gas Leakage
Detection System with IoT Using ESP 8266 Module” Proc. of IJAREEIE
Reviewed Journal Vol. 7, Issue 12, December 2018.
[2]. Aravinda Beliraya” GSM Based Gas Leakage Detection System Using
Arduino” Volume 4, Issue 10 October 2017
[3]. For Arduino Programming
:forum.arduino.cc
[4]. “Design and Implementation of an
Economic Gas Leakage Detector” A. MAHALINGAM, R. T. NAAYAGI,1, N. E.
MASTORAKIS§ Department of Engineering Systemsschool of Engineering, University
of Greenwich (Medway Campus)Chatham Maritime, Kent ME4 4TBUNITED KINGDOM,
article in Recent Researches in Applications of Electrical and Computer
Engineering
[5]. Johansson, A.; Birk, W.; Medvedev,
A., “Model-based gas leakage detection and isolation in a pressurized system
via Laguerre spectrum analysis”, Proc. of IEEE International Conference on
Control Applications, pp. 212-216, 1998.
[6]. Lopes dos Santos, P.; Azevedo-Perdicoúlis,T,P.Ramos,J.A.;
Martins de Carvalho, J.L.; Jank, G.; Milhinhos, “An LPV modeling and
identification approach to leakage detection in high pressure natural gas
transportation networks”, IEEE Transactions on Control Systems Technology, vol.
19, pp. 77-92, 2011.
[7]. Mandelis, Andreas, and Constantinos
Christofides. Physics, chemistry and technology of solid state gas sensor
devices. Vol. 174. John Wiley & Sons, 1993.
[8]. J. Jaber, M. Mohsen, and B. Akash,
"Energy analysis of Jordan's commercial sector," Energy Policy, Vol.
31(9), pp. 887-894, 2003.
[9].
Lopes dos Santos, P.; Azevedo-Perdicoúlis, T.- P.; Ramos, J.A.; Jank, G.;
Martins de Carvalho, J.L.; Milhinhos, J., “Gas pipelines LPV modelling and
identification for leakage detection”, Proc. of American Control Conference,
pp. 1211-1216, 2010.
[10].
Fraiwan, Luay, Khaldon Lweesy, Aya Bani-Salma, and Nour Mani. "A wireless
home safety gas leakage detection system." In Biomedical Engineering
(MECBME), 2011 1st Middle East Conference on, pp. 11-14. IEEE, 2011.
[11].
National Research Council (US). Committee for Pipelines, Public Safety, Scoping
Study on the Feasibility of Developing Risk-Informed Land Use Guidance near
Existing, and Future Transmission Pipelines. Transmission Pipelines and Land
Use: A Risk-informed Approach. Vol. 281. Transportation Research Board, 2004.
[12].
Abid Khan, Neju K. Prince, Shailendra Kumar Dewangan, Praveen Singh Rathore
(2014), “GSM based automatic LPG ordering system with leakage alert”, IJRET:
International Journal of Research in Engineering and Technology, Volume: 03
Special Issue: 12 | ICAESA - 2014 | Jun-2014.
[13].
Mahesh P Potadar , Pranav S Salvi, Ravindra B Sathe, Poonam S Chavan (2015),
“LPG Leakage Detection and Automatic Gas Cylinder Booking System”,
International Journal of Engineering Research ISSN: 2348-4039 & Management
Technology, May- 2015 Volume 2, Issue-3.
[14].
Yogesh A C, Ashwini P , Shruti B P (2013), “Automated unified system for LPG
refill booking and leakage detection : pervasive approach” , International
journal of Advanced Technology and Engineering Research, May 2013.
[15].
Directed Inspection and Maintenance at Gas Processing Plants and Booster
Stations, United States Environmental Protection Agency, BiblioGov 2013, ISBN
978-1288576357
[16].
“Industry Sector Emissions”, United States Environmental Protection Agency,
retrieved August
2014[http://epa.gov/climatechange/ghgemissions/sources/industry.html]
[17].
Gurney, D., Alleman, D., Kulp, T., “Development of hydrocarbon vapor imaging
system for petroleum and natural gas fugitive emission sensing”, United States
Department of Energy, 2004
[18].
Laframboise, G., Karschnia, B., “Improve exploration, production and refining
with „add-at-will‟ wireless automation”, Hydrocarbon Processing, p. 35 - 38,
2010
[19].
“The selection and use of flammable gas detectors”, UK Health and Safety
Executive, 2004
[20].
Murvay, P., Silea, I., “A survey on gas leak detection and localization
techniques”, Journal of Loss Prevention in the Process Industries, 25, p.966 -
973, Elsevier, 2012
DEDICATION
First
and foremost, I would like to thank my parents, for providing me with the
opportunity to engage in this project. Without their support I may not have found
myself at Faculty Of Engineering and Technolgy
Gomal University, nor had the courage to engage in this task and see it
through. They are well aware how this project and my studies throughout my four
years at Faculty Of Engineering and Technolgy Gomal University have formulated my outlook,
determination, motivation and perspective that will sculpt my future. Through
their and my sisters’ emotional support, intellectual stimulation and many
hours of identity-forming conversation, I am inspired to pursue an
unconventional dream in which I truly believe. And secondly my team member,
Without their support I may not have found myself at Faculty Of Engineering and
Technolgy Gomal University, nor had the
courage to engage in this task and see it through.
Importantly,
I would like to thank my Project supervisor Engr Dr Sheraaz Ahmad for the guidance, advice, and hours of
struggling through this challenging process. Since I was a sophomore, he has
helped me intellectualize a childhood fantasy into a course of academic study
that may eventually become a career. In the process, he has helped cultivate my
passion.
Regard
Mr . Muhammad Arsalan
Cell: +923497309190
Email:muhammadarsalan5750@gmail.com