Music Reactive Led Using Arduino || Sound Sensor Tutorial
by rayankiwan63 in Circuits > Arduino
206 Views, 1 Favorites, 0 Comments
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
Components Needed
Arduino UNO
Breadboard
wires
LED
Sound sensor
Circuit Diagram / Connections
sensor connections
VCC -5V
GND-GND
D0- PIN3
LED:
POSTIVE -PIN7
NEGATIVE -GND
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); } }