LPG Gas Leakage Detector with SMS Alert | Home Safety Project

Robotica DIY
Robotica DIY
12.4 هزار بار بازدید - 4 سال پیش - LPG Gas Leakage Detector with
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
https://github.com/fdebrabander/Ardui...

I2C scanner arduino website
https://playground.arduino.cc/Main/I2...

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)

http://amzn.to/2fvSRJq   (Arduino)
https://amzn.to/2ytw1ve (SIM900) (SIM900 is for US & Canada user & SIM900A is mostly for Asian user)
https://amzn.to/3dTEGr0 (MQ2 Gas Sensor)
http://amzn.to/2zg8aeX (I2C)
http://amzn.to/2yBk7eT (LCD display)
http://amzn.to/2vSpUON   (LED)
http://amzn.to/2vmSK8l  (Resistor)
http://amzn.to/2wxPmWz  (Breadboard)
http://amzn.to/2vJ3lvo   (Jumper wire)

Track: Julius Dreisig & Zeus X Crona - Invisible [NCS Release]
Music provided by NoCopyrightSounds.
Watch: Julius Dreisig & Zeus X Crona - Invis...
Free Download / Stream: http://ncs.io/InvisibleYO

#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);
}
4 سال پیش در تاریخ 1399/01/16 منتشر شده است.
12,469 بـار بازدید شده
... بیشتر