lpg leakage detector

LPG Gas leakage detector using arduino | Arduino Project

Arduino Projects

Introduction

lpg leakage detector

Hey guys, we are back with another new project on Arduino UNO. Do you know what is a gas sensor and how we can use it for making an alert system? Well, don’t worry we are here for you. In this article, we are going to teach you that how you can make your own LPG leakage detector using Arduino.

These kinds of alert systems are used in modern buildings, schools, hotels, etc. For sensing the flammable gases we are using an MQ-6 gas sensor with Arduino in our project. You can also read articles on IoT and basic electronics published by us. Make the connections according to the given circuit diagram and then upload the given code.

Description

LPG Gas leakage detector using arduino
  • So basically this project is useful when you are planning to secure your place from any type of gas leakage.
  • When the LPG gas is detected by the MQ-6 gas sensor in LPG Gas leakage detector using arduino then the green LED will go on otherwise red LED will glow.
  • To make this project more interesting and user friendly we attach a 16×2 LCD module to it.
  • You can see the real time status of the working of the gas sensor in this LCD screen.
  • You can also check the Blynk smart smoke detector made by us.

LPG Gas leakage detector using arduino Components Required

  • Arduino UNO
  • MQ-6 gas sensor
  • 16×2 LCD module
  • 10K potentiometer
  • Red and green LEDs
  • 220 ohms resistors
  • Jumper wires and a breadboard
  • USB cable for uploading the code

Circuit for LPG Leakage Detector

lpg leakage detector CIRCUIT
  • First, let us connect the MQ-6 gas sensor with the Arduino.
  • So you have to join the VCC pin of the gas sensor with the 5 volts pin of the Arduino.
  • Then attach the GND pin of the gas sensor with the GND pin of the Arduino.
  • Connect the OUT/A0 pin of the MQ-6 gas sensor with the analog-0 pin of the Arduino.
  • Now make the connections between the 16×2 LCD and the digital pins of the Arduino as shown in the diagram.
  • For reference, you can go through our article on interfacing of 16×2 LCD display with Arduino.
  • After that connect the positive leg of the green LED with the digital- pin of the Arduino.
  • Join the positive leg of the red LED with the digital- pin of the Arduino.
  • At last, connect the negative legs of both the LEDs with the GND pin of the Arduino via a 220 ohm resistor.
  • We are using a resistor here so that it protects LEDs from getting fuse. Your circuit is complete now and you can proceed with the next step.

Code for LPG Leakage Detector

NOTE: Please upload this code to the Arduino but first of all you have to install the <LiquidCrystal.h> library in your Arduino IDE. Check here how to add a zip file in the Arduino IDE.

#include "LiquidCrystal.h"
LiquidCrystal lcd(9,8,7,6,5,4);

int GAS_VAL = 0;

void setup()
{
  pinMode(A0, INPUT); // MQ-6 A0 Pin
  Serial.begin(9600);
  lcd.begin(16,2);
  pinMode(11,OUTPUT); // LED Green
  pinMode(12,OUTPUT); // LED Red
  
  lcd.setCursor(0,0);
  lcd.print("   GAS SENSOR  ");
 
}

void loop()
{
  GAS_VAL = analogRead(A0);
  Serial.println(GAS_VAL);


 if (GAS_VAL > 500)
 {
    lcd.setCursor(0,1);
    lcd.print("  LPG Detected    ");
    digitalWrite(11,HIGH);
    digitalWrite(12,LOW);
  }
  
  else
 {
     lcd.setCursor(0,1);
     lcd.print("LPG Not Detected    ");
     digitalWrite(11,LOW);
     digitalWrite(12,HIGH);
  }
  
  delay(10); 
}

We hope that you liked this project and understand it’s working completely. If you have any doubts related to this project then feel free to ask them in the comments section given below. Also, do check out more projects on Arduino and Raspberry Pi made by us.

Happy Learning!

Spread the love, Share this post with friends

Leave a Reply

Your email address will not be published. Required fields are marked *