• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Contact | Calculators-online
You are here: Home / Sensors and Detectors / LPG Leakage SMS Alert using MQ-135 – Get Warning Message in your Cellphone

LPG Leakage SMS Alert using MQ-135 – Get Warning Message in your Cellphone

Last Updated on September 11, 2019 by Swagatam 4 Comments

In this article I will show how to construct an GSM based LPG leakage SMS alert circuit using Arduino, which alerts the recipient via SMS and surrounding people via beep, when LPG gas leaks out from the LPG cylinder or if there's leakage due to improperly closed valve.

Table of Contents
  • Using MQ-135 as the Sensor
  • The Design:
  • Circuit Diagram
  • Prototype Image:
  • Directions for use and Testing:
  • Program Code:

Using MQ-135 as the Sensor

We are going to utilize MQ-135 air quality sensor for detection of rise in LPG gas in air.
If you are not much acquainted with the MQ-135 sensor,  please check this article which explains all the basics about the sensor MQ-135:

LPG gas cylinders servers thousands of households every day for food, some may have piped LPG connection from a company or government. We always underestimate the damage caused by gas leakage/explosion, may be because we occasionally/rarely read them on newspaper.

We have to admit that a full or near empty LPG gas cylinder is no less than a dynamite. If we handle them wrongly by intentionally or unintentionally it will end up in catastrophe.

The most of the catastrophe occur due to leakage from the valve of LPG gas cylinder/stove. This is because, users may forget about the food which was cooking and gets into household/other chores. The flame gets off due to liquids surrounded around the burner of cooktop.

The LPG gas keeps coming out of it and finally room get floated with toxic gas, which may explode due to tiny impact, even a static charge.

Similar scenario can be simulated if gas cylinders and cooktops are maintained poorly. The rubber gas tube is the most vulnerable part, where a pinhole gap is enough to escape gas out the cylinder.

The LPG gas itself don’t have any/faint odour, the LPG gas manufacturer add an odour agent, which we could felt by smell. But, everyone have busy life, we won’t be available at site while leakage takes place. So we will place an artificial nose (MQ-135 sensor) inside the kitchen.

When it detects LPG gas and goes beyond pre-set threshold level it beeps and sends SMS to alert the user.

NOTE: The MQ-135 is capable of detecting smoke and other chemical substance in air. The sensor can’t distinguish between them, so if the setup beeps and send SMS alert, you can assume that there is something wrong in kitchen/room.

It could be a burned food or LPG gas leak or even a fire. Simply we can say this is a multipurpose alert system.

The Design:

The LPG leakage SMS alert circuit is fairly simple and its Arduino beginner friendly. The brain is arduino as usual, which analyse sensor readings every second and takes decisions. The GSM modem which used to send SMS alert to recipient phone number. A buzzer is utilized for alerting people around the gas leakage area. You can even replace the buzzer with relay.

Circuit Diagram

GSM 2

An external power supply is used for heater coil of the sensor. The input for IC7805 must be above 8 volt. The GSM modem must be powered form its DC jack and not hosted from arduino supply.

The ground to ground connection is established between external power, GSM modem and arduino. Use a valid SIM card and make sure that, your SIM has working SMS plan.

Prototype Image:

P 20161002 185113 2

Directions for use and Testing:

For testing purpose we need serial monitor, once your calibration is complete, you can power arduino from external power sources.

Don’t use batteries as main supply, it draws few hundred mA from the supply, when the sensor goes below optimum temperature, it gives false alert. However, you can use batteries for backup power with sharp cut-off voltage.

When the user turns the circuit ON, it takes 3 minutes to get optimum temperature for the sensor, until then the circuit is inactive. We can witness from the serial monitor. It displays “Sensor waiting for optimum temperature”.

Once the sensor reaches optimum temperature level, the setup sends a test message to recipient phone number. Once you receive it, you can assume that GSM modem is working fine.

It starts displaying some numbers on the serial monitor, which is voltage level from the sensor. Higher the pollution in air higher the value get printed.

You should study about those values before you set a threshold value. For example: if the you are getting readings between 300 to 350, you should set the threshold in program, twice the value of readings in serial monitor, say 600 for above case (you can set from 0 to 1023), it should not false trigger due to small changes in the room’s air pollution content so, a double or higher value is preferred.

Now bring a cigar lighter near the gas sensor and leak the gas without flaming it. The readings should go high, an SMS alert should be sent and buzzer starts beeping.

Don’t place the sensor directly above cooking area, as the sensor is susceptible to corrosion and reads garbage values due to emission of hot food particles and send false SMS alert.

Program Code:

//--------------Program developed by R.Girish---------------//
#include <SoftwareSerial.h>
SoftwareSerial gsm(9,8);
int input=A0;
int output=7;
int th=600;    //set threshold temperature
unsigned long A = 1000L;
unsigned long B = A * 60;
unsigned long C = B * 3;
unsigned long D = B * 30;
void setup()
{
Serial.begin(9600);
pinMode(output,OUTPUT);
digitalWrite(output,LOW);
Serial.println("Sensor waiting for optimum temperature");
delay(C);
Serial.println("Sending test SMS......");
gsm.begin(9600);
gsm.println("AT+CMGF=1");
delay(1000);
gsm.println("AT+CMGS="+91xxxxxxxxxx"r"); // Replace x with mobile number
delay(1000);
gsm.println("LPG leak, test SMS");// The SMS text you want to send
delay(100);
gsm.println((char)26); // ASCII code of CTRL+Z
delay(1000);
Serial.println("Test SMS sent.");
}
void loop()
{
Serial.println(analogRead(input));
delay(1000);
if(analogRead(input)>th)
{
delay(5000);
if(analogRead(input)>th)
{
Serial.println("Sending SMS............");
Serial.println(analogRead(input));
gsm.println("AT+CMGF=1");
delay(1000);
gsm.println("AT+CMGS="+91xxxxxxxxxxx"r"); // Replace x with mobile number
delay(1000);
gsm.println("Warning: LPG gas leak detected");// The SMS text you want to send
delay(100);
gsm.println((char)26); // ASCII code of CTRL+Z
delay(1000);
Serial.println("SMS sent.");
digitalWrite(output,HIGH);
delay(B);
delay(B);
digitalWrite(output,LOW);
delay(D);
}
}
}
//--------------Program developed by R.Girish---------------//

Note: Replace th=600 with your own value.
int th=600;    //set threshold temperature

Replace x with recipient phone number. You need to place the recipient phone number at two places in the program.
gsm.println("AT+CMGS="+91xxxxxxxxxx"r"); // Replace x with mobile number

You'll also like:

  • 1.  Obstacle Avoiding Robot Circuit without Microcontroller
  • 2.  Make this Temperature Indicator Circuit with Sequential LED Display
  • 3.  Automatic PWM Door Open/Close Controller Circuit
  • 4.  Field Strength Meter Circuit
  • 5.  Simple Digital Clock using LM8650 IC Circuit
  • 6.  3 Simple Frequency Counter Circuits Discussed

About Swagatam

I am an electronics engineer with over 15 years of hands-on experience. I am passionate about inventing, designing electronic circuits and PCBs, and helping hobbyists bring their projects to life. That is why I founded homemade-circuits.com, a website where I share innovative circuit ideas and tutorials. Have a circuit related question? Leave a comment.... I guarantee a reply!

Previous Post: « Door Security Alarm Circuit for Alerting if Door was Opened
Next Post: How to Make LED Air Pollution Meter Circuit with Arduino »

Reader Interactions

Comments

  1. Willy Tham says

    March 30, 2019 at 12:34 pm

    Dear Swag,

    May I have the simple diagram on connecting Sim900A to the Arduino Uno?

    Reply
    • Swagatam says

      March 30, 2019 at 1:39 pm

      Sorry Willy, I have not studied it yet, so don’t have any idea regarding this.

      Reply
  2. Noel says

    June 29, 2018 at 2:49 am

    Sorry sir could you explain arduino and how it works and do you have a circuit to make one.
    Really appreciate your feedback

    Reply
    • Swagatam says

      June 29, 2018 at 10:36 am

      Glad you liked them Noel, however the Arduino articles were written by another author, my expertise is in the filed of discrete electronics not Arduino, so I won’t be able to help you in this regard.

      Reply

Need Help? Please Leave a Comment! We value your input—Kindly keep it relevant to the above topic! Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Subscribe to New Circuit Ideas

Categories

  • Arduino Projects (87)
  • Audio and Amplifier Projects (132)
  • Automation Projects (17)
  • Automobile Electronics (101)
  • Battery Charger Circuits (83)
  • Datasheets and Components (104)
  • Electronics Theory (143)
  • Free Energy (37)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (19)
  • Health related Projects (25)
  • Home Electrical Circuits (12)
  • Indicator Circuits (14)
  • Inverter Circuits (87)
  • Lamps and Lights (142)
  • Meters and Testers (69)
  • Mini Projects (46)
  • Motor Controller (64)
  • Oscillator Circuits (27)
  • Pets and Pests (15)
  • Power Supply Circuits (108)
  • Remote Control Circuits (50)
  • Security and Alarm (64)
  • Sensors and Detectors (101)
  • Solar Controller Circuits (59)
  • Temperature Controllers (42)
  • Timer and Delay Relay (49)
  • Transmitter Circuits (29)
  • Voltage Control and Protection (37)
  • Water Controller (36)

Calculators

  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator
  • Filter Capacitor Calculator
  • Buck Converter Calculator
  • Boost Converter Calculator
  • Solar Panel, Inverter, Battery Calculator
  • Wire Current Calculator
  • SMPS Transformer Calculator
  • IC SG3525, SG3524 Calculator
  • Inverter LC Filter Calculator

People Also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |

Recent Comments

  • Swagatam on AC Motor Speed Controller Circuits using Back EMF
  • Swagatam on DC to DC Converter Circuits using SG3524 [Buck, Boost Designs]
  • Swagatam on Understanding SG3525 IC Pinouts
  • Swagatam on 7 Simple Inverter Circuits you can Build at Home
  • Swagatam on Timer Based Cell Phone Charger Circuit

Company

  • Privacy Policy
  • Cookie Policy
  • About Me
  • Contact
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Quora
  • Stack Exchange
  • Linkedin
  • © 2025 · Swagatam Innovations