IOT

Gas Leakage Detector using GSM & Arduino with SMS Alert

In this project, we will learn how to create a GSM and Arduino Gas Leak Detector with SMS Alert. Arduino will be used to interface Sim800 GSM Module with MQ135 Gas Sensor. On the 16×2 LCD Display, the gas level value will be presented. When excess gas is detected, an SMS message will be sent to a specified phone number.

In buildings, smoke and gas leakage detectors are extremely valuable for detecting smoke or fire, as are other crucial safety parameters for preventing catastrophes. In the past, exploding cylinders and accidental fires caused significant economic damage. This circuit activates the alarm system upon detection of smoke or gas leaks. Arduino and the MQ135 Smoke/Gas sensor are mostly used in the circuit to detect smoke and gas leaks. 

This MQ135 gas sensor is sensitive to LPG, ethanol, and methane, among other gases. It detects the presence of a hazardous LPG leak in your vehicle or at a gas station’s storage tank. The sensor’s sensitivity and response time are both exceptional. The sensor can also detect cigarette smoke, iso-butane, propane, and LNG. If the LPG sensor detects any gas leaking from storage, the sensor’s output decreases. This low signal is monitored by the microcontroller, which then sends the signal to the GSM module in order to send “Gas Leakage” notifications to a mobile number typed in binary.

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.

Bill of Materials

S.N.COMPONENTS NAMEDESCRIPTION
1Arduino BoardArduino UNO R3 Development Board
2GSM ModuleSIM800/900 UART GSM Module
3LCD DisplayJHD162A 16×2 LCD Display
4Potentiometer10K
5Gas SensorMQ-135/MQ7/MQ6/MQ5/MQ2
6Arduino Power Supply5V DC Adapter
7GSM Power Supply12V DC Adapter
8Connecting WiresJumper Wires
9Breadboard

SIM800 GSM Module

Description

The SIM800 is an international quad-band GSM/GPRS module. It operates on the GSM 850MHz, EGSM 900MHz, DCS 1800MHz, and PCS 1900MHz frequencies. SIM800 supports the GPRS coding schemes CS-1, CS-2, CS-3, and CS-4 and includes GPRS multi-slot class 12/ class 10 (optional). With a configuration of 24243mm, the SIM800 can accommodate virtually all space needs in user applications, including M2M, smartphones, PDA, and other mobile devices.

SIM800 contains 68 SMT pads and all hardware interfaces between the module and customer boards. In sleep mode, the current consumption of the SIM800 is as low as 1.2mA due to its energy-efficient design. The SIM800 incorporates TCP/IP protocol and enhanced TCP/IP AT commands, which are extremely beneficial for data transmission applications.

Features

• Support up to 552 Keypads.

• One full function UART port, and can be configured to two independent serial ports.

• One USB port can be used for 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 for debugging and firmware upgrading

MQ135 Gas/Smoke Sensor

Description

The MQ-135 gas sensor detects ammonia, nitrogen, oxygen, alcohols, and aromatic compounds, sulfide, and smoke, among other gases. As a gas sensing material, the MQ-3 gas sensor has a lower conductivity to purify the air. There are damaging gases in the atmosphere, yet the conductivity of gas sensors increases as the concentration of polluting gases rises. MQ-135 gas sensor is capable of detecting smoke, benzene, steam, and other hazardous gases. It is capable of detecting various noxious gases. It is inexpensive and well-suited for Air quality monitoring purposes.

Gas Leakage Detector using GSM & Arduino with SMS Alert

The MQ135 sensor is an indication of signal output. The device has two outputs: analog and TTL. The TTL output is a low-level signal that can be accessed via the IO ports of the microcontroller. The analog output is a concentration, such that an increase in voltage is proportionate to an increase in concentration. This sensor has a lengthy lifespan and dependable reliability. Consult the MQ135 Datasheet for further information.

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: Gas Leakage Detector using GSM & Arduino with SMS Alert

So here is a circuit for a GSM and Arduino Gas Leak Detector with SMS Alert. Assemble the circuit as depicted in the diagram.

  • Provide the MQ135 Sensor with a 5V Power Supply. Connect its Analog pin A0 to Arduino’s Analog pin A0.
  • Connect the GSM Module to an external 9V/12V power supply. Sim800 Modem just has its Tx, Rx, and GND pins connected to Arduino. Connect Tx and Rx to Arduino’s pins 9 and 10 correspondingly.
  • Connect the LCD to Arduino pins 7,6,5,4,3,2. It requires a 5V Power Supply. Adjust the contrast with a 10K POT.

Source Code/Programs:

Here is the source code or program for a GSM Module and Arduino-based gas leak detector with an SMS alert. Copy and upload this code to the Arduino Board using the 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

After the code is uploaded and the circuit is powered on, the LCD shows the Gas Level in analog digits. It will indicate whether the gas level is adequate or excessive. When the gas level is exceeded, the SMS Sent status will be shown.

2

This circuit activates the alarm system upon detection of smoke or gas leaks. Arduino and the MQ135 Smoke/Gas sensor are mostly used in the circuit to detect smoke and gas leaks. The sensor’s sensitivity and response time are both exceptional. This low signal is monitored by the microcontroller, which then sends the signal to the GSM module Sim800 to deliver messages such as “Excess Gas Detected. Open Windows” to a coded cellphone number.

Conclusion

I hope all of you understand how to design a Gas Leakage Detector using GSM & Arduino with SMS Alert. We MATHA ELECTRONICS will be back soon with more informative blogs.

Back to list

Leave a Reply

Your email address will not be published.