Introduction: Sound Reactive LED Strip

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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!

Picture of 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:

Comments

lalthanpuia (author)2017-10-12

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

manojkumar999 (author)2017-10-12

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

jekob (author)2016-07-10

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

MattT36 (author)jekob2016-11-16

Hey I am new and wanting to do a rgb setup also, Why did you set up the rgb with a relay?

kbagla (author)MattT362017-08-04

Probably because his strip needed 12v to operate and the arduino can only supply 5V and there is current limits too on the Arduino.

Noro13 (author)2017-02-22

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

kbagla (author)Noro132017-08-04

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.

sklaujb (author)2017-03-03

What voltage of LED strip is appropriate for connecting direct to the board as shown in this tutorial? I guess 12V is too high.........

kbagla (author)sklaujb2017-08-04

Anything <= 5V

realpigywigy made it! (author)2017-03-15

Hey this was a great instructable! Esp for a first time arduino user! The one problem I has was having is that the LED strip became significantly less bright running through the arduino. I got a friend to help and it was a pretty easy fix with a transistor...you must all know this but for other first timers apparently there's less risk of frying the arduino doing it with a transistor as well.

Because of this I had to reverse the "0" and "255" values in the original code provided in this instructable to look like this:

#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, 0);
delay(10);
}
else{

analogWrite(LEDstrip,255);
}
}

If you don't swap those two the LED strip is OFF unless it's picking up sound. Swapping them makes them ON unless picking up sound.

I've attached a couple images of the way I ended up setting it up.

Hope this helps some people and thank you for posting this in the first place!

NickJ32 (author)realpigywigy2017-05-26

The reason you had to swap the numbers is because of the transistor type you used.

https://youtu.be/JScZd7AAJwI?list=PLR9GEQzfbv3-uPfRodyRNzR_vOtH4N7Gv&t=186 The guy in that video gives a quick comparison of the difference.

agh717 (author)2017-04-26

Would the sensor you used be strong enough for music at a concert if I made it mobile?

tnbhatia (author)2017-04-02

So I had a question, I got one of the sound sensing microphones from Keyes and well one of my questions was I'm trying to make a sound activated led strip but every time the sound sensor senses sound, the led starts blinking and I just wanted to know if there was any way I could get it to fade instead of blinking. This is for an architectural project and I really want to figure this one out.

My code goes like

if (sensorvalue >= threshold) {

digitalWrite(3, HIGH);

}

else {

digitalWrite(3, LOW);

}

Its set to only be on when threshold is met and off when threshold is not met. but what I want it to do is fade and get brighter when sound is on and fade out slowly once the sound goes off instead of just switching off.

Please help, it ll be much appreciated.

BruceJ15 (author)2016-04-21

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.

Schwartzy26 (author)BruceJ152017-03-14

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.

VincentV58 (author)BruceJ152016-10-12

Off the top of my head:

- Use external 12V supply for strip.

- Use relay to control external supply.

sklaujb (author)VincentV582017-03-03

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

kajensen15 (author)2017-03-09

i forgot to mention that my pixle strip has three in stead of two so how do i connect it

kajensen15 (author)2017-02-21

i love it but i have a programmable pixel strip could i have some help with this

GemmaL10 (author)2017-02-14

Hi I'm trying to make a similar idea using a neopixel ring, but I would like the LEDs to fade on and off in a much more subtle way responding to the music, with the idea that it would be relaxing to watch! Would this circuit be a good start? Any tips would be appreciated, thanks!

JeffO123 (author)2015-06-13

Hello,
Great tutorial.
I am trying to make it, but my led strip won't go on. Everything is hooked up right, but the led strip doesn't light up.
What could be the problem? I hope that anyone can help me out.

kajensen15 (author)JeffO1232017-02-11

have you tried in stalling the pixle strip

aakhtar1 (author)JeffO1232016-01-27

is the voltage right? plus double check everything and try to do exactly as it is in the steps if its your first time.

The Litan (author)2016-10-16

I try to get 2 type output from my one arduino uno. I upload 2 types sketch, but i can't able....so anyone is help me out....from this

GarethZiggy (author)2016-10-12

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 someone can help me please? I have the RGB led strip and understand I need Transistors. Please can someone show me how to wire everything up to the breadboard? Thanks!

MalekT2 (author)2016-09-29

Works great! gonna be throwing so many parties now lol

porpoisepower69 (author)2016-07-12

Hello! I am making a cyberman helmet so that when I speak the mouthlight comes on (3-4 neopixels) and when im donw it is off. Is this what that is? Thanks

Pedro_Morales made it! (author)2016-07-06

I made it with arduino pro mini, thanks!!! :3

sadiemaeolson (author)2016-06-06

so my led strip needs a minimum of 8 volts to light up how do i do that with my arduino? still using v in an pin 9. i want to change the code as little as possible. any suggestions?

use transistor to copy the signals from the arduino using a higher voltage source

SpecOpsTheLiC (author)2015-01-30

If I know there should be resistors....

Sorry, I mean Transistors.

aakhtar1 (author)SpecOpsTheLiC2016-01-27

like this?

ArashG4 (author)aakhtar12016-06-05

Late response but thanks man this helps a lot!

Whydoihave (author)2016-04-28

The LED strip has red and black wires coming out of both ends. I popped the one end into the breadboard like the simple single LED, but what do I do with the other end?

Whydoihave (author)Whydoihave2016-05-02

Other end doesn't need anything! It works now!

TunaB1 (author)2016-04-29

How to do this on Rasberry Pi2

Cooper1228 (author)2016-04-21

I want to use my pcs psu to power this. Would this need to be modified in any way to use a 12v supply? If so how?

cora.carmody made it! (author)2016-04-21

I did a very simple test, and included the suggestions from JensC to reverse the lighting effect, and to keep them on a dim setting. to test, I just blew softly - the dogs wouldn't bark on command. This is a lovely Instructable - easy, but teaches some very nice basics.

JensC made it! (author)2015-06-10

I made a very basic version of this. I didn't buy an LED strip because I wanted to test it out first. My best recommendation is to not cut corners. The sound sensor is not the same one that is used in the instructions. I found it on Amazon for about 8 dollars (plus it had Prime shipping and I was being impatient). While it technically *works*, the decibel threshold is set much higher than I would like, even with the most sensitive setting. This meant that it would not pick up ambient sound easily and it would only work effectively if I placed the sensor directly next to my speaker.

Otherwise, great project, especially if you're new to arduino. One thing I did was swap the LED brightness values (the analogWrite(LEDstrip, 255) portion of the code). As the author previously mentioned, 255 means "off" and 0 means "on". I wanted the lights to pulse when the sensor sent 1, so I had the "if" statement write 0 and the "else" statement write 255. I also lowered the "off" value to 250 so that the bulbs are always a bit dim, even if no music is playing.

Another thing you can play around with is the delay() value. This essentially will tell the bulb how many milliseconds it should remain off (or on depending on how you set the analogWrite() values). I lowered mine from 10 to 2 and noticed a very slight improvement on how it reacts to the music, however, 10 will probably be ideal in most cases.

Very cool project and great idea for parties! I will definitely have to pick up the better sensor and the LED light strip. I have a beer pong table that I would love to mount this under :-)

cora.carmody (author)JensC2016-04-21

excellent observations, very helpful to aid in launching off from the basics.

ZombieS2 made it! (author)2016-04-06

I used a RGB strip and needed transistors as well.

The code is

//hyperhitesh.hol.es

#define LEDstrip 6

#define LED2 5

void setup()

{

pinMode(8,INPUT);

pinMode(LEDstrip, OUTPUT);

pinMode(LED2, 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(8);

if (soundstate == 1) {

digitalWrite(LEDstrip, HIGH);

digitalWrite(LED2, LOW);

delay(100);

}

else{

digitalWrite(LEDstrip, LOW);

digitalWrite(LED2, HIGH);

delay(100);

}

}

LEDstrip is green

LED2 is blue. Just used 2 colours.

harr_ (author)ZombieS22016-04-11

What should the code look like if I am using a 5V arduino microphone (http://www.amazon.com/Adafruit-Electret-Microphone-Amplifier-Adjustable/dp/B00K9M6S1O?ie=UTF8&psc=1&redirect=true&ref_=oh_aui_detailpage_o03_s00) instead of a parallax sound impact sensor?

joaofrf (author)2016-03-04

Hello sir, I am a student who's attempting to make your project here, in school, and i would like to know what cables did u use to connect the sensor to the arduino, was it female/male right?

If you have a more explainned video that you could send me i would appreciate it alot!

Thank you, João.

tinkeringaway (author)2016-02-18

I love this! Do you know how one would connect the LED wireless. Ideally I wuold like to control something like this from my Phillips Hue controller.

aakhtar1 (author)2016-02-01

i have a sensor that has 4 pins, GND, +VE, AI , DI
and has a completely different pot
the problem now arises is that im unable to use it after a couple of runs :(

this was my first arduino project. perhaps arduino is not for me :'(

CliffK (author)2015-05-27

Can I use any of the cheap ebay sound sensors in the same way?

JensC (author)CliffK2015-06-10

As long as it has power, ground, and a signal/output pin, it should work. Be wary though... the same thought went through my head and I found one for 8 bucks on amazon (http://www.amazon.com/gp/product/B00AF2GB1U?psc=1&redirect=true&ref_=oh_aui_detailpage_o00_s00) and, while it works, it only is effective for extremely loud noises. I basically had to put the sensor right next to my speaker in order for it to work effectively. I would recommend just getting the sensor that is in the description and not cut corners.

aakhtar1 (author)JensC2016-01-27

what if i use an audio input jack instead of the sensor? will the circuit work?

GauravK58 (author)aakhtar12016-02-01

did it work?how do you connect the jack to the circuit?simply replace the sensor with it?i need to do this because i cant find the sensor anywhere

About This Instructable

320,860views

1,082favorites

License:

More by GraziCNU:Motion Activated LEDsSound Reactive LED StripTurning your Raspberry Pi into a personal web server
Add instructable to: