Introduction: Music Reactive Led Using Arduino || Sound Sensor Tutorial

Hello reader ! You've come to the right place. Its incredibly easy & I bet it won't take more than 5 minutes ! Alright, lets get started

Step 1: Components Needed

Arduino UNO

Breadboard

wires

LED

Sound sensor

Step 2: Circuit Diagram / Connections

sensor connections

VCC -5V

GND-GND

D0- PIN3

LED:

POSTIVE -PIN7

NEGATIVE -GND

Step 3: CODE

int soundsensor = 3;

int led = 7; // defining pin numbers

void setup()

{ pinMode (soundsensor, INPUT);

pinMode (led, OUTPUT);

}

void loop()

{ int sensorvalue = digitalRead (soundsensor);//if the sound intensity is higher than threshold which is set by us, //then sensor would return the value as 1

if (sensorvalue == 1)

{ digitalWrite(led, HIGH); }

else { digitalWrite(led, LOW); } }