Gas Leakage Detector with SMS Alert using GSM Module & Arduino

Gas Leakage Detector GSM Arduino (Last Updated On: May 6, 2019)

Gas Leakage Detector with SMS Alert using GSM Module & Arduino

In this project we are going to learn how to design a Gas Leakage Detector with SMS Alert using GSM Module & Arduino. We will interface Sim800 GSM Module as well as MQ135 Gas Sensor with Arduino. The gas level value will be displayed on 16×2 LCD Display. Whenever the excess gas is detected SMS will be sent to a particular phone number.



Smoke and gas leakage detectors are very useful in detecting smoke or fire in buildings, and so are the important safety parameters in order to prevent disasters. Bursting cylinders and accidential fires has caused lots of harm to the economies in the past. This circuit triggers the alert system when smoke or gas leakage is detected.The circuit mainly uses MQ135 Smoke/Gas sensor and Arduino to detect and smoke and gas leak. This MQ135 gas sensor is sensible to LPG, Alcohol, and Methane etc.It detects the presence of a dangerous LPG leak in your car or in a service station, storage tank environment. The sensor has excellent sensitivity combined with a quick response time. The sensor can also sense iso-butane, propane, LNG and cigarette smoke. If the LPG sensor senses any gas leakage from storage the output of this sensor goes low. This low signal is monitored by the microcontroller and sends the signal to GSM module to send messages as “Gas Leakage” to a mobile number written in code.

You can also use SIM900 or any other GSM Module instead of SIM800. Similarly you can use MQ2/MQ3/MQ5 or any other Gas/Smoke Sensor instead of MQ135.


Components Required

1. Arduino Uno Board (Buy Online from Amazon)
2. MQ135 Gas/Smoke Sensor (Buy Online from Amazon)
3. 16x2 LCD Display (Buy Online from Amazon)
4. SIM800/SIM900 GSM Module (Buy Online from Amazon)
5. Breadboard (Buy Online from Amazon)
6. 9V Power Adapter - 2  (Buy Online from Amazon)
7. Connecting Wires  (Buy Online from Amazon)



SIM800 GSM Module

Description

SIM800 is a quad-band GSM/GPRS module designed for the global market. It works on frequencies GSM 850MHz, EGSM 900MHz, DCS 1800MHz and PCS 1900MHz. SIM800 features GPRS multi-slot class 12/ class 10 (optional) and supports the GPRS coding schemes CS-1, CS-2, CS-3 and CS-4. With a tiny configuration of 24*24*3mm, SIM800 can meet almost all the space requirements in users’ applications, such as M2M, smart phone, PDA and other mobile devices.

Sim800 GSM Module

SIM800 has 68 SMT pads, and provides all hardware interfaces between the module and customers’ boards. SIM800 is designed with power saving technique so that the current consumption is as low as 1.2mA in sleep mode. SIM800 integrates TCP/IP protocol and extended TCP/IP AT commands which are very useful for data transfer applications.

Features

• Support up to 5*5*2 Keypads.
• One full function UART port, and can be configured to two independent serial ports.
• One USB port can be used as debugging and firmware upgrading.
• Audio channels which include a microphone input and a receiver output.
• Programmable general purpose input and output.
• One SIM card interface.
• Support Bluetooth function.
• Support one PWM.
• PCM/SPI/SD card interface, only one function can be accessed synchronously.
• Power supply 3.4V ~ 4.4V
• Typical power consumption in sleep mode is 1.2mA
• Frequency bands GPRS multi-slot class 12
• Support SIM card: 1.8V, 3V
• Serial Port: Can be used for AT commands for data stream
• USB Port: Can be used as debugging and firmware upgrading




MQ135 Gas/Smoke Sensor

Description

The MQ-135 gas sensor senses the gases like ammonia nitrogen, oxygen, alcohols, aromatic compounds, sulfide and smoke. The MQ-3 gas sensor has a lower conductivity to clean the air as a gas sensing material. In the atmosphere we can find polluting gases, but the conductivity of gas sensor increases as the concentration of polluting gas increases. MQ-135 gas sensor can be implementation to detect the smoke, benzene, steam and other harmful gases. It has potential to detect different harmful gases. It is with low cost and particularly suitable for Air quality monitoring application.

MQ135 Gas Smoke Sensor

The MQ135 sensor is a signal output indicator instruction. It has two outputs: analog output and TTL output. The TTL output is low signal light which can be accessed through the IO ports on the Microcontroller. The analog output is an concentration, i.e. increasing voltage is directly proportional to increasing concentration. This sensor has a long life and reliable stability as well.

Features

• High Sensitivity
• High sensitivity to Ammonia, Sulfide and Benze
• Stable and Long Life
• Detection Range: 10 – 300 ppm NH3, 10 – 1000 ppm Benzene, 10 – 300 Alcohol
• Heater Voltage: 5.0V
• Dimensions: 18mm Diameter, 17mm High excluding pins, Pins – 6mm High
• Long life and low cost


Circuit Diagram & Connections

So here is a circuit for Gas Leakage Detector with SMS Alert using GSM Module & Arduino. Assemble the circuit as shown in the figure below.

Circuit Diagram Gas leakage detector with SMS using Arduino GSM

Supply MQ135 Sensor with 5V Power Supply. Connect its Analog pin A0 to Analog pin A0 of Arduino.

Similarly Connect the GSM Module with 9V/12V external Power Supply. Only the Tx, Rx and GND pin of Sim800 Modem is connected to Arduino. So connect Tx & Rx to Pin No. 9 & 10 of Arduino respectively.

Connect the LCD to pin no 7,6,5,4,3,2 of Arduino. Supply it with 5V power Supply. Use 10K POT to adjust the contrast.


Source Code/Programs:

Here is a Source Code or Program for Gas Leakage Detector with SMS Alert using GSM Module & Arduino. Copy this code and upload it to Arduino Board using Arduino IDE.

#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
#include <SoftwareSerial.h>

SoftwareSerial mySerial(9, 10);

int gasValue = A0; // smoke / gas sensor connected with analog pin A1 of the arduino / mega.
int data = 0;

void setup()
{
randomSeed(analogRead(0));
mySerial.begin(9600); // Setting the baud rate of GSM Module
Serial.begin(9600); // Setting the baud rate of Serial Monitor (Arduino)
lcd.begin(16,2);
pinMode(gasValue, INPUT);
lcd.print (" Gas Leakage ");
lcd.setCursor(0,1);
lcd.print (" Detector Alarm ");
delay(3000);
lcd.clear();
}

void loop()
{

data = analogRead(gasValue);

Serial.print("Gas Level: ");
Serial.println(data);
lcd.print ("Gas Scan is ON");
lcd.setCursor(0,1);
lcd.print("Gas Level: ");
lcd.print(data);
delay(1000);

if ( data > 500) //
{
SendMessage();
Serial.print("Gas detect alarm");
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Gas Level Exceed");
lcd.setCursor(0,1);
lcd.print("SMS Sent");
delay(1000);

}
else
{
Serial.print("Gas Level Low");
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Gas Level Normal");
delay(1000);
}

lcd.clear();
}

void SendMessage()
{
Serial.println("I am in send");
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=\"+91900xxxxxxx\"\r"); // Replace x with mobile number
delay(1000);
mySerial.println("Excess Gas Detected. Open Windows");// The SMS text you want to send
delay(100);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
}

Working of the Project

When the circuit is powered on after uploading code, the LCD displays the Gas Level in some analog number. It will display the status whether the gas level is normal or excessive. When the gas level exceeds it will display SMS Sent status.


This circuit triggers the alert system when smoke or gas leakage is detected.The circuit mainly uses MQ135 Smoke/Gas sensor and Arduino to detect and smoke and gas leak. The sensor has excellent sensitivity combined with a quick response time. This low signal is monitored by the microcontroller and sends the signal to GSM module Sim800 to send messages as “Excess Gas Detected. Open Windows” to a mobile number written in code.




Video Demonstration

Recommended For You

About the Author: Alex Newton

Ask A Question .......

Close