Gas Leakage Detection System using Arduino
The Gas Leakage Detection System using Arduino is a security solution designed to detect the presence of gas leaks in indoor environments.
It employs an Arduino microcontroller, a gas sensor, LEDs, a buzzer, and an LCD display to monitor gas levels continuously.
When the gas sensor detects a gas leak above a predefined threshold, the system triggers visual and auditory alerts to notify users of the potential danger. The LCD screen provides real-time feedback on the gas levels, ensuring timely response and mitigation of risks.
Component List:
Name | Quantity | Component |
---|---|---|
U1 | 1 | Arduino Uno R3 |
PIEZO1 | 1 | Piezo |
GAS1 | 1 | Gas Sensor |
U2 | 1 | LCD 16 x 2 |
D1 | 1 | Green LED |
D2 | 1 | Red LED |
R1 | 1 | 220 mΩ Resistor |
R2 | 1 | 221 mΩ Resistor |
R3 | 1 | 4.7 kΩ Resistor |
R4 R5 | 2 | 1 kΩ Resistor |
The system begins by initialising the Arduino and setting up the necessary pins for input and output. It then reads analog values from the gas sensor to measure the gas concentration in the environment.
If the sensor reading exceeds the predefined threshold, indicating a gas leak, the system activates the red LED, sounds the buzzer, and displays an alert message on the LCD screen.
Conversely, if the gas levels are within the safe range, the green LED lights up, and the system displays a “SAFE” message on the LCD. This continuous monitoring and alerting mechanism ensure the safety of indoor spaces by promptly detecting and responding to gas leaks.
Arduino Code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(5, 6, 8, 9, 10, 11);
int redled = 2;
int greenled = 3;
int buzzer = 4;
int sensor = A0;
int sensorThresh = 500;
void setup() {
pinMode(redled, OUTPUT);
pinMode(greenled, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(sensor, INPUT);
Serial.begin(9600);
lcd.begin(16, 2);
}
void loop() {
int analogValue = analogRead(sensor);
Serial.print(analogValue);
if (analogValue > sensorThresh) {
digitalWrite(redled, HIGH);
digitalWrite(greenled, LOW);
tone(buzzer, 1000, 10000);
lcd.clear();
lcd.print("ALERT");
delay(1000);
lcd.clear();
lcd.setCursor(0, 1);
lcd.print("Dangerous zone");
delay(1000);
} else {
digitalWrite(greenled, HIGH);
digitalWrite(redled, LOW);
noTone(buzzer);
lcd.clear();
lcd.print("SAFE");
delay(1000);
lcd.clear();
lcd.setCursor(0, 1);
lcd.print("ALL CLEAR");
delay(1000);
}
}