Gas Detection Project Final

  • Uploaded by: Sherry Sher
  • 0
  • 0
  • March 2021
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Gas Detection Project Final as PDF for free.

More details

  • Words: 11,703
  • Pages: 54
Loading documents preview...
GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

CHAPTER I INTRODUCTION There are approximately 30crore LPG users in the country in which mostly 40% of the population. The Several standards have been implemented for the gas leakage detection system. The existing systems provides an alarm system which is mainly meant to detect an Gas leakage in the house and commercial premises The objective of the proposed system is to detect theleakage of gas usind ARDUINO and GSM,so it will automatically sends an SMS alert to the user as well as Authorized agent so that they can act accordingly. This system also designed to detect LPG gases such as propane and butane. The allowed level for butane is 600ppm above which it is considered to be of high level and poses a danger. The main aim of this project is to monitor for liquid petroleum gas (LPG) leakage to avoid major fire accidents and also facilitating safety precautions where security has been an important issue. The system detects the leakage of the LPG using gas sensor and alerts the consumer about the gas leakage by sending SMS. The proposed system uses the GSM Modem to alert the person about the gas leakage via SMS. When the system identifies that LPG concentration in the air reaches the specified level then it alert the consumer by sending SMS to registered mobile phone and alert the people at home by activating the alarm which includes Buzzer and switch on the exhaust fan or opening windows to decrease the gas concentration in the air.

1.1 CIRCUIT DIAGRAM

M.B.S. College of Engineering and Technology

1

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

Fig 1.1 circuit diagram

1.2 ABOUT THE CIRCUIT The circuit of simply made by interfacing gas sensor MQ-5, SIM 900 GSM Module and an Arduino Uno Board. GSM module are expensive and there are various types of GSM module available in market like SIM 300, SIM 800, SIM 900 etc but you can use any of them. The components that are required are given below 1.3 COMPONENTS REQUIREMENTS 1.SIM -900 GSM Module 2. MQ-2 gas sensor 3. Arduino Uno Board 4.Buzzer 5.Resistors (100E and 10K) 6. 2N2222 Transistor 7.5 volt Battery 8. Connecting wires.

M.B.S. College of Engineering and Technology

2

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

1.4 CIRCUIT EXPLAINATION • Interfacing MQ2 Sensor to Arduino • Connecting Digital Out of MQ2 to pin 7 • Interfacing GSM Module to Arduino • Connect to PWM pins 9 and 10 of Arduino (using SoftwareSerial) • Tx of GSM Module to 9 and Rx of GSM Module to 10 • Interfacing Speaker to Arduino • 2N2222 is used as driving transistor • Connect to Pin 8 of Arduino • Data Lines (DB4,DB5,DB6,DB7) connected to 5,4,3,2 pins of Arduino (in order) • Enable Pin connected to 11 and RS (Register Select) connected to 12 • Backlit LED is connected to Vcc (+5v) through a 560 ohms current limiting resistor • Contrast – is adjusted by connecting VEE to a 10K Pot and +5V 1.5 WORKING Assemble the circuit as shown in the circuit diagram. The arduino board is programmed with arduino programming which does the every processing. The MQ-2 detectects the gas like butane, methane, coal gas and other form of LPS gas. After it detects the gas, it sends the information to the arduino uno board. The SIM-900 GSM Module is also connected to Arduino board with sim in it. It sends the sms to desired number which is programmed early. On the other hand the buzzer also produces sound and alerts every individual.

M.B.S. College of Engineering and Technology

3

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

CHAPTER 2 LITERATURE OVERVIEW 1. IN THE YEAR 2011, A. MAHALINGAM et. al., “DESIGN AND IMPLEMENTATION

OF

AN

ECONOMIC

GAS

LEAKAGE

DETECTOR”. This project developed system to detect the gas leakage and providing immediate alarm or intimation to the user. Later in 2013, few people developed the design proposed for home safety. This system detects the leakage of the LPG and alerts the consumer about the leak by buzzer. This project was developed using microcontroller ARM version 7 processor and simulated using Keil software.In the year 2014, Hitendra Rawat, Ashish Kushwah, Khyati Asthana, Akanksha Shivhare, designed a system, They provided security issues against thieves, leakage and fire accidents. In those cases their system sends SMS to the emergency number provided to it. In the proposed system we have designed “LPG gas monitoring with alert system”. These report focus on detection of economic fuels like petroleum, liquid petroleum gas, alcohol..etc., and alert the surrounding people about the leakage through SMS. It also sense surrounding temperature, so that no fire accidents occurs. These projects alert the user by sending message to mobile through SMS in two conditions. They are 

When the LPG gas exceed its peak value.



When the temperature exceed more than room temperature.

These project gives alert message by buzzing the buzzer and trough SMS to the house holders. We also provide automatic doors and windows opening, so that the compressed gas can spread in to air freely. Hence a fire accident does not occurs.[1] 2. CH. MANOHAR RAJU 2008; et. al., “ INTRODUCE AN ANDROID BASED

AUTOMATIC

GAS

DETECTION

AND

INDICATION

ROBOT.” They proposed prototype depicts a mini mobile robot which is capable to detect gas leakage in hazardous places. Whenever there is an occurrence of gas leakage in a particular place the robot immediately read and sends the data to android mobile M.B.S. College of Engineering and Technology

4

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

through wireless communication like Bluetooth. We develop an android application for android based smart phones which can receive data from robot directly through Bluetooth. The application warns with an indication whenever there is an occurrence of gas leakage and we can also control the robot movements via Bluetooth by using text commands as well as voice commands. The previous mobile robots are based on heterogeneous technologies like GSM, GPS, internet based etc., but the main disadvantage of those prototypes were the absence of communication in particular areas. So, with the rapid developments and tremendous changes in technology we have lots of techniques to eradicate previous problems. Wireless communication protocols play a vital role in present trends. Bluetooth, WI-Fi, Zigbee etc., we use one of the best feature of smart phone, i.e., the Bluetooth technology to control and monitor parameters driven by a robot. [2] 3. PAL-STEFAN MURVAYA, 2008; et. al., “ SURVEY ON GAS LEAK DETECTION AND LOCALIZATION TECHNIQUES VARIOUS WAYS TO DETECT THE GAS LEAKAGE.” They introduce some old or new technique to detect the gas. The proposed techniques in this paper are nontechnical methods, hardware based methods which include acoustic methods, optical methods and active methods. In their survey they told a wide variety of leak detecting techniques is available for gas pipelines. Some techniques have been improved since their first proposal and some new ones were designed as a result of advances in sensor manufacturing and computing power. However, each detection method comes with its advantages and disadvantages. Leak detection techniques in each category share some advantages and disadvantages. For example, all external techniques which involve detection done from outside the pipeline by visual observation or portable detectors are able to detect very small leaks and the leak location, but the detection time is very long. Methods based on the mathematical model of the pipe have good results at high flow rates while at low flow rates a mass balance based detection system would be more suitable. This disadvantage is prone to disappear for some of these techniques due to forthcoming technological advancements.[3]

M.B.S. College of Engineering and Technology

5

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

4.

ZHAO YANG, 2011; et. al., “RESEARCH ON LEAKAGE DETECTION AND ANALYSIS OF LEAKAGE POINT IN THE GAS PIPELINE SYSTEM.”

In this paper they gave various model which used SCADA I/F Model: The SCADA system has the function of transferring the acquired data from a pipeline system to Transient Simulation Model every 30 seconds. This module communicates with SCADA. Dynamic parameters are collected every 30 seconds, such as pressure, flow and temperature. Transient Simulation Model: Transient flow is simulated utilizing perfect numerical methods based on actual data. Pressure and temperature served as independent variables are provided in order to get average pressure and average temperature. Then all the parameters of the gas in the pipeline system can be acquired. Leakage Detection: The leakage detection is carried out by comparing the data acquired through the SCADA system with that by the Transient Simulation Model. This model could provide leakage point judgment and prompt warning based on transient simulation and volume balance.[4] 5. S SHYAMALADEVI, 2014; et. al., “RESEARCH PROJECT ARM7 BASED AUTOMATED HIGH PERFORMANCE SYSTEM FOR LPG REFILL

BOOKING

AND

LEAKAGE

DETECTION

AND

METHODOLOGY TO MAKE THEIR PROJECT.” The paper is designed based on modular approach which is easy to analyze as LPG cylinder booking unit, gas leakage monitoring unit at the consumer end and server system unit at the distributor side. MQ6 placed in the vicinity of the gas cylinder. In the advent of leakage, the resistance of the sensor decreases increasing its conductivity. Corresponding pulse is fed to microcontroller and simultaneously switches on the buzzer and exhaust fan. Microcontroller sends a message “EMERGENCY ALERT: LPG gas leakage found in your home” to required cell numbers via GSM module and the same will be displayed on LCD. In automatic Gas booking system, LCD continuously monitors the weight of the gas in cylinder and displays it on seven segment display. When the weight of the gas is less than or equal to 2 Kg, a logic high pulse is fed to a port pin of microcontroller. As this pin goes high, microcontroller will send a booking message to distributor of format, "AA01-RAJA-05-B". At the same time, the message will be displayed on LCD as

M.B.S. College of Engineering and Technology

6

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

“Cylinder Booking”. Hardware and Software Requirements are Load cell, Instrumentation amplifier, 2*16 LCD, LPG sensor, GSM modem, PC, Keil uvision4, Visual studio2008, Pro-load software.[5] 6. FALOHUN A.S., 2016; et. al., “PROPOSED THEIR DANGEROUS GAS DETECTION USING AN INTEGRATED CIRCUIT AND MQ-9” In this basically, they used an embedded design which includes typical input and output devices include switches, relays, solenoids, LEDs, small or custom LCD displays, radio frequency devices, and sensors for data such as temperature, humidity, light level etc. Embedded systems usually have no keyboard, screen, disks, printers, or other recognizable I/O devices of a personal computer, and may lack human interaction device. The amount and type of detectors and the type of fire alarm system that one chooses for property protection will depend on the owner’s property protection goals, the value of the property and the requirements of the owner’s insurance company. The principle of operation which is proposed in this paper is the gas detector alarm system is designed with the intention to ensure that the event of gas is intelligently detected, promptly notified and interactively managed. It is built around a timer to accept input from the gas sensor, MQ-9, and activate a buzzer and set of led that alerts in the event of gas. The sensor used is the MQ9 and from the datasheet, it specializes in gas detection equipment for carbon monoxide and CH4, LPG family and any other relevant industry or car assemblage. [6]

M.B.S. College of Engineering and Technology

7

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

CHAPTER 3 DESIGN AND IMPLEMENTATION This proposed method consists of gas leakage detection system, weight measurement module, microcontroller, GSM module and alert system.

Fig 3.1: Block Diagram of Proposed System

The main basic Arduino Mega2560 micro controller requires the power supply ranging from 7-12 volts which can be build by using different components like step down transformer, rectifier, filter and regulator which are readily available as adapters these days. Supply can be either from an ac to dc adapter or battery. The board can operate on at 7-12 volts. If voltage<7V then board becomes unstable. If voltage>12V then board get demaged. The Main platform we are using to build the project is Arduino UNO which provides us the flexibility to write the code effectively in convenient way and also it will provides us features like Inexpensive, Cross platform, Simpler and clear programming environment, Open source and extensible software, Easy for beginners, The Arduino UNO is a microcontroller board based on the ATMEGA UNO (datasheet).It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC to-DC adapter or battery to get started. With the above features it force us to use in our project design.

M.B.S. College of Engineering and Technology

8

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

3.1 Methane gas sensor MQ-4 is a Sensor for Natural Gases Sensitive material. FC22 gas sensor is SnO2, which has lower conductivity in clear air. When the target combined gas exist, the sensor‟s conductivity is heavier with the gas concentration rising. we used simple circuit to convert respective output signal according to concentration level. FC22 gas sensor has high sensitive to Methane, Propane and Butane. The sensor can be used to detect different combustible gas, especially Methane; it is with cost effective and useful for so many applications.

Fig3.2: Gas sensor FC22

3.2 Specification 

Model: FC‐22‐1



Quantity: 1



Color: Blue



Material: PCB board



Range: 10~1000ppm



High quality double panel design, with power and TTL signal output indicator



With DO switch signal (TTL) output and AO analog signal output



TTL output effective signal for low level (when output lower than usually the sign al light, can be directly meet SCM or relay module)



Analog output voltage: 0~5V, the higher concentration, the higher voltage



High sensitivity for the harmful gases detection



There are four screw holes for positioning



Product size: 32mm (L) x 20mm (W) x 22mm (H)



Long service life and reliable stability, fast response and recovery characteristics



Working voltage: 5V



Suitable for home / industry carbon monoxide, coal gas, natural gas, smoke and ot

M.B.S. College of Engineering and Technology

9

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

her harmful 

monitoring gases detection



Before use, please heat the board for about 20 seconds



Packing list:



1 x Sensor module



Dimensions: 1.38 in x 0.79 in x 0.91 in (3.5 cm x 2.0 cm x 2.3 cm)



Weight: 0.25 oz (7 g)

3.3 Piezoelectric Buzzer Buzzer is an audio signaling device. The typical uses of buzzers are for alarms, timers and confirmation of user input such as a mouse click or keystroke. The project used an electronic type of buzzer which is a piezoelectric element that driven by an micro-controller signals. Peizo buzzer is based on the inverse principle of peizo electricity discover in 1880 by Jacques and Pierre Curie. It is the phenomenon of generating electricity when mechanical pressure is applied to the certain materials and the vice versa . such materials called Piezoelectric materials. When an alternating electric field subjected to the material they stretch or compress accordance with the frequency of the signal thereby producing sound. 

Two wires, red & black.Polarity matters: black=ground



Apply an oscillating voltage to make a noise

Fig3.3:Buzzer



The buzzer case supports the piezo element and has resonant cavity for sound

3.4 Modern Applications While technological advancements have caused buzzers to be impractical and undesirable there are still instances in which buzzers and similar circuits may be used. Present day applications include: 

Novelty uses

M.B.S. College of Engineering and Technology

10

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM



Judging panels



Educational purposes



Annunciator panels



Electronic metronomes



Game show lock-out device



Microwave ovens and other household appliances



Sporting events such as basketball games



Electrical alarms



Joy buzzer (mechanical buzzer used for pranks)

3.5 Arduino UNO The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz crystal oscillator,aUSB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it features the 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; for a comparison with previous versions, see the index of Arduino boards.

Fig3.4: Arduino Uno

M.B.S. College of Engineering and Technology

11

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

3.5.1 Technical Specification Microcontroller

ATmega328

Operating Voltage

5V

Input Voltage (recommended)

7-12V

Input Voltage (limits)

6-20V

Digital I/O Pins

14 (of which 6 provide PWM output)

Analog Input Pins

6

DC Current per I/O Pin

40 mA

DC Current for 3.3V Pin

50 mA

Flash Memory 32 KB of which 0.5 KB used by

bootloader

SRAM

2 KB

EEPROM

1 KB

Clock Speed

16 MHz

3.5.2 Power The Arduino Uno can be powered via the USB connection or with an external power supply. The power source is selected automatically.External (non-USB) power can comeeither from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER connector.The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may be unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.The power pins are as follows: 

VIN. The input voltage to the Arduino board when it's using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.



5V. The regulated power supply used to power the microcontroller and other components on the board. This can come either from VIN via an on-board

M.B.S. College of Engineering and Technology

12

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

regulator, or be supplied by USB or another regulated 5V supply. 

3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.



GND. Ground pins.

3.5.3 Memory The Atmega328 has 32 KB of flash memory for storing code (of which 0,5 KB is used for the bootloader); It has also 2 KB of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library). 3.5.4 Input and 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-50 kOhms. In addition, some pins have specialized functions: 

Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. TThese pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip .



External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.



PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.



SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication, which, although provided by the underlying hardware, is not currently included in the Arduino language.



LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it's off.

The Uno has 6 analog inputs, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and the analogReference() function. Additionally, some pins have specialized functionality:

M.B.S. College of Engineering and Technology

13

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM



I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the Wire library. There are a couple of other pins on the board:



AREF. Reference voltage for the analog inputs. Used with analogReference().



Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board.

3.5.5 Programming The Arduino Uno can be programmed with the Arduino software (download). Select "Arduino Uno w/ ATmega328" from the Tools > Board menu (according to the microcontroller on your board). For details, see the reference and tutorials. The ATmega328 on the Arduino Uno comes preburned with a bootloader that allows you to upload new code to it without the use of an external hardware programmer. It communicates using the original STK500 protocol (reference, C header files). You can also bypass the bootloader and program the microcontroller through the ICSP (In-Circuit Serial Programming) header; see these instructions for details. The ATmega8U2 firmware source code is available . The ATmega8U2 is loaded with a DFU bootloader, which can be activated by connecting the solder jumper on the back of the board (near the map of Italy) and then resetting the 8U2. You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X and Linux) to load a new firmware. Or you can use the ISP header with an external programmer (overwriting the DFU bootloader). 3.5.6 Automatioc (Software) Reset Rather than requiring a physical press of the reset button before an upload, the Arduino Uno is designed in a way that allows it to be reset by software running on a connected computer. One of the hardware flow control lines (DTR) of the ATmega8U2 is connected to the reset line of the ATmega328 via a 100 nanofarad capacitor. When this line is asserted (taken low), the reset line drops long enough to reset the chip. The Arduino software uses this capability to allow you to upload code by simply pressing the upload button in the Arduino environment. This means that the bootloader can have a shorter timeout, as the lowering of DTR can be well-coordinated with the start of the upload. This setup has other implications. When the Uno is connected to either a computer running Mac OS X or USB). For the following half-second or so, the bootloader is running on the Uno. While it is programmed to ignore malformed data M.B.S. College of Engineering and Technology

14

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

(i.e. anything besides an upload of new code), it will intercept the first few bytes of data sent to the board after a connection is opened. If a sketch running on the board receives one-time configuration or other data when it first starts, make sure that the software with which it communicates waits a second after opening the connection and before sending this data. The Uno contains a trace that can be cut to disable the auto-reset. The pads on either side of the trace can be soldered together to re-enable it. It's labeled "RESET-EN". You may also be able to disable the auto-reset by connecting a 110 ohm resistor from 5V to the reset line; see this forum thread for details. 3.5.7 USB Overcurrent Protection 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. 3.5.8 Physical Characteristics The maximum length and width of the Uno PCB are 2.7 and 2.1 inches respectively, with the USB connector and power jack extending beyond the former dimension. Three screw holes allow the board to be attached to a surface or case. Note that the distance between digital pins 7 and 8 is 160 mil (0.16"), not an even multiple of the 100 mil spacing of the other pins. 3.5.9 How to USE Arduino Arduino can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights, motors, and other actuators. The microcontroller on the board is programmed using the Arduino programming language (based on Wiring) and the Arduino development environment (based on Processing). Arduino projects can be stand-alone or they can communicate with software on running on a computer (e.g. Flash, Processing, MaxMSP).Arduino is a cross-platoform program. You’ll have to follow different instructions for your personal OS. Check on the Arduino site for the latest instructionNow you’re actually ready to “burn” your first program on the arduino board. To select “blink led”, the physical translation of the well known programming “hello world”, select File>Sketchbook>Arduino-0017>Examples>Digital>Blink M.B.S. College of Engineering and Technology

15

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

Once you have your skecth you’ll see something very close to the screenshot on the right. In Tools>Board select Now you have to go toTools>SerialPort and select the right serial port, the one arduino is attached to.

Fig 3.5:Use of Arduino

3.5.10 Terms and Conditions Warranties The producer warrants that its products will conform to the Specifications. This warranty lasts for one (1) years from the date of the sale. Theproducer shall not be liable for any defects that are caused by neglect, misuse or mistreatment by the Customer, including improper installation or testing, or for any products that have been altered or modified in any way by a Customer. Moreover, The producer shall not be liable for any defects that result from Customer's design, specifications or instructions for such products. Testing and other quality control techniques are used to the extent the producer deems necessary. If any products fail to conform to the warranty set forth above, the producer's sole liability shall be to replace such products. The producer's liability shall be limited to products that are determined by the producer not to conform to such warranty. If the producer elects to replace such products, the producer shall have a reasonable time to replacements. Replaced products shall be warranted for a new full warranty period.

M.B.S. College of Engineering and Technology

16

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

Customer agrees that prior to using any systems that include the producer products, Customer will test such systems and the functionality of the products as used in such systems. The producer may provide technical, applications or design advice, quality characterization, reliability data or other services. Customer acknowledges and agrees that providing these services shall not expand or otherwise alter the producer's warranties, as set forth above, and no additional obligations or liabilities shall arise from the producer providing such services. The Arduino Products are not authorized for use in safety-critical applications where a failure of the product would reasonably be expected to cause severe personal injury or death. Safety-Critical Applications include, without limitation, life support devices and systems, equipment or systems for the operation of nuclear facilities and weapons systems. Arduino

products are neither designed nor intended for use in military or

aerospace applications or environments and for automotive applications or environment. Customer acknowledges and agrees that any such use of Arduino products which is solely at the Customer's risk, and that Customer is solely responsible for compliance with all legal and regulatory requirements in connection with such use.1.6 Customer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirements concerning its products and any use of Arduino

products in Customer's applications, notwithstanding any

applications-related information or support that may be provided by the producer. Indemnification The Customer acknowledges and agrees to defend, indemnify and hold harmless the producer from and against any and all third-party losses, damages, liabilities and expenses it incurs to the extent directly caused by: (i) an actual breach by a Customer of the representation and warranties made under this terms and conditions or (ii) the gross negligence or willful misconduct by the Customer. Consequential Damages WaiverIn no event the producer shall be liable to the Customer or any third parties for any special, collateral, indirect, punitive, incidental, consequential or exemplary damages in connection with or arising out of the products provided hereunder, regardless of whether the producer has been advised of the possibility of such damages. This section will survive the termination of the warranty period.

M.B.S. College of Engineering and Technology

17

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

Changes to specifications The producer may make changes to specifications and product descriptions at any time, without notice. The Customer must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined." The producer reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The product information on the Web Site or Materials is subject to change without notice. Do not finalize a design with this information. 3.5.11 PIN Description

Fig 3.6: Pin Description

Power USB Arduino board can be powered by using the USB cable from your computer. All you need to do is connect the USB cable to the USB connection. Power (Barrel Jack) Arduino boards can be powered directly from the AC mains power supply by connecting it to the Barrel Jack. Voltage Regulator

M.B.S. College of Engineering and Technology

18

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

The function of the voltage regulator is to control the voltage given to the Arduino board and stabilize the DC voltages used by the processor and other elements. Crystal Oscillator The crystal oscillator helps Arduino in dealing with time issues. How does Arduino calculate time? The answer is, by using the crystal oscillator. The number printed on top of the Arduino crystal is 16.000H9H. It tells us that the frequency is 16,000,000 Hertz or 16 MHz. Arduino Reset You can reset your Arduino board, i.e., start your program from the beginning. You can reset the UNO board in two ways. First, by using the reset button (17) on the board. Second, you can connect an external reset button to the Arduino pin labelled RESET. Pins (3.3, 5, GND, Vin) 

3.3V (6) − Supply 3.3 output volt



5V (7) − Supply 5 output volt



Most of the components used with Arduino board works fine with 3.3 volt and 5 volt.



GND (8)(Ground) − There are several GND pins on the Arduino, any of which can be used to ground your circuit.



Vin (9) − This pin also can be used to power the Arduino board from an external power source, like AC mains power supply.

Analog pins 

The Arduino UNO board has five analog input pins A0 through A5. These pins can read the signal from an analog sensor like the humidity sensor or temperature sensor and convert it into a digital value that can be read by the microprocessor.

Main microcontroller Each Arduino board has its own microcontroller (11). You can assume it as the brain of your board. The main IC (integrated circuit) on the Arduino is slightly different from board to board. The microcontrollers are usually of the ATMEL Company. You must know what IC your board has before loading up a new program from the Arduino IDE. This information is available on the top of the IC. For more details about the IC construction and functions, you can refer to the data sheet. M.B.S. College of Engineering and Technology

19

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

ICSP pin Mostly, ICSP (12) is an AVR, a tiny programming header for the Arduino consisting of MOSI, MISO, SCK, RESET, VCC, and GND. It is often referred to as an SPI (Serial Peripheral Interface), which could be considered as an "expansion" of the output. Actually, you are slaving the output device to the master of the SPI bus. Power LED indicator This LED should light up when you plug your Arduino into a power source to indicate that your board is powered up correctly. If this light does not turn on, then there is something wrong with the connection. TX and RX LEDs On your board, you will find two labels: TX (transmit) and RX (receive). They appear in two places on the Arduino UNO board. First, at the digital pins 0 and 1, to indicate the pins responsible for serial communication. Second, the TX and RX led (13). The TX led flashes with different speed while sending the serial data. The speed of flashing depends on the baud rate used by the board. RX flashes during the receiving process. Digital I/O The Arduino UNO board has 14 digital I/O pins (15) (of which 6 provide PWM (Pulse Width Modulation) output. These pins can be configured to work as input digital pins to read logic values (0 or 1) or as digital output pins to drive different modules like LEDs, relays, etc. The pins labeled “~” can be used to generate PWM. AREF AREF stands for Analog Reference. It is sometimes, used to set an external reference voltage (between 0 and 5 Volts) as the upper limit for the analog input pins. 3.5.12 Adruino Variables And Constants What is Variable Scope? Variables in C programming language, which Arduino uses, have a property called scope. A scope is a region of the program and there are three places where variables can be declared. They are − 

Inside a function or a block, which is called local variables.



In the definition of function parameters, which is called formal parameters.

M.B.S. College of Engineering and Technology

20

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM



Outside of all functions, which is called global variables.

Local Variables Variables that are declared inside a function or block are local variables. They can be used only by the statements that are inside that function or block of code. Local variables are not known to function outside their own. Following is the example using local variables −

.Global Variables Global variables are defined outside of all the functions, usually at the top of the program. The global variables will hold their value throughout the life-time of your program. A global variable can be accessed by any function. That is, a global variable is available for use throughout your entire program after its declaration. The following example uses global and local variables −

3.5.15 Arduino Loops while Loop M.B.S. College of Engineering and Technology

21

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

while loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the while loop will never exit. While Loop Syntax

do…while loop The do…while loop is similar to the while loop. In the while loop, the loop-continuation condition is tested at the beginning of the loop before performed the body of the loop. dO-while loop syntax:

M.B.S. College of Engineering and Technology

22

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

For loop A for loop executes statements a predetermined number of times. The control expression for the loop is initialized, tested and manipulated entirely within the for loop parentheses. Each for loop has up to three expressions, which determine its operation. The following example shows general for loop syntax. Notice that the three expressions in the for loop argument parentheses are separated with semicolons. For loop syntax

FOR LOOP EXECUTION SEQUENCE:

Fig 3.7 For Loop Execution Sequence

M.B.S. College of Engineering and Technology

23

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

Nested Loop C language allows you to use one loop inside another loop. The following example illustrates the concept. Nested loop syntax:

.Infinte loop: It is the loop having no terminating condition, so the loop becomes infinite.

M.B.S. College of Engineering and Technology

24

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

3.5.14 Arduino Functions Functions allow structuring the programs in segments of code to perform individual tasks. The typical case for creating a function is when one needs to perform the same action multiple times in a program. Standardizing code fragments into functions has several advantages − 

Functions help the programmer stay organized. Often this helps to conceptualize the program.



Functions codify one action in one place so that the function only has to be thought about and debugged once.



This also reduces chances for errors in modification, if the code needs to be changed.



Functions make the whole sketch smaller and more compact because sections of code are reused many times.



They make it easier to reuse code in other programs by making it modular, and using functions often makes the code more readable.

There are two required functions in an Arduino sketch or a program i.e. setup () and loop(). Other functions must be created outside the brackets of these two functions. The most common syntax to define a function is:

M.B.S. College of Engineering and Technology

25

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

3.5.15 Function Declaration A function is declared outside any other functions, above or below the loop function.We can declare the function in two different ways − The first way is just writing the part of the function called a function prototypeabove the loop function, which consists of − 

Function return type



Function name



Function argument type, no need to write the argument name

Function prototype must be followed by a semicolon ( ; ). The following example shows the demonstration of the function declaration using the first method. Example:

The second part, which is called the function definition or declaration, must be declared below the loop function, which consists of − 

Function return type



Function name



Function argument type, here you must add the argument name



The function body (statements inside the function executing when the function is called)

M.B.S. College of Engineering and Technology

26

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

The following example demonstrates the declaration of function using the second method. Example:

The second method just declares the function above the loop function. Arduino Function Libraries: Strings are used to store text. They can be used to display text on an LCD or in the Arduino IDE Serial Monitor window. Strings are also useful for storing the user input. For example, the characters that a user types on a keypad connected to the Arduino. There are two types of strings in Arduino programming − 

Arrays of characters, which are the same as the strings used in C programming.



The Arduino String, which lets us use a string object in a sketch.

In this chapter, we will learn Strings, objects and the use of strings in Arduino sketches. By the end of the chapter, you will learn which type of string to use in a sketch.

3.5.16 Programming used in project. #include <SoftwareSerial.h> SoftwareSerial mySerial(9, 10); int analogSensor=10; int sensor=A5; int flag =1; int buzzer=A4; M.B.S. College of Engineering and Technology

27

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

void setup() { mySerial.begin(115200);

// Setting the baud rate of GSM Module

pinMode(sensor, INPUT); Serial.begin(9600);

// Setting the baud rate of Serial Monitor (Arduino)

delay(100); } void loop() { int analogSensor = analogRead(sensor); if (analogSensor > 400 && flag!=2) {

SendMessage(); tone(buzzer, 1000, 200); delay(1000); noTone(buzzer); flag=2; } if (mySerial.available()>0) Serial.write(mySerial.read()); } void SendMessage() { Serial.println("ss");

M.B.S. College of Engineering and Technology

28

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

mySerial.println("AT+CMGF=1");

//Sets the GSM Module in Text Mode

delay(1000); // Delay of 1000 milli seconds or 1 second mySerial.println("AT+CMGS=\"+919858588414\"\r"); // Replace x with mobile numberdelay(1000); mySerial.println("Gas Leakage Detected");// The SMS text you want to send delay(100); mySerial.println((char)26);// ASCII code of CTRL+Z delay(1000); /*mySerial.println("ATDT + +919906676166;"); delay(100); mySerial.println(); delay(10000); mySerial.println("ATH");*/

CHAPTER 4 GSM MODULEGSM (SIM300/900) GSM/GPRS RS232 Modem is built with SIMCOM Make SIM900 Quad-band GSM/GPRS engine, works on frequencies 850 MHz, 900 MHz, 1800 MHz and 1900 MHz It is very compact in size and easy to use as plug in GSM Modem. The Modem is designed with RS232 Level converter circuitry, which allows you to directly interface PC Serial port .The baud rate can be configurable from 9600-115200 through AT command. Initially Modem is in Auto baud mode. This GSM/GPRS RS232 Modem is having internal TCP/IP stack to enable you to connect with internet via GPRS. It is suitable for SMS as well as DATA transfer application in M2M interface. The modem needed only 3 wires (Tx, Rx, GND) except Power supply to interface with microcontroller/Host PC. The built in Low Dropout Linear voltage regulator allows you to connect wide range of unregulated power supply (4.2V -13V). Yes, 5 V is in M.B.S. College of Engineering and Technology

29

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

between!! .Using this modem, you will be able to send & Read SMS, connect to internet via GPRS through simple AT commands. Features: 

High Quality Product (Not hobby grade)



Quad-Band GSM/GPRS



850/ 900/ 1800/ 1900 MHz



Built in RS232 Level Converter (MAX3232)



Configurable baud rate



SMA connector with GSM L Type Antenna.



Built in SIM Card holder.



Built in Network Status LED



Inbuilt Powerful TCP/IP protocol stack for internet data transfer over GPRS.



Audio interface Connector



Most Status & Controlling Pins are available at Connector



Normal operation temperature: -20 °C to +55 °C



Input Voltage: 5V-12V DC

4.1 Specifications 

Quad-Band 850/ 900/ 1800/ 1900 MHz



GPRS multi-slot class 10/8



GPRS mobile station class B



Compliant to GSM phase 2/2+

Class 4 (2 W @850/ 900 MHz) Class 1 (1 W @ 1800/1900MHz) 

Dimensions: 24*24*3mm



Weight: 3.4g



Control via AT commands (GSM 07.07,07.05 and SIMCOM enhanced AT Commands)



Low power consumption: 1.0mA(sleep mode)



Operation temperature: -40°C to +85 °C

M.B.S. College of Engineering and Technology

30

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

Specifications for Fax 

Group 3, class 1

4.2 Specifications for Data 

GPRS class 10: max. 85.6 kbps (downlink)



PBCCH support



Coding schemes CS 1, 2, 3, 4



CSD up to 14.4 kbps



USSD



Non transparent mode



PPP-stack

4.3 Specifications for Sms Via Gsm/Gprs 

Point to point MO and MT



SMS cell broadcast



Text and PDU mode

Software features 

0710 MUX protocol



embedded TCP/UDP protocol



FTP/HTTP

4.4 Special Firmware 

MMS



Java (cooperate with isolation)



Embedded AT

4.5 Specifications for Voice 

Tricodec

Half rate (HR) Full rate (FR) Enhanced Full rate (EFR) 

Hands-free operation

M.B.S. College of Engineering and Technology

31

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM



(Echo suppression)



AMR



Half rate (HR)



Full rate (FR)

4.6 Interfaces 

Analog audio interface pins at 2mm Pitch RMC



RS232 Serial interface



SMA Antenna Connector



DC Power pins at 2mm Pitch RMC

4.8 Operating Conditions: PARAMETER

IN/OUT

MINIMUM

MAXIMUM

UNIT

SUPPLY

INPUT

4.2

13

V

--------------

40

590

mA

VOLTAGE IN CURRENT CONSUMPTION

Fig 4.1 GSM Module

OPERATING MODES: The table below briefly summarizes the various operating modes referred to in the following chapters.

M.B.S. College of Engineering and Technology

32

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

Table 4.1 operating modes

4.7 Turn Off GSM Modem Using At Command You can use the AT command “AT+CPOWD=1” to turn off the modem. This command lets the GSM Modem log off from the network and allows the GSM Modem to enter into a secure state and save data before completely disconnecting the power supply. Before the completion of the switching off procedure the GSM Modem will send out result code: “NORMAL POWER DOWN”. After this moment, the AT commands can’t be executed. The GSM Modem enters the POWER DOWN mode, only the RTC is still active. POWER DOWN can also be indicated by STATUS pin, which is a low level voltage in this mode. 4.8 Power Saving M.B.S. College of Engineering and Technology

33

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

There are two methods for the GSM Modem to enter into low current consumption status. “AT+CFUN” is used to set GSM Modem into minimum functionality mode and DTR hardware interface signal can be used to lead system to be in SLEEP mode (or slow clocking mode). 4.9 Minimum Functionality Mode Minimum functionality mode reduces the functionality of the GSM Modem to a minimum and, thus, minimizes the current consumption to the lowest level. This mode is set with the AT+CFUN” command which provides the choice of the functionality levels =014 

0: minimum functionality;



1: full functionality (default);



4: disable phone both transmit and receive RF circuits;

If GSM MODEM has been set to minimum functionality by “AT+CFUN=0”, the RF function and SIM card function will be closed. In this case, the serial port is still accessible, but all AT commands correlative with RF function or SIM card function will not be accessible. If GSM MODEM has been set by “AT+CFUN=4”, the RF function will be closed, the serial port is still active. In this case all AT commands correlative with RF function will not be accessible. After GSM MODEM has been set by “AT+CFUN=0” or “AT+CFUN=4”, it can return to full functionality by “AT+CFUN=1”. For detailed information about “AT+CFUN”, please refer to document 4.10 Sleep Mode (Slow Clock Mode) We can control SIM900 GSM Modem to enter or exit the SLEEP mode in customer applications through DTR signal. When DTR is in high level and there is no on air and hardware interrupt(such as GPIO interrupt or data on serial port), GSM MODEM will enter SLEEP mode automatically. In this mode, GSM MODEM can still receive paging or SMS from network but the serial port is not accessible. Note: For GSM MODEM, it requests to set AT command “AT+CSCLK=1” to enable the sleep mode; the default value is 0, that can’t make the GSM Modem enter sleep

M.B.S. College of Engineering and Technology

34

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

mode. When GSM MODEM is in SLEEP mode, the following methods can wake up the GSM Modem. 

Enable DTR pin to wake up GSM MODEM. If DTR pin is pulled down to a low level this signal will wake up GSM MODEM from power saving mode. The serial port will be active after DTR changed to low level for about 50ms.



Receiving a voice or data call from network to wake up GSM MODEM.



Receiving a SMS from network to wake up GSM MODEM.

4.11 Summary of State Transitions (Except Sleep Mode) The following figure shows how to proceed from one mode to another

Serial Interfaces Table 4.2 pins and there functions

Serial DB9

Port

Name

Pin

Function

GND

5

Ground

CTS

8

Clear to send

RTS

7

Request to send

TXD

2

Transmit data

RXD

3

Receive data

M.B.S. College of Engineering and Technology

35

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

AT Command Syntax When DCE powers on with the autobauding enabled, user must first send “A” to synchronize the baud rate. It is recommended to wait 2 to 3 seconds before sending “AT” character. After receiving the “OK” response, DTE and DCE are correctly synchronized The “AT” or “at” prefix must be set at the beginning of each Command. To terminate a Command line enter , otherwise known as carriage return

or

\r.

Commands

are

followed

by

a

response

that

includes

. Only the responses are presented in the document here, are omitted intentionally. Example: With Local Echo enabled: Transmit: AT\r Receive: AT\r\r\nOK\r\n

Settings for easy microcontroller communication When communicating with the GSM Modem using a microcontroller, you usually want very short responses, no local echo, and no startup messages. Sticking on the&W to the end of the command saves the setting into memory. ATV0&W\r Enable short response ATE0&W\r Disable Local Echo AT+CIURC=0;&W\r Disable “CALL READY” Startup Message Now instead of commands returning OK or ERROR in plain text, as well as repeating all written commands, the GSM Modem will not echo what you transmit and the GSM Modem will return error codes in single bytes. For example, instead of: Transmit: AT\r Receive: \r\nOK\r\n You’ll have: Transmit: AT\r Receive: \r\n0\r\n SAMPLE AT COMMANDS CODE 1. Phone communication Goal: Call a phone M.B.S. College of Engineering and Technology

36

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

Dial 123-456-7890 = ATD1234567890;\r This command returns OK or ERROR. Returns NO CARRIER when phone hangs up 2. Send a text message Goal: Send a text AT+CMGF=1\r Returns OK or ERROR AT+CSCS=”GSM”\r Returns OK or ERROR AT+CSCA=”+13123149810” \r Returns OK or ERROR. This number +13123149810 is the short message center for AT&T/Cingular service. T-Mobile’s is +12063130004 AT+CSMP=17, 167, 0,240\r Returns OK or ERROR. These numbers refer to settings for text message sending, keep them this way. AT+CMGS=” AT+CMGS=”1234567890”\r Returns > , prompting what message to send. 1234567890 is the phone number that the text message will be sent to. Hello this is a message Type any message, and then press . Returns confirmation message and Message ID number 3. Send a text message Goal: Read a Text AT+CMGF=1\r Returns OK or ERROR AT+CMGDA=”DEL ALL”

M.B.S. College of Engineering and Technology

37

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

Delete all text AT+CNMI=0, 0 Disable unsolicited error code AT+CMGR=1 Read Message #1 AT+CMGL=”REC UNREAD” Read all received unread messages Debug port 

Null modem port



Only contain Data lines TXD and RXD



Debug Port used for debugging and upgrading firmware. It cannot be used for CSD call,

FAX call. And the Debug port cannot use multiplexing function. It does not support autobauding function. 

Debug port supports the communication rates is 115200bps

Software Upgrade and Software Debug The DBG_TXD, DBG_RXD and GND must be connected to the IO connector when user need to upgrade software and debug software, the DBG_TXD, DBG_RXD should be used for software upgrade and for software debugging. The TXD and RXD also should be connected to the IO connector, if user wants to send AT command or data stream to GSM MODEM. The PWRKEY pin is recommended to connect to the IO connector. The user also can add a switch between the PWRKEY and the GND. The PWRKEY should be connected to the GND when GSM MODEM is upgrading software. Please refer to the following figure.

M.B.S. College of Engineering and Technology

38

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

Fig 4.2: I/P. O/P LINES

Audio Interfacing: Table 4.3 audio interfacing

The GSM Modem provides one analog input channel, AIN, which may be used for microphone. The electrets microphone is recommended when the interface is used for microphone. The outputs connect to the receiver. The receiver outputs only can directly drive 32Ω. External line inputs are available to directly mix or multiplex externally generated analog signals such as Polyphonic tones from an external melody IC or music generated by an FM tuner IC or module. You can use AT+CMIC to adjust the input gain level of microphone, use AT+SIDET to set the side-tone level. In addition, you can also use AT+CLVL to adjust the output gain level. For more details, please refer to document It is suggested that you adopt one of the following two matching circuits in order to improve audio performance. The difference audio signals have to be layout according to difference signal layout rules. As show in following figures (Note: all components package are 0603.) If you want to adopt an amplifier circuit for audio, we recommend

M.B.S. College of Engineering and Technology

39

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

National Company’s LM4890. Of course you can select it according to your requirement. Interfacing the GSM modem: Interfacing the Modem to Microcontroller (Basic connection)

Fig: 4.4 Interfacing the GSM Module

The Modem can be directly interface with 5V microcontrollers like PIC, AVR, 8051 Derivatives, Arduinos and 3V3 Microcontrollers like ARM, ARM Cortex XX etc. Make ensure V_INTERFACE pin is supplied with same voltage level as the microcontroller VCC. As per the Fig: 3 there is only 2 connections are required to use the modem. Connect RX pin of the modem to the TX pin of the microcontroller and TX pin of the modem to microcontroller’s RX pin. The connected power supply (4.2v to 12v dc) should be capable of handling current up to 1 A. Interfacing the Modem to ARDUINO:

Fig 4.5: Interfacing The Modem to Arduino

M.B.S. College of Engineering and Technology

40

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

Getting started: 1) Insert SIM card Open the SIM cardholder by sliding it as per the arrow mark and lift up. Insert the SIM card, so as to align the chamfered corner suits in card holder .After inserting the SIM card, lock the holder by sliding it to the opposite direction of arrow mark. 2) Connect The Antenna Fix the Supplied RF antenna to the SMA Antennae connector and tighten it by Rotating the Nut (Never rotate the antennae for tightening). 3) Connect the Pins Connect the GSM modem as per the circuit diagram provided 4) Power the Modem Power the modem from suitable power supply, which is having enough current capacity (>1A). 5) Check the Status of the LEDs PWR LED - Red LED will lit immediately STS LED - Green LED will lit after 1-2 seconds NET LED -Blue LED will starts to blink in fast for few seconds (Searching for Network) and becomes slow blinking once the Modem registers with the Network. 6) Network LED: The Network LED indicates the various status of GSM module e.g. Power on, Network registration & GPRS connectivity. When the modem is powered up, the status LED will blink every second. After the Modem registers in the network (takes between 10-60 seconds), LED will blink in step of 3 seconds. At this stage you can start using Modem for your application. 7) Baud rate The Baud rate supported by the modem is between 9600 and 115200. Make sure the host system is set to the supported baud rate.

M.B.S. College of Engineering and Technology

41

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

¾ The modem automatically sets to the baud rate of the first command sent by the host system after it is powered up. User must first send “A” to synchronize the baud rate. It is recommended to wait 2 to 3 seconds before sending “AT” character. After receiving the “OK” response, Your Device and GSM Modem are correctly synchronized. So there is no need for setting the baud rate using commands. ¾ Before You Start using the modem, please make sure that the SIM card you inserted support the needed features and there is enough balance in SIM! Testing with a PC 1. Connect the GSM Modem to a PC COM Port 2. Create a HyperTerminal (Windows tool for serial port communications) window with Baud rate 9600 and connect it to the COM Port to which GSM is connected. 3. Type any AT command in the HyperTerminal window and you could see the modem responding by sending “OK”. TERMINAL WINDOW ON PC WHERE GSM MODEM IS CONNECTED SAMPLE CODE – FOR INTERFACING WITH MICROCONTROLLER

/* this program module sends an SMS from the modem to a prefixed number */ void main() M.B.S. College of Engineering and Technology

42

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

{ SerialPortInit(); /* Serial Communication – 9600-N-8-1 */ Send2Gsm("AT\r\n"); /* Transmit AT to the module – GSM Modem sends OK */ DelayS(2); /* 2 sec delay */ Send2Gsm("ATE0\r\n"); /* Echo Off */ DelayS(2); /* 2 sec delay */ Send2Gsm("AT+CMGF=1\r\n"); /* Switch to text mode */ DelayS(2); /* 2 sec delay */ Send2Gsm("AT+CMGS=\"+91988575203\"\r\n"); /* Send SMS to a cell number */ DelayS(2); /* 2 sec delay */ Send2Gsm("TEST DATA FROM INNOVATE"); /* Input SMS Data */ SerialTx(0x1a); /* Ctrl-Z indicates end of SMS */ DelayS(2); /* 2 sec delay */ Function Description: SerialPortInit – Module to initialize serial communication parameters Send2Gsm -- Module to transmit a string of data through Serial Port SerialTx – Module to transmit a byte through serial port Structure of GSM module:

Fig4.6: Structure of GSM Module

M.B.S. College of Engineering and Technology

43

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

IC

ATMEGA

368:

The ATmega328 is

a

single-chip microcontroller created

by Atmel in the megaAVR family.

Fig 4,7:ATMEGA 368

Specifications The Atmel 8-bit AVR RISC-based microcontroller combines 32 kB ISP flash memory with read-while-write capabilities, 1 kB EEPROM, 2 kBSRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible timer/counters with compare modes, internal and external interrupts, serial programmable USART, a byte-oriented

2-wire

serial

interface, SPI serial

port,

6-channel

10-bit A/D

converter (8-channels in TQFP and QFN/MLF packages), programmable watchdog timer with internal oscillator, and five software selectable power saving modes. The device operates between 1.8-5.5 volts. The device achieves throughput approaching 1 MIPS per MHz. Key parameters

Table 4.4 key parameters

M.B.S. College of Engineering and Technology

44

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

SERIES ALTERNATIVES A common alternative to the ATmega328 is the "picoPower" ATmega328P. A comprehensive list of all other member of the megaAVR series can be found on the Atmel website.[3] Applications: As of 2013 the ATmega328 is commonly used in many projects and autonomous systems where a simple, low-powered, low-cost micro-controller is needed[citation needed]. Perhaps

the

most

common

popular Arduino development

implementation

platform,

namely

of

this

chip

the Arduino

is

on

the

Uno and Arduino

Nano models. Programming

Fig 4.8: Pinout of ATmega 48A/PA/88A/PA/168A/PA/328/P in 28-PDIP

Reliability qualification shows that the projected data retention failure rate is much less than 1 PPM over 20 years at 85 °C or 100 years at 25 °C. Table 4.5 parallel programming modes Parallel program mode[2] Programming

Pin Name

I/O Function

PD1

O

signal RDY/BSY

High means the MCU is ready for a new command,

M.B.S. College of Engineering and Technology

45

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

otherwise busy. OE

PD2

I

Output Enable (Active low)

WR

PD3

I

Write Pulse (Active low)

BS1

PD4

I

Byte Select 1 (“0” = Low byte, “1” = High byte)

XA0

PD5

I

XTAL Action bit 0

XA1

PD6

I

XTAL Action bit 1

PAGEL

PD7

I

Program

memory

and

EEPROM Data Page Load BS2

PC2

I

Byte Select 2 (“0” = Low byte, “1” = 2nd High byte)

DATA

PC[1:0]:PB[5:0] I/O

Bi-directional

data

bus

(Output when OE is low) Programming mode is entered when PAGEL (PD7), XA1 (PD6), XA0 (PD5), BS1 (PD4) is set to zeroRESET pin to 0V and VCC to 0V. VCC is set to 4.5 - 5.5V. Wait 60 μs, and RESET is set to 11.5 - 12.5 V. Wait more than 310 μs Set XA1:XA0:BS1:DATA = 100 1000 0000, pulse XTAL1 for at least 150 ns, pulse WR to zero. This starts the Chip Erase. Wait until RDY/BSY (PD1) goes high. XA1:XA0:BS1:DATA = 100 0001 0000, XTAL1 pulse, pulse.

Table 4.6 serial programming

Serial Programming[2] Symbol Pins I/O Description M.B.S. College of Engineering and Technology

46

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

MOSI

PB3

I

Serial data in

MISO

PB4

O

Serial Data out

SCK

PB5

I

Serial Clock

Serial data to the MCU is clocked on the rising edge and data from the MCU is clocked on the falling edge. Power is applied to VCC while RESET and SCK are set to zero. Wait for at least 20 ms and then the Programming Enable serial instruction 0xAC, 0x53, 0x00, 0x00 is sent to the MOSI pin. The second byte (0x53) will be echoed back by the MCU. Voltage Regulator: All voltage sources cannot able to give fixed output due to fluctuations in the circuit. For getting constant and steady output, the voltage regulators are implemented. The integrated circuits which are used for the regulation of voltage are termed as voltage regulator ICs. Here, we can discuss about IC 7805. The voltage regulator IC 7805 is actually a member of 78xx series of voltage regulator ICs. It is a fixed linear voltage regulator. The xx present in 78xx represents the value of the fixed output voltage that the particular IC provides. For 7805 IC, it is +5V DC regulated power supply. This regulator IC also adds a provision for heat sink. The input voltage to this voltage regulator can be up to 35V and this IC can give a constant

M.B.S. College of Engineering and Technology

47

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

5V for any value of input less than or equal to 35V which is the threshold limit.

Fig 4.9 LM7805 PINOUT DIAGRAM

PIN 1-INPUT: The function of this pin is to give the input voltage. It should be in the range of 7V to 35V. The unregulated voltage is given to this pin for regulation. For 7.2V input, maximum efficiency can be achieved. PIN 2-GROUND: The ground is given to this pin. For output and input, this pin is equally neutral (0V). PIN 3-OUTPUT: This pin is used to take the regulated output. It will be

.

Heat Dissipation in IC 7805: In IC 7805 voltage regulator, lots of energy is exhausted in the form of heat. The difference in the value of input voltage and output voltage comes as heat. So if the difference is higher, there will be more heat generation. Without a heat sink, this too much heat will cause malfunction. The bare minimum tolerable difference between the input and output voltage to keep the output voltage in the accurate level is termed as dropout voltage. It is better to keep the input voltage 2 to 3V greater than output voltage or a suitable heat sink should be placed to dissipate excess heat. The heat sink size should have to be properly calculated. The following formula will give an idea for this calculation.

M.B.S. College of Engineering and Technology

48

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

Now, we can analyse the relation of generated heat and the input voltage value in this regulator with the following two examples. Assume a system with input voltage 16V and required output current be 0.5A. So, heat generated = Thus,

5.5W

heat

. energy

=

is

wasted

and

the

actual

energy

used

.

That is almost double energy is wasted as heat. Next, we can consider the case when input is lower, say 9V. In this case, heat generated = From this, we can conclude that for high input voltage, this regulator IC will become inefficient. Internal Block Diagram of 7805 Voltage Regulator: The internal block diagram of IC 7805 is represented in figure below: The block diagram comprises of an error amplifier, series pass element, current generator, reference voltage, current generator, starting circuit, SOA protection and thermal protection. Here Operating amplifier performs as error amplifier. The Zener diode is used for giving the reference voltage. It is shown below.

M.B.S. College of Engineering and Technology

49

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

Transistor is the series pass element here. It is used for dissipating additional energy in the form of heat. It controls the output voltage by controlling the current among the input and output. SOA is the Safe Operating Area. It is in fact the conditions of voltage and current in which the equipment is expected to work without any self-damage. Here for the SOA protection, bipolar transistor is implemented with a series resistor and an auxiliary transistor. Heat sink is implemented for thermal protection when there is high supply voltage. Regulated Power Supply Circuit: The voltage regulator 7805 and the other components are arranged in the circuit as shown in figure.

M.B.S. College of Engineering and Technology

50

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

The purposes of coupling the components to the IC7805 are explained below. C1- It is the bypass capacitor, used to bypass very small extent spikes to the earth. C2 and C3- They are the filter capacitors. C2 is used to make the slow changes in the input voltage given to the circuit to the steady form. C3 is used to make the slow changes in the output voltage from the regulator in the circuit to the steady form. When the

value

of

these

capacitors

increases,

stabilization

is

enlarged.

But

these capacitors single-handedly are unable to filter the very minute changes in the input and output voltages. C4- like C1, it is also a bypass capacitor, used to bypass very small extent spikes to the ground or earth. This is done without influencing other components. Applications of Voltage Regulator 7805 IC 

Current regulator



Regulated dual supply



Building circuits for Phone charger, UPS power supply circuits, portable CD player etc



Fixed output regulator



Adjustable output regulator etc



4.12 applications  Home security – can be used in homes (especially kitchen area) to prevent accidents due to gas leak.  Industrial security – can be used in sensitive areas to prevent any accidents.  Enhancement – can be enhanced to measure specific gas levels to use in industrial applications.  Automatic – can be enhanced to automatic electrical cut off process to prevent short circuit.

M.B.S. College of Engineering and Technology

51

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

CHAPTER CONCLUSION This project is microcontroller based project. A Gas sensor is used to Detect dangerous gas leaks in the various industrial plants. It can also be used to detect leakage in homes and gas heaters. Ideal to detect dangerous gas leaks in the kitchen. Sensor can be easily configured as an alarm unit. The sensor can also sense LPG and Coal Gas as well as Ideal sensor for use to detect the presence of a dangerous LPG leak in your car or in a service station, storage tank environment. This unit can be easily incorporated into an alarm unit, to sound an alarm or give a visual indication of the LPG concentration. The sensor has excellent sensitivity combined with a quick response time. When GAS leakage is detected and is messaged to the authorized person using cellular network called GSM.

M.B.S. College of Engineering and Technology

52

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

REFERENCES [1] in the year 2011, a. Mahalingam, r. T. Naayagi,1, n. E. Mastorakis, “design and implementation of an economic gas leakage detector”, [2] Ch. Manohar raju and n. Sushma rani, 2008; “introduce an android based automatic gas detection and indication robot.” [3] Pal-stefan murvaya, ioan sileaa, 2008; “ survey on gas leak detection and localization techniques various ways to detect the gas leakage.” [4] Zhao yang, mingliang liu, min shao, and yingjie ji, 2011; “research on leakage detection and analysis of leakage point in the gas pipeline system.” [5] S shyamaladevi, v g rajaramya, p rajasekar and p sebastin ashok, 2014; “research project arm7 based automated high performance system for lpg refill booking and leakage detection and methodology to make their project.” [6] falohun a.s., oke a.o., and abolaji b.m. 2016; “proposed their dangerous gas detection using an integrated circuit and mq-9”

M.B.S. College of Engineering and Technology

53

GAS DETECTION USING ARDUINO AND GSM MODULE WITH SMS ALERT AND SOUND ALARM

BIBLIOGRAPHY 

www.wikipedia.com/load-flow-analysis



www.avotraining.com/arc-flash/load-flow-analysis



www.electrical4u.com/loadflow



https://in.mathworks.com/products/simpower/features.html#simulation-and-analys is



www.top10electrical.blogspot.in/2015/02/power-flow-studies-and-its-importance. html?m=1



http://nptel.ac.in/courses/Webcourse-contents/IIT-KANPUR/power-system/ui/Co urse_home-4.htm



http://myelectrical.com/notes/entryid/256/load-flow-study-how-they-work

M.B.S. College of Engineering and Technology

54

Related Documents

Final Project
February 2021 1
Final Project Alprog
February 2021 1
Cpc Final Project Nm
February 2021 1
Final Project Report
January 2021 1

More Documents from "Shubhendra Singh"