Building Sound Sensor Project


Sound Sensor Project

To gain more experience with building projects using sensors, I decided to build the music reactive LED circuit found on the instructables website.

This circuit uses a sound sensor which controls whether the LED flashes on or off - depending if music is playing or not.



Code written for this circuit

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                            
  if (sensorvalue == 1)                                        //then sensor would return the value as 1    
  {
    digitalWrite(led, HIGH);
  }
  
  else
  {
    digitalWrite(led, LOW);
  }
  
}

Bibliography & References 
[1] http://www.instructables.com/id/Music-Reactive-LED-Arduino-Sound-Sensor-Tutorial-i/

Comments

Popular posts from this blog

Unity Project 4: Ball platformer game

[Research] Traditional Poster Design (4CTA1214)