The LPG gas leakage detector is an essential safety tool that may stop incidents and tragedies.
An Arduino microcontroller is used in this project to track the amount of LPG gas in the surrounding air.
People are instantly alerted to the possible risk when the gadget sounds a buzzer and shows a warning on an LCD screen when the gas level surpasses a particular limit.
Code Programming and Explanation:
#include <LiquidCrystal.h>
// Define pins
const int gasSensorPin = A0;
const int buzzerPin = 13;
const int threshold = 300; // Adjust threshold as needed
// Initialize LCD
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// Set up sensor and LCD
pinMode(gasSensorPin, INPUT);
pinMode(buzzerPin, OUTPUT);
lcd.begin(16, 2);
}
void loop() {
int sensorValue = analogRead(gasSensorPin);
// Check for gas leak
if (sensorValue < threshold) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("No Gas Leak");
digitalWrite(buzzerPin, LOW);
} else {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Gas Leak Detected!");
digitalWrite(buzzerPin, HIGH);
}
delay(100);
}
- The liquid crystal library for LCD control is included in the code.
- The Arduinos analog pin, which is used to read the sensor output, is linked to gas sensor pin.
- The digital pin that controls the buzzer is linked to buzzer pin.
- Threshold is the predetermined amount used to identify the presence of a gas leak.
- Depending on the intended sensitivity and sensor calibration, change the value.
- The buzzer pin, LCD and sensor pins are configured via the setup() method.
- The buzzer and LCD are controlled by the loop() method, which constantly reads the sensor data, compares it to the threshold, and acts appropriately.
Circuit Working:
Parts List:
Component | Quantity |
---|---|
Arduino Uno board | 1 |
LPG gas sensor module (MQ-2 or similar) | 1 |
16×2 LCD display | 1 |
Buzzer | 1 |
IC 7809 | 1 |
Transistor BC547 | 1 |
Resistor 1k 1/4 watt | 1 |
Potentiometer 10k | 1 |
In this article we have used an Arduino board, a gas sensor, a buzzer and a LCD display screen are all part of the setup.
When necessary, the Arduino sounds the buzzer, reads the gas sensor and displays messages on the screen.
One can adjust the sensitivity of the gas sensor.
The MQ-2 type LPG gas sensor module measures variations in resistance to identify the presence of LPG gas.
The resistance of the sensor reduces as the level of gas rises.
The sensors analog voltage output is captured by the Arduino, which then compares it to a threshold value.
A gas leak is indicated if the value is more than the threshold.
The buzzer is then turned on by the Arduino via a transistor, sounding an alert.
To warn the user, the LCD additionally displays a clear warning message.
Until the gas concentration returns to normal, the system keeps an eye on the gas level and gives updates.
How to Build:
To build a LPG Gas Leakage Detector Circuit using Arduino we need to follow the below mentioned steps:
- Gather all the components as shown in above circuit diagram.
- Connect a regulated IC1 7809 to provide a regulatedĀ 9V DC to the Arduino board
- Connect pot 10k 1st pin to VCC pin of LCD display board, 2nd leg of pot 10k to VO pin of LCD display board and 3rd leg of pot 10k to GND pin of LCD display board
Connection of LCD to Arduino are mentioned below:
- VCC (LCD) pin connected to the 5V pin on the Arduino board.
- GND (LCD) pin connected to the GND pin on the Arduino board.
- Anode (LCD) pin connected to the 5V pin through a potentiometer resistor to limit current.
- RS (Register Select) pin is connected to pin 12 on the
- Enable (E) pin is connected to pin 10 on the Arduino board
- D4, D5, D6, D7 pins connect to digital pins 4, 5, 6, and 7 on the Arduino board.
- RW (Read/Write) pin connect to GND on Arduino board.
Connections for Buzzer, Transistor BC547, and LPG Gas Sensor are mentioned below:
Buzzer and Transistor BC547
- Buzzer connect one leg to the collector of the BC547 transistor, the other leg of the buzzer connects to the positive supply voltage of 5V on Arduino board
- BC547 Transistor connect collector to the buzzer one leg, Connect base to a digital output pin 13 on the Arduino board through resistor 1k
LPG Gas Sensor connections are mentioned below:
- Vcc pin connect to the 5V supply of Arduino board.
- GND pin connect to the ground of Arduino board
- Aout pin connect to an analog input pin A0 on the Arduino board.
Note:
- When handling gas, safety procedures should always be followed.
- For more accuracy, choose a gas sensor that is more sensitive.
- Use a relay to manage heavier loads, such as alarms or ventilation fans.
- To ensure continuous functioning, think about including a battery backup.
- Examine your alternatives for wireless communication to get notifications and remote monitoring.
Conclusion:
To conclude, one important safety tool that may save lives and save property is the LPG gas leak detection system.
A dependable and efficient gas detection system may be made with an Arduino microcontroller and easily accessible parts.
The gadget must be tested and calibrated on a regular basis to guarantee optimal operation.
References:
Detecting LPG Leakage and Automatic Turn off using Arduino Connected with PIR Sensor
Leave a Reply