Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CHAPTER I
INTRODUCTION
There are approximately 30crore LPG users in the country in which mostly 40% of the
population. The Several standards have been implemented for the gas leakage detection
system. The existing systems provides an alarm system which is mainly meant to detect
an Gas leakage in the house and commercial premises The objective of the proposed
system is to detect theleakage of gas usind ARDUINO and GSM,so it will
automatically sends an SMS alert to the user as well as Authorized agent so that they
can act accordingly. This system also designed to detect LPG gases such as propane and
butane. The allowed level for butane is 600ppm above which it is considered to be of
high level and poses a danger. The main aim of this project is to monitor for liquid
petroleum gas (LPG) leakage to avoid major fire accidents and also facilitating safety
precautions where security has been an important issue. The system detects the leakage
of the LPG using gas sensor and alerts the consumer about the gas leakage by sending
SMS. The proposed system uses the GSM Modem to alert the person about the gas
leakage via SMS. When the system identifies that LPG concentration in the air reaches
the specified level then it alert the consumer by sending SMS to registered mobile
phone and alert the people at home by activating the alarm which includes Buzzer and
switch on the exhaust fan or opening windows to decrease the gas concentration in the
air.
Assemble the circuit as shown in the circuit diagram. The arduino board is
programmed with arduino programming which does the every processing.
The MQ-2 detectects the gas like butane, methane, coal gas and other form
of LPS gas. After it detects the gas, it sends the information to the arduino
uno board. The SIM-900 GSM Module is also connected to Arduino board
with sim in it. It sends the sms to desired number which is programmed
early. On the other hand the buzzer also produces sound and alerts every
individual.
CHAPTER 2
LITERATURE OVERVIEW
This project developed system to detect the gas leakage and providing immediate alarm
or intimation to the user. Later in 2013, few people 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 version 7
processor and simulated using Keil software.In the year 2014, Hitendra Rawat, Ashish
Kushwah, Khyati Asthana, Akanksha Shivhare, designed a system, 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 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. These projects alert the user by sending
message to mobile through SMS in two conditions.
They are
These project gives alert message by buzzing the buzzer and trough 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 occurs.[1]
They proposed prototype depicts a mini mobile robot which is capable to detect gas
leakage in hazardous places. Whenever there is an occurrence of gas leakage in a
particular place the robot immediately read and sends the data to android mobile
They introduce some old or new technique to detect the gas. The proposed techniques
in this paper are nontechnical methods, hardware based methods which include
acoustic methods, optical methods and active methods.
In their survey they told a wide variety of leak detecting techniques is available for gas
pipelines. Some techniques have been improved since their first proposal and some new
ones were designed as a result of advances in sensor manufacturing and computing
power. However, each detection method comes with its advantages and disadvantages.
Leak detection techniques in each category share some advantages and disadvantages.
For example, all external techniques which involve detection done from outside the
pipeline by visual observation or portable detectors are able to detect very small leaks
and the leak location, but the detection time is very long. Methods based on the
mathematical model of the pipe have good results at high flow rates while at low flow
rates a mass balance based detection system would be more suitable. This disadvantage
is prone to disappear for some of these techniques due to forthcoming technological
advancements.[3]
In this paper they gave various model which used SCADA I/F Model: The SCADA
system has the function of transferring the acquired data from a pipeline system to
Transient Simulation Model every 30 seconds. This module communicates with
SCADA. Dynamic parameters are collected every 30 seconds, such as pressure, flow
and temperature. Transient Simulation Model: Transient flow is simulated utilizing
perfect numerical methods based on actual data. Pressure and temperature served as
independent variables are provided in order to get average pressure and average
temperature. Then all the parameters of the gas in the pipeline system can be acquired.
Leakage Detection: The leakage detection is carried out by comparing the data acquired
through the SCADA system with that by the Transient Simulation Model. This model
could provide leakage point judgment and prompt warning based on transient
simulation and volume balance.[4]
The paper is designed based on modular approach which is easy to analyze as LPG
cylinder booking unit, gas leakage monitoring unit at the consumer end and server
system unit at the distributor side. MQ6 placed in the vicinity of the gas cylinder. In the
advent of leakage, the resistance of the sensor decreases increasing its conductivity.
Corresponding pulse is fed to microcontroller and simultaneously switches on the
buzzer and exhaust fan. Microcontroller sends a message “EMERGENCY ALERT:
LPG gas leakage found in your home” to required cell numbers via GSM module and
the same will be displayed on LCD.
In automatic Gas booking system, LCD continuously monitors the weight of the gas in
cylinder and displays it on seven segment display. When the weight of the gas is less
than or equal to 2 Kg, a logic high pulse is fed to a port pin of microcontroller. As this
pin goes high, microcontroller will send a booking message to distributor of format,
"AA01-RAJA-05-B". At the same time, the message will be displayed on LCD as
In this basically, they used an embedded design which includes typical input and output
devices include switches, relays, solenoids, LEDs, small or custom LCD displays, radio
frequency devices, and sensors for data such as temperature, humidity, light level etc.
Embedded systems usually have no keyboard, screen, disks, printers, or other
recognizable I/O devices of a personal computer, and may lack human interaction
device. The amount and type of detectors and the type of fire alarm system that one
chooses for property protection will depend on the owner’s property protection goals,
the value of the property and the requirements of the owner’s insurance company.
The principle of operation which is proposed in this paper is the gas detector alarm
system is designed with the intention to ensure that the event of gas is intelligently
detected, promptly notified and interactively managed. It is built around a timer to
accept input from the gas sensor, MQ-9, and activate a buzzer and set of led that alerts
in the event of gas. The sensor used is the MQ9 and from the datasheet, it specializes in
gas detection equipment for carbon monoxide and CH4, LPG family and any other
relevant industry or car assemblage. [6]
CHAPTER 3
This proposed method consists of gas leakage detection system, weight measurement
module, microcontroller, GSM module and alert system.
The main basic Arduino Mega2560 micro controller requires the power supply ranging
from 7-12 volts which can be build by using different components like step down
transformer, rectifier, filter and regulator which are readily available as adapters these
days. Supply can be either from an ac to dc adapter or battery. The board can operate on
at 7-12 volts. If voltage<7V then board becomes unstable. If voltage>12V then board
get demaged. The Main platform we are using to build the project is Arduino UNO
which provides us the flexibility to write the code effectively in convenient way and
also it will provides us features like Inexpensive, Cross platform, Simpler and clear
programming environment, Open source and extensible software, Easy for beginners,
The Arduino UNO is a microcontroller board based on the ATMEGA UNO
(datasheet).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. With the above features it force us to use in our project design.
MQ-4 is a Sensor for Natural Gases Sensitive material. FC22 gas sensor is SnO2, which
has lower conductivity in clear air. When the target combined gas exist, the sensor‟s
conductivity is heavier with the gas concentration rising. we used simple circuit to
convert respective output signal according to concentration level. FC22 gas sensor has
high sensitive to Methane, Propane and Butane. The sensor can be used to detect
different combustible gas, especially Methane; it is with cost effective and useful for so
many applications.
3.2 Specification
Model: FC‐22‐1
Quantity: 1
Color: Blue
Material: PCB board
Range: 10~1000ppm
High quality double panel design, with power and TTL signal output indicator
With DO switch signal (TTL) output and AO analog signal output
TTL output effective signal for low level (when output lower than usually the sign
al light, can be directly meet SCM or relay module)
Analog output voltage: 0~5V, the higher concentration, the higher voltage
High sensitivity for the harmful gases detection
There are four screw holes for positioning
Product size: 32mm (L) x 20mm (W) x 22mm (H)
Long service life and reliable stability, fast response and recovery characteristics
Working voltage: 5V
Suitable for home / industry carbon monoxide, coal gas, natural gas, smoke and ot
her harmful
monitoring gases detection
Before use, please heat the board for about 20 seconds
Packing list:
1 x Sensor module
Dimensions: 1.38 in x 0.79 in x 0.91 in (3.5 cm x 2.0 cm x 2.3 cm)
Weight: 0.25 oz (7 g)
Buzzer 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
micro-controller signals. Peizo buzzer is based on the inverse principle of peizo
electricity discover in 1880 by Jacques and Pierre Curie. It is the phenomenon of
generating electricity when mechanical pressure is applied to the certain materials and
the vice versa . such materials called Piezoelectric materials. When an alternating
electric field subjected to the material they stretch or compress accordance with the
frequency of the signal thereby producing sound.
Fig3.3:Buzzer
The buzzer case supports the piezo element and has resonant cavity for sound
Novelty uses
Judging panels
Educational purposes
Annunciator panels
Electronic metronomes
Game show lock-out device
Microwave ovens and other household appliances
Sporting events such as basketball games
Electrical alarms
Joy buzzer (mechanical buzzer used for pranks)
Microcontroller ATmega328
Operating Voltage 5V
SRAM 2 KB
EEPROM 1 KB
3.5.2 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
comeeither 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. The regulated power supply used to power the microcontroller and other
components on the board. This can come either from VIN via an on-board
3.5.3 Memory
The Atmega328 has 32 KB of flash memory for storing code (of which 0,5 KB is used
for the bootloader); It has also 2 KB of SRAM and 1 KB of EEPROM (which can be
read and written with the EEPROM library).
Each of the 14 digital pins on the Uno can be used as an input or output, using
pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each
pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor
(disconnected by default) of 20-50 kOhms. In addition, some pins have specialized
functions:
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial
data. TThese pins are connected to the corresponding pins of the ATmega8U2
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 in value. 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
communication, which, although provided by the underlying hardware, is not
currently included in the Arduino language.
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, each of which provide 10 bits of resolution (i.e. 1024
different values). By default they measure from ground to 5 volts, though is it possible
to change the upper end of their range using the AREF pin and the analogReference()
function. Additionally, some pins have specialized functionality:
I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the Wire
library. There are a couple of other pins on the board:
AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a
reset button to shields which block the one on the board.
3.5.5 Programming
The Arduino Uno can be programmed with the Arduino software (download). Select
"Arduino Uno w/ ATmega328" from the Tools > Board menu (according to the
microcontroller on your board). For details, see the reference and tutorials. 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 header files). You can
also bypass the bootloader and program the microcontroller through the ICSP
(In-Circuit Serial Programming) header; see these instructions for details. The
ATmega8U2 firmware source code is available . The ATmega8U2 is loaded with a
DFU bootloader, which can be activated by connecting the solder jumper on the back of
the board (near the map of Italy) and then resetting the 8U2. You can then use Atmel's
FLIP software (Windows) or the DFU programmer (Mac OS X and Linux) to load a
new firmware. Or you can use the ISP header with an external programmer
(overwriting the DFU bootloader).
Rather than requiring a physical press of the reset button before an upload, the Arduino
Uno is designed in a way that allows it to be reset by software running on a connected
computer. One of the hardware flow control lines (DTR) of the ATmega8U2 is
connected to the reset line of the ATmega328 via a 100 nanofarad capacitor. When this
line is asserted (taken low), the reset line drops long enough to reset the chip. The
Arduino software uses this capability to allow you to upload code by simply pressing
the upload button in the Arduino environment. This means that the bootloader can have
a shorter timeout, as the lowering of DTR can be well-coordinated with the start of the
upload. This setup has other implications. When the Uno is connected to either a
computer running Mac OS X or USB). For the following half-second or so, the
bootloader is running on the Uno. While it is programmed to ignore malformed data
(i.e. anything besides an upload of new code), it will intercept the first few bytes of data
sent to the board after a connection is opened. If a sketch running on the board receives
one-time configuration or other data when it first starts, make sure that the software
with which it communicates waits a second after opening the connection and before
sending this data. The Uno contains a trace that can be cut to disable the auto-reset. The
pads on either side of the trace can be soldered together to re-enable it. It's labeled
"RESET-EN". You may also be able to disable the auto-reset by connecting a 110 ohm
resistor from 5V to the reset line; see this forum thread for details.
The Arduino Uno has a resettable polyfuse that protects your computer's USB ports
from shorts and overcurrent. Although most computers provide their own internal
protection, the fuse provides an extra layer of protection. If more than 500 mA is
applied to the USB port, the fuse will automatically break the connection until the short
or overload is removed.
The maximum length and width of the Uno PCB are 2.7 and 2.1 inches respectively,
with the USB connector and power jack extending beyond the former dimension. Three
screw 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.
Arduino can sense the environment by receiving input from a variety of sensors and can
affect its surroundings by controlling lights, motors, and other actuators. The
microcontroller on the board is programmed using the Arduino programming language
(based on Wiring) and the Arduino development environment (based on Processing).
Arduino projects can be stand-alone or they can communicate with software on running
on a computer (e.g. Flash, Processing, MaxMSP).Arduino is a cross-platoform
program. You’ll have to follow different instructions for your personal OS. Check on
the Arduino site for the latest instructionNow you’re actually ready to “burn” your first
program on the arduino board. To select “blink led”, the physical translation of the well
known programming “hello world”, select
File>Sketchbook>Arduino-0017>Examples>Digital>Blink
M.B.S. College of Engineering and Technology 15
GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM
Once you have your skecth you’ll see something very close to the screenshot on the
right.
In Tools>Board select
Now you have to go toTools>SerialPort and select the right serial port, the one arduino
is attached to.
Warranties
The producer warrants that its products will conform to the Specifications. This
warranty lasts for one (1) years from the date of the sale. Theproducer shall not be liable
for any defects that are caused by neglect, misuse or mistreatment by the Customer,
including improper installation or testing, or for any products that have been altered or
modified in any way by a Customer. Moreover, The producer shall not be liable for any
defects that result from Customer's design, specifications or instructions for such
products. Testing and other quality control techniques are used to the extent the
producer deems necessary.
If any products fail to conform to the warranty set forth above, the producer's sole
liability shall be to replace such products. The producer's liability shall be limited to
products that are determined by the producer not to conform to such warranty. If the
producer elects to replace such products, the producer shall have a reasonable time to
replacements. Replaced products shall be warranted for a new full warranty period.
Customer agrees that prior to using any systems that include the producer products,
Customer will test such systems and the functionality of the products as used in such
systems. The producer may provide technical, applications or design advice, quality
characterization, reliability data or other services. Customer acknowledges and agrees
that providing these services shall not expand or otherwise alter the producer's
warranties, as set forth above, and no additional obligations or liabilities shall arise
from the producer providing such services.
The Arduino Products are not authorized for use in safety-critical applications where a
failure of the product would reasonably be expected to cause severe personal injury or
death. Safety-Critical Applications include, without limitation, life support devices and
systems, equipment or systems for the operation of nuclear facilities and weapons
systems. Arduino products are neither designed nor intended for use in military or
aerospace applications or environments and for automotive applications or
environment. Customer acknowledges and agrees that any such use of Arduino
products which is solely at the Customer's risk, and that Customer is solely responsible
for compliance with all legal and regulatory requirements in connection with such
use.1.6 Customer acknowledges and agrees that it is solely responsible for compliance
with all legal, regulatory and safety-related requirements concerning its products and
any use of Arduino products in Customer's applications, notwithstanding any
applications-related information or support that may be provided by the producer.
Indemnification
The Customer acknowledges and agrees to defend, indemnify and hold harmless the
producer from and against any and all third-party losses, damages, liabilities and
expenses it incurs to the extent directly caused by: (i) an actual breach by a Customer of
the representation and warranties made under this terms and conditions or (ii) the gross
negligence or willful misconduct by the Customer.
Consequential Damages WaiverIn no event the producer shall be liable to the Customer
or any third parties for any special, collateral, indirect, punitive, incidental,
consequential or exemplary damages in connection with or arising out of the products
provided hereunder, regardless of whether the producer has been advised of the
possibility of such damages. This section will survive the termination of the warranty
period.
Changes to specifications
The producer may make changes to specifications and product descriptions at any time,
without notice. The Customer must not rely on the absence or characteristics of any
features or instructions marked "reserved" or "undefined." The producer reserves these
for future definition and shall have no responsibility whatsoever for conflicts or
incompatibilities arising from future changes to them. The product information on the
Web Site or Materials is subject to change without notice. Do not finalize a design with
this information.
Power USB
Arduino board can be powered by using the USB cable from your computer. All you
need to do is connect the USB cable to the USB connection.
Arduino boards can be powered directly from the AC mains power supply by
connecting it to the Barrel Jack.
Voltage Regulator
The function of the voltage regulator is to control the voltage given to the Arduino
board and stabilize the DC voltages used by the processor and other elements.
Crystal Oscillator
The crystal oscillator helps Arduino in dealing with time issues. How does Arduino
calculate time? The answer is, by using the crystal oscillator. The number printed on
top of the Arduino crystal is 16.000H9H. It tells us that the frequency is 16,000,000
Hertz or 16 MHz.
Arduino Reset
You can reset your Arduino board, i.e., start your program from the beginning. You can
reset the UNO board in two ways. First, by using the reset button (17) on the board.
Second, you can connect an external reset button to the Arduino pin labelled RESET.
Analog pins
The Arduino UNO board has five analog input pins A0 through A5. These pins can
read the signal from an analog sensor like the humidity sensor or temperature sensor
and convert it into a digital value that can be read by the microprocessor.
Main microcontroller
Each Arduino board has its own microcontroller (11). You can assume it as the brain of
your board. The main IC (integrated circuit) on the Arduino is slightly different from
board to board. The microcontrollers are usually of the ATMEL Company. You must
know what IC your board has before loading up a new program from the Arduino IDE.
This information is available on the top of the IC. For more details about the IC
construction and functions, you can refer to the data sheet.
ICSP pin
Mostly, ICSP (12) is an AVR, a tiny programming header for the Arduino consisting of
MOSI, MISO, SCK, RESET, VCC, and GND. It is often referred to as an SPI (Serial
Peripheral Interface), which could be considered as an "expansion" of the output.
Actually, you are slaving the output device to the master of the SPI bus.
This LED should light up when you plug your Arduino into a power source to indicate
that your board is powered up correctly. If this light does not turn on, then there is
something wrong with the connection.
TX and RX LEDs
On your board, you will find two labels: TX (transmit) and RX (receive). They appear
in two places on the Arduino UNO board. First, at the digital pins 0 and 1, to indicate
the pins responsible for serial communication. Second, the TX and RX led (13). The
TX led flashes with different speed while sending the serial data. The speed of flashing
depends on the baud rate used by the board. RX flashes during the receiving process.
Digital I/O
The Arduino UNO board has 14 digital I/O pins (15) (of which 6 provide PWM (Pulse
Width Modulation) output. These pins can be configured to work as input digital pins to
read logic values (0 or 1) or as digital output pins to drive different modules like LEDs,
relays, etc. The pins labeled “~” can be used to generate PWM.
AREF
AREF stands for Analog Reference. It is sometimes, used to set an external reference
voltage (between 0 and 5 Volts) as the upper limit for the analog input pins.
Local Variables
Variables that are declared inside a function or block are local variables. They can be
used only by the statements that are inside that function or block of code. Local
variables are not known to function outside their own. Following is the example using
local variables −
.Global Variables
Global variables are defined outside of all the functions, usually at the top of the
program. The global variables will hold their value throughout the life-time of your
program.
A global variable can be accessed by any function. That is, a global variable is available
for use throughout your entire program after its declaration.
while Loop
while loops will loop continuously, and infinitely, until the expression inside the
parenthesis, () becomes false. Something must change the tested variable, or the while
loop will never exit.
do…while loop
The do…while loop is similar to the while loop. In the while loop, the
loop-continuation condition is tested at the beginning of the loop before performed the
body of the loop.
For loop
Each for loop has up to three expressions, which determine its operation. The
following example shows general for loop syntax. Notice that the three expressions in
the for loop argument parentheses are separated with semicolons.
Nested Loop
C language allows you to use one loop inside another loop. The following example
illustrates the concept.
.Infinte loop: It is the loop having no terminating condition, so the loop becomes
infinite.
Functions help the programmer stay organized. Often this helps to conceptualize
the program.
Functions codify one action in one place so that the function only has to be thought
about and debugged once.
This also reduces chances for errors in modification, if the code needs to be
changed.
Functions make the whole sketch smaller and more compact because sections of
code are reused many times.
They make it easier to reuse code in other programs by making it modular, and
using functions often makes the code more readable.
There are two required functions in an Arduino sketch or a program i.e. setup () and
loop(). Other functions must be created outside the brackets of these two functions.
A function is declared outside any other functions, above or below the loop
function.We can declare the function in two different ways −
The first way is just writing the part of the function called a function prototypeabove
the loop function, which consists of −
The following example shows the demonstration of the function declaration using the
first method.
Example:
The second part, which is called the function definition or declaration, must be declared
below the loop function, which consists of −
The following example demonstrates the declaration of function using the second
method.
Example:
The second method just declares the function above the loop function.
Strings are used to store text. They can be used to display text on an LCD or in the
Arduino IDE Serial Monitor window. Strings are also useful for storing the user input.
For example, the characters that a user types on a keypad connected to the Arduino.
Arrays of characters, which are the same as the strings used in C programming.
The Arduino String, which lets us use a string object in a sketch.
In this chapter, we will learn Strings, objects and the use of strings in Arduino sketches.
By the end of the chapter, you will learn which type of string to use in a sketch.
#include <SoftwareSerial.h>
int analogSensor=10;
int sensor=A5;
int buzzer=A4;
void setup()
pinMode(sensor, INPUT);
delay(100);
void loop()
SendMessage();
delay(1000);
noTone(buzzer);
flag=2;
if (mySerial.available()>0)
Serial.write(mySerial.read());
}
void SendMessage()
Serial.println("ss");
delay(100);
delay(1000);
/*mySerial.println("ATDT + +919906676166;");
delay(100);
mySerial.println();
delay(10000);
mySerial.println("ATH");*/
CHAPTER 4
The modem needed only 3 wires (Tx, Rx, GND) except Power supply to interface with
microcontroller/Host PC. 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:
4.1 Specifications
Class 1 (1 W @ 1800/1900MHz)
Dimensions: 24*24*3mm
Weight: 3.4g
Control via AT commands (GSM 07.07,07.05 and SIMCOM enhanced AT
Commands)
Low power consumption: 1.0mA(sleep mode)
Operation temperature: -40°C to +85 °C
Group 3, class 1
Software features
MMS
Java (cooperate with isolation)
Embedded AT
Tricodec
Hands-free operation
(Echo suppression)
AMR
Half rate (HR)
Full rate (FR)
4.6 Interfaces
OPERATING MODES: The table below briefly summarizes the various operating
modes referred to in the following chapters.
You can use the AT command “AT+CPOWD=1” to turn off the modem. This
command lets the GSM Modem log off from the network and allows the GSM Modem
to enter into a secure state and save data before completely disconnecting the power
supply. Before the completion of the switching off procedure the GSM Modem will
send out result code: “NORMAL POWER DOWN”.
After this moment, the AT commands can’t be executed. The GSM Modem enters the
POWER DOWN mode, only the RTC is still active. POWER DOWN can also be
indicated by STATUS pin, which is a low level voltage in this mode.
There are two methods for the GSM Modem to enter into low current consumption
status. “AT+CFUN” is used to set GSM Modem into minimum functionality mode and
DTR hardware interface signal can be used to lead system to be in SLEEP mode (or
slow clocking mode).
0: minimum functionality;
1: full functionality (default);
4: disable phone both transmit and receive RF circuits;
If GSM MODEM has been set by “AT+CFUN=4”, the RF function will be closed, the
serial port is still active. In this case all AT commands correlative with RF function will
not be accessible.
After GSM MODEM has been set by “AT+CFUN=0” or “AT+CFUN=4”, it can return
to full functionality by “AT+CFUN=1”. For detailed information about “AT+CFUN”,
please refer to document
We can control SIM900 GSM Modem to enter or exit the SLEEP mode in customer
applications through DTR signal. When DTR is in high level and there is no on air and
hardware interrupt(such as GPIO interrupt or data on serial port), GSM MODEM will
enter SLEEP mode automatically. In this mode, GSM MODEM can still receive paging
or SMS from network but the serial port is not accessible.
mode. When GSM MODEM is in SLEEP mode, the following methods can wake up
the GSM Modem.
Enable DTR pin to wake up GSM MODEM. If DTR pin is pulled down to a low
level this signal will wake up GSM MODEM from power saving mode. The serial
port will be active after DTR changed to low level for about 50ms.
Receiving a voice or data call from network to wake up GSM MODEM.
Receiving a SMS from network to wake up GSM MODEM.
The following figure shows how to proceed from one mode to another
Serial Interfaces
GND 5 Ground
AT Command Syntax When DCE powers on with the autobauding enabled, user must
first send “A” to synchronize the baud rate. It is recommended to wait 2 to 3 seconds
before sending “AT” character. After receiving the “OK” response, DTE and DCE are
correctly synchronized The “AT” or “at” prefix must be set at the beginning of each
Command. To terminate a Command line enter <CR> , otherwise known as carriage
return or \r. Commands are followed by a response that includes
<CR><LF><response><CR><LF>. Only the responses are presented in the document
here, <CR><LF> are omitted intentionally.
Transmit: AT\r
Receive: AT\r\r\nOK\r\n
When communicating with the GSM Modem using a microcontroller, you usually want
very short responses, no local echo, and no startup messages. Sticking on the&W to the
end of the command saves the setting into memory.
Transmit: AT\r
Receive: \r\nOK\r\n
You’ll have:
Transmit: AT\r
Receive: \r\n0\r\n
SAMPLE AT COMMANDS CODE
1. Phone communication
AT+CMGF=1\r
Returns OK or ERROR
AT+CSCS=”GSM”\r
Returns OK or ERROR
AT+CSCA=”+13123149810” \r
Returns OK or ERROR. This number +13123149810 is the short message center for
Returns OK or ERROR. These numbers refer to settings for text message sending, keep
AT+CMGS=”
AT+CMGS=”1234567890”\r
Returns > , prompting what message to send. 1234567890 is the phone number that
the text message will be sent to.
Type any message, and then press <Ctrl+z>. Returns confirmation message and
Message ID number
AT+CMGF=1\r
Returns OK or ERROR
AT+CMGDA=”DEL ALL”
AT+CNMI=0, 0
AT+CMGR=1
Read Message #1
AT+CMGL=”REC UNREAD”
Debug port
FAX call. And the Debug port cannot use multiplexing function. It does not support
autobauding function.
The DBG_TXD, DBG_RXD and GND must be connected to the IO connector when
user need to upgrade software and debug software, the DBG_TXD, DBG_RXD should
be used for software upgrade and for software debugging. The TXD and RXD also
should be connected to the IO connector, if user wants to send AT command or data
stream to GSM MODEM. The PWRKEY pin is recommended to connect to the IO
connector. The user also can add a switch between the PWRKEY and the GND. The
PWRKEY should be connected to the GND when GSM MODEM is upgrading
software. Please refer to the following figure.
Audio Interfacing:
The GSM Modem provides one analog input channel, AIN, which may be used for
microphone.
The electrets microphone is recommended when the interface is used for microphone.
The outputs connect to the receiver. The receiver outputs only can directly drive 32Ω.
External line inputs are available to directly mix or multiplex externally generated
analog signals such as Polyphonic tones from an external melody IC or music generated
by an FM tuner IC or module. You can use AT+CMIC to adjust the input gain level of
microphone, use AT+SIDET to set the side-tone level. In addition, you can also use
AT+CLVL to adjust the output gain level. For more details, please refer to document It
is suggested that you adopt one of the following two matching circuits in order to
improve audio performance. The difference audio signals have to be layout according
to difference signal layout rules. As show in following figures (Note: all components
package are 0603.) If you want to adopt an amplifier circuit for audio, we recommend
The Modem can be directly interface with 5V microcontrollers like PIC, AVR, 8051
Derivatives, Arduinos and 3V3 Microcontrollers like ARM, ARM Cortex XX etc.
Make ensure V_INTERFACE pin is supplied with same voltage level as the
microcontroller VCC. As per the Fig: 3 there is only 2 connections are required to use
the modem. Connect RX pin of the modem to the TX pin of the microcontroller and TX
pin of the modem to microcontroller’s RX pin. The connected power supply (4.2v to
12v dc) should be capable of handling current up to 1 A.
Getting started:
Open the SIM cardholder by sliding it as per the arrow mark and lift up. Insert the SIM
card, so as to align the chamfered corner suits in card holder .After inserting the SIM
card, lock the holder by sliding it to the opposite direction of arrow mark.
Fix the Supplied RF antenna to the SMA Antennae connector and tighten it by Rotating
Power the modem from suitable power supply, which is having enough current capacity
(>1A).
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
e.g. 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 3 seconds 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!
Testing with a PC
3. Type any AT command in the HyperTerminal window and you could see the modem
responding by sending “OK”.
/* this program module sends an SMS from the modem to a prefixed number */ void
main()
Function Description:
Specifications
The Atmel 8-bit AVR RISC-based microcontroller combines 32 kB ISP flash memory
with read-while-write capabilities, 1 kB EEPROM, 2 kBSRAM, 23 general purpose
I/O lines, 32 general purpose working registers, three flexible timer/counters with
compare modes, internal and external interrupts, serial programmable USART, a
byte-oriented 2-wire serial interface, SPI serial port, 6-channel 10-bit A/D
converter (8-channels in TQFP and QFN/MLF packages), programmable watchdog
timer with internal oscillator, and five software selectable power saving modes. The
device operates between 1.8-5.5 volts. The device achieves throughput approaching
1 MIPS per MHz.
SERIES ALTERNATIVES
Applications:
Programming
Reliability qualification shows that the projected data retention failure rate is much less
than 1 PPM over 20 years at 85 °C or 100 years at 25 °C.
otherwise busy.
Programming mode is entered when PAGEL (PD7), XA1 (PD6), XA0 (PD5), BS1
(PD4) is set to zeroRESET pin to 0V and VCC to 0V. VCC is set to 4.5 - 5.5V. Wait 60
μs, and RESET is set to 11.5 - 12.5 V. Wait more than 310 μs Set
XA1:XA0:BS1:DATA = 100 1000 0000, pulse XTAL1 for at least 150 ns, pulse WR to
zero. This starts the Chip Erase. Wait until RDY/BSY (PD1) goes high.
XA1:XA0:BS1:DATA = 100 0001 0000, XTAL1 pulse, pulse.
Serial Programming[2]
Serial data to the MCU is clocked on the rising edge and data from the MCU is clocked
on the falling edge. Power is applied to VCC while RESET and SCK are set to zero.
Wait for at least 20 ms and then the Programming Enable serial instruction 0xAC,
0x53, 0x00, 0x00 is sent to the MOSI pin. The second byte (0x53) will be echoed back
by the MCU.
Voltage Regulator:
All voltage sources cannot able to give fixed output due to fluctuations in the circuit.
For getting constant and steady output, the voltage regulators are implemented.
The integrated circuits which are used for the regulation of voltage are termed as
voltage regulator ICs. Here, we can discuss about IC 7805.
5V for any value of input less than or equal to 35V which is the threshold limit.
PIN 1-INPUT:
The function of this pin is to give the input voltage. It should be in the range of 7V to
35V. The unregulated voltage is given to this pin for regulation. For 7.2V input,
maximum efficiency can be achieved.
PIN 2-GROUND:
The ground is given to this pin. For output and input, this pin is equally neutral (0V).
PIN 3-OUTPUT:
This pin is used to take the regulated output. It will be .
In IC 7805 voltage regulator, lots of energy is exhausted in the form of heat. The
difference in the value of input voltage and output voltage comes as heat. So if the
difference is higher, there will be more heat generation. Without a heat sink, this too
much heat will cause malfunction. The bare minimum tolerable difference between the
input and output voltage to keep the output voltage in the accurate level is termed as
dropout voltage. It is better to keep the input voltage 2 to 3V greater than output voltage
or a suitable heat sink should be placed to dissipate excess heat. The heat sink size
should have to be properly calculated. The following formula will give an idea for this
calculation.
Now, we
can analyse the relation of generated heat and the input voltage value in this regulator
with the following two examples. Assume a system with input voltage 16V and
required output current be 0.5A.
So, heat generated = .
Thus, 5.5W heat energy is wasted and the actual energy used
= .
That is almost double energy is wasted as heat.
Next, we can consider the case when input is lower, say 9V.
In this case, heat generated =
From this, we can conclude that for high input voltage, this regulator IC will become
inefficient.
Here Operating amplifier performs as error amplifier. The Zener diode is used for
giving the reference voltage. It is shown below.
Transistor is the series pass element here. It is used for dissipating additional energy in
the form of heat. It controls the output voltage by controlling the current among the
input and output. SOA is the Safe Operating Area. It is in fact the conditions of voltage
and current in which the equipment is expected to work without any self-damage. Here
for the SOA protection, bipolar transistor is implemented with a series resistor and an
auxiliary transistor. Heat sink is implemented for thermal protection when there is high
supply voltage.
The voltage regulator 7805 and the other components are arranged in the circuit as
shown in figure.
The purposes of coupling the components to the IC7805 are explained below.
C1- It is the bypass capacitor, used to bypass very small extent spikes to the earth.
C2 and C3- They are the filter capacitors. C2 is used to make the slow changes in the
input voltage given to the circuit to the steady form. C3 is used to make the slow
changes in the output voltage from the regulator in the circuit to the steady form. When
the value of these capacitors increases, stabilization is enlarged. But
these capacitors single-handedly are unable to filter the very minute changes in the
input and output voltages.
C4- like C1, it is also a bypass capacitor, used to bypass very small extent spikes to the
ground or earth. This is done without influencing other components.
Current regulator
Regulated dual supply
Building circuits for Phone charger, UPS power supply circuits, portable CD player
etc
Fixed output regulator
Adjustable output regulator etc
4.12 applications
CHAPTER
CONCLUSION
This project is microcontroller based project. A Gas sensor is used to Detect dangerous
gas leaks in the various industrial plants. It can also be used to detect leakage in homes
and gas heaters. Ideal to detect dangerous gas leaks in the kitchen. Sensor can be
easily configured as an alarm unit. The sensor can also sense LPG and Coal Gas as well
as Ideal sensor for use 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, to sound an alarm or give a visual indication of the LPG concentration. The
sensor has excellent sensitivity combined with a quick response time. When GAS
leakage is detected and is messaged to the authorized person using cellular network
called GSM.
REFERENCES
BIBLIOGRAPHY
www.wikipedia.com/load-flow-analysis
www.avotraining.com/arc-flash/load-flow-analysis
www.electrical4u.com/loadflow
https://in.mathworks.com/products/simpower/features.html#simulation-and-analys
is
www.top10electrical.blogspot.in/2015/02/power-flow-studies-and-its-importance.
html?m=1
http://nptel.ac.in/courses/Webcourse-contents/IIT-KANPUR/power-system/ui/Co
urse_home-4.htm
http://myelectrical.com/notes/entryid/256/load-flow-study-how-they-work