LPG Gas Leakage Detector using Arduino, MQ6 Gas Sensor and 16×2 LCD Display

Description:

In this project we build an LPG Gas Leakage Detector using Arduino and MQ6 Gas sensor. Here, the MQ6 Gas sensor is used to LPG. Once the gas is detected, the LED lights up and buzzer makes sound. Also an alert message is displayed on the 16×2 LCD Display.

Circuit Diagram:

LPG Gas Leakage Detector using Arduino, MQ6 Gas Sensor and 16x2 LCD Display
Circuit Diagram: LPG Gas Leakage Detector using Arduino, MQ6 Gas Sensor and 16×2 LCD Display

Components:

SR. NO.COMPONENTPINOUT DIAGRAMBUY
1Arduino UNO (Other Arduinos can be used too)Arduino UNO Pinout Diagram⇗
2Red LED
3Buzzer
4MQ6 Gas SensorMQ6 Gas Sensor Pinout Diagram⇗
5330 Ohm Resistor
616×2 LCD Display
Arduino UNO
Arduino UNO

Arduino UNO

The Arduino UNO is a microcontroller board based on the ATmega328P microcontroller. It is a popular open-source platform that is widely used in a variety of DIY projects, including robotics, home automation, and sensor-based systems. The Arduino UNO can be programmed using the Arduino software development environment, which is available for free online.

In this project, the Arduino UNO serves as the brain of the system, controlling the other components and providing the necessary logic for the system to function. The Arduino UNO receives input from the MQ6 Gas Sensor, which detects the presence of LPG gas. The Arduino UNO then processes the data from the sensor and displays the results on the 16×2 LCD Display. The Arduino UNO is also programmed to trigger an alarm or send an alert message in case of gas leakage.

MQ6 Gas Sensor
MQ6 Gas Sensor

MQ6 Gas Sensor

The MQ6 gas sensor is a type of semiconductor sensor that is used to detect the presence of LPG (liquid petroleum gas) in the air. This sensor is highly sensitive to LPG gas and can detect gas concentrations as low as 200ppm. The MQ6 gas sensor is a low cost, easy to use and reliable gas sensor that can be used in a wide range of applications, including home security systems, industrial monitoring and control systems, and personal safety devices.

In this project, the MQ6 gas sensor is used to detect the presence of LPG gas in the air. The sensor is connected to the Arduino UNO, which reads the analog output of the sensor and converts it into a digital signal. The Arduino UNO then processes the data and displays the results on the 16×2 LCD Display. The Arduino UNO is also programmed to trigger an alarm or send an alert message in case of gas leakage.

Red LED
Red LED

Red LED

A red LED (light-emitting diode) is a type of diode that emits light when a current is passed through it. They are commonly used in electronic devices as indicators or status lights. They are known for their long lifespan, energy efficiency and durability.

In this project, the red LED is used as an indicator of gas leakage. The Arduino UNO is programmed to turn the red LED on when the MQ6 gas sensor detects a gas leak. This serves as a visual warning for the user that there is a gas leak present in the area and to take necessary precautions. The red LED is also used as an alarm, which can be triggered when the gas concentration exceeds a certain level.

330 Ohm Resistor
330 Ohm Resistor

330 Ohm Resistor

A 330 Ohm resistor is an electronic component that is used to limit the flow of current in an electrical circuit. It is characterized by its resistance value, which in this case is 330 Ohms. Resistors are used in a wide variety of electronic devices to control the flow of current and protect other components from damage.

In this project, the 330 Ohm resistor is used to limit the current flowing through the red LED. The red LED is a low power component that can be damaged by a high current, so a resistor is used to protect it. The Arduino UNO is programmed to turn the red LED on when the MQ6 gas sensor detects a gas leak, and the 330 Ohm resistor is used to limit the current flowing through the LED, ensuring that it does not exceed the maximum safe level.

Buzzer
Buzzer

Buzzer

A 330 Ohm resistor is an electronic component that is used to limit the flow of current in an electrical circuit. It is characterized by its resistance value, which in this case is 330 Ohms. Resistors are used in a wide variety of electronic devices to control the flow of current and protect other components from damage.

In this project, the 330 Ohm resistor is used to limit the current flowing through the red LED. The red LED is a low power component that can be damaged by a high current, so a resistor is used to protect it. The Arduino UNO is programmed to turn the red LED on when the MQ6 gas sensor detects a gas leak, and the 330 Ohm resistor is used to limit the current flowing through the LED, ensuring that it does not exceed the maximum safe level.

Steps and Info:

1. Get correct components as given. You can buy online or offline. I buy electronics components mostly from Amazon.

2. Start connecting the components. If you are new to connecting components in an electronic circuit, then use a Breadboard or you can straight up make connections using Jumper wires but it will create problem when there will be two or more connections needed at one pin (for example two or more different sensors 5V connection to Arduino’s 5V pin). But before soldering components on a PCB or printing a PCB for your circuit, better try using breadboard so that any errors and mistakes can be observed on breadboard and not after soldering. Or do connections in your way.

3. Now after building the circuit, download the Arduino IDE from https://www.arduino.cc/ website.

4. If you are new to Arduino IDE software, then watch this video we made specially for beginners about Arduino IDE.

5. If you know Arduino IDE then straight up copy the code we given and paste it into the Arduino IDE sketch.

6. Connect the Arduino to your Computer/device. Select a proper port, proper Arduino type and whatever other settings are. Here it is Arduino UNO. (If you don’t know what this all is then watch our video: ).

7. Compile the code and Upload it.

8. If any error occurs then try to troubleshoot it by finding/copy-pasting it into our Solve Errors page https://electronicsprojects.in/solve-errors/, or you can straight up paste the error on Internet and you know the rest. Also check if there are no spelling/syntax errors in the code. Compile the code again once to check if errors are fixed. I have given proper connections and code but still nothing is perfect.

9. Once code compiles and uploads smoothly, you can start testing the working of your circuit/project.

10. Now for this project, take your device to a place where there is an LPG Gas stove, try to pass very few amount of gas from the nozzle or the gas burner and check if the sensor detects the gas. If it detects then the LED will light up and buzzer will make sound. Also an alert message will be displayed on 16×2 LCD Display. If it doesn’t then find what’s wrong. Check connections, code and whatever it is. As LPG is hazardous, you can use a simple smoke from something as well to detect if the thing works or not.

11. NOTE: LPG gas is super hazardous! NEVER NEVER keep any fire/fire source near the LPG gas. If the gas comes in contact with fire, it ignites instantly or even blows up! Work safely and cautiously.

Program Code:

/* https://www.electronicsprojects.in LPG Gas Leakage Detector using Arduino, MQ6 Gas Sensor and 16x2 LCD Display */

#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
int RedLED = 13;
int BUZZER = 11; 
int MQ6 = 0; 
int MQ6Sensor = 0; 
void setup() {
  lcd.begin(16,2);
  lcd.print("☢LPG DETECTOR☢");
  delay(1500);
  lcd.clear();
  pinMode(RedLED, OUTPUT); 
  pinMode(BUZZER, OUTPUT);
  pinMode(MQ6, INPUT);  
}
void loop() {
  MQ6Sensor = digitalRead(MQ6); 
  if (MQ6Sensor == HIGH) {  
   digitalWrite(RedLED, LOW); 
    lcd.print("❀SAFE❀");
    lcd.setCursor(0,1); 
    lcd.print("❀NO LPG LEAKAGE❀"); 
    noTone(BUZZER);
    delay(125);
    lcd.clear();
    
  } else { 
     digitalWrite(RedLED, HIGH);
    lcd.print("☢ALERT☢");
    lcd.setCursor(0,1);
    lcd.print("☢LPG IS LEAKED☢");
    tone(BUZZER, 1000, 200);
    delay(250);
    lcd.clear();
    delay(100);
  }
}

Download:

Links:

More: