Sound Detection Sensor

Sound Detection Sensor

Introduction

This experiment involves using a sound detection sensor to measure sound levels in the environment. It can be used to create sound-activated devices.

Sound Detection Sensor

Components Needed

Circuit Setup

  1. Connect the VCC pin of the sound sensor to the 5V pin of the Arduino.
  2. Connect the GND pin of the sensor to the GND pin of the Arduino.
  3. Connect the OUT pin of the sensor to pin D2 on the Arduino.

Ensure all connections are secure and that the sensor is positioned in an area with sound.

Sound Sensor Circuit Setup

Code for Sound Detection Sensor

Upload the following code to your Arduino to detect sound:


const int soundPin = 2; // Pin connected to the sound sensor
void setup() {
    pinMode(soundPin, INPUT); // Set the sound pin as input
    Serial.begin(9600); // Start serial communication
}
void loop() {
    if (digitalRead(soundPin) == HIGH) {
        Serial.println("Sound Detected!");
    } else {
        Serial.println("No Sound");
    }
    delay(100); // Delay for stability
}
            

Explanation

The sound detection sensor detects sound through a microphone and outputs a high or low signal to the Arduino. The Arduino reads the signal and prints "Sound Detected!" to the Serial Monitor when a sound is heard.

Troubleshooting