Smoke Detection System

Description

       Guys,What about a system in your home which will give you an alarm when an amount of smoke detects? I think it is helpful to avoid dangerous situations. In this project we are going to make a smoke detection system which detects the smoke and gives an alarm when the smoke reaches the limited value set by yours. Here this project the Red LED turns ON when the value of smoke reaches the limited value it denotes the danger situation and Green LED turns OFF when the value of smoke is belongs to normal value. This project can also used to find flammable gases like LPG,Butane,Propane,Methane, Alcohol and Hydrogen also.

Components Required

 1. Arduino UNO    * 1
 2. Smoke Sensor(MQ-2) * 1
 3. LED(Green) * 1
 4. LED(Red)  * 1
 5. Buzzer    * 1
 6. Resister(220 Ohm)  * 3
 7. Jumper Wires * 1

Circuit Diagram


















Program

int redLed = 12;
int greenLed = 11;
int buzzer = 10;
int smoke = A5;
// Your threshold value
int sensorThres = 400;

void setup() {
  pinMode(redLed, OUTPUT);
  pinMode(greenLed, OUTPUT);
  pinMode(buzzer, OUTPUT);
  pinMode(smoke, INPUT);
  Serial.begin(9600);
}

void loop() {
  int analogSensor = analogRead(smoke);

  Serial.print("Pin A5: ");
  Serial.println(analogSensor);
  // Checks if it has reached the threshold value
  if (analogSensor > sensorThres)
  {
    digitalWrite(redLed, HIGH);
    digitalWrite(greenLed, LOW);
    digitalWrite(buzzer,HIGH);
  }
  else
  {
    digitalWrite(redLed, LOW);
    digitalWrite(greenLed, HIGH);
    digitalWrite(buzzer,LOW);
  }
  delay(100);
}