Arduino Project (2)
Arduino Project (2)
To build the smoke detector, you will need the following components:
● Jumper Wires
The smoke detector circuit is simple and involves connecting the MQ-2 sensor, buzzer, and
LEDs to the Arduino.
Wiring Guide:
○ VCC → 5V (Arduino)
● Buzzer:
● LCD Display (if used): Connect to Arduino using I2C or standard 16x2 LCD
connections.
● Wi-Fi Module (ESP8266/ESP32, if used): Connect RX/TX pins for data transmission.
The Arduino program (sketch) reads the sensor values, compares them with a threshold, and
triggers the buzzer and LED when smoke is detected.
void setup() {
pinMode(BUZZER_PIN, OUTPUT);
pinMode(LED_PIN, OUTPUT);
Serial.begin(9600); // Initialize serial monitor
}
void loop() {
int smokeValue = analogRead(MQ2_SENSOR); // Read sensor value
Serial.print("Smoke Level: ");
Serial.println(smokeValue); // Print to Serial Monitor
The Arduino-based smoke detector project provides an efficient, affordable, and customizable
alternative to traditional smoke alarms. By utilizing an MQ-2 sensor, Arduino microcontroller, and
alert systems like buzzers and LEDs, this project enhances safety by offering real-time smoke
detection. Furthermore, integrating IoT features can make this system even more powerful for
smart homes and industrial applications.