Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino-Controlled Smoke Detection System with Buzzer and LED Alert

View and Edit Project In Cirkit DesignerImage of Arduino-Controlled Smoke Detection System with Buzzer and LED Alert

Circuit Documentation

Summary of the Circuit

This circuit is designed to detect smoke using a smoke sensor and to provide an alert through both visual and auditory indicators. When smoke is detected by the sensor, the circuit activates a piezo speaker to emit a sound and an LED to provide a visual signal. The core of the circuit is an Arduino UNO microcontroller, which reads the digital output from the smoke sensor and controls the activation of the piezo speaker and LED.

Component List

Smoke Sensor

Piezo Speaker

LED: Two Pin (red)

Resistor

Arduino UNO

Comments

Wiring Details

Smoke Sensor

Piezo Speaker

LED: Two Pin (red)

Resistor

Arduino UNO

Documented Code

/*
 * Arduino Buzzer LED Smoke Sensor
 * This sketch reads the digital output from a smoke sensor and triggers a
 * piezo buzzer and an LED when smoke is detected.
 */

// Pin definitions
const int smokeSensorPin = 4; // Smoke sensor digital output connected to D4
const int buzzerPin = 3;      // Piezo buzzer connected to D3
const int ledPin = 5;         // LED connected to D5 through a resistor

void setup() {
  // Initialize the smoke sensor pin as an input
  pinMode(smokeSensorPin, INPUT);
  // Initialize the buzzer and LED pins as outputs
  pinMode(buzzerPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  // Read the smoke sensor value
  int smokeDetected = digitalRead(smokeSensorPin);
  if (smokeDetected == HIGH) {
    // Smoke detected, turn on buzzer and LED
    digitalWrite(buzzerPin, HIGH);
    digitalWrite(ledPin, HIGH);
  } else {
    // No smoke detected, turn off buzzer and LED
    digitalWrite(buzzerPin, LOW);
    digitalWrite(ledPin, LOW);
  }
  // Small delay to debounce sensor reading
  delay(100);
}

The code is written for the Arduino UNO microcontroller. It initializes the pins connected to the smoke sensor, piezo speaker, and LED. In the main loop, it continuously reads the digital output from the smoke sensor. If smoke is detected (indicated by a HIGH signal), it activates the piezo speaker and LED. If no smoke is detected, it deactivates both the speaker and LED. A short delay is included to debounce the sensor reading.