Sound Reactive LED Strip

431,928

1,167

141

Introduction: Sound Reactive LED Strip

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

    Make it Glow Contest
  • First Time Author Contest

    First Time Author Contest
  • PCB Challenge

    PCB Challenge

141 Discussions

0
arduino700
arduino700

Question 5 months ago on Step 9

could anyone pls explain what is the LED rating? if it's greater than 5v how did u power it from the arduino...pls tell.
or if it's a 5v led strip then does the arduino power it from the Vin itself?

0
LukeF67
LukeF67

1 year ago

Is there a way to modify this system so that the lights are reactive to a specific range of sound frequencies to display a specific color.... lets say the sound frequency of a Ukulele A cord that gets the response of a flash of green color. Any other sound would be a flash of red color. Thanks for the help! This is really neat!

1
FabJ
FabJ

Question 1 year ago

How did you wire this so that the Arduino was able to provide power to the LED strip? Most common LED strips are 12V (I'm working with a 24V, non-RGB (the only connectors are positive and negative), LED strip and a Texas Instrument TM4C which also outputs a max of 3.3V or 5V). The simple schematic at the end of the instructions will work fine because a single LED (which is a diode) will work once the forward voltage is surpassed (i.e. if the LED has a forward voltage of 0.7V, the Vin needs to be >0.7V for the LED to illuminate; the more diodes you add in series, the greater the forward voltage: two LEDs in series will require Vin > 0.14V for both to illuminate). So it's evident by the other commenters that the wiring requires clarification, epsecially since you got it to work.

2
DrGee1961
DrGee1961

Question 1 year ago on Introduction

I think the description is a bit fuzzy (to say the least ;-)) about how to connect the LED strip. Most strips require 12V but the Arduino Uno only supplies max 5V. Can you elaborate? Thank you

0
hrishikeshck44
hrishikeshck44

Question 1 year ago

Will this work for an RGB LED strip?

0
aakhtar1
aakhtar1

Reply 4 years ago

like this?

schematics.PNG
0
ArashG4
ArashG4

Reply 4 years ago

Late response but thanks man this helps a lot!

0
IainP6
IainP6

Reply 1 year ago

New to this stuff, can you tell me specs for the transistors? Thanks

0
RobH194
RobH194

Question 2 years 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.

0
C.R.C3
C.R.C3

Answer 2 years 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
C.R.C3
C.R.C3

Answer 2 years 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

1
BruceJ15
BruceJ15

4 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.

0
C.R.C3
C.R.C3

Reply 2 years 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
VincentV58
VincentV58

Reply 4 years ago

Off the top of my head:

- Use external 12V supply for strip.

- Use relay to control external supply.

0
sklaujb
sklaujb

Reply 3 years ago

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

0
RobH194
RobH194

Reply 2 years ago

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

0
Schwartzy26
Schwartzy26

Reply 3 years 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.