Gas leakage is one of the most dangerous hazards in homes, restaurants, and industries. A small leak can lead to serious accidents including fire or explosion. To prevent such situations, we can build a LPG Gas Leakage Detector using Arduino. This simple yet effective system detects gas leaks early and alerts you through a buzzer or alarm, giving you enough time to take action.
This project is perfect for beginners and students interested in IoT, safety systems, or home automation.
What is an LPG Gas Detector?An LPG (Liquefied Petroleum Gas) detector is a device that senses the presence of flammable gas in the environment. In this project, we use the MQ-2 gas sensor, which is capable of detecting LPG, methane, propane, and smoke.
The Arduino reads data from the MQ-2 sensor. If the gas concentration exceeds a certain limit, it triggers an alarm using a buzzer and may also activate a relay to cut off power or trigger ventilation systems.
Components RequiredTo build this project, you’ll need the following components:
Arduino Uno or Nano
- Arduino Uno or Nano
MQ-2 Gas Sensor
- MQ-2 Gas Sensor
Buzzer or Alarm
- Buzzer or Alarm
LED (optional for visual alert)
- LED (optional for visual alert)
Relay module (optional for safety control)
- Relay module (optional for safety control)
Jumper wires and breadboard
- Jumper wires and breadboard
5V power supply
- 5V power supply
The MQ-2 sensor detects gas concentration in the air and outputs an analog voltage depending on the amount of gas detected.
When the gas level is below the threshold, nothing happens — the system stays idle.
- When the gas level is below the threshold, nothing happens — the system stays idle.
If the gas level is above the threshold, Arduino activates the buzzer, LED, or relay to alert users or cut off power supply to gas lines or equipment.
- If the gas level is above the threshold, Arduino activates the buzzer, LED, or relay to alert users or cut off power supply to gas lines or equipment.
This helps in early detection and avoids potential fire or explosions.
Circuit ConnectionsMQ-2 Sensor:
VCC → 5V (Arduino)
- VCC → 5V (Arduino)
GND → GND
- GND → GND
A0 → A0 (Arduino analog pin)
- A0 → A0 (Arduino analog pin)
- MQ-2 Sensor:VCC → 5V (Arduino)GND → GNDA0 → A0 (Arduino analog pin)
Buzzer:
+ve → D8 (Arduino)
- +ve → D8 (Arduino)
-ve → GND
- -ve → GND
- Buzzer:+ve → D8 (Arduino)-ve → GND
LED (Optional):
Anode → D9
- Anode → D9
Cathode → GND (via 220Ω resistor)
- Cathode → GND (via 220Ω resistor)
- LED (Optional):Anode → D9Cathode → GND (via 220Ω resistor)
Here is a simple example of the code logic:
cpp
CopyEdit
int gasSensor = A0;
int buzzer = 8;
int threshold = 400;
void setup() {
pinMode(buzzer, OUTPUT);
Serial.begin(9600);
}
void loop() {
int gasValue = analogRead(gasSensor);
Serial.println(gasValue);
if (gasValue > threshold) {
digitalWrite(buzzer, HIGH);
} else {
digitalWrite(buzzer, LOW);
}
delay(500);
}
cpp
CopyEdit
int gasSensor = A0;
int buzzer = 8;
int threshold = 400;
void setup() {
pinMode(buzzer, OUTPUT);
Serial.begin(9600);
}
void loop() {
int gasValue = analogRead(gasSensor);
Serial.println(gasValue);
if (gasValue > threshold) {
digitalWrite(buzzer, HIGH);
} else {
digitalWrite(buzzer, LOW);
}
delay(500);
}
This code reads the analog value from the gas sensor and activates the buzzer if it exceeds the threshold (e.g., 400).
ApplicationsHome gas leak detection
- Home gas leak detection
Industrial gas monitoring systems
- Industrial gas monitoring systems
Smart kitchen safety systems
- Smart kitchen safety systems
Educational and engineering safety projects
- Educational and engineering safety projects
Building an LPG Gas Leakage Detector using Arduino is a smart and life-saving project. It’s easy to build and highly useful for ensuring safety at home or in small businesses. You can also upgrade the system by integrating GSM modules for SMS alerts or Wi-Fi modules for IoT connectivity.
Always remember: Safety is not expensive — it’s priceless. So, take the time to build this simple project and make your environment safer.
Comments