GAS LEAKAGE DETECTION USING GSM



This project is microcontroller based project. A Gas sensor is used to Detect dangerous gas leaks in the kitchen or near the gas heater. This unit detects 300 to 5000ppm of Natural Gas. 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. 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. detected is messaged to the authorized person using cellular network called GSM.
In this project there are mainly two units, GSM modem  and microcontroller unit.GSM modem can be configured by standard GSM AT command set for sending and receiving SMS and getting modem status. Depending upon the Gas sensor output microcontroller can send message to the authorized person and also depending upon the message received the microcontroller unit will control the devices and acknowledges the device status to the user as SMS.

1.2. software & hardware requirements

      a)  Software requirements
Ø  Keil software programming using assembly language
Ø  Flash magic
     

b) Hardware requirements
Ø  Gas sensor
Ø  Microcontroller
Ø  LCD display
Ø  GSM
Ø  MAX 232
GAS SENSOR

2.1. GAS sensor:

A NATURAL GAS SENSOR is an electronic device which Detect dangerous gas leaks in the kitchen or near the gas heater. This unit detects 300 to 5000ppm of Natural Gas. 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. 
 A LPG SENSOR 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. The sensor can also sense iso-butane, propane, LNG and cigarette smoke. 
 FEatUREs:
·         High sensitivity to LPG, iso-butane, propane
·         Small sensitivity to alcohol, smoke.
·         Fast response .

·         Stable and long life 

·         Simple drive circuit
2.2 NATURAL/LPG GAS SENSOR:

STRUCTURE AND CONFIGURATION:

    Sensor composed by micro AL2O3 ceramic tube, Tin Dioxide (SnO2) sensitive Layer , measuring electrode and heater are fixed into a crust made by plastic and stainless steel net. The heater provides necessary work conditions for work of sensitive components. The enveloped MQ-5 have 6 pin ,4 of them are used to fetch signals, and other 2 are used for providing heating current.
They are used in gas leakage detecting equipments in family and industry, are suitable for detecting of LPG, natural gas , town gas, avoid the noise of alcohol and cooking fumes and cigarette smoke. The gas sensor gives 12v to 16 v output when triggered and this output voltage is given to the microcontroller using NPN transistor BC547.The gas sensor output is taken across he HS1527 OTP Encoder, HS1527 It can reduce any code collision and unauthorized code scanning possibilities.
Natural gas is an energy source that is commonly used in homes for cooking, heating, and Water  heating. It is primarily composed of methane. (Methane is a highly flammable chemical compound consisting of one carbon atom surrounded by four hydrogen atoms.) Although it only happens rarely, a natural gas leak can sometimes occur inside the home. A natural gas leak can be dangerous because it increases the risk of fire or explosion. Your local gas company works hard to provide adequate warning in the event of a gas leak. Because methane—and therefore, natural gas—does not have any odor, the gas company adds a warni“rottenegg” smell (mercaptan or a similar sulfur-based compound) that can be easily detected by most people. However, people who have a diminished sense of smell may not be able to rely upon this safety mechanism. If you have a concern about your ability to smell the additive that signals a gas leak, you need to see a physician and use a different safety signal. A gas detector can be an important tool to help protect you and your family.

 PRECAUTIONS TO BE TAKEN WHEN GAS LEAKAGE
 DETECTED:
What to do if your gas detector alerts you to a natural gas leak
1.      Leave the house immediately.
2.      DO NOT make calls from your home. Phones are capable of producing a spark, which could start a fire or explosion. Contact your local gas utility company or call 911 from a phone outside and away from your home.
3.      DO NOT light a match or other combustible material. Likewise, DO NOT turn any light switches on or off, and DO NOT plug or unplug electrical appliances such as a television or vacuum cleaner. These activities also can produce a spark that could start a fire or explosion.
4.      Do not re-enter the house until the gas company finds the source of the leak and corrects it.
2.3 SOURCES OF NATURAL GAS SENSORS:

1.      Leaks from gas appliances, heating systems, and water heaters

2.      Leaks from interior natural gas piping systems

3.      Migration of natural gas indoors from leaks in outdoor piping systems

GLOBAL SYSTEM FOR MOBILE COMMUNICATIONS

3.1 INTRODUCTION:
The Global System for Mobile Communications (GSM: originally from Groupe Special Mobile) is the most popular standard for mobile phones in the world. GSM service is used by over 2 billion people across more than 212 countries and territories. The ubiquity of the GSM standard makes international roaming very common between mobile phone operators, enabling subscribers to use their phones in many parts of the world. GSM differs significantly from its predecessors in that both signaling and speech channels are Digital call quality, which means that it is considered a second generation (2G) mobile phone system. This fact has also meant that data communication was built into the system from the 3rd Generation Partnership Project (3GPP).
            From the point of view of the consumers, the key advantage of GSM systems has been higher digital voice quality and low cost alternatives to making calls such as text messaging. The advantage for network operators has been the ability to deploy equipment from different vendors because the open standard allows easy inter-operability. Like other cellular standards GSM allows network operators to offer roaming services which mean subscribers can use their phones all over the world.
As the GSM standard continued to develop, it retained backward compatibility with the original GSM phones; for example, packet data capabilities were added in the Release '97 version of the standard, by means of GPRS. Higher speed data transmission has also been introduced with EDGE in the Release '99 version of the standard.

3.2 Historical background of GSM:

The growth of cellular telephone systems took off in the early 1980s, particularly in Europe. The lack of a technological standardization prompted the European Conference of Postal and Telecommunications Administrations (CEPT) to create the Groupe Special Mobile (GSM) in 1982 with the objective of developing a standard for a mobile telephone system that could be used across Europe. The first GSM network was launched in 1991 by Radiolinja in Finland.
In 1989, GSM responsibility was transferred to the European Telecommunications Standards Institute (ETSI), and phase I of the GSM specifications were published in 1990. By the end of 1993, over a million subscribers were using GSM phone networks being operated by 70 carriers across 48 countries.

 3.4 Network structure
The network behind the GSM system seen by the customer is large and complicated in order to provide all of the services which are required. It is divided into a number of sections and these are each covered in separate articles.
  • The Base Station Subsystem (the base stations and their controllers).
  • The Network and Switching Subsystem (the part of the network most similar to a fixed network). This is sometimes also just called the core network.
  • The GPRS Core Network (the optional part which allows packet based Internet connections).
  • All of the elements in the system combine to produce many GSM services such as voice calls and SMS.

Subscriber identity module:

One of the key features of GSM is the Subscriber Identity Module (SIM), commonly known as a SIM card. The SIM is a detachable smart card containing the user's subscription information and phonebook. This allows the user to retain his or her information after switching handsets. Alternatively, the user can also change operators while retaining the handset simply by changing the SIM. Some operators will block this by allowing the phone to use only a single SIM, or only a SIM issued by them; this practice is known as SIM locking, and is illegal in some countries.
In the United States, Canada, Europe and Australia, many operators lock the mobiles they sell. This is done because the price of the mobile phone is typically subsidized with revenue from subscriptions and operators want to try to avoid subsidizing competitor's mobiles. A subscriber can usually contact the provider to remove the lock for a fee, utilize private services to remove the lock, or make use of ample software and websites available on the Internet to unlock the handset themselves. While most web sites offer the unlocking for a fee, some do it for free. The locking applies to the handset, identified by its International Mobile Equipment Identity (IMEI) number, not to the account (which is identified by the SIM card). It is always possible to switch to another (non-locked) handset if such other handset is available.
 Some providers will unlock the phone for free if the customer has held an account for a certain period. Third party unlocking services exist that are often quicker and lower cost than that of the operator. In most countries removing the lock is legal. Cingular and T-Mobile provide free unlock services to their customers after 3 months of subscription.
In countries like India, Pakistan, Indonesia, Belgium, etc., all phones are sold unlocked. However, in Belgium, it is unlawful for operators there to offer any form of subsidy on the phone's price. This was also the case in Finland until April 1, 2006, when selling subsidized combinations of handsets and accounts became legal though operators have to unlock phone free of charge after a certain period (at most 24 months).

GSM security

GSM was designed with a moderate level of security. The system was designed to authenticate the subscriber using shared-secret cryptography. Communications between the subscriber and the base station can be encrypted. The development of UMTS introduces an optional USIM, that uses a longer authentication key to give greater security, as well as mutually authenticating the network and the user - whereas GSM only authenticated the user to the network (and not vice versa). The security model therefore offers confidentiality and authentication, but limited authorization capabilities, and no non-repudiation.

GSM uses several cryptographic algorithms for security. The A5/1 and A5/2 stream ciphers are used for ensuring over-the-air voice privacy. A5/1 was developed first and is a stronger algorithm used within Europe and the United States; A5/2 is weaker and used in other countries. A large security advantage of GSM over earlier systems is that the Key, the crypto variable stored on the SIM card that is the key to any GSM ciphering algorithm, is never sent over the air interface. Serious weaknesses have been found in both algorithms, and it is possible to break A5/2 in real-time in a cipher text-only attack. The system supports multiple algorithms so operators may replace that cipher with a stronger one.

GSM services

GSM services are a standard collection of applications and features available to mobile phone subscribers all over the world. The GSM standards are defined by the 3GPP collaboration and implemented in hardware and software by equipment manufacturers and mobile phone operators. The common standard makes it possible to use the same phones with different companies' services, or even roam into different countries. GSM is the world's most dominant mobile phone standard.
The design of the service is moderately complex because it must be able to locate a moving phone anywhere in the world, and accommodate the relatively short battery life, limited input/output capabilities, and weak radio transmitters on mobile devices.

Accessing a GSM network:

In order to gain access to GSM services, a user needs three things:
  • A subscription with a mobile phone operator. This is usually either a Pay As You Go arrangement, where all GSM services are paid for in advance, or a Pay Monthly option where a bill is issued each month for line rental, normally paid for a month in advance, and for services used in the previous month.
  • A mobile phone which is GSM compliant and operates at the same frequency as the operator. Most phone companies sell phones from third-party manufacturers.
  • A SIM card which is issued by the operator once the subscription is granted. The card comes pre-programmed with the subscriber's phone "identity" and will be used to store personal information (like contact numbers of friends and family).
After subscribers sign up, information about their phone's identity and what services they are allowed to access are stored in a "SIM record" in the Home Location Register (HLR). The Home Location Register is a database maintained by the "home" phone company for all of its subscribers. It is used to answer queries like, "Where on the mobile phone network is the device associated with this phone number?" and "What services is this subscriber paying for?"
 Once the SIM card is loaded into the phone and it is powered on, it will search for the nearest mobile phone mast, also called a Base Transceiver Station or BTS. If a mast can be successfully contacted, then there is said to be coverage in the area.
 Stationary phones are always connected to the same part of the phone network, but mobile phones can "visit" any part of the network, whether across town or in another country via a foreign provider. Each geographic area has a database called the Visitors Location Register (VLR) which contains details of all the local mobiles. Whenever a phone attaches, or visits, a new area, the Visitors Location Register must contact the Home Location Register.

 The Visitors LR will tell the Home LR where the phone is connected to the network (which VLR), and will ask it for a copy of the SIM record (which includes, for example, what services the phone is allowed to access). The current cellular location of the phone (i.e. which BTS it is at) is entered into the VLR record and will be used during a process called paging when the GSM network wishes to locate the mobile phone.
Every SIM card contains a secret key, called the Ki, which it uses to prove its identity to the phone network (to prevent theft of services), upon first contact. The network does this by consulting the Authentication Center of the "home" phone company, which also has a copy of the secret key. (Though the authentication is accomplished without transmitting the key directly.)
Every phone contains a unique identifier (different from the phone number, which is associated at the HLR with the removable SIM card), called the International Mobile Equipment Identity (IMEI). When a phone contacts the network, its IMEI is supposed to be checked against the global Equipment Identity Register to locate stolen phones and facilitate monitoring.

3.5 AT Commands:

1. +CMGD - Delete SMS Message
Exec Command: +CMGD=<index> Execution command deletes message from preferred message storage <mem1> (<mem1> is the selected message storage from the +CPMS command) location <index>. If deleting fails, final result code +CMS
ERROR: <cms_err> is returned.
An example of an error report is:
+CMS ERROR: <cms_err>
Where <cms_err> can be one of the numbers below:
·         1 unassigned number
·         8 operator barred
·         10 call barred
·         21 SM transfer rejected

2. +CMGF - SMS Message Format
Set Command: +CMGF= [<mode>]
Set command tells the phone, which input and output format of messages to use. <Mode> indicates the format of messages used with send, list, read and write commands and unsolicited result codes resulting from received messages. Mode can be either PDU mode (entire TP data units used) or text mode (headers and body of the messages given as separate parameters). Only PDU mode is supported at this time.
Valid values for <mode> are:
·         0 PDU mode (default)
·         Read Command: +CMGF?
·         Read command returns the current <mode> set. Response is in the form:
+CMGF: <mode>
Test Command: +CMGF=?
Test command returns the list of supported <mode>s. Response is in the form:
+CMGF: (list of supported <mode>s)

3. +CMGR - Read SMS Message
Exec Command: +CMGR=<index>
Execution command returns the SMS message with location value <index> from message storage <mem1> (<mem1> is the selected message storage from the +CPMS command).
If status of the message is ’received unread’, status in the storage changes to ’received read’. If reading fails, final result code
+CMS ERROR: <cms_err> is returned.
Response is in the following format for PDU mode: +CMGR: <stat>, [<alpha>], <length><CR><LF><pdu>
where: <alpha>: string type alphanumeric representation of TP-destination address or TP-originating address corresponding to the entry found in the phonebook (optional field); <length>: in PDU mode, this is the length of the actual TP data unit in octets (i.e. the RP layer SMSC address octets are not counted in the length) <pdu>: GSM 04.11 SC address followed by GSM 03.40 TPDU in hexadecimal format.

4. +CMGS - Send SMS Message
Exec Command: +CMGS=<length><CR><pdu><ctrl-Z/ESC> (PDU mode)
Execution command sends message from a DTE to the network (SMS-SUBMIT). In PDU mode, <length> is the length of the actual TP data unit in octets; <pdu> is the GSM 04.11 SC address followed by GSM 03.40 TPDU in hexadecimal format. PDU entry must be terminated by <ctrl-Z>. Sending can be cancelled by the <ESC> character.
Response is in the following format for PDU mode:
+CMGS: <mr>
Where <mr> is the message reference value of the message.
If sending fails, final result code +CMS ERROR: <cms_err> is returned.

To send a message in text mode:
To send an SMS message in text mode use the AT+CMGS command.
The format of this command is:-
AT+CMGS=”<destination number>” [, <type of destination] <CR>
The GSM engine will then respond with a > prompt, next enter the message to send followed by Control-Z. The Engine will then respond with a reference number or and error.

Example:
At+cmgs="+61418400200"
> test^Z
+CMGS: 188
OK 

Note:
The Conexant engine does not correctly support the <type of destination> field, the <destination number> field must be an international ISDN number as in the example above and the <type of destination> file must be left blank.

To receive messages in text mode:
The most straightforward way to read incoming SMS messages is to use the AT+CMGL command. This command will list any received SMS messages.
Example:
AT+CMGL
+CMGL: 1,"REC UNREAD","+61418400200","02/08/23, 11:35:05-40"
test
+CMGL: 2,"REC UNREAD","+61418400200","02/08/23, 11:39:52-40"
test
OK 
In this case there are 2 messages displayed

Hardware Components

4.1 A BRIEF HISTORY OF THE 8051 FAMILY
In 1981, Intel Corporation introduced an 8-bit microcontroller called the 8051. This microcontroller had 128 bytes of RAM,4K bytes of on- chip ROM, two timers, one serial port, and four ports(each 8-bit wide) all on a single chip. At the time it is also referred to as a “system on chip.” The is an 8-bit processor, meaning that the CPU can work on only 8 bits of data at a time. Data larger than 8 bits has to be broken into 8 bit pieces to be processed by the CPU. The 8051 has a total of four I/O ports, each 8-bit wide.
The 8051 became widely popular after Intel allowed other manufactures to make and market any flavors of the 8051 they please with the condition that they remain code-compatible with the 8051. This led to many versions of the 8051 with different speeds and amounts of on-chip ROM marketed by more than Half a dozen manufacturers. It is important to note that although there are different flavors of the 8051 in terms of speed and amount of on-chip ROM, they are all compatible with the original 8051 as far as the instructions are concerned. This means that if you write your program for one, it will run on any of them regardless of the manufacturer.“The 8051 is the original member of the 8051 family. Intel refers to it as MCS-51.”
The Microcontroller AT89c51 is from Atmel Corporation. It has a wide collection of 8051 chips, as shown below. The AT89C51 is a popular and inexpensive chip used in many small projects. It has 4K bytes of flash ROM. Notice that AT89C51-12PC, where “C” before the 51 stands foe CMOS, which has low power consumption, “12” indicates 12MHz, “P” is for plastic DIP package, and another “C” is for commercial.
          
Part number
Speed
Pins
Packaging
Use
AT89C51 -12PC
12MHz
40
DIP plastic
Commercial
AT89C51-16PC
16MHz
40
DIP plastic
Commercial
AT89C51-20PC
20MHz
40
DIP plastic
Commercial
       TABLE 4.1.1 VARIOUS SPEEDS OF 8051 FROM ATMEL   
                                                                
Part Number
ROM
RAM
I/O pins
Timer
Interrupt
Vcc
Packaging
AT89C51
4K
128
32
2
6
5V
40
AT89LV51
4K
128
32
2
6
3V
40
AT89C1051
1K
64
15
1
3
3V
20
AT89C2051
2K
128
15
2
6
3V
20
AT89C52
8K
128
32
3
8
5V
40
AT89LV52
8K
128
32
3
8
3V
40
TABLE 4.1.2 VERSIONS OF 8051 FROM ATMEL (ALL ROM FLASH)

4.2 Microcontroller (AT89C51):

       DESCRIPTION OF 89C51
The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications.
The AT89C51 provides the following standard features 4K bytes     of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, five vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator and clock circuitry.
             In addition, the AT89C51 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The Power-down Mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset

APPLICATIONS

Ø  They are used in gas leakage detecting equipments in family and industry.
Ø   They are suitable for detecting of LPG, natural gas , town gas.
Ø   Avoid the noise of alcohol and cooking fumes and cigarette smoke.

ADVANTAGES

Ø  GSM providers are almost available almost in every countries
Ø  We can control the home appliances by sending an sms to programmed home  automation kit with coded instructions by the auntheticated programmer imultaneously we will get a feedback and the status of the device. Since we have an option of roaming service provided by gsm service providers hence we can get sms at any place on the earth.
Ø  We can switch on/off the devices by sending a sms from any place in the world.
Ø  It is cheaper when compared to other type of automation system.
Ø  It is more effective when compared to other type of automation system.
Ø  It is easy to change to the systems action according to change in situation.

CONCLUSION

   This project is microcontroller based project. A Gas sensor is used to Detect dangerous gas leaks in the kitchen or near the gas heater. 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.

1 comment:

  1. I'm an engineering second year student. We are thinking to make this project! Would you please tell me what might br the approximate cost of this system? :-?

    ReplyDelete

leave your opinion