Arduino Sound Sensor Tutorial | Arduino Clap Sensor Tutorial

Introduction: Arduino Sound Sensor Tutorial | Arduino Clap Sensor Tutorial

Hi guys in this instructables we will learn how to use sound sensor with Arduino and basically sound sensor is used to detect sounds and read the sound using Arduino and we can use sound inputs with Arduino using sound sensor.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Things You Need

For this instructables we will need following things :

Arduino uno

Sound sensor

Jumper wires

Breadboard

LED

Resistor 220ohm

Step 2: Connections

Please follow the shown schmatics and connect everything According to it.

Pin - Wiring to Arduino
D0 - Digital pins
GND - GND
VCC - 5V

Step 3: Code

Please copy the following code and upload it to the arduino Board :

int ledPin=13;
int sensorPin=7;
boolean val =0;

void setup(){
pinMode(ledPin, OUTPUT);
pinMode(sensorPin, INPUT);
Serial.begin (9600);
}

void loop (){
val =digitalRead(sensorPin);
Serial.println (val);
// when the sensor detects a signal above the threshold value, LED flashes
if (val==HIGH) {
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite(ledPin, LOW);
}
}

Step 4: Output

After uploading the code, you can clap next to the sensor. If the LED is not lighting up, you need to change the sensor sensitivity by rotating the potentiometer.



You can also adjust the sensitivity so that the LED follows the beat of a certain music.

Add more LEDs for a more spectacular effect!

Be the First to Share

    Recommendations

    • Trash to Treasure Contest

      Trash to Treasure Contest
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest

    Discussions