LPG Gas Leakage Detector Using Arduino
LPG Gas Leakage Detector Using Arduino
LPG Gas Leakage Detector Using Arduino
Arduino
ARDUINO
BySaddam Jun 23, 201549
We have used a LPG gas sensor module to detect LPG Gas. When LPG gas leakage
occurs, it gives a HIGH pulse on its DO pin and arduino continuously reads its DO pin.
When Arduino gets a HIGH pulse from LPG Gas module it shows “LPG Gas Leakage Alert”
message on 16x2 LCD and activates buzzer which beeps again and again until the gas
detector module doesn't sense the gas in environment. When LPG gas detector module
gives LOW pulse to arduino, then LCD shows “No LPG Gas Leakage” message.
Components Used
1. Arduino Pro Mini
2. LPG Gas sensor Module
3. Buzzer
4. BC 547 Transistor
5. 16x2 LCD
6. 1K resistor
7. Bread board
8. 9 volt battery
9. Connecting wires
LPG gas sensor module's DO pin is directly connected to pin 18 (A4) of Arduino and Vcc
and GND are connected to Vcc and GND of arduino. LPG gas sensor module consist a
MQ3 sensor which detects LPG gas. This MQ3 sensor has a heater inside which needs
some heater supply to heat up and it may takes up to 15 minute to get ready for detecting
LPG gas. And a comparator circuit is used for converting Analog output of MQ3 in digital.
A 16x2 LCD is connected with arduino in 4-bit mode. Control pin RS, RW and En are
directly connected to arduino pin 2, GND and 3. And data pin D0-D7 are connected to 4, 5,
6, 7 of arduino. A buzzer is connected with arduino pin number 13 through a NPN BC547
transistor having a 1 k resistor at its base.
Program Description
In programming we have used digital read function to read output of LPG gas sensor
module and then performed operation according to input.
For testing this project we have used a cigarette lighter which contains LPG gas.
Code
#include <LiquidCrystal.h>
LiquidCrystal lcd(3, 2, 4, 5, 6, 7);
#define lpg_sensor 18
#define buzzer 13
void setup()
{
pinMode(lpg_sensor, INPUT);
pinMode(buzzer, OUTPUT);
lcd.begin(16, 2);
lcd.print("LPG Gas Detector");
lcd.setCursor(0,1);
lcd.print("Circuit Digest");
delay(2000);
}
void loop()
{
if(digitalRead(lpg_sensor))
{
digitalWrite(buzzer, HIGH);
lcd.clear();
lcd.print("LPG Gas Leakage");
lcd.setCursor(0, 1);
lcd.print(" Alert ");
delay(400);
digitalWrite(buzzer, LOW);
delay(500);
}
else
{
digitalWrite(buzzer, LOW);
lcd.clear();
lcd.print(" No LPG Gas ");
lcd.setCursor(0,1);
lcd.print(" Leakage ");
delay(1000);
}
}
Video