Sound Reactive LED Strip

367,424

1,114

136

THERE MAY BE 9 STEPS BUT I PROMISE THIS ONE IS QUICK AND EASY! 

In this Instructable I will be showing you how to create a light reactive LED system. In this clip, I used a single color LED strip, but you you can use a single LED, multiple LEDs wired together, single color or RGB LED strip, it just depends on what you are trying to build. The set up is fairly simple, the component list is fairly basic so if you are a tinkerer you should already have the majority of the materials laying around. If not, I will post links to the components I used so you can order parts and get to work! 

In the following link you will see the entire setup. Obviously you may arrange it anyway you would like, I just kept everything close and compact for the sake of an easy video. 

 

Step 1: Components

For this project you will need the following:


1) LED  ~$20 (with shipping) 
- For this project I used a solid blue LED strip which I purchased on amazon. These 5 meter SMD 5050 strips can run around $70 in retail stores so I though I would be taking a chance purchasing something priced under $20, but I was not disappointed in the least. I'm sure there are better quality lights out there, but if you plan on cutting these up and have no real game plan you wont feel any guilt putting these through the ringer.

2) Mini breadboard  $5

3) Arduino Uno  $30

4) Solid core wire  $2.50
- For anything involving breadboarding, do yourself a favor and stay away from any stranded wire. It will just end up getting frayed and hard to manage. Solid core is the way to go. I also like to choose at least two different colors for my wire to keep grounds and powers visibly separate. It makes troubleshooting and wiring easier in the long run when dealing with a lot of components.

5) USB A to B cable  $4
- This will be used to upload your Arduino LED code to the Arduino Uno board

6) Wire cutter/stripper $5
 
7) Parallax Sound Impact Sensor $10

8) Wall Adapter Power Supply - 9VDC 650mA $6

Total cost will be a bout $80 but keep in mind, all of these components are completely reusable. You can recycle them into a multitude of projects in the future so try not to worry about the cost. Think of it as building up your technical tool box :)

Step 2: Breadboard Basics

Breadboards are incredibly helpful when building circuits. They help you keep all of your components organized and laid out in a logical fashion. They also make it easy to confirm that the right wires are making the connections to the proper component leads. If you have never worked with a breadboard before, I'll explain the internal connection layout with the diagram above:

The on either side of the breadboard there are two columns, denoted by the blue and red highlights. These columns allow the user to have a common power and ground for components no matter where they are placed on the board. Whether your component is placed at A1 or J30, a common power and ground connection will only be a short distance away. All of the holes are connected vertically, so if you connected your ground (or power if you felt so inclined) to the left  or right most blue column, your common ground would extend from that column from position 1 all the way down to 30. However, the left and right sides are not connected, so If you wanted both blue columns grounded you would need to make two separate connections on either side. 

Rows A-E and F-J are where your components will be placed. This part of the board is also split between the left and right side about the center of the board. If a wire is placed in A1, that charge will carry through E1 and stop at the center divide. If a wire is placed in F1 that charge will carry through J1. You do not have to start out at position 1 every time either. If you place a connection at C1 for example, A1, B1, D1 and E1 would all have the same charge. 

TL; DR
The first two and last two blue and red columns share a connection vertically.
A-E share a connection horizontally
F-J share a connection horizontally
A-E connections and F-J connections are not bridged across the center.

Step 3: Parallax Sound Impact Sensor

The basic idea behind this component is that it picks up sounds that cross a certain decibel level. At the very top (opposite side of the pins) of the module is a microphone that listens for ambient sounds. This module has a dial (look for the blue and white) which allows the user to fine tune the sensitivity of the microphone, so that way you can have the microphone register very subtle quiet noises or you can decrease the sensitivity to the point where it only listens for louder than average sounds loud claps, shouts, etc. Play around with this dial and experiment with the sensitivity to get the your desired effect.
Once the microphone picks up a sound that is above the sensitivity threshold, the sensor sends a high (1) signal from the SIG line to whatever component you are trying to connect.

Step 4: Arduino and Pulse-Wave Modulation

An Arduino Uno is perfect for this project because it can handle the load of the LED strip, you can write multiple programs depending on what particular behavior you would like to see from your LEDs and besides the standard General Purpose Input/Output (GPIO) pins, it also has Pulse-Width Modulation (PWM) pins. PWM pins are great for powering components such as LEDs and electronic motors and although the pulse wave forms may look a bit jumpy (from the pulsating ons and offs) it actually allows you to control aspects such as brightness (when it comes to LEDs) and speed (when it comes to motors) in a very deliberate. smooth fashion, while efficiently utilizing your power. 

Here is a nice explanation of Pulse-Wave Modulation from the awesome people of MAKE (makezine.com)

Step 5: Arduino IDE

"The Arduino language is merely a set of C/C++ functions that can be called from your code. Your sketch undergoes minor changes (e.g. automatic generation of function prototypes) and then is passed directly to a C/C++ compiler (avr-g++). All standard C and C++ constructs supported by avr-g++ should work in Arduino." - Arduino support page

It is fairly straight forward and Arduino has a nice set of references and tutorials listed on their webpage: http://arduino.cc/en/Reference/HomePage

To begin programming your Arduino, you will need to download the Arduino IDE software: Click here

Once you have downloaded the IDE open up a blank document. 

 

Step 6: LED Arduino Code

Copy and paste the following code into the new project window:


#define LEDstrip 9


void setup()
{
  pinMode(7,INPUT); //SIG of the Parallax Sound Impact Sensor connected to Digital Pin 7
  pinMode(LEDstrip, OUTPUT);

}

//this function will make the LED dim once the Parallax Sound Impact Sensor sends a 1 signal, and then return to it’s original brightness.
void loop()
{
  boolean soundstate = digitalRead(7);
  if (soundstate == 1) {
         analogWrite(LEDstrip, 255);
         delay(10);
  }
  else{
  
    analogWrite(LEDstrip,0);
  }
}

Step 7: Compile and Upload Your Code

The check button is for the compiler. Click it and you should receive a message at the bottom of your screen saying that the code is done compiling. 

Once that has been verified, use the USB A to B cable to hook up your Arduino to your computer. Be sure you do not simultaneously powering the Arduino with the wall adapter power supply. You can end up frying the microcontroller if it is being powered by both sources simultaneously...I accidentally did this to an Arduino Mega before. 

Once the Arduino is connected to your computer navigate to Tools > Board to make sure you have the right model board selected. You may also want to navigate to Tools > Serial Port to be sure you have the proper port selected to send your information.

Hit the upload icon (looks like a right facing arrow) and it should upload in about 10 seconds. You should see a "Done Uploading." pormpt at the bottom of the window when this is complete.

Unplug your Arduino from your computer, it will save the information you just uploaded even when it is in an "off" state.

*the first figure shows the compilation steps and the second figure shows the upload steps

Step 8: Wiring

Now it is time to wire your project up! The following diagram shows all of the connections. These are the direct connections for the sake of simplicity, the number of wires on your actual project may vary since you will be using a breadboard and literally connecting wire to wire. 


*explanation
Parallax sound sensor:
GND > GND on Arduino
5V > 5V on Arduino
SIG > Digital Pin 7 on Arduino

LED:
Anode (+, long end) > Vin on Arduino
Cathode (-, short end) > PWM pin 9 on Arduino
*LED strips usually have two wires at one end, black (ground) and red (power), which makes things pretty easy to wire. 

Use your 9 volt wall adapter to power the Arduino (plug it into the black component on the lower left side of the Arduino) 

Step 9: Pick a Song!

Pick a song with some solid down beats and have some fun watching your LEDs dance to the music! 

Put them anywhere you think some ambient mood lighting is needed. For example, I placed mine behind my computer monitor:

6 People Made This Project!

Recommendations

  • Make it Glow Contest 2018

    Make it Glow Contest 2018
  • Plastics Contest

    Plastics Contest
  • Optics Contest

    Optics Contest

136 Discussions

0
None
RobH194

Question 9 months ago on Step 1

I have tried both a 5v 2.5 Amp and a 12v 3 Amp power supplies, and all that happens is the single red led lights up. I have played around with the setting on the sound card, but when music is playing the led doesn't react to it.

I have connected everything up as per the picture showing the connections, and there is no extra power to the board, only the 5v from the arduino.

3 more answers
0
None
C.R.C3RobH194

Answer 2 months ago

Ok. If you are powering the Arduino via power jack VIN will output a high V. Yry using a multimeter on VIN when using a power jack vs USB and note the difference in voltage. Anyway, when powered by the power jack, instead of using VIN try using the 3.3V and see if that helps.

0
None
C.R.C3RobH194

Answer 2 months ago

Try using a resistor in series with the LED or a different color LED. Most likely the power from the Arduino is over powering the LED

0
None
BruceJ15

2 years ago

Hi, I have a 12V LED strip and it has the two wires (positive/negative) however the LED will not light up when it is all powered up (as the arduino won't output that much power I believe) Can someone tell me what I need to do to fix this? everything else works perfectly. Many thanks.

5 replies
0
None
C.R.C3BruceJ15

Reply 2 months ago

You need to add a transistor and power the LED with its own power supply. Look in the "I Made It!" section above. I added a basic tutorial to do this. Good luck!

0
None
VincentV58BruceJ15

Reply 2 years ago

Off the top of my head:

- Use external 12V supply for strip.

- Use relay to control external supply.

0
None
sklaujbVincentV58

Reply 1 year ago

Any suggestion on a specific type of relay I can use on this? Thanks.

0
None
RobH194sklaujb

Reply 9 months ago

I have a 1000uF 16v capacitor across the red and black power leads

0
None
Schwartzy26BruceJ15

Reply 1 year ago

I am having the same problem, unless I connect the 9 pin to ground then the LED strip turns on. But when it is on the lights don't flash to the beat of the music.

0
None
LorieN5

Question 3 months ago on Introduction

New here:) May I ask how to make this for shirts??

0
None
priya8311

Question 6 months ago on Step 9

Hi there I'm really new to this, first time using a breadboard let alone an Arduino and I think I understand everything but would like to know if you have instructions with the breadboard. A bunch middle schoolers are trying this out for a school project. Also, is any soldering involved here?

0
None
NathanS257

9 months ago

I realize that this site is a great resource for DIY, and that is the sites intent, but in my research for sound reactive LEDs I came across the American DJ T44 Channel controller that has speed control too. Please correct me if I am wrong but my understandings is that it allows for 4 different lights, so it would seem that would also work, correct?

0
None
Noro13

1 year ago

How can I connect my RGB LED strip (128leds/2m) to that (has 4 wires instead of 2) ????

2 replies
0
None
kbaglaNoro13

Reply 1 year ago

Since the 3 wires are the positive leads of the Red, Green, Blue leds individually, you would have to rewrite the code or you could connect on the the 3 to the digital pin on the arduino but it then it would light up that specific color only.

0
None
MitchelJ5kbagla

Reply 11 months ago

what exactly do u have to change about the code

0
None
dinab1995

1 year ago

hey, I have a question: Can I use another sound sensor? like the one below:

https://www.sparkfun.com/products/12642

0
None
lalthanpuia

1 year ago

In my experience if you put the delay in the else part it works better and make the delay 100.

0
None
manojkumar999

1 year ago

can you please upload a picture with an led strip and connections made using the breadboard

0
None
jekob

2 years ago

good project man! i made it but with a relay because I have a rgb led strip
good project