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

14,788

31

5

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

First Time Author Contest 2018

Participated in the
First Time Author Contest 2018

Be the First to Share

    Recommendations

    • Microcontroller Contest

      Microcontroller Contest
    • Automation Contest

      Automation Contest
    • Make it Glow Contest

      Make it Glow Contest

    5 Comments

    0
    pjhvan.1107
    pjhvan.1107

    Question 6 months ago

    you have a design or layout of this project?

    0
    DheerajD15
    DheerajD15

    1 year ago

    You did not used resistor with led?

    0
    ElmarB2
    ElmarB2

    Question 2 years ago

    Can i add another set of led. And every beat the two set of light are alternately on/off?

    0
    DIY Hacks and How Tos

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