Smoking Sensor Using Arduino

In this article I explain about the Smoking Sensor using Arduino.

Introduction
A smoke detector is a device that senses smoke, typically as an indicator of fire. Commercial security devices issue a signal to a fire alarm control panel as part of a fire alarm system. It is also a household detector, known as a smoke alarm. Generally, it issues a local audible or visual alarm from the detector itself. (Source Wikipedia).

Part of list:
  • Arduino
  • Smoke sensor MQ-5
  • Bread Board
  • Hookup wires
  • Buzzer
  • Led.
Connection From Sensor To Arduino Board:
  • The first pin can take A0 or D0 connected to an Arduino board.
  • The second pin Gnd can be connected to Gnd to an Arduino board.
  • The third pin Vcc can be connected to 5V to an Arduino board.
Connection From Led To Arduino Board:
  • The positive pin on the led can be connected to digital pin 13.
  • The negative pin on the led can be connected to Gnd.
Connection From Buzzer To Arduino Board:
  • The positive pin on the buzzer can be connected to digital pin 10.
  • The negative pin on the buzzer can be connected to Gnd.
Programming
  1. const int sensorpin = A0; // sensor output pin to Arduino analog A0 pin  
  2. int led = 13;  
  3. int buzzer = 10;  
  4. int sensorValue = 0;  
  5. void setup()  
  6. {  
  7.     pinMode(led, OUTPUT);  
  8.     pinMode(buzzer, OUTPUT);  
  9.     Serial.begin(9600); //Initialize serial port - 9600 bps  
  10. }  
  11. void loop()   
  12. {  
  13.     Serial.println("Welcome to c#corner");  
  14.     sensorValue = analogRead(sensorpin);  
  15.     Serial.println(sensorValue);  
  16.     if (sensorValue < 100)  
  17.     {  
  18.         Serial.println("Smoke Detected");  
  19.         Serial.println("LED on");  
  20.         digitalWrite(led, HIGH);  
  21.         digitalWrite(buzzer, HIGH);  
  22.         delay(1000);  
  23.     }  
  24.     digitalWrite(led, LOW);  
  25.     digitalWrite(buzzer, LOW);  
  26.     delay(sensorValue);  
  27. }  
Explanation

When the smoke detect the LED can be HIGH.

The value can be shown in the serial monitor accurately.
Then the smoke detected automatically the buzzer can produce the sound.

Output



Read more articles on Arduino: