Block Diagram:: Gas Sensor GSM Modem Arduino
Block Diagram:: Gas Sensor GSM Modem Arduino
Block Diagram:: Gas Sensor GSM Modem Arduino
ABSTRACT
Ideal gas sensor is used to detect the presence of a dangerous LPG leak in your car or
in a service station, storage tank environment. This unit can be easily
incorporated into an alarm unit, sound an alarm or give a visual indication. The
sensor has excellent sensitivity combined with a quick response time. The sensor can
also sense iso-butane, propane, LNG alcohol and cigarette smoke.
If the LPG sensor senses any gas leakage from storage the output of this sensor goes
low. This low signal is monitored by the microcontroller and it will identify the
gas leakage. Now the microcontroller is turn on LED and Buzzer. And send
messages as GAS LEAKAGE to a mobile number written in c-code.
Block Diagram:
Gas sensor
Arduino
LED
GSM
Modem
Buzzer
Platforms to be used:
Hardware: Arduino Uno board, Gas sensor Buzzer, LED and GSM
Modem
APPLICATIONS
This project is applicable in following fields:
1. Domestic gas leakage detector
2. Industrial Combustible gas detector
3. Portable gas detector
4. Homes
5. Factories
6. LPG storage
7. Gas cars
8. Hotels etc.
MICROCONTROLLER
It is the whole control of the project. LED, Buzzer and when LPG leak occurs. The
input/ output ports of the microcontroller is used for this.
Buzzer
When buzzer is blowing, this indicates the leakage of LPG gas. It is 12 V DC operated
buzzer.
LED
When LED is glowing, this indicates the leakage of LPG gas. It is 1.2 V DC operated
LED.
GSM Modem
To send alert as SMS to remote mobile number which defined in
program.
CONTENTS
AKNOWLEDGMENT.. (i)
CERTIFICATE.. (ii)
DECLARATION.. (iii)
ABSTRACT.. (iv)
1. INTRODUCTION
1.1 Background...6
1.2 Aim of the project................7
1.3 Methodology................7
1.4 Significance of this work.8
1.5 Outline of this report...............8
1.6 Conclusion9
2. ARDUINO
2.1 Overview.....................10.
2.2 Schematic and reference design..11
2.3 Summary..11
2.4 Power...12
2.5 Memory................13
2.6 Input and Output..13
2.7 Communication................13
2.8 Programming................14
2.9 Automatic reset...14
2.10 USB Over current protection.15
3. GAS SENSOR
3.1 Overview................16
3.2 Applications17
3.3 Dimensions.................18
3.4 Features...19
3.5 Performance specifications................20
3.6 Functional description.21
4. GSM Modem
4.1 Overview.................22
4.2 Features...22
4.3 Specifications..23
4.4 Operating conditions..25
4.5 Pin configuration...............25
5. BUZZER
5.1 Overview................30
5.2 Applications30
5.3 Dimensions.................31
5.4 Features...31
5.5 Performance specifications................32
5.6 Functional description.32
6. LED
6.1 Overview................33
7. BLOCK DIAGRAM
7.1 Block diagram.34
7.2 Flow chart...35
7.3 Program...36
BIBILOGRAPHY...39
Chapter 1
INTRODUCTION
1.1 Background
In humans daily life, environment gives the most significant impact to
their health issues. Therefore, environment and industry air quality issues are
critically discussed to increase the awareness and responsibility regarding the
threat on the environment towards public and workers health. Most of the
dangerous gas such as carbon monoxide (CO), refrigerant gas and liquefied
petroleum gas (LPG) are colorless and odorless compound that are produced by
incomplete combustion. Therefore, gas detector device is needed in order to inform
the safety situation continuously. Carbon monoxide (CO), often referred to as a "silent
killer" is an injurious gas and its prolonged exposure to living beings can lead to brain
damage and even death. The harmfulness of CO is dependent on both, the
concentration of the gas and the exposure time. Thus, a small concentration of the
CO when exposed for a long period of time can be fatal just like a large concentration
of the CO for a small period of time. Fires are the most common source of CO
[1]. In smaller quantities (e.g. 100 ppm) it may cause a headache and dizziness
after a couple of hours of exposure. Higher concentrations (example 3200 ppm)
may causes headaches and dizziness after 510 min, and death within 30 min.
Very high concentrations (e.g. 12800 ppm) causes unconsciousness after a couple
of breaths, followed by death in less than 3 min. [2] The indoor dangerous sources are
the leak source of CO, CO2 and CH4, which may be gas tank or the fire site. The
essential component of coal gas or nature gas is CO or alkanes gas. The burning of
chemical materials or decorative materials will emanate CO, CO2 and alkanes gas.
The danger of these gases arising is from two aspects, one is the toxicity of
these gases themselves, the other side is that the accumulation of these gases will
easy be ignited. The position of gas tank or pipeline is usually fixed, so it is easy to
inspect, yet the fire site is random, and it will be difficult for inspection. [ 3] The
danger of the CO gas is the same as the LPG and others dangerous gas in the
environment. Gas detector is a gas detecting device. It only can detect if there is a gas
leakage or the leaking concentration.
This is what is running situation in our day to day life, a thought of finding some
solution to this problem come up with this idea of giving the alert about gas leakage as
soon as possible. So, a thought from taking responsibility of society came our
project MICROCONTROLLER BASED GASLEAKAGE ALERT SYSTEM VIA
SMS.
1.3 Methodology
The purpose of this project is to develop alarm system for gas detector. The
gas sensor used in this project is MQ6 which detect the present of smoke alcohol and
Liquefied Petroleum Gas (LPG). These sensor will detect the concentration of the gas
according the voltage output of the sensor. To make the sensors operate in the alarm
system and data monitoring system, Arduino Uno was used as the microcontroller
for the whole system. The circuit also includes LED GSM and buzzer.GSM will send
the alert as SMS from gas sensor to a remote mobile.
Arduino UNO
Gas sensor
GSM module
Buzzer
LED
A detailed report about each and every component is described in separate chapter wise.
Chapter 2 contains information about Arduino UNO.
Chapter 3 contains information about Gas sensor.
Chapter 4 contains information about GSM module.
Chapter 5contains information about Buzzer
Chapter 6contains information about LED
Chapter 7 contains block diagram, flow chart, and program for the project.
At last ending with bibliography and appendix.
1.6 Conclusion
I have finally succeeded in making the MICROCONTROLLER BASED GAS
LEAKAGE ALERT SYSTEM VIA SMS Satisfactorily. More knowledge is
gained and more experiences are faced lot of informations are collected ultimately,
I have concluded with a great pleasure for achieving our aim
.I have planned to fulfill my technical requirements. The knowledge I have
attained with this project really would follow till the end of our career.
This system is built to help user to feel comfortable in a work place and easy to
monitor the range of air quality in the environment from remote location. This
system device also gives an advantage to the user to easily get the information
about the air quality in their building or industrial area by monitoring the system.
10
Chapter 2
ARDUINO(Uno Rev3)
2.1Overview
The Arduino Uno is a microcontroller board based on the ATmega328. It has 14
digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16
MHzceramic resonator, a USB connection, a power jack, an ICSP header, and a
reset button. It contains everything needed to support the microcontroller; simply connect
it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get
started.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial
driver chip. Instead, it features the Atmega16U2(Atmega8U2up to version R2) programmed
as a USBto-serial converter.
Revision3of the board has the following new features:
1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two other
new pins placed near to the RESET pin, the IOREF that allow the shields to
adapt to the voltage provided from the board. In future, shields will be compatible
both with the board that use the AVR, which operate with 5V and with the Arduino
Due that operate with 3.3V. The second one is a not connected pin, that is reserved
for future purposes.
Atmega 16U2 replace the 8U2.
"Uno" means one in Italian and is named to mark theupcoming release of Arduino
1.0.
The Uno and version 1.0 will be the reference versions of Arduino, moving forward. The
Uno is the latest in a series of USB Arduino boards, and the reference model for
the Arduino platform; for a comparison with previous version
11
The Arduino reference design can use an Atmega8, 168, or 328, Current models use
an ATmega328, but an Atmega8 is shown in the schematic for reference. The pin
configuration is identical on all three processors.
2.3 Summary
Microcontroller
ATmega328
Operating Voltage
5V
12
Input Voltage
7-12V
(recommended)
Input Voltage (limits)
6-20V
40 mA
50 mA
Flash Memory
SRAM
2 KB (ATmega328)
EEPROM
1 KB (ATmega328)
Clock Speed
16 MHz
2.4 Power
The Arduino Uno can be powered via the USB connection orwith 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 POWERconnector.
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
13
source (as opposed to 5 volts from the USB connection or other regulated
power source). You cansupply voltage through this pin, or, if supplying voltage via
the power jack, access it throughthis pin.
5V:This pin outputs a regulated 5V from the regulator on the board. The board can
besupplied with power either from the DC power jack (7 - 12V),the USB connector
(5V), or theVIN 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. Maximumcurrent 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.
2.5 Memory
The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB of
SRAM
and 1 KB of EEPROM (which can be read and written with the EEPROMlibrary).
Serial: 0 (RX) and 1 (TX).Used to receive (RX) and transmit (TX) TTL serial data.
Thesepins are connected to the corresponding pins of theATmega8U2 USB-to-TTL
Serial chip.
External Interrupts: 2 and 3.These pins can be configured to trigger an interrupt
on a low value, a rising or falling edge, or a change invalue. See the
attachInterrupt()function for details.
PWM: 3, 5, 6, 9, 10, and 11.Provide 8-bit PWM output with the
analogWrite()function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK).These pins support SPI
communicationusing the SPI library.
LED: 13.There is a built-in LED connected to digital pin 13. When the pin is HIGH
value,the LED is on, when the pin is LOW, it's off.
The Uno has 6 analog inputs, labeled A0 through A5, each of which
14
2.7 Communication
The Arduino Uno has a number of facilities for communicating with a computer,
another Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V)
serial communication, which is available on digital pins 0 (RX) and 1 (TX). An
ATmega16U2 on the board channels this serial communication over USB and appears
as a virtual com port to software on the computer. The '16U2 firmware uses the
standard USB COM drivers, and no external driver is needed. However, on Windows, a
.inf file is required. The Arduino software includes a serial monitor which allows simple
textual datato be sent to and from the Arduino board. The RX and TX LEDs on the
board will flash when data is being transmitted via the USB-to-serial chip and USB
connection to the computer (butnot for serial communication on pins 0 and 1).
A Software Serial libraryallows for serial communication on any of the Uno's digital
pins.The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino
software includes a Wire library to simplify use of the I2C bus; see the documentationfor
details. For SPI communication, use the SPI library.
2.8 Programming
The Arduino Uno can be programmed with the Arduino software. The ATmega328 on the
Arduino Uno comes preburned with a bootloader that allows you to upload new code
to it without the use of an external hardware programmer. It communicates using the
original STK500 protocol (reference, C headerfiles).
You can also bypass the bootloader and program the microcontroller through the
ICSP (InCircuit Serial Programming) header; see these instructions for details.
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is
available . The ATmega16U2/8U2 is loaded with a DFU bootloader, which can be activated
by:
On Rev1 boards: connecting the solder jumper on the back ofthe board (near the
15
16
holes allow the board to be attached to a surface or case. Note that the distance between
digital pins 7 and 8 is 160 mil (0.16"), not an even multiple of the 100 mil spacing of the
other pins.
17
Chapter 3
GAS SENSOR
(MQ-6)
3.1 Overview
LPG Gas Sensor Module is designed to detect the presence of a dangerous LPG leak
in your Home, car or in a service station, storage tank environment by interfacing with
Microcontroller without ADC Channels and programming. In this version of LPG Gas
sensor module two pots are included, one for trigger level setting and the other for
setting sensitivity of the sensor. It allows to determine when a preset LPG gas level
has been reached or exceeded. The module uses MQ-6 sensor to sense LPG leak. The
MQ-6 can detect gas concentrations anywhere from 200 to 10000 ppm.
Interfacing with the sensor module is done through a 4-pin breadboard compatible SIP
header and requires One I/O pin from the host microcontroller. The onboard
microcontroller provide initial heating interval after power-up and then starts to
measure LPG sensor output.If it found the LPG concentration above preset value , it
will inform the Host controller by pulling the Output Pin to High and Starts to blink a
onboard status LED. The sensor module is mainly intended to provide a means of
comparing LPG sources and being able to set an alarm limit when the source becomes
excessive.
The best location to fix Gas Sensor Module is near the Gas Cylinder or near the
pipeline in case of piped gas connection. In case of LPG, when Gas leakage occurs ,
the gas will settle down near the floor because LPG is heavier than the air. So for best
results it would be advisable to fit Gas Sensor Module nearly 1m above the floor.
18
3.2 APPLICATIONS
They are used in gas leakage detecting equipments in family and industry, are
suitable for detecting of
LPG, iso-butane, propane, LNG, avoid the noise of alcohol and cooking fumes
and cigarette smoke.
19
20
3.4 FEATURES
21
2. Environment condition
3. Sensitivity characteristic
22
23
Chapter 4
GSM Modem
(SIM 900 -TTL UART)
4.1 Overview
GSM/GPRS TTL Modem is built with SIMCOM Make SIM900 QuadbandGSM/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 TTLinterfacing 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
Autobaud mode. This GSM/GPRS TTL Modem ishaving internal TCP/IP stack to
enable you to connect with internet via GPRS. It is suitable for SMS aswell as
DATAtransfer 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 ofunregulated 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.
4.2 Features
24
4.3Specifications
Quad-Band 850/ 900/ 1800/ 1900 MHz
Software features
Special firmware
FOTA
MMS
Java (cooperate with Iasolution)
25
_ Embedded AT
26
27
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) Andbecomes slow blinking once the
Modem registers with the Network.
28
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 theModem
registers in the network (takes between 10-60 seconds), LED will blink in step
of 3 seconds. Atthis 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 setto the supported baud rate.
The modem automatically sets to the baud rate of the first
command sent by the host system afterit 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 Modemare 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.!!!
29
30
31
Chapter 5
Buzzer
(Piezo)
5.1 Overview
Buzzer as shown in Figure is an audio signaling device. The typical uses of
buzzers are for alarms, timers and confirmation of user input such as a mouse
click or
keystroke. The project used an electronic type of buzzer which is a piezoelectric
element
that driven by an Arduino microcontroller signals.
5.2 Applications
Electric ranges
washing machines
computer terminals
various devices that require speech synthesis output.
32
5.3 Dimensions
5.4 Features
The PS series are high-performance buzzers that employ unimorph piezoelectric
element and are designed for easy incorporation into various circuits.
They feature extremely low power consumption in comparison to
electromagnetic units.
Because these buzzers are designed for external excitation, the same part can
serve as both a musical tone oscillator and a buzzer.
They can be used with automated inserters. Moisture-resistant models are also
available.
The lead wire type(PS1550L40N) with both-sided adhesive tape installed easily
is prepared.
33
34
Chapter 6
LED
6.1 Overview
When a diode is forward biased which is switch on, electron are able to
recombine with holes within the devices, releasing energy in the form of photon. This
effect is called electroluminescence and the colour of the light is determined
by the energy gap of the semiconductor. LED are usually integrated optical
components are used to shape its radiation pattern and assist in the reflection.
35
Gas Sensor
LED
(MQ-6)
Buzzer
(piezo)
Arduino Uno Rev-3
GSM Modem
(SIM-900)
36
37
7.3 PROGRAM
#include <SoftwareSerial.h>
#include <TinyGPS.h>
#include "SIM900.h"
void setup()
{
pinMode(A1,INPUT);
connected)
Serial.println("AT\r");
delay(2000);
Serial.println("AT\r");
delay(500);
Serial.println("AT\r");
delay(500);
Serial.println("AT+CMGF=1\r");
delay(3000);
Serial.println("AT+CNMI=2,2,0,0,0\r");
delay(2000);
}
38
void loop()
{
g=analogRead(A1); // Get the analog value to variable 'g'
digitalWrite(13,LOW);
if(g>300)
{
digitalWrite(13,HIGH));
delay(1000);
digitalWrite(13,LOW);
delay(1000);
digitalWrite(13, HIGH); // Turn the LED on (HIGH is the voltage level)
delay(1000);
digitalWrite(13, LOW);
delay(1000);
digitalWrite(13, HIGH);
send_sms(); // Call sub function 'send_sms'
}
delay(1000);
}
39
void send_sms()
{
Serial.println("AT\r");
delay(500);
Serial.println("AT\r");
delay(500);
Serial.println("AT+CMGS=\"8891574056\"\r"); //Mobile number of recipient
delay(3000);
Serial.println("ENVIRONMENT_STATUS:\r");
delay(100);
Serial.println("Leakage_Detected!\r);
delay(100);
Serial.println("Take proper action");
delay(100);
Serial.write(26); // ASCII Value of ctrl+z
Serial.println("\r\n");
delay(1000);
Serial.println("AT\r");
delay(500);
Serial.println("AT\r");
delay(500);
delay(2000);
}
40
BIBLIOGRAPHY
i
ii
iii
iv
v
vi
www.arduino.cc
www.instructables.com
Intro to Embedded systems, By Shibu, 2009.
GRIET Arduino manual
Data sheet for GPS module from Rhydolabz
Data sheet for GSM module from Simplelab
41