• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Get free circuit help 24/7

New Projects | Privacy Policy | About us | Contact | Disclaimer | Copyright | Videos | Circuits for Beginners | Basic Circuits | Hobby Projects | Transistor Circuits | LED Drivers 

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

caution electricity can be dangerous

In this article we are going 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.

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

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:

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.  MQ-135 Air Quality Sensor Circuit – Working and Interfacing with Program Code
  • 2.  Electric Match (Ematch) Circuit Firework Ignitor
  • 3.  Precision Current Sensing and Monitoring Circuit using IC NCS21xR
  • 4.  GSM Fire SMS Alert Project
  • 5.  Ion Detector Circuit [Static Discharge Detector]
  • 6.  Obstacle Avoiding Robot Circuit without Microcontroller

About Swagatam

I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials.
If you have any circuit related query, you may interact through comments, I'll be most happy to help!

Have Questions? Please Comment below to Solve your Queries! Comments must be Related to the above Topic!!

Subscribe
Notify of
4 Comments
Newest
Oldest
Inline Feedbacks
View all comments

Primary Sidebar

Calculators

  • 3-Phase Power (15)
  • 324 IC Circuits (19)
  • 4017 IC Circuits (52)
  • 4060 IC Circuits (25)
  • 555 IC Circuits (98)
  • 741 IC Circuits (19)
  • Arduino Engineering Projects (83)
  • Audio and Amplifier Projects (114)
  • Battery Chargers (82)
  • Car and Motorcycle (94)
  • Datasheets (46)
  • Decorative Lighting (Diwali, Christmas) (33)
  • Electronic Components (100)
  • Electronic Devices and Circuit Theory (36)
  • Electronics Tutorial (116)
  • Fish Aquarium (5)
  • Free Energy (34)
  • Fun Projects (13)
  • GSM Projects (9)
  • Health Related (20)
  • Heater Controllers (29)
  • Home Electrical Circuits (102)
  • How to Articles (20)
  • Incubator Related (6)
  • Industrial Electronics (28)
  • Infrared (IR) (40)
  • Inverter Circuits (98)
  • Laser Projects (12)
  • LED and Light Effect (93)
  • LM317/LM338 (21)
  • LM3915 IC (25)
  • Meters and Testers (65)
  • Mini Projects (148)
  • Motor Controller (67)
  • MPPT (7)
  • Oscillator Circuits (26)
  • PIR (Passive Infrared) (8)
  • Power Electronics (34)
  • Power Supply Circuits (77)
  • Radio Circuits (10)
  • Remote Control (48)
  • Security and Alarm (61)
  • Sensors and Detectors (120)
  • SG3525 IC (5)
  • Simple Circuits (75)
  • SMPS (29)
  • Solar Controllers (60)
  • Timer and Delay Relay (53)
  • TL494 IC (5)
  • Transformerless Power Supply (8)
  • Transmitter Circuits (40)
  • Ultrasonic Projects (16)
  • Water Level Controller (45)

Calculators

  • AWG to Millimeter Converter
  • 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
  • Small Signal Transistor(BJT) and Diode Quick Datasheet
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator

© 2023 · Swagatam Innovations

wpDiscuz