Arduino Projects

LPG Gas leakage detector using arduino | Arduino Project


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.

HTML Image as link

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.

lpg leakage detector


  • 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

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
  pinMode(11,OUTPUT); // LED Green
  pinMode(12,OUTPUT); // LED Red
  lcd.print("   GAS SENSOR  ");

void loop()
  GAS_VAL = analogRead(A0);

 if (GAS_VAL > 500)
    lcd.print("  LPG Detected    ");
     lcd.print("LPG Not Detected    ");

LPG gas sensor interface with Arduino (MQ6)

HTML Image as link

Blynk LPG Detector | Lpg Detector IoT project

Gas leakage detector using Arduino- LPG Alarm

Blynk Smart Smoke Detector | MQ-2 Gas Sensor

Blynk Smart Smoke Detector | MQ-2 Gas Sensor

Blynk MQ3 Alcohol Sensor| Alcohol Detector IoT project

PCBWay PCB Prototyping Services

I have assembled the whole circuit on a breadboard. As you know breadboard assembly is not effective for this type of project. So, PCBWay offers Rapid PCB Prototyping for Your Research Work. I personally, recommend PCBWay because you can get your first-try boards right in 24 hours!

PCBWay website

The prototyping stage is the most critical period of time for engineers, students, and hobbyists. PCBWay not only makes your boards quick but also makes your job right as well as cost-effective. This greatly reduces your cost and shortens the time for developing your electronic

PCBWay can provide 2 Layer PCBs to highly advanced HDI and flex boards. Even though the PCBs they produce differ a lot regarding functionality and areas of use. I am impressed with the quality of the boards, the delivery time, and the cost-effectiveness

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, IoT, and Raspberry Pi made by us.

Happy Learning!

Related Articles

Leave a Reply

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

Back to top button