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

Arduino UNO Sound-Activated Buzzer System

View and Edit Project In Cirkit DesignerImage of Arduino UNO Sound-Activated Buzzer System

Circuit Documentation

Summary

This circuit is designed to interface with a sound sensor, a buzzer, and an LED. The primary function of the circuit is to activate the buzzer when the sound sensor detects noise above a certain threshold. The LED is included in the circuit but is not utilized in the current configuration. The Arduino UNO serves as the central microcontroller, reading the sound sensor's analog output and controlling the buzzer accordingly.

Component List

Arduino UNO

Buzzer

Sound Sensor

Resistor (200 Ohms)

LED: Two Pin (red)

Wiring Details

Arduino UNO

Buzzer

Sound Sensor

Resistor (200 Ohms)

LED: Two Pin (red)

Documented Code

/*
 * This Arduino sketch is designed to interface with a sound sensor, a buzzer,
 * and an LED. When the sound sensor detects a sound, the buzzer will turn on.
 * The LED is not used in this sketch but is part of the circuit.
 */

// Pin definitions
const int soundSensorPin = A0; // Sound sensor analog output connected to A0
const int buzzerPin = 8;       // Buzzer connected to digital pin 8

void setup() {
  // Initialize the buzzer pin as an output
  pinMode(buzzerPin, OUTPUT);
  // Initialize the sound sensor pin as an input
  pinMode(soundSensorPin, INPUT);
}

void loop() {
  // Read the value from the sound sensor
  int soundValue = analogRead(soundSensorPin);
  // If sound is detected (value above a threshold), turn on the buzzer
  if (soundValue > 500) { // Adjust threshold as needed
    digitalWrite(buzzerPin, HIGH);
  } else {
    digitalWrite(buzzerPin, LOW);
  }
  // Small delay to avoid rapid toggling
  delay(100);
}

Filename: sketch.ino

Description: The code continuously reads the analog value from the sound sensor connected to pin A0. If the value exceeds a predefined threshold (500 in this case), the buzzer connected to pin D8 is turned on. Otherwise, the buzzer is turned off. A short delay is included in the loop to prevent rapid toggling of the buzzer state.