Skip to main content

MQ-5 GAS LEAK DETECTOR

 

MQ-5 GAS LEAK DETECTOR

 This project is used to detect the gas leak and alert us that the gas is leaking. You can use it for your science projects.
FOR VIDEO :

THING'S NEEDED

  1. Arduino UNO R3
  2. MQ-5 Gas Sensor
  3. 2 - LEDS
  4. Buzzer

CIRCUIT DIAGRAM

WIRING

SENSOR TO ARDUINO

  • Connect the Vcc Pin of sensor to 5V of Arduino.
  • Connect the GND pin of sensor to GND of Arduino.
  • Connect the AO (analogOutput) of sensor to pin A0 of Arduino.

LED & BUZZER TO ARDUINO

  • Connect the Red LED to pin 2 of Arduino.
  • Connect the Green LED to pin 3 of Arduino.
  • Connect the Buzzer to pin 4 of Arduino.

CODE

// scientist BENIEL'S LAB
// GAS DETECTOR

int Input = A0;
int R_LED = 2;
int G_LED = 3;
int Buzzer = 4;
// VAL INTEGER
int val;
int MAX = 400;

void setup() {
  Serial.begin(9600);
  pinMode(Input ,INPUT);
  pinMode(R_LED ,OUTPUT);
  pinMode(G_LED ,OUTPUT);
  pinMode(Buzzer ,OUTPUT);
}

void loop() {
  val = analogRead(A0);
  if (val >= MAX) {
    digitalWrite(R_LED ,HIGH);
    digitalWrite(Buzzer ,HIGH);
    digitalWrite(G_LED ,LOW);
    Serial.println("GAS LEAKING");
  }
  else {
    digitalWrite(R_LED ,LOW);
    digitalWrite(Buzzer ,LOW);
    digitalWrite(G_LED ,HIGH);
    Serial.println("NORMAL");
  }
}
SUBSCRIBE TO "scientist BENIEL'S LAB" IN YOUTUBE FOR MORE ELECTRONIC'S & ROBOTIC'S PROJECTS.
THANK YOU

Comments

Popular posts from this blog

Arduno Clock

  Arduino Clock This is a clock using RTC Tiny with Arduino. Using this we can see time & date.  FOR VIDEO :

Blutooth Switch (Arduino)

 BLUTOOTH SWITCH (ARDUINO) Hi, Using this we can control leds using Smart Phone via Blutooth. We can also control home appliances using Relay with it. For Video :  CLICK HERE  .