Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » Gas Leakage Detector using GSM & Arduino with SMS Alert
Arduino Projects

Gas Leakage Detector using GSM & Arduino with SMS Alert

Mamtaz AlamBy Mamtaz AlamUpdated:February 2, 202513 Comments6 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Gas Leakage Detector GSM Arduino
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Gas Leakage Detector using GSM & Arduino with SMS Alert

In this project, we are going to learn how to design a Gas Leakage Detector using GSM & Arduino with SMS Alert. We will interface Sim800 GSM Module as well as MQ135 Gas Sensor with Arduino. The gas level value will be displayed on the 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 accidental fires have 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 the 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 the 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.

To learn more about the gas sensors you can follow these post:

  • Alcohol Level Meter using Arduino & MQ-135 Alcohol/Gas Sensor
  • Arduino Smoke Level Detector using MQ-135 Sensor with Alert Alarm
  • Gas Leak Alarm System using MQ2 & Arduino

Bill of Materials

S.N.Components NameQuantityPurchase Links
1Arduino UNO Board1Amazon | AliExpress
2SIM800/900 GSM Module1Amazon | AliExpress
316x2 LCD Display1Amazon | AliExpress
4Potentiometer 10K1Amazon | AliExpress
5MQ2 Gas Sensor1Amazon | AliExpress
65V DC Supply1Amazon | AliExpress
712V DC Supply1Amazon | AliExpress
8Connecting Wires20Amazon | AliExpress
9Breadboard1Amazon | AliExpress




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 24243mm, SIM800 can meet almost all the space requirements in users’ applications, such as M2M, smartphone, 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 552 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 implemented to detect the smoke, benzene, steam and other harmful gases. It has the potential to detect different harmful gases. It is with low cost and particularly suitable for Air quality monitoring applications.

Gas Leakage Detector using GSM & Arduino with SMS Alert

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 a concentration, i.e. increasing voltage is directly proportional to increasing concentration. This sensor has a long life and reliable stability as well. Check the MQ135 Datasheet to learn more.

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 Gas Leakage Detector using GSM & Arduino with SMS Alert. Assemble the circuit as shown in the figure below.

Gas Leakage Detector using GSM & Arduino with SMS Alert

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 a 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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#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 numbers. It will display the status of whether the gas level is normal or excessive. When the gas level exceeds it will display SMS Sent status.

  • 1
  • 2
  • 3

  • 1
  • 2
  • 3

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


Video Demonstration

Gas Leakage Detector with SMS Alert Using GSM Module & Arduino
Watch this video on YouTube.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous Article12V DC to 220V AC Inverter Circuit & PCB
Next Article RGB Color Detector using TCS3200 Color Sensor & Arduino

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
View 13 Comments

13 Comments

  1. K.sivakumar on March 9, 2020 2:18 PM

    Sir I do gas leakage detector with sms alert project.gas leval was detect and monitoring in display successfully but sms will be not send sir

    Reply
  2. Ola Dunk on May 22, 2020 4:06 AM

    How do you power the SIM800 module? It uses about 2-2.5 A when transmitting so you need a good power supply. The Arduino can NOT supply enough power. You also need extra thick wires in the +5 and GND for the SIM800.

    Reply
    • Mr. Alam on May 22, 2020 5:53 AM

      Use 9V-12V adapter with 2A rating adapter.

      Reply
  3. Rahul on August 26, 2020 9:06 PM

    Sir project is ready but SMS is not send by GSM .
    I’m used 5volt power supply for GSM.
    Sir my GSM module is 900a.

    Reply
    • Mr. Alam on August 26, 2020 8:56 PM

      GSM works at 9V to 12V. It won’t work at 5V.

      Reply
  4. Uma on October 5, 2020 2:57 PM

    Sir I have one doubt, if we implement this things,we can avoid it when we are in our home but if we are outside how can we solve this sir……

    Reply
  5. AKANKAKSHA on December 11, 2020 8:04 PM

    YOU HAVE OR HOW CAN I DO IOT BASED GAS LEKAGE DETECTING AND SMS ALERT OR IT IS POSSIBLE OR NOT

    Reply
  6. kodang bryan on March 23, 2021 12:47 PM

    i keep having errors when i run the code

    Reply
  7. Shashank Doddamani on July 19, 2021 2:14 PM

    Sir can we send multiple sms for different numbers…? If we can then plz share the code sir

    Reply
  8. Abu Bakar Siddique on September 5, 2021 4:09 PM

    Can I disconnect the Arduino from computer ?

    Reply
  9. dheeraj on March 4, 2022 11:22 AM

    sir i have uploded code and made connections right but lcd display is showing nothing can u please help me

    Reply
  10. Trupti on April 22, 2022 3:35 PM

    On which software u done the simulation sir?? I am trying on tinkercad.but the gsm module is not available there

    Reply
  11. Bery on May 17, 2023 12:55 PM

    Hi sir, can you provide an updated schematic diagram of this?

    Reply

CommentsCancel reply

Latest Posts

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 14, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • IoT Based PM & Air Quality Monitoring System using ESP32
    IoT Based PM & Air Quality Monitoring System using ESP32
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
  • How to use INA219 DC Current Sensor Module with Arduino
    How to use INA219 DC Current Sensor Module with Arduino
  • Designing of MPPT Solar Charge Controller using Arduino
    Designing of MPPT Solar Charge Controller using Arduino
  • ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
    ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
  • High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU
    High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.