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 Name | Quantity | Purchase Links |
---|---|---|---|
1 | Arduino UNO Board | 1 | Amazon | AliExpress |
2 | SIM800/900 GSM Module | 1 | Amazon | AliExpress |
3 | 16x2 LCD Display | 1 | Amazon | AliExpress |
4 | Potentiometer 10K | 1 | Amazon | AliExpress |
5 | MQ2 Gas Sensor | 1 | Amazon | AliExpress |
6 | 5V DC Supply | 1 | Amazon | AliExpress |
7 | 12V DC Supply | 1 | Amazon | AliExpress |
8 | Connecting Wires | 20 | Amazon | AliExpress |
9 | Breadboard | 1 | Amazon | 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 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.
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.
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.
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.
13 Comments
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
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.
Use 9V-12V adapter with 2A rating adapter.
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.
GSM works at 9V to 12V. It won’t work at 5V.
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……
YOU HAVE OR HOW CAN I DO IOT BASED GAS LEKAGE DETECTING AND SMS ALERT OR IT IS POSSIBLE OR NOT
i keep having errors when i run the code
Sir can we send multiple sms for different numbers…? If we can then plz share the code sir
Can I disconnect the Arduino from computer ?
sir i have uploded code and made connections right but lcd display is showing nothing can u please help me
On which software u done the simulation sir?? I am trying on tinkercad.but the gsm module is not available there
Hi sir, can you provide an updated schematic diagram of this?