Professional Documents
Culture Documents
CHAPTER 1
INTRODUCTION
1.1 BACKGROUND
Gas is a leading source of energy used for cooking and heating in our homes. It provide an
economical and clean source of energy compared to other source of energy like firewood. It is also
used as a source of energy in industry and fueling our cars. The two major type of gas used are
Natural Gas and Liquefied Petroleum Gas(LPG) both of which are hydrocarbons gas. Natural Gas
is basically methane gas while LPG gas is a mixture of butane and propane gas or purely butane
or propane gas. Natural gas is extracted from underground while LPG gas is a by-product of
Natural Gas and crude oil processing. These gases have a characteristic of being highly flammable
and can cause suffocation in high concentration. It is because of this, the usage of gases should be
done with great care and safety standards are put in place to ensure everyone using the gas is safe.
Gas used for cooking is supplied in gas cylinders which have a regulating valve. After using the
gas you are supposed to turn off the gas. The supplier of the gas should make sure the valve are
working well and not leaking the gas. Observation of the safety standards would avoid the dangers
posed by the gas. However, systems made by human being are bound to fail at one point due to
wearing out, accident or by intention. Also by accident, we might forget to turn off the gas. This
poses an immediate danger to life and property due to the flammable and intoxicating nature of
the gas. As an engineer, it is a lifesaving task to design a LPG gas detector capable of raising an
alarm and showing the concentration of the gas leakage and also intimating the fire station about
the gas leakage when gas leakage concentration reaches a dangerous level. Thus we are going to
design a project to avoid the accidents due to LPG gas leakage by using Arduino, GPS module,
GSM module.
Over the past decade, there is a substantial increase in our country’s LPG consumption. It
was reported that India’s total LPG consumption in 2002-03 is 8.157 million tons but now it is
estimated that the country’s LPG consumption to be at 23.5 million tons for fiscal 2018[1,2]. This
increment is attributed to its high calorific value and eco-friendliness. It doesn’t contain Sulphur
like other energy resources making it a cleaner fuel. Being clean fuel, Government has also
encouraged each and every household to use LPG as the primary fuel.
Although LPG has many advantages compared to other energy resources it poses a serious threat
if leakage happens. LPG is stored in steel cylinders under a very high pressure in liquid form and
when leakage happens it transforms to a gaseous state. LPG is heavier than air, so when leakage
happens the gas settles at low points in the room making it difficult to disperse. Moreover, it
replaces oxygen causing suffocation. If an ignition happens due to any spark, it leads to an
explosion. According to National Crime Records Bureau (NCRB), 3700 people have died in 2014-
15 due to fire accidents from Cooking Gas Cylinder or Stove Burst. Many gas accidents also takes
place because of not providing information to the fire stations in time. There was a decrement in
fire accidents due to LPG leakage by 15% from 2010 to 2014 [3]. This decline is a good sign but
accidents can be reduced further if we can employ some protection mechanism for fire accidents.
To design and implement a Arduino based Smart LPG gas detector system capable of
giving an Buzzer alarm and tripping MCB to avoid accidents due to sparking of switches and also
sends the message alert and GPS location during LPG gas leakage. There will always be a risk of
gas leakage whenever we are using the gas. If the leakage of the gas goes undetected it leads to
undesirable consequences. I have witnessed one case of a neighbor’s house being destroyed by fire
caused by gas leakage. Gas leakage also pollute the environment called greenhouse effect. In the
light of this, a LPG gas leakage detector can help so much in alleviating this problem. LPG gas is
odorless and a small amounts of a pungent gas such as Ethanethiol is added to help people smell a
gas leakage. However this is not reliable as you may not smell the gas hence the need for a gas
leakage detector.
One such kind of system is our Arduino based smart LPG Gas Detector system. This
system also consists of light indicator and also fan to send out the gas leaked and MCB tripping
Mechanism to avoid sparking of switches. It is also capable of sending the GSM alert and GPS
location to the fire station. The success of designing this Arduino based smart LPG gas leakage
detector system will help to efficiently detect the leakage of LPG gas and avoid risk of fire and
pollution, saving life and property.
To design a Arduino Based Smart LPG gas detector system capable of giving audio visual
alarm and providing Protection mechanism for avoiding the fire accidents during LPG gas leakage.
CHAPTER 2
LITERATURE REVIEW
2.1 INTRODUCTION
LPG gas is the main gas fuel used for cooking and other heating appliances. This is because
it is a stable, high energy content, relatively low Sulphur, clean burning fuel which can be
transported economically as a liquid[1].It is a by-product of crude oil and Natural Gas
processing[2].
They are used to detect the presence of hazardous gases in the air as a part of safety system
or air monitoring system. They are classified according to the operation mechanism:
Semiconductor gas sensor, Catalytic gas sensor, Electrochemical gas sensor, Solid electrolyte gas
sensor, Thermal conductor gas sensor, Infrared point gas sensors, etc. [5, 6].
The different types of gas sensors are available as MX series (X = Q, C, E, etc.) in the
market. These different series of gas sensors have different type of operation in detecting the target
gases and are used in various different applications. The different series of gas sensors are
mentioned in the below table fig-2.1, they are MQ,ME,MC,MG,MD,MP series of gas sensors.
MQ Semiconductor
MC Catalytic
ME Electrochemical
MG Solid Electrolyte
MD Thermal Conductor
MP Flat-surfaced
They are relatively inexpensive to manufacture due to their simplicity and scalability. For
example, there exists different sensor for low concentration and high concentration applications
[7]. Considering which, we have employed MQ series sensor in the project. These MQ series
sensors detect gases by a chemical reaction that takes place when the gas comes in direct contact
with the sensor.
A semiconductor gas sensor is made up of sensing element, sensor base, and sensor cap.
The sensor cap act as a filter for outside particle smoke and moisture. The sensing element contains
sensing material and heater to heat up the sensing element. The sensing element varies depending
on the target gas
MQ Target Gas
Series
MQ-3B Alcohol
MQ-8 Hydrogen
MQ-131 Ozone
MQ-137 Ammonia
The Figure - shows a photo of MQ-6 sensor. In clean air, the sensor has a high resistance
and in presence of a gas the sensor conductivity increases. The sensor has a simple drive circuit
shown in Figure 2.2.The sensor is driven from a 5V supply. A voltage (heating voltage) is applied
between Pin 2 and 5 with a resistance of 26 ± 3Ω to heat the sensor to the working temperature[6].
When Tin Oxide is pre-heat in presence of oxygen, oxygen is adsorbed on the crystal
surface with negative charges. The donor electrons on the crystal are transferred to the absorbed
oxygen thus leaving positive charges in a space charge layer. This create a surface potential which
acts as potential barrier against electrons flow hence the high resistance of the sensor in clean
air[7].
In presence of reducing gas such as LPG, the gas molecules are adsorbed on the material
surface reducing the surface density of the negatively charged Oxygen ions thus increasing
concentrations of electrons and the conductivity of the sensor[7].[4]
Therefore, as the gas concentration increase the conductivity of the sensor will increase
and so does the sensor output voltage. However, this relationship is not linear and Figure 2.5
describe this relationship[6].
This sensor resistance is between pins 6&4 and 1&3 and a loop voltage is applied between
the series of the sensor resistance and the load resistanceıı. The sensor output voltage is the voltage
across the load resistance.
The load resistance is used to change the sensitivity of the sensor. A very high resistance,
reduce the sensor sensitivity and small changes in the concentration of the gas would not be
noticed. MQ-6 sensor has a load resistance of 4.7K
The sensor detect the gas concentration from a range of 300-10,000PPM. The sensitivity
curve of the sensor form the basis for setting the alarm trigger level and the amount of gas
concentration for a given voltage. From the curve, the sensor has an output voltage of 2.0V at 300
PPM and thus the trigger level is 2.0V. When the input voltage to the MCU is equal to or more
than 2.0V, the MCU starts the audiovisual alarm. Although the relation between gas concentration
and sensor voltage is not linear, there are ranges of sensor output voltage with constant gradient
i.e. between 2.0V and 2.5V, for every increase of 20 PPM in gas concentration there is an increase
of 0.1V. Thus gas concentration for any other voltage is through extrapolation from the known
values of sensor voltage and gas concentration from Figure 2.3.
The Hitachi HD44780 controlled 16*2 LCD will be used for display of the gas
concentration. This LCD displays alphanumeric characters (letters, numbers and symbols) which
can be used to convey adequate information concerning the gas concentration status. The fact that
it is built around the JHD 162A controller makes the LCD a smart device. The LCD has controls
lines and data lines which makes it possible to send information for displaying on the LCD by
putting the controls lines and data lines high or low. Therefore, the LCD can be interfaced to the
microcontroller pins and information be sent to the LCD.
Several different LC technologies exists. “supertwist” types, for example, offer Improved
contrast and viewing angle over the older “twisted neumatic” types. Some modules are available
with back lighting, so that they can be viewed in dimly-lit conditions. The back lighting may be
either “electro-luminescent”, requiring a high voltage inverter circuit, or simple LED illumination.
The JHD162A LCD module has 16 pins and can be operated in 4-bit mode or 8-bit mode.
Here we are using the LCD module in 4-bit mode
Before going in to the details of the project, let’s have a look at the JHD162A LCD
module.The schematic of a JHD162A LCD pin diagram is given below.
The name and functions of each pin of the 16×2 LCD module are as follows
The voltage at the VEE pin defines the contrast. The normal setting is between 0
and 0.9V.
Pin4(RS):Register select pin. The JHD162A has two registers namely command
registerand data register. Logic HIGH at RS pin selects data register and logic LOW at RS
pin selects command register.
If we make the RS pin HIGH and feed an input to the data lines (DB0 to DB7), this
input will be treated as data to display on LCD screen. If we make the RS pin LOW and
feed an input to the data lines, then this will be treated as a command ( a command to be
written to LCD controller – like positioning cursor or clear screen or scroll).
Pin5(R/W): Read/Write modes. This pin is used for selecting between read and write
modes. Logic HIGH at this pin activates read mode and logic LOW at this pin activates
write mode.
Pin6(E): This pin is meant for enabling the LCD module. A HIGH to LOW signal at this
pin will enable the module.
Pin7(DB0) to Pin14(DB7): These are data pins. The commands and data are fed to the
LCD module though these pins.
Pin15(LED+): Anode of the back light LED. When operated on 5V, a 560 ohm resistor
should be connected in series to this pin. In arduino based projects the back light LED can
be powered from the 3.3V source on the arduino board.
Pin16(LED-): Cathode of the back light LED.
The Atmega328 is one of the microcontroller chips that are used with the popular Arduino
development boards. The Arduino development board comes with either 1 of 2 microcontroller
chips, the Atmega168 or the Atmega328. Of these 2, the Atmega328 is the upgraded, more
advanced chip. Unlike the Atmega168 which has 16K of flash program memory and 512 bytes of
internal SRAM, the Atmega328 has 32K of flash program memory and 2K of Internal SRAM.
The Atmega328 has 28 pins.It has 14 digital I/O pins, of which 6 can be used as PWM
outputs and 6 analog input pins. These I/O pins account for 20 of the pins.
As stated before, 20 of the pins function as I/O ports. This means they can function as an
input to the circuit or as output. Whether they are input or output is set in the software. 14
of the pins are digital pins, of which 6 can function to give PWM output. 6 of the pins are
for analog input/output.
of the pins are for the crystal oscillator. This is to provide a clock pulse for the Atmega
chip. A clock pulse is needed for synchronization so that communication can occur in
synchrony between the Atmega chip and a device that it is connected to.
The chip needs power so 2 of the pins, Vcc and GND, provide it power so that it can
operate. The Atmega328 is a low-power chip, so it only needs between 1.8-5.5V of power
to operate.
The Atmega328 chip has an analog-to-digital converter (ADC) inside of it. This must be
or else the Atmega328 wouldn't be capable of interpreting analog signals. Because there is
an ADC, the chip can interpret analog input, which is why the chip has 6 pins for analog
input. The ADC has 3 pins set aside for it to function- AVCC, AREF, and GND. AVCC is
the power supply, positive voltage, that for the ADC.
The ADC needs its own power supply in order to work. GND is the power supply ground.
AREF is the reference voltage that the ADC uses to convert an analog signal to its
corresponding digital value. Analog voltages higher than the reference voltage will be
assigned to a digital value of 1, while analog voltages below the reference voltage will be
assigned the digital value of 0.
The Atmega328 chip has an analog-to-digital converter (ADC) inside of it. This must be
or else the Atmega328 wouldn't be capable of interpreting analog signals. Because there is
an ADC, the chip can interpret analog input, which is why the chip has 6 pins for analog
input.
Since the ADC for the Atmega328 is a 10-bit ADC, meaning it produces a 10-bit digital
value, it converts an analog signal to its digital value, with the AREF value being a
reference for which digital values are high or low. Thus, a portrait of an analog signal is
shown by this digital value; thus, it is its digital correspondent value.
The last pin is the RESET pin. This allows a program to be rerun and start over.
The ATMEGA328P is used mainly for Arduino UNO which is the first version of Arduino
board.
1 PC6 Reset
2 PD0 Digital Pin (RX)
3 PD1 Digital Pin (TX)
4 PD2 Digital Pin
5 PD3 Digital Pin (PWM)
6 PD4 Digital Pin
7 Vcc Positive Voltage (Power)
8 GND Ground
9 XTAL 1 Crystal Oscillator
10 XTAL 2 Crystal Oscillator
11 PD5 Digital Pin (PWM)
12 PD6 Digital Pin (PWM)
13 PD7 Digital Pin
14 PB0 Digital Pin
15 PB1 Digital Pin (PWM)
16 PB2 Digital Pin (PWM)
17 PB3 Digital Pin (PWM)
18 PB4 Digital Pin
19 PB5 Digital Pin
20 AVCC Positive voltage for ADC (power)
21 AREF Reference Voltage
22 GND Ground
23 PC0 Analog Input
24 PC1 Analog Input
25 PC2 Analog Input
26 PC3 Analog Input
27 PC4 Analog Input
28 PC5 Analog Input
2.5.1 INTRODUCTION
GSM (Global System for Mobile communications) is a cellular network, which means that
mobile phones connect to it by searching for cells in the immediate vicinity. GSM networks operate
in four different frequency ranges. Most GSM networks operate in the 900 MHz or 1800 MHz
bands. Some countries in the Americas use the 850 MHz and 1900 MHz bands because the 900
and 1800 MHz frequency bands were already allocated.
The rarer 400 and 450 MHz frequency bands are assigned in some countries, where these
frequencies were previously used for first-generation systems.
GSM-900 uses 890–915 MHz to send information from the mobile station to the base
station (uplink) and 935–960 MHz for the other direction (downlink), providing 124 RF channels
(channel numbers 1 to 124) spaced at 200 kHz. Duplex spacing of 45 MHz is used. In some
countries the GSM-900 band has been extended to cover a larger frequency range. This 'extended
GSM', E-GSM, uses 880–915 MHz (uplink) and 925–960 MHz (downlink), adding 50 channels
(channel numbers 975 to 1023 and 0) to the original GSM-900 band. Time division multiplexing
is used to allow eight full-rate or sixteen half-rate speech channels per radio frequency channel.
There are eight radio timeslots (giving eight burst periods) grouped into what is called a TDMA
frame. Half rate channels use alternate frames in the same timeslot. The channel data rate is
270.833k bit/s, and the frame duration is 4.615 ms.
GSM also pioneered a low-cost, to the network carrier, alternative to voice calls, the Short
message service (SMS, also called "text messaging"), which is now supported on other mobile
standards as well. Another advantage is that the standard includes one worldwide Emergency
telephone number, 112. This makes it easier for international travelers to connect to emergency
services without knowing the local emergency number.
GSM provides recommendations, not requirements. The GSM specifications define the
functions and interface requirements in detail but do not address the hardware. The GSM network
is divided into three major systems: the switching system (SS), the base station system (BSS), and
the operation and support system (OSS).
The GSM network is wide and it consists of many levels or subsystems in it. The systems
present in the GSM network are shown in below figure.
The switching system (SS) is responsible for performing call processing and subscriber-
related functions. The switching system includes the following functional units.
HOME LOCATION REGISTER (HLR): The HLR is a database used for storage and
management of subscriptions. The HLR is considered the most important database, as it
stores permanent data about subscribers, including a subscriber's service profile, location
information, and activity status. When an individual buys a subscription from one of the
PCS operators, he or she is registered in the HLR of that operator.
MOBILE SERVICES SWITCHING CENTER (MSC): The MSC performs the
telephony switching functions of the system. It controls calls to and from other telephone
and data systems. It also performs such functions as toll ticketing, network interfacing,
common channel signaling, and others.
VISITOR LOCATION REGISTER (VLR): The VLR is a database that contains
temporary information about subscribers that is needed by the MSC in order to service
visiting subscribers.
The VLR is always integrated with the MSC. When a mobile station roams into a
new MSC area, the VLR connected to that MSC will request data about the mobile station
from the HLR. Later, if the mobile station makes a call, the VLR will have the information
needed for call setup without having to interrogate the HLR each time.
AUTHENTICATION CENTER (AUC): A unit called the AUC provides authentication
and encryption parameters that verify the user's identity and ensure the confidentiality of
each call. The AUC protects network operators from different types of fraud found in
today's cellular world.
EQUIPMENT IDENTITY REGISTER (EIR): The EIR is a database that contains
information about the identity of mobile equipment that prevents calls from stolen,
unauthorized, or defective mobile stations. The AUC and EIR are implemented as stand-
alone nodes or as a combined AUC/EIR node.
All radio-related functions are performed in the BSS, which consists of base station
controllers (BSCs) and the base transceiver stations (BTSs).
BSC: The BSC provides all the control functions and physical links between the MSC and
BTS. It is a high-capacity switch that provides functions such as handover, cell
configuration data, and control of radio frequency (RF) power levels in base transceiver
stations. A number of BSCs are served by an MSC.
BTS: The BTS handles the radio interface to the mobile station. The BTS is the radio
equipment (transceivers and antennas) needed to service each cell in the network. A group
of BTSs are controlled by a BSC.
The operations and maintenance center (OMC) is connected to all equipment in the
switching system and to the BSC. The implementation of OMC is called the operation and support
system (OSS). The OSS is the functional entity from which the network operator monitors and
controls the system. The purpose of OSS is to offer the customer cost-effective support for
centralized, regional and local operational and maintenance activities that are required for a GSM
network. An important function of OSS is to provide a network overview and support the
maintenance activities of different operation and maintenance organizations.
FREQUENCY BAND: The frequency range specified for GSM is 1,850 to 1,990 MHz
(mobile station to base station).
DUPLEX DISTANCE: The duplex distance is 80 MHz. Duplex distance is the distance
between the uplink and downlink frequencies. A channel has two frequencies, 80 MHz
apart.
CHANNEL SEPARATION: The separation between adjacent carrier frequencies. In
GSM, this is 200 kHz.
MODULATION: Modulation is the process of sending a signal by changing the
characteristics of a carrier frequency. This is done in GSM via Gaussian minimum shift
keying (GMSK).
TRANSMISSION RATE: GSM is a digital system with an over-the-air bit rate of 270
kbps.
ACCESS METHOD: GSM utilizes the time division multiple access (TDMA) concept.
TDMA is a technique in which several different calls may share the same carrier. Each call
is assigned a particular time slot.
SPEECH CODER: GSM uses linear predictive coding (LPC). The purpose of LPC is to
reduce the bit rate. The LPC provides parameters for a filter that mimics the vocal tract.
The signal passes through this filter, leaving behind a residual signal. Speech is encoded at
13 kbps.
subscriber when the mobile is powered on or has reentered the coverage area of the
network. This function ensures that the message will be received.
CELL BROADCAST: A variation of the short message service is the cell broadcast
facility. A message of a maximum of 93 characters can be broadcast to all mobile
subscribers in a certain geographic area. Typical applications include traffic congestion
warnings and reports on accidents.
VOICE MAIL: This service is actually an answering machine within the network, which
is controlled by the subscriber. Calls can be forwarded to the subscriber's voice-mail box
and the subscriber checks for messages via a personal security code.
FAX MAIL: With this service, the subscriber can receive fax messages at any fax
machine. The messages are stored in a service center from which they can be retrieved by
the subscriber via a personal security code to the desired fax number
GSM supports a comprehensive set of supplementary services that can complement and
support both telephony and data services.
CALL FORWARDING: This service gives the subscriber the ability to forward
incoming calls to another number if the called mobile unit is not reachable, if it is busy, if
there is no reply, or if call forwarding is allowed unconditionally.
HOLD: This service enables the subscriber to interrupt an ongoing call and then
subsequently reestablish the call. The call hold service is only applicable to normal
telephony.
CALL WAITING: This service enables the mobile subscriber to be notified of an
incoming call during a conversation. The subscriber can answer, reject, or ignore the
incoming call. Call waiting is applicable to all GSM telecommunications services using a
circuit-switched connection.
MULTIPARTY SERVICE: The multiparty service enables a mobile subscriber to
establish a multiparty conversation—that is, a simultaneous conversation between three
and six subscribers. This service is only applicable to normal telephony.
CALLING LINE IDENTIFICATION PRESENTATION/RESTRICTION: These
services supply the called party with the integrated services digital network (ISDN) number
of the calling party. The restriction service enables the calling party to restrict the
presentation. The restriction overrides the presentation.
CLOSED USER GROUPS (CUGS): CUGs are generally comparable to a PBX. They
are a group of subscribers who are capable of only calling themselves and certain numbers
Note that the starting "AT" is the prefix that informs the modem about the start of a
command line. It is not part of the AT command name. For example, D is the actual AT command
name in ATD and +CMGS is the actual AT command name in AT+CMGS. However, some books
and web sites use them interchangeably as the name of an AT command.
Here are some of the tasks that can be done using AT commands with a GSM/GPRS
modem or mobile phone:
Get basic information about the mobile phone or GSM/GPRS modem. For example, name
of manufacturer (AT+CGMI), model number (AT+CGMM), IMEI number (International
Mobile Equipment Identity) (AT+CGSN) and software version (AT+CGMR).
Get basic information about the subscriber. For example, MSISDN (AT+CNUM) and
IMSI number (International Mobile Subscriber Identity) (AT+CIMI).
Get the current status of the mobile phone or GSM/GPRS modem. For example, mobile
phone activity status (AT+CPAS), mobile network registration status (AT+CREG), radio
signal strength (AT+CSQ), battery charge level and battery charging status (AT+CBC).
Establish a data connection or voice connection to a remote modem (ATD, ATA, etc).
Control the presentation of result codes / error messages of AT commands. For example,
you can control whether to enable certain error messages (AT+CMEE) and whether error
Get or change the configurations of the mobile phone or GSM/GPRS modem. For example,
change the GSM network (AT+COPS), bearer service type (AT+CBST), radio link
protocol parameters (AT+CRLP), SMS center address (AT+CSCA) and storage of SMS
messages (AT+CPMS).
Save and restore configurations of the mobile phone or GSM/GPRS modem. For example,
save (AT+CSAS) and restore (AT+CRES) settings related to SMS messaging such as the
SMS center address.
2.6.1 INTRODUCTION
The Global Positioning System (GPS) is the only fully functional Global Navigation
Satellite System (GNSS). The GPS uses a constellation of between 24 and 32 Medium Earth Orbit
satellites that transmit precise microwave signals, which enable GPS receivers to determine their
location, speed,. GPS was developed by the United States Department of Defense. Its official name
is NAVSTAR-GPS. Although NAVSTAR-GPS is not an acronym, a few backronyms have been
created for it. The GPS satellite constellation is managed by the United States Air Force 50th Space
Wing.
facilities and laboratory standards can be set to precise time signals or controlled to accurate
frequencies by special purpose GPS receivers.
Following the shooting down of Korean Air Lines Flight 007 in 1983, President Ronald
Reagan issued a directive making the system available free for civilian use as a common good.
Since then, GPS has become a widely used aid to navigation worldwide, and a useful tool for map-
making, land surveying, commerce, scientific uses, and hobbies such as geocaching. GPS also
provides a precise time reference used in many applications.
A GPS receiver calculates its position by carefully timing the signals sent by the
constellation of GPS satellites high above the Earth. Each satellite continually transmits messages
containing the time the message was sent, a precise orbit for the satellite sending the message (the
ephemeris), and the general system health and rough orbits of all GPS satellites (the almanac).
These signals travel at the speed of light through outer space, and slightly slower through the
atmosphere. The receiver uses the arrival time of each message to measure the distance to each
satellite, from which it determines the position of the receiver (conceptually the intersection of
spheres - see trilateration ) The resulting coordinates are converted to more user-friendly forms
such as latitude and longitude, or location on a map, then displayed to the user.
It might seem that three satellites would be enough to solve for a position, since space has
three dimensions. However, a three satellite solution requires the time be known to a nanosecond
or so, far better than any non-laboratory clock can provide. Using four or more satellites allows
the receiver to solve for time as well as geographical position, eliminating the need for a super
accurate clock. In other words, the receiver uses four measurements to solve for four variables: x,
y, z, and t. While many GPS applications have no particular use for this (very accurate) time, it is
used in some GPS applications such as time transfer, and it is the only variable of interest in some
applications, such as traffic signal timing.
Although four satellites are required for normal operation, fewer may be needed in some
special cases.. Also, in practice, receivers use additional clues (Doppler shift of satellite signals,
last known position, dead reckoning, inertiral navigation, and so on) to give degraded answers
when fewer than four satellites are visible.
To provide an introductory description of how a GPS receiver works, errors will be ignored
in this section. Using messages received from a minimum of four visible satellites, a GPS receiver
is able to determine the satellite positions and time sent.
The x, y, and z components of position and the time sent are designated as
where the subscript i denotes the satellite number and has the value 1, 2, 3, or 4. Knowing the
indicated time the message was received , the GPS receiver can compute the indicated transit
Assuming the message traveled at the speed of light, c, the distance travelled, can be
computed as . Knowing the distance from GPS receiver to a satellite and the position
of a satellite implies that the GPS receiver is on the surface of a sphere centered at the position of
a satellite. Thus we know that the indicated position of the GPS receiver is at or near the
intersection of the surfaces of four spheres. In the ideal case of no errors, the GPS receiver will be
at an intersection of the surfaces of four spheres. The surfaces of two spheres if they intersect in
more than one point intersect in a circle. A figure, two sphere surfaces intersecting in a circle, is
shown below.
The article, trilateration, shows mathematically that two spheres intersecting in more than
one point intersect in a circle.
Fig 2.9- Surface of Sphere Intersecting a Circle (not disk) at Two Points
A circle and sphere surface in most cases of practical interest intersects at two points,
although it is conceivable that they could intersect in 0 or 1 point. Another figure, Surface of
Sphere Intersecting a Circle (not disk) at Two Points, is shown to aid in visualizing this
intersection. Again trilateration clearly show this mathematically. The correct position of the GPS
receiver is the one that is closest to the fourth sphere.
The current GPS consists of three major segments. These are the space segment (SS), a
control segment (CS), and a user segment (US).
A visual example of the GPS constellation in motion with the Earth rotating. Notice how
the number of satellites in view from a given point on the Earth's surface, in this example at 45°N,
changes with time.
The space segment (SS) comprises the orbiting GPS satellites, or Space Vehicles (SV) in
GPS parlance. The GPS design originally called for 24 SVs, eight each in three circular orbital
planes, but this was modified to six planes with four satellites each. The orbital
planes are centered on the Earth, not rotating with respect to the distant stars. The six planes
have approximately 55° inclination (tilt relative to Earth's equator) and are separated by 60° right
ascension of the ascending node (angle along the equator from a reference point to the orbit's
intersection). The orbits are arranged so that at least six satellites are always within line of sight
from almost everywhere on Earth's surface.
As of March 2008, there are 31 actively broadcasting satellites in the GPS constellation.
The additional satellites improve the precision of GPS receiver calculations by providing
redundant measurements. With the increased number of satellites, the constellation was changed
to a nonuniform arrangement. Such an arrangement was shown to improve reliability and
availability of the system, relative to a uniform system, when multiple satellites fail.
Some reports in 2008 indicated that the 32nd satellite was causing difficulties for some
GPS receivers.
The flight paths of the satellites are tracked by US Air Force monitoring stations in Hawaii,
Kwajalein, Ascension Island, Diego Garcia, and Colorado Springs, Colorado, along with monitor
stations operated by the National Geospatial-Intelligence Agency (NGA). The tracking
information is sent to the Air Force Space Command's master control station at Schriever Air Force
Base in Colorado Springs, which is operated by the 2nd Space Operations Squadron (2 SOPS) of
the United States Air Force (USAF). Then 2 SOPS contacts each GPS satellite regularly with a
navigational update (using the ground antennas at Ascension Island, Diego Garcia, Kwajalein, and
Colorado Springs). These updates synchronize the atomic clocks on board the satellites to within
a few nanoseconds of each other, and adjust the ephemeris of each satellite's internal orbital model.
The updates are created by a Kalman filter which uses inputs from the ground monitoring stations,
space weather information, and various other inputs.
Satellite maneuvers are not precise by GPS standards. So to change the orbit of a satellite,
the satellite must be marked 'unhealthy', so receivers will not use it in their calculation. Then the
maneuver can be carried out, and the resulting orbit tracked from the ground. Then the new
ephemeris is uploaded and the satellite marked healthy again.
GPS receivers come in a variety of formats, from devices integrated into cars, phones, and
watches, to dedicated devices such as those shown here from manufacturers Trimble, Garmin and
Leica (left to right).
The user's GPS receiver is the user segment (US) of the GPS. In general, GPS receivers are
composed of an antenna, tuned to the frequencies transmitted by the satellites, receiver-processors,
and a highly-stable clock (often a crystal oscillator). They may also include a display for providing
location and speed information to the user.
A receiver is often described by its number of channels: this signifies how many satellites
it can monitor simultaneously. Originally limited to four or five, this has progressively increased
over the years so that, as of 2007, receivers typically have between 12 and 20 channels.
The method of calculating position for the case of no errors has been explained. One of the
most important errors is the error in the GPS receiver clock. Because of the very large value of c,
the speed of light, the estimated distances from the GPS receiver to the satellites, the pseudo
ranges, are very sensitive to errors in the GPS receiver clock.
This seems to suggest that an extremely accurate and expensive clock is required for the
GPS receiver to work. On the other hand, manufacturers would like to make an inexpensive GPS
receiver which can be mass marketed. The manufacturers were thus faced with a difficult design
problem. The technique that solves this problem is based on the way sphere surfaces intersect in
the GPS problem.
It is likely the surfaces of the three spheres intersect since the circle of intersection of the
first two spheres is normally quite large and thus the third sphere surface is likely to intersect this
large circle. It is very unlikely that the surface of the sphere corresponding to the fourth satellite
will intersect either of the two points of intersection of the first three since any clock error could
cause it to miss intersecting a point. However the distance from the valid estimate of GPS receiver
position to the surface of the sphere corresponding to the fourth satellite can be used to compute a
clock correction.
Let denote the distance from the valid estimate of GPS receiver position to the fourth
satellite and let denote the pseudo range of the fourth satellite. Let . Note that
is the distance from the computed GPS receiver position to the surface of the sphere
Once if any error occurs in the GPS clock it creates a dangerous impact on the present
technology and all the satellites work with this GPS clock.
2.6.6 APPLICATIONS
Civilian application: To help prevent civilian GPS guidance from being used in an
enemy's military or improvised weaponry, the US Government controls the export of
civilian receivers. A US-based manufacturer cannot generally export a GPS receiver unless
the receiver contains limits restricting it from functioning when it is simultaneously (1) at
an altitude above 18 kilometers (60,000 ft) and (2) traveling at over 515 m/s (1,000 knots).
These parameters are well above the operating characteristics of the typical cruise missile,
but would be characteristic of the reentry vehicle from a ballistic missile.
CHAPTER 3
PROJECT DESIGN
Fig 3.1- Block Diagram of Arduino Based Smart LPG Gas Leakage Detector System
The project consists of many blocks as listed below and their functioning is
explained.
Gas sensor: It is used to detect the LPG gas leakage and can also display the concentration
of gas leakage. It provides a voltage signal output with respect to the concentration of gas to the
Arduino.
Relay module: Relay is an electronic switch that can be used to operate the large voltage
appliances or applications with a small voltage input. This relay module operates the fan, light,
MCB ,Buzzer based on the output of the Arduino.
GSM module: It is used to send the SMS to the owner and fire station that the gas is being
leaked in the house.it works on the AT commands and it also sends the GPS location to the desired
person and fire station
GPS Module: It used to get the GPS location from the GPS satellite. Later this location
will be sent to the fire station through GSM module.
MCB: It is a circuit breaker that can give protection from fault currents and short circuits.
When the gas is leaked, the MCB is tripped there by avoid the sparking of switches. As the MCB
cannot be disturbed or modified we are using an external relay in series with the MCB there by
performing the tripping operation.
Buzzer: It is an audio alarm that provides beep sound alerting the owner about the Gas
leakage in the house.it goes on sounding until the reset button is pressed.
Light indicator: It is an Visual alarm in this project that alerts the owner about the gas
leakage in the house.
Fan: it is a device that can be used to send the leaked gas out of the house, there reducing
the chances of fire accident.it is also connected to relay only, when the gas leak is detected it the
relay is switched on thereby switching on the fan.
CHAPTER 4
HARDWARE DESCRIPTION
4.1 ARDUINO
Arduino is open source physical processing which is based on a microcontroller board and
an incorporated development environment for the board to be programmed. Arduino gains a few
inputs, for example, switches or sensors and control a few multiple outputs, for example, lights,
engine and others. Arduino program can run on Windows, Macintosh and Linux operating systems
(OS) opposite to most microcontrollers’ frameworks which run only on Windows. Arduino
programming is easy to learn and apply to beginners and amateurs. Arduino is an instrument used
to build a better version of a computer which can control, interact and sense more than a normal
desktop computer. It's an open-source physical processing stage focused around a straightforward
microcontroller board, and an environment for composing programs for the board. Arduino can be
utilized to create interactive items, taking inputs from a diverse collection of switches or sensors,
and controlling an assortment of lights, engines, and other physical outputs. Arduino activities can
be remaining solitary, or they can be associated with programs running on your machine (e.g.
Flash, Processing and Maxmsp.) The board can be amassed by hand or bought preassembled; the
open-source IDE can be downloaded free of charge. Focused around the Processing media
programming environment, the Arduino programming language is an execution of Wiring, a
comparative physical computing platform.
Inexpensive - Arduino boards are moderately cheap compared with other microcontroller
boards. The cheapest version of the Arduino module can be amassed by hand, and even the
preassembled Arduino modules cost short of what $50.
Cross-platform - The Arduino programming runs multiple operating systems Windows,
Macintosh OSX, and Linux working frameworks. So we conclude that Arduino has an
advantage as most microcontroller frameworks are constrained to Windows.
Straightforward, clear programming method - The Arduino programming environment is
easy to use for novices, yet sufficiently versatile for cutting edge customers to adventure
as well. For educators, it is favorably engaged around the Processing programming
environment, so Under studies finding ways to understand how to program in that
environment will be familiar with the nature of arduino.
Open source and extensible programming. The Arduino program language is available as
open source, available for development by experienced engineers. The lingo can be reached
out through C++ libraries, and people expecting to understand the specific purposes of
different interests can make the leap from Arduino to the AVR C programming language
on which it is based. Basically, you can incorporate AVR-C code clearly into your Arduino
programs if you have to.
Open source and extensible hardware - The Arduino is concentrated around Atmel's
Atmega8 and Atmega168 microcontrollers. The plans for the modules are circulated under
a Creative Commons license, so experienced circuit designers can make their own
particular interpretation of the module, extending it and improving it. slightly
inexperienced customers can build the breadboard variation of the module remembering
the finished objective to perceive how it capacities and save money.
Atmega8U2 programmed as a USB-to-serial converter. "Uno" means one in Italian and is named
to mark the upcoming release of Arduino 1.0. The Uno and version 1.0 will be the reference
versions of Arduno, moving forward. The Uno is the latest in a series of USB Arduino boards, and
the reference model for the Arduino platform;
Microcontroller : ATmega328
Operating Voltage : 5V
SRAM : 2 KB (ATmega328)
EEPROM : 1 KB (ATmega328)
Length : 68.6 mm
Width : 53.4 mm
4.1.5 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.
4.1.6 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).
4.1.7 INPUT/OUTPUT:
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-50k
Ohms. 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:
I 2C: 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.
4.1.8 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 ATmega8U2 on the board channels this serial communication
over USB and appears as a virtual com port to software on the computer. The '8U2 firmware uses
the standard USB COM drivers, and no external driver is needed. However, on Windows, an *.inf
file is required..
The Arduino software includes a serial monitor which allows simple textual data to 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-toserial chip and USB connection to the computer (but not for serial
communication on pins 0 and 1).
4.1.9 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 .
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 theATmega8U2/16U2 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. 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. 11
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.
For LPG gas detection, the sensing element is Tin Oxide (SnO2) with Platinum (Pt)
as a catalyst. When a metal oxide like SnO2 is heated in air, oxygen is adsorbed on the crystal
surface. The adsorbed oxygen attains negative charge due to the transfer of donor electrons from
SnO2, resulting in surface Sn+2 ions.
Hydrocarbons (which is the major component of LPG) dissociate on metal oxide surface
before reacting with adsorbed oxygen. The Platinum catalyst makes this dissociation faster. The
dissociated molecules then interact with the adsorbed oxygen to produce trapped electrons.
These trapped electrons increase the electron carrier concentration in the sensing SnO2
layer which accounts for the decrease in sensor resistance in the presence of LPG gas. Therefore,
the conductivity between the electrodes is directly proportional to the concentration of LPG gas.
The MQ-6 sensor which is used for LPG gas detection is connected in the following
manner:
Fig 4.3- MQ-6 connection for LPG Gas detection fig 4.4- MQ-6(LPG) sensor
Both A pins of the sensor are connected together to the Vcc and both B pins are connected
to ground through a variable load resistance. The heater pins are connected directly to Vcc and
ground. If A and B pins are interconnected mistakenly, the sensor could get damaged.
CONNECTIONS:
4.3 RELAYS
A relay is an electrical switch that opens and closes under the control of another
electrical circuit. In the original form, the switch is operated by an electromagnet to open or close
one or many sets of contacts. A relay is able to control an output circuit of higher power than the
input circuit, it can be considered to be, in a broad sense, a form of an electrical amplifier.
Relays are usually SPDT (single pole double through switch)or DPDT (double pole double
through switch) but they can have many more sets of switch contacts, for example relays with 4
sets of changeover contacts are readily available.
An electric current through a conductor will produce a magnetic field at right angles
to the direction of electron flow. If that conductor is wrapped into a coil shape, the magnetic field
produced will be oriented along the length of the coil. The greater the current, the greater the
strength of the magnetic field, all other factors being equal.
Inductors react against changes in current because of the energy stored in this magnetic
field. When we construct a transformer from two inductor coils around a common iron core, we
use this field to transfer energy from one coil to the other. However, there are simpler and more
direct uses for electromagnetic fields than the applications we've seen with inductors and
transformers. The magnetic field produced by a coil of current-carrying wire can be used to exert
a mechanical force on any magnetic object, just as we can use a permanent magnet to attract
magnetic objects, except that this magnet (formed by the coil) can be turned on or off by switching
the current on or off through the coil.
If we place a magnetic object near such a coil for the purpose of making that object move
when we energize the coil with electric current, we have what is called a solenoid. The movable
magnetic object is called an armature, and most armatures can be moved with either direct current
(DC) or alternating current (AC) energizing the coil. The polarity of the magnetic field is irrelevant
for the purpose of attracting an iron armature. Solenoids can be used to electrically open door
latches, open or shut valves, move robotic limbs, and even actuate electric switch mechanisms and
is used to actuate a set of switch contacts
This is the most elementary type of relay. The neutral relays have a magnetic coil, which
operates the relay at a specified current, regardless of the polarity of the voltage applied.
Biased relays have a permanent magnet above the armature. The relay operates if the
current through the coil winding establishes a magneto-motive force that opposes the flux by the
permanent magnet. If the fluxes are in the same direction, the relay will not operate, even for a
greater current through the coil.
Like the biased relays, the polarized relays operate only when the current through the coil
in one direction. But there the principle is different. The relay coil has a diode connected in series
with it. This blocks the current in the reverse direction.
The major difference between biased relays and polarized relays is that the former allows
the current to pass through in the reverse direction, but does the not operate the relay and the later
blocks the current in reverse direction. You can imagine how critical these properties when relays
are connected in series to form logic circuits.
These relays have a magnetic circuit with high permanence. Two coils, one to operate
(pick up) and one to release (drop) are present. The relay is activated by a current in the operate
coil.
On the interruption of the current the armature remains in picked up position by the residual
magnetism. The relay is released by a current through the release coil.
These relays have a capacitor connected in parallel to their coil. When the operating current
is interrupted the release of relay is delayed by the stored charge in the capacitor. The relay releases
as the capacitor discharges through the coil.
These are neutral relays and picked up for a.c. current through their coil. These are very
fast in action and used on power circuits of the point motors, where high current flows through the
contacts. A normal relay would be slow and make sparks which in turn may weld the contacts
together. All relays have two operating values (voltages), one pick-up and the other drop away.
To detect and isolate faults on transmission and distribution lines by opening and closing
circuit breakers (protection relays).
To isolate the controlling circuit from the controlled circuit when the two are at different
potentials, for example when controlling a mains-powered device from a low-voltage
switch. The latter is often applied to control office lighting as the low voltage wires are
easily installed in partitions, which may be often moved as needs change. They may also
be controlled by room occupancy detectors in an effort to conserve energy.
To perform logic functions. For example, the boolean AND function is realised by
connecting NO relay contacts in series, the OR function by connecting NO contacts in
parallel. The change-over or Form C contacts perform the XOR (exclusive or) function.
Similar functions for NAND and NOR are accomplished using NC contacts. The Ladder
programming language is often used for designing relay logic networks.
In Early computing. Before vacuum tubes and transistors, relays were used as logical
elements in digital computers. See ARRA (computer), Harvard Mark II, Zuse Z2, and Zuse
Z3.
Safety-critical logic. Because relays are much more resistant than semiconductors to
nuclear radiation, they are widely used in safety-critical logic, such as the control panels of
radioactive waste-handling machinery
CONNECTIONS
Connect the 5V and GND of Arduino to the VCC and GND terminals of the relay module.
Connect the digital pin of Arduino to the input pin (IN1) of relay module and if second
relay is also used then connect another digital pin of Arduino to the IN2 pin of Relay
module.
4.4.1 INTRODUCTION
SIM800 is a quad-band GSM/GPRS module designed for the global market. It works on
frequencies GSM 850MHz, EGSM 900MHz, DCS 1800MHz and PCS 1900MHz. SIM800
features GPRS multi-slot class 12/ class 10 (optional) and supports the GPRS coding schemes CS-
1, CS-2, CS-3 and CS-4.
With a tiny configuration of 24*24*3mm, SIM800 can meet almost all the space
requirements in users’ applications, such as M2M, smart phone, PDA and other mobile devices.
SIM800 has 68 SMT pads, and provides all hardware interfaces between the module and
customers’ boards. SIM800 is designed with power saving technique so that the current
consumption is as low as 1.2mA in sleep mode. SIM800 integrates TCP/IP protocol and extended
TCP/IP AT commands which are very useful for data transfer applications .
This SIM800L is the latest version than the SIM900 GSM MODULE, but the AT
commands they support are same with SIM800L having some extra features.
SIM800 series GSM modules have a inbuilt Bluetooth stack compliant with 3.0+EDR
& FM radio support, and the interface is accessible using AT commands.
One full function UART port, and can be configured to two independent serial ports.
The SIM800L consists of 12 pins as shown in below figure and their functioning is also
explained.
NET is a pin where you can solder Helical Antenna provided along with the module.
VCC supplies power for the module. This can be anywhere from 3.4V to 4.4 volts.
Remember connecting it to 5V pin will likely destroy your module! It doesn’t even run on
3.3 V! An external power source like Li-Po battery or DC-DC buck converters rated 3.7V
2A would work.
RST (Reset) is a hard reset pin. If you absolutely got the module in a bad space, pull this
pin low for 100ms to perform a hard reset.
RxD (Receiver) pin is used for serial communication.
TxD (Transmitter) pin is used for serial communication.
GND is the Ground Pin and needs to be connected to GND pin on the Arduino.
RING pin acts as a Ring Indicator. It is basically the ‘interrupt’ out pin from the module.
It is by default high and will pulse low for 120ms when a call is received. It can also be
configured to pulse when an SMS is received.
DTR pin activates/deactivates sleep mode. Pulling it HIGH will put module in sleep mode,
disabling serial communication. Pulling it LOW will wake the module up.
MIC± is a differential microphone input. The two microphone pins can be connected
directly to these pins.
SPK± is a differential speaker interface. The two pins of a speaker can be tied directly to
these two pins.
4.4.5 AT COMMANDS
Here are some of the tasks that can be done using AT commands with a GSM/GPRS
modem or mobile phone:
Get basic information about the mobile phone or GSM/GPRS modem. For example, name
of manufacturer (AT+CGMI), model number (AT+CGMM), IMEI number (International
Mobile Equipment Identity) (AT+CGSN) and software version (AT+CGMR).
Get basic information about the subscriber. For example, MSISDN (AT+CNUM) and
IMSI number (International Mobile Subscriber Identity) (AT+CIMI).
Get the current status of the mobile phone or GSM/GPRS modem. For example, mobile
phone activity status (AT+CPAS), mobile network registration status (AT+CREG), radio
signal strength (AT+CSQ), battery charge level and battery charging status (AT+CBC).
Establish a data connection or voice connection to a remote modem (ATD, ATA, etc).
Control the presentation of result codes / error messages of AT commands. For example,
you can control whether to enable certain error messages (AT+CMEE) and whether error
Get or change the configurations of the mobile phone or GSM/GPRS modem. For example,
change the GSM network (AT+COPS), bearer service type (AT+CBST), radio link
protocol parameters (AT+CRLP), SMS center address (AT+CSCA) and storage of SMS
messages (AT+CPMS).
Save and restore configurations of the mobile phone or GSM/GPRS modem. For example,
save (AT+CSAS) and restore (AT+CRES) settings related to SMS messaging such as the
SMS center address.
CONNECTIONS:
4.5.1 SIM28ML
SIMCom presents a small, high performance and reliable assisted GPS module-SIM28ML.
This is a standalone L1 frequency GPS module with the MediaTek MT3337 high sensitivity
navigation engine, which allows you to achieves the industry’s highest levels of sensitivity,
accuracy, and Time-to-First-Fix (TTFF) with lowest power consumption
GPS satellites transmit at least 2 low-power radio signals. The signals travel by line of
sight, meaning they will pass through clouds, glass and plastic but will not go through most
solid objects, such as buildings and mountains. However, modern receivers are more sensitive
and can usually track through houses.
CONNECTIONS:
4.6.1 INTRODUCTION
A Liquid Crystal Display commonly abbreviated as LCD is basically a display unit built
using Liquid Crystal technology. When we build real life/real world electronics based projects, we
need a medium/device to display output values and messages.
The most basic form of electronic display available is 7 Segment display – which has its
own limitations. The next best available option is Liquid Crystal Displays which comes in different
size specifications. Out of all available LCD modules in market, the most commonly used one
is 16×2 LCD Module which can display 32 ASCII characters in 2 lines (16 characters in 1 line).
Other commonly used LCD displays are 20×4 Character LCD, Nokia 5110 LCD module,
128×64 Graphical LCD Display and 2.4 inch TFT Touch screen LCD display.
4.6.2 FEATURES
CONNECTIONS:
The arduino can be powered through the external power jack provided on the board. +5V required
in some other parts of the circuit can be tapped from the 5V source on the Arduino board.
A liquid crystal display (LCD) is a thin, flat display device made up of any number of color or
monochrome pixels arrayed in front of a light source or reflector. Each pixel consists of a column
of liquid crystal molecules suspended between two transparent electrodes, and two polarizing
filters, the axes of polarity of which are perpendicular to each other.
Without the liquid crystals between them, light passing through one would be blocked by the other.
The liquid crystal twists the polarization of light entering one filter to allow it to pass through the
other.
4.7 BUZZER
In game shows it is also known as a "lockout system," because when one person signals
("buzzes in"), all others are locked out from signaling. Several game shows have large buzzer
buttons which are identified as "plungers".
The word "buzzer" comes from the rasping noise that buzzers made when they were
electromechanical devices, operated from stepped-down AC line voltage at 50 or 60 cycles. Other
sounds commonly used to indicate that a button has been pressed are a ring or a beep.
Fig 4.18-buzzer
MCBs are primarily used for overload and short-circuit protection. They are manufactured
in different pole versions such as single, double, triple and four pole structures with different trip
current ratings. Majority of MCBs that are manufactured are of single pole construction used in
single-phase circuits. They are enclosed in a moulded insulating material which provides strong
and insulated housing. The current carrying parts are made of copper or silver alloy depending on
the rating of the MCB. MCBs are designed to handle electric arc formed during a trip by metallic
arc splitter plates (Arc-Chute Chamber).
The thermal tripping mechanism consists of a bimetallic strip around which a heater coil
is wounded to create heat depending on the flow of current. The tripping mechanism is activated
by the deflection of the bimetallic strip due to a continuous flow of overload current. So, the
characteristics of bimetallic strip provide the particular delays under overload or fault currents.
The magnetic tripping mechanism consists of a coil which is wounded around a tube. This
tube has a spring-loaded slug and the slug movement operates the tripping mechanism. The
magnetic field generated by the coil during the high short-circuit current overcomes the spring
force holding the slug in position. So, the movement of slug actuates the tripping mechanism. The
tripping mechanism is activated by the deflection of the bimetallic strip due to a continuous flow
of overload current. .
MCBs are classified into three major types according to their instantaneous tripping times
B 3Ir 5Ir
C 5Ir 10Ir
D 10Ir 20Ir
Choosing a particular MCB for a specific application is very important. The following
condition must be considered while choosing the MCB.
Maximum full load current in system ≤ Current rating of MCB ≤ Cable or wire rating
CHAPTER 5
SOFTWARE
PURCHASE PARTS: purchase the parts from any electronics store. The Serial version in
particular has been designed to use the most basic parts that can be found anywhere in the
world. The USB version on the other hand requires some advanced soldering skills because
of the FTDI chip that is an Smd part. Here is a list of parts for the serial board.
ASSEMBLE THE BOARD: We put together a step by step guide on how to build an
arduino board. Newbies: never soldered before? afraid of trashing thousands of boards
before getting one properly soldered? fear not : learn to master the art of soldering.
PROGRAM THE BOOTLOADER: In order for the development environment to be able
to program the chip, this has to be programmed with a piece of code called bootloader. See
the bootloader page on how to program it on your chip.
Mac OS X note: After downloading the IDE, run the macosx_setup.command. It corrects
permission on a few files for use with the serial port and will prompt you for your password. You
may need to reboot after running this script.
If you are using a USB Arduino, you will need to install the drivers for the FTDI chip on
the board. These can be found in the Drivers directory of the Arduino distribution.
On Windows, you will need to unzip FTDI USB Drivers.zip. Then, when you plug
in the Arduino board, point the Windows Add Hardware wizard to the FTDI USB
Drivers directory.
If you're using a serial board, power the board with an external power supply (6 to 25 volts
DC, with the core of the connector positive). Connect the board to a serial port on your computer.
On the USB boards, the power source is selected by the jumper between the USB and
power plugs. To power the board from the USB port (good for controlling low power devices
like LEDs), place the jumper on the two pins closest to the USB plug. To power the board from an
external power supply (needed for motors and other high current devices), place the jumper on the
two pins closest to the power plug. Either way, connect the board to a USB port on your computer.
On Windows, the Add New Hardware wizard will open; tell it you want to specify the location to
search for drivers and point to the folder containing the USB drivers you unzipped in the previous
step.
Open the LED blink example sketch: File > Sketchbook > Examples > led_blink.
Here's what the code for the LED blink example looks like.
Select the serial device of the Arduino board from the Tools | Serial Port menu. On
Windows, this should be COM1 or COM2 for a serial Arduino board, or COM3, COM4,
or COM5 for a USB board. On the Mac, this should be something like /dev/cu.usbserial-
1B1 for a USB board, or something like /dev/cu.USA19QW1b1P1.1 if using a Keyspan adapter
with a serial board (other USB-to-serial adapters use different names).
Push the reset button on the board then click the Upload button in the IDE. Wait a few
seconds. If successful, the message "Done uploading." will appear in the status bar.
If the Arduino board doesn't show up in the Tools | Serial Port menu, or you get an error
while uploading, please see the FAQ for troubleshooting suggestions.
A few seconds after the upload finishes, you should see the amber (yellow) LED on the
board start to blink.
To upload new code to the Arduino, either you'll need to have access to code you can paste
into the programmer, or you'll have to write it yourself, using the Arduino programming language
to create your own sketch.
A setup routine that sets the initial conditions of variables and runs preliminary code
A loop routine, which is where you add the main code that will execute repeatedly until
you stop running the sketch and
A section where you can list other functions that activate during the setup and loop routines.
All sketches must include the setup and loop routines.
CHAPTER 6
RESULT
When the kit is switched on 40sec will be taken for initialization of the kit and the gas
sensor to get heated up.
After initialization the MCB is turned on, the LED light indicator and fan will be in off
state as shown in figure below
when the gas leakage is detected the buzzer goes ON and when the concentration raises
above 250 ppm the appliances like fan and LED indicator are turned on and the MCB trips
OFF.
And when the gas concentration raise above the 300 ppm the GSM message that the LPG
gas is detected is sent to the owner and the when gas concentration raises above 320 ppm
the location is indicated to the fire station through the app we designed.
As seen in the below picture ,the light is off indicating that the MCB is tripped off and
appliances like exhaust fan, light indicator are turned ON and Buzzer is also on.
Fig 6.5- GPS location is sent Fig 6.6-Google maps view of location
CHAPTER 7
7.1 CONCLUSION
The protection mechanism system for fire accidents was implemented. The value of
Concentration of gas is detected and operation of the appliances and working of project is assessed.
The LCD displayed the concentration of Gas and the light indicator are switched on when the gas
is detected and also the GPS location is sent to the fire station when the gas concentration reached
a dangerous level.
In the process of completing the project following points were inferred from the results
and mistakes:
When we used the MQ-6 sensor for the first time, we didn’t get the desired output. Later it
was inferred from the datasheet that all semiconductor gas sensors must be heated for some
time (approximately 24 hours) namely the preheating time.
We inferred from our experience that the semiconductor gas sensors will not work properly
under high humidity conditions.
We also inferred from the datasheet (of MQ-6) that first, we should apply the supply
voltage to the heating pins and then only pins A & B must be connected to resistor and
ground otherwise the gas sensor may get damaged.
The GPS module cannot receive the signal sometimes inside the home.so an external GPS
antenna can be used.
Since the power will be MCB will tripped and power supply is off inside the house, an
external secondary power source like battery should be used for project.
A new type of MCB can be moulded with 3D printing, so that instead of using relay
externally it can be embedded inside the MCB.
The desktop site can be created for receiving the GPS alert when the gas concentration
reaches a dangerous level in any house.
CHAPTER 8
REFERENCES
1. Antonette D’Sa, and K V Narasimha Murthy, “Report on the use of LPG as a domestic
cooking fuel option in India,” in International Energy Initiative, Bangalore, 2004, pp. 17.
2. The Hindu. (2018, Jan.) Domestic LPG consumption set to grow 10% this fiscal.
[Online]. Available: http://www.thehindubusinessline.com/economy/domestic-lpg-consumption-
set-to-grow-10-this-fiscal/article9642347.ece
3. Business Standard. (2015, Sep.) Fire accidents kill 54 people daily in India, yet deaths
have declined. [Online]. Available: http://www.business-standard.com/article/specials/fire-
accidents-kill-54-people-daily-in-india-yet-deaths-have-declined-115092500584_1.html
4. The Hindu. (2013, Nov.) What sparks LPG accidents. [Online]. Available:
http://www.thehindu.com/news/national/tamil-nadu/what-sparks-lpg-
accidents/article5372757.ece
ANNEXURE A
#include <LiquidCrystal.h>
#include <SoftwareSerial.h>
int la,lo,latt,lonn,gps_chk='0',i;
float lath,latl,lonh,lonl,lat,lon;
int ss=0;
int gval=0;
void setup() {
Serial.begin(9600);
gps.begin(9600);
lcd.begin(16,2);
lcd.print(" WELCOME");
lcd.setCursor(0,1);
lcd.print("INITIALIZING..");
pinMode(lt,OUTPUT);
pinMode(bz,OUTPUT);
pinMode(rl1,OUTPUT);
pinMode(rl2,OUTPUT);
pinMode(fn,OUTPUT);
delay(40000);
digitalWrite(bz,0);
digitalWrite(lt,1);
digitalWrite(fn,1);
digitalWrite(rl1,0);
digitalWrite(rl2,0);
lcd.clear();
lcd.print("GAS: PPM");
lcd.setCursor(0,1);
lcd.print("MCB:ON ");
Serial.println("WELCOME");
void loop() {
gval=a
nalogRead(gas);
int gval=analogRead(gas);
lcd.setCursor(4,0);
lcd.print(" ");
lcd.setCursor(4,0);
lcd.print(gval);
delay(500);
digitalWrite(bz,1);
delay(300);
digitalWrite(bz,0);
delay(300);
ss=0;
ss=1;
lcd.setCursor(0,1);
lcd.print("MCB:OFF");
digitalWrite(rl1,1);
digitalWrite(rl2,1);
digitalWrite(bz,1);
digitalWrite(lt,0);
read_gps(3);
delay(1000);
if(gval>320)
ss=0;
lcd.setCursor(0,1);
lcd.print("MCB:OFF");
digitalWrite(bz,1);
digitalWrite(lt,0);
digitalWrite(rl1,1);
digitalWrite(rl2,1);
read_gps(2);
delay(1000);
while(1);
while (gps.available()==0);
return(gps.read());
//return (sdata);
gps_chk='0';
while(gps_chk=='0')
if(rxd()=='$')
if(rxd()=='G')
if(rxd()=='P')
if(rxd()=='G')
if(rxd()=='G')
if(rxd()=='A')
gps_chk='1';
for(r=0;r<36;r++)
rx[r] = rxd();
/*for(r=12;r<36;r++)
Serial.write(rx[r]);//rx[r] = rxd();
}*/
//Serial.println();
la=(rx[12]&0x0f)*10+(rx[13]&0x0f);
lath=(rx[14]&0x0f)*10+(rx[15]&0x0f);
latl=(rx[17]&0x0f)*1000+(rx[18]&0x0f)*100+(rx[19]&0x0f)*10+(rx[20]&0x0f);
lo=(rx[25]&0x0f)*10+(rx[26]&0x0f);
lonh=(rx[27]&0x0f)*10+(rx[28]&0x0f);
lonl=(rx[30]&0x0f)*1000+(rx[31]&0x0f)*100+(rx[32]&0x0f)*10+(rx[33]&0x0f);
//-----------------lat------------------------
lath=lath/60;
latl=(latl/60)/10000;
lat=lath+latl;
latt=lat*10000;
//------------------lon------------------------
lonh=lonh/60;
lonl=(lonl/60)/10000;
lon=lonh+lonl;
lonn=lon*10000;
delay(1000);
gps.println("GAS:");
gps.write(gval/1000+48);
gps.write((gval/100)%10+48);
gps.write((gval/10)%10+48);
gps.write((gval/1)%10+48);
gps.println(" PPM");
gps.print("http://maps.google.com/maps?q=");
gps.print(la);gps.print('.');gps.print(latt);gps.print(",");//Serial.println(latl);
gps.print(lo);gps.print('.');gps.println(lonn);//16.496390, 80.654752
delay(100);
delay(5000);
delay(1000);
gps.println("GAS:");
gps.write(gval/1000+48);
gps.write((gval/100)%10+48);
gps.write((gval/10)%10+48);
gps.write((gval/1)%10+48);
gps.println(" PPM");
delay(100);
Serial.print("http://maps.google.com/maps?q=");
Serial.print(la);Serial.print('.');Serial.print(latt);Serial.print(",");//Serial.println(latl);
Serial.print(lo);Serial.print('.');Serial.println(lonn);//16.496390, 80.654752
delay(4000);
//-------------------------------------------------------------