Music Reactive LED | Arduino-Sound Sensor Tutorial in 4 Easy Steps

3,199

19

1

Introduction: Music Reactive LED | Arduino-Sound Sensor Tutorial in 4 Easy Steps

About: MechStuff is a blog for people who want to learn about Arduino and various mechanical devices & other engineering marvels !

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: Requirements -

  1. Arduino board
  2. Breadboard
  3. Jumpers/single stranded wires
  4. LED
  5. Sound sensor
  6. A pizza slice to celebrate(optional) :P

Step 2: Connections :

Connections of Sound sensor -

  • VCC - 5V supply of Arduino
  • GND - GND of Arduino
  • D0 - Pin 3 on Arduino

Connections of LED -

  • Positive terminal - Pin 7 on Arduino (or any digital pin)
  • Negative terminal - GND of Arduino

Step 3: Code

int soundsensor = 3;<br>int led = 7;                // defining pin numbersvoid 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);
  }
  
}

Step 4: Only Thing to Take Care

The potentiometer on the sound sensor allows you to adjust sensitivity of the sensor. Changing sensitivity allows the LED to glow even at low sound levels & high sound levels.
High sensitivity will enable the sensor even to detect the smallest sounds. Turn the potentiometer clockwise to increase the sensitivity & anti-clockwise to decrease the sensitivity.

Thank you all for reading my instructable! I would be very glad if I could help you with any other tutorials. You can watch my other Arduino tutorials on my YouTube channel !
Also I have a Arduino tutorials section on my blog !

If you face any problems, do share it below in the comments section ! I'll get to them ASAP ! :D

Share

    Recommendations

    • Metalworking Contest

      Metalworking Contest
    • Creative Misuse Contest

      Creative Misuse Contest
    • Tiny Home Contest

      Tiny Home Contest

    Discussions

    Great project. Good luck in the First Time Authors contest.