Smoke sensor with buzzer Arduino
Smoke sensor with buzzer Arduino
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 buzzer = 6;
void setup() {
pinMode(red_LED_PIN, OUTPUT);
pinMode(green_LED_PIN, OUTPUT);
pinMode(blue_LED_PIN, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(smoke_detector, INPUT);
void loop() {
Serial.println(sensor_read);
analogWrite(red_LED_PIN,255);
analogWrite(green_LED_PIN, 0);
else
analogWrite(green_LED_PIN, 255);
analogWrite(red_LED_PIN,0);
delay(50);
Result- Find the result by smoke sensor detect signal and buzzer start beeping