LPG Gas Leakage Detector with SMS Alert | Home Safety Project
Scroll down for code.....
In this tutorial we are going to learn how to detect LPG gas leakage and send SMS notification via GSM Module. It can be a good home safety features, as we can forget to off or accidentally gas leaking, until we know this, it's already late. With this project, it will detect within 5 to 10 seconds of leakage and send the SMS. Even you can receive call for that, but we are not going in this video. This video shows how MQ2 sensor detect LPG gas leakage and GSM SIM900 module will send SMS to owner about gas leakage.
LiquidCrystal_I2C library Github link
[ Ссылка ]
I2C scanner arduino website
[ Ссылка ]
If you want to support my video please buy any product through my amazon affiliate link. I will receive a commission, at no extra cost to you.
LIST OF COMPONENT (affiliate links)
[ Ссылка ] (Arduino)
[ Ссылка ] (SIM900) (SIM900 is for US & Canada user & SIM900A is mostly for Asian user)
[ Ссылка ] (MQ2 Gas Sensor)
[ Ссылка ] (I2C)
[ Ссылка ] (LCD display)
[ Ссылка ] (LED)
[ Ссылка ] (Resistor)
[ Ссылка ] (Breadboard)
[ Ссылка ] (Jumper wire)
Track: Julius Dreisig & Zeus X Crona - Invisible [NCS Release]
Music provided by NoCopyrightSounds.
Watch: [ Ссылка ]
Free Download / Stream: [ Ссылка ]
#include (LiquidCrystal_I2C.h) //instead of parenthesis () put angle bracket as YouTube description does not allow angle bracket
// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x3F, 16, 2);
#include (SoftwareSerial.h)
SoftwareSerial SIM900(7, 8);
int led = 2;
int sensor = A0;
int threshold = 150; // threshold value
void setup() {
pinMode(led, OUTPUT);
pinMode(sensor, INPUT);
SIM900.begin(19200);
Serial.begin(19200);
delay(10000);
lcd.begin();
}
void loop() {
float MQ2SensorValues = analogRead(sensor);
lcd.setCursor(0, 0);
lcd.print("Ur Home is Safe!");
lcd.setCursor(0, 1);
lcd.print("Sensor Value:");
lcd.setCursor(13, 1);
lcd.print(MQ2SensorValues);
Serial.println(MQ2SensorValues);
if (MQ2SensorValues ) threshold) // Checks if MQ2 Sensor Value greater than threshold value
{
lcd.setCursor(0, 0);
lcd.print("Gas Leakage...!!");
digitalWrite(led, HIGH);
sendSMS();
}
digitalWrite(led, LOW);
delay(500);
lcd.clear();
}
void sendSMS() {
// AT command to set SIM900 to SMS mode
SIM900.print("AT+CMGF=1\r");
delay(100);
// REPLACE THE X's WITH THE RECIPIENT'S MOBILE NUMBER
// USE INTERNATIONAL FORMAT CODE FOR MOBILE NUMBERS
SIM900.println("AT + CMGS = \"XXXXXXXXXXXXX\"");
delay(100);
// REPLACE WITH YOUR OWN SMS MESSAGE CONTENT
SIM900.println("Gas Leakaged..!!");
delay(100);
// End AT command with a ^Z, ASCII code 26
SIM900.println((char)26);
delay(100);
SIM900.println();
// Give module time to send SMS
delay(60000);
}
LPG Gas Leakage Detector with SMS Alert | Home Safety Project
Теги
lpg gas leakage detectorgas leakage detector using arduino and gsm modulegas leakage detector project using arduinogas leakage detection and alert systemlpg gas leakage sensorlpg gas leakageinterface gas sensor gsm module with arduinogsm arduino gas leakagegas leakage detector using arduino with sms alertsim900 arduino gas detectorgas leakege detectorlpg leakage detector using arduinogas leakage detector projectlpg leakage detector circuitmq2 sensor