Arduino Gas leakage detection and SMS alert MQ-2 sensor

(Last Updated On: October 1, 2019)

gas leakage

Description:

This project is based on the Gas leakage detection or smoke detection using MQ-2 gas/smoke sensor, Arduino Uno and GSM sim900A module. This project is used for the Gas/Smoke detection, once the Gas/Smoke is detected a message is sent to the owner. This Project can be installed in kitchens, Rooms, etc.

In my previous project, I used the same sensor with the Solenoid valve. So whenever there was a gas leakage the solenoid valve would close automatically. If you want to control the gas flow using a solenoid valve then you should definitely watch my tutorial. Which provides the best protection.

The Gsm sim900A and MQ-2 sensor interfacing with Arduino Uno or Mega are really simple.

In this tutorial, I will show you have to make your own Smoke/ gas leakage detection and SMS alert system. This is an automatic system, a message will be sent automatically whenever the gas or smoke is detected.

The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Arduino Uno: https://amzn.to/2tVz1vu
Mega 2560: https://amzn.to/2ze1kdu
Sim900A: https://amzn.to/2Nv70TI
5V regulated power supply/Adaptor for GSM sim900A: https://amzn.to/2u10V9a
solenoid valve: https://amzn.to/2NyoD50
smoke sensor MQ-2: https://amzn.to/2Mv1wai
12v 10A SPDT relay: https://amzn.to/2MThQBK
2n2222 npn transistors: https://amzn.to/2EmXsIb
10k Resistor: https://amzn.to/2KTd6OW
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
female DC power jack socket: https://amzn.to/2KEo1gt
470uf capacitors: https://amzn.to/2xDCOzf
5×7 cm Vero board: https://amzn.to/2OHGbvn
female headers: https://amzn.to/2zqmtiJ
connection wires: https://amzn.to/2DpBuW7
Super Starter kit for Beginners: https://amzn.to/2KJvmKG
Jumper Wires: https://amzn.to/2KMoVXs
Bread Board: https://amzn.to/2MS4q8X
12v Adaptor: https://amzn.to/2Ntr6h1
PCB plate: https://amzn.to/2IUwpCt
Variable Supply: https://amzn.to/2MT4Qfj
Digital Multimeter: https://amzn.to/2Nvft9i
Vero Board / stripboard: https://amzn.to/2MTf9jD
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2zfoNuJ
Solder wire: https://amzn.to/2ufUMWf
Wire Stripper: https://amzn.to/2KOqxfU
wirecutter: https://amzn.to/2ucIq14
PCB small portable drill machine: https://amzn.to/2Nu62XF


GSM SIM900A Module:

The GSM SIM900A module is already explained in my previous tutorials. You can check out these two projects.

Arduino GSM Alarm system:

https://www.electroniclinic.com/arduino-gsm-alarm-system/

 

RFID and GSM based students attendance system with SMS alert:

https://www.electroniclinic.com/rfid-based-students-attendance-system-with-message-alert/

MQ-2 Sensor:

gas leakage

The MQ-2 sensor is capable of detecting a wide range of gases including carbon monoxide, alcohol, methane, hydrogen, isobutene, liquefied petroleum gas, propane, and smoke. For the easy interfacing, the MQ-2 sensor Module is provided with 4 male headers so that it can be easily interfaced with the Arduino Uno or Mega using male to female type jumper wires.


gas leakage

Pinouts:

As you can see The 4 male header pins are labeled with

A0…

 D0…

Gnd…

and Vcc…

A0 pin is the Analog output of the MQ-2 sensor module, and this pin should be connected with the analog pin of the Arduino Uno or Mega.

D0 is the digital output in the form of 5v or GND. This sensor module also has a variable resistor which can be used to change the detection level.

The MQ-2 Sensor Module GND pin should be connected with the Arduino Uno or Mega ground.

While Vcc of the MQ-2 sensor module will be connected with the 5v pin of the Arduino Uno or Mega.

Applications:

They are used in gas leakage detecting equipment in family and industry, are suitable for detecting of LPG, i-butane, propane, methane, alcohol, Hydrogen and smoke.


Circuit Diagram:

gas leakage

This schematic is designed in cadesoft eagle, if you want to learn how to make schematics and PCB, then you can watch my tutorial “Click Here link 3”. The MQ-2 Sensor  Module and gsm sim900A or Sim900D modules interfacing with Arduino /Mega is very simple.

As you know my friends GSM sim900A module communicates with Arduino using Serial communication so that’s why we have to define pins for the tx and Rx pins of the GSM module. Well, you also know that Arduino has a serial port which is on pin number0 and pin number1.

If you have watched my previous tutorials on YouTube, you will know, I always say never use the Arduino’s default serial port for the communication with other devices, you can define another serial port on any digital pins. Now the question is if we will not use the Arduino’s default serial port then how we will connect the gsm module? well no worries at all, we can define multiple serial ports using the SoftwareSerial library which I will explain in the programming.

As you can see in the circuit diagram above the tx pin of the sim900A is connected with pin7 of the Arduino, the rx Pin of the sim900A is connected with pin8 of Arduino and GND is connected with the GND of Arduino.  a power supply is connected with sim900A ideal voltage is 4.7v to 5v.

The MQ-2 sensor module VCC pin will be connected with the Arduino’s 5v, its Ground pin will be connected with the Arduino’s Ground and its A0 pin will be connected with the Arduino’s A1.


Programming:

Watch Video Tutorial:

 

Related Project:

IoT Smoke Detector using MQ135 Gas Sensor & Nodemcu ESP8266

 

 

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply

Close