Aim- Study about How to make Smoke Detection Alarm using Arduino.
The sensor will detect the smoke and
will notify the user through the buzzer and red LED
Equipment Components Required
1. Arduino UNO -A microcontroller board based on the ATmega328P 2. MQ2 Gas Sensor - which detects the level
of smoke 3. Buzzer -A device that produces sound or alarm 4. 5V LED -A Light-emitting diode that emits
light 5. 220ohm Resistor To resist the current 6. Jumper Wires -For connecting the elements of the circuit
Processor- Arduino is an open-source electronics platform based on easy-to-use hardware and software.
Arduino boards can read digital & analog inputs from the sensors and The MQ2 smoke sensor is sensitive to smoke
gases like LPG, Butane, Propane, Methane, Alcohol, and Hydrogen. In this article, we will learn how we can make a
Smoke Detector Alarm using Arduino. When the MQ2 Gas Sensor will detect the smoke level high, the red led will
glow and the buzzer will start. In this circuit, the MQ2 gas sensor detects the level of smoke in the environment and
sends the analog value to the Arduino. Which compares the value with the standard value if the value is higher,
Arduino sends the signal to the led and the red light will be illuminated and the buzzer will be started. Otherwise,
green led will be illuminated.
Circuit Diagram-
Smoke Gas Sensor-When we apply bias to the sensor, it takes some time for the sensor to warm, after that the
electrochemical sensor detects specific Gas and varies the current flow through the sensor. Hence we get analog output
ranges depends on Gas concentration. It has 6 pins in all.The centre has two pins which are called the H pins (Heater
pins).The other pins up and down pairs are known as A and B pins. Both pins are connected with separate sensors. Both A
pins are connected to the +5 DC voltage, both B pins are connected to the Analog Output pins of the Arduino and one H pin
to the ground while another H pin to +5 DC voltage. We can vary the sensitivity of the sensor by connecting a resistor
between ground and a B pin. So we can control the sensitivity of the detector by changing the resistance
Arduino Code-
int red_LED_PIN = 11;
int green_LED_PIN = 9;
int blue_LED_PIN = 10;
int buzzer = 6;
int smoke_detector = A0;
int safety_lim = 60; //Sets smoke density safe limit
void setup() {
pinMode(red_LED_PIN, OUTPUT);
pinMode(green_LED_PIN, OUTPUT);
pinMode(blue_LED_PIN, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(smoke_detector, INPUT);
Serial.begin(9600); //baud rate
void loop() {
int sensor_read = analogRead(smoke_detector);
//reads and stores the reading from the detector in sensor_read
Serial.print("Smoke Density: ");
Serial.println(sensor_read);
if (sensor_read > safety_lim)
// Checks if reading is beyond safety limit
analogWrite(red_LED_PIN,255);
analogWrite(green_LED_PIN, 0);
tone(buzzer,500, 100); //piezo rings
else
analogWrite(green_LED_PIN, 255);
analogWrite(red_LED_PIN,0);
noTone(buzzer); //peizo wont ring
delay(50);
Result- Find the result by smoke sensor detect signal and buzzer start beeping