Gas Detecting Alarm System With Arduino Uno

by prajaktagumphalwar in Circuits > Arduino

94 Views, 1 Favorites, 0 Comments

Gas Detecting Alarm System With Arduino Uno

final img.jpeg
1step .jpeg

Gas detecting system using Arduino Uno is safety system designed to detected the harmful gases in the environment alert the people. Use in Homes , industries , laboratory & Kitchen to prevent the accident cause and Leakage.

In this system, a gas sensor such as MQ-2 gas sensor is used to sensing the gas like LPG, Propane, Methane, carbon monoxide, Alcohol & smoke

Supplies

MQ-2 gas sensor.jpeg
Ardiuno uno.jpeg
buzzer.jpeg
LCD.jpeg
LCD with I2c model.jpeg
LED.jpeg
resistor.jpeg
jumper wire.jpeg
Breadboard.jpg

Components & Uses in this Project:


1.ARDIUNO UNO

  1. Arduino Uno is main microcontroller of the system it control the system and processes the signal received from gas sensor.

2.BUZZER

  1. Buzzer is to create alarm when gas is detected.

3.GAS SENSOR

  1. Gas sensor is to detect the gas leakage like methane ,propane, LPG, Alcohol , carbon monoxide.

4.LCD I2c MODEL

  1. LCD to display the message such as 'Gas is Detected' & 'Gas is not Detected' then the user can know the output.

5.BREADBOARD

  1. Breadboard for connecting a components without soldering.

6.JUMPER WIRE

  1. Jumper wire for connecting components together.

7.LED

  1. To show the gas is Detected or The gas is not detected.

8.RESISTOR(330ohm &4.70kohm)

  1. Resistor for control the flow of current and protect the components from high supply.

PIN CONNETION EXPLANATION 01

1step img.jpeg

1.LED & BUZZER connection to ARDUINO UNO

  1. LED pin

A) Green LED

  1. Anode(+) - 6
  2. Cathode(-) - Resistor(330ohm) -GND

B)RED LED

  1. Anode-7
  2. cathode-Resistor(330ohm)-GND
  3. BUZZER
  4. Cathode(-) - GND
  5. Anode(+) - 8





Downloads

02

2step img.jpeg

2.MQ-2 GAS SENSOR CONNECTION TO ARDUINO UNO

  1. VCC-3.3v
  2. GND-GND
  3. AOUT-AO

Downloads

03

WhatsApp Image 2026-03-16 at 4.16.02 AM.jpeg

3.LCD I2C MODEL CONNECTION TO ARDIUNO UNO

  1. GND-GND
  2. VCC-5V
  3. SDA-A4
  4. SCL-A5


CODE

CODE

(CODE FOR MQ-2 GAS SENSOR IN ARDIUNO IDE)

#include <Wire.h>

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,16,2);


int gasSensor = A0;

int greenLED = 6;

int redLED = 7;

int buzzer = 8;


int threshold = 200;


void setup()

{

pinMode(greenLED, OUTPUT);

pinMode(redLED, OUTPUT);

pinMode(buzzer, OUTPUT);


lcd.init();

lcd.backlight();


Serial.begin(9600);


lcd.setCursor(0,0);

lcd.print("Gas Detector");

delay(2000);

lcd.clear();

}


void loop()

{

int gasValue = analogRead(gasSensor);

Serial.println(gasValue);


if(gasValue > threshold)

{

digitalWrite(redLED, HIGH);

digitalWrite(greenLED, LOW);

digitalWrite(buzzer, HIGH);


lcd.setCursor(0,0);

lcd.print("Gas Detected ");

lcd.setCursor(0,1);

lcd.print("Value:");

lcd.print(gasValue);

}

else

{

digitalWrite(redLED, LOW);

digitalWrite(greenLED, HIGH);

digitalWrite(buzzer, LOW);


lcd.setCursor(0,0);

lcd.print("Gas Not Detect");

lcd.setCursor(0,1);

lcd.print("Value:");

lcd.print(gasValue);

}


delay(500);

}

WORKING

WORKING :-

  1. When the gas value is 200-350 then gas sensor detect the gas.
  2. LCD show the "Gas Detected"
  3. Also showing the gas value 200-300 .
  4. when gas is not detected then Green LED Glow and LCD show "Gas is not Detected" .
  5. And showing the gas value in the range of 80-200 because in the code set threshold value 200.
  6. It detected the small gas when Threshold rang is 200-350 .
  7. when it detect the high concentrated gas then it shows the value 350-700
  8. And when the gas is detected it show through LCD and also Glow the Blue LED and buzzer

APPLICATIONS

APPLICATION :-

1.Home safety

  1. It can be detect the Leakage LPG gas and prevent the people to harmful accident.

2.Industrial Safety

  1. Used in factory and industry to monitor flammable and toxic gases to prevent explosion.

3.Laboratories

  1. Helps in chemical laboratory to detect harmful gases to ensure the safe working environment.

4.Gas storage area

  1. used in place where gas cylinder are store to monitor leakage gas continuously

CONCLUSION

CONCLUSION :-

gas detecting alarm system using Arduino Uno is simple and effective safety project that helps detect the harmful gases .MQ-2 gas sensor continuously monitor the gas and send to the Arduino Uno. when the gas level exceeds threshold value then activate the system buzzer and LED alarm and display the warning message on LCD .