# Creating an Audio-Reactive LED Circuit

66,189

80

17

## Introduction: Creating an Audio-Reactive LED Circuit

These instructions will help you learn how to construct an audio-reactive LED circuit.  Familiarity with electronics and soldering is strongly recommended  Barring any circuit errors, the task should take no more than an hour. This circuit can easily be expanded and integrated into other projects to create visually impressive effects.

## Step 1: Safety Precautions

Caution should always be exercised when working with electric currents.  Currents can cause burns or damage to vital organs.  Currents as small as 10 mA can be damaging or even fatal.  Power sources should be disconnected when modifying a circuit, and remember to always use common sense when working with electronics.

## Step 2: Materials Needed

-9 Volt Battery (or a lab power supply)
-9 Volt Battery Connector (if using a battery)
-An Audio Splitter
-An MP3 Player (or computer)
-1 or more LEDs of any color
-1 NPN Transistor (this guide uses the 2N3904)
-1 100-400 ohm resistor
-An audio Y Cable
-A few alligator clips
-Jumper wires

## Step 3: Calculating Resistor Values

Pictured above is a chart detailing how to read a resistor value from color coding information.  The formula to calculate the resistor value needed to power a single LED is:
resistance(R) = (power supply voltage - LED voltage drop) / LED current

The typical recommended LED current is 20mA, our power supply voltage is 9V, and the LED voltage drop for a clear blue LED is 3.0V.  This results in:
(9-3)/0.020=300 ohm
Of course this doesn't need to be exact, a 330 ohm resistor will work fine here.  If we plug 330 ohm back into our formula we get
(power supply voltage - LED voltage drop) / resistance (R) = LED current
(9-3)/330 = 18 mA

18 mA is a good value to power our LED.  If the current is too low, the LED will be dimly lit, and if the current is too high, the LED will become very bright and may explode.

## Step 4: Powering the Breadboard

1) Strip off a small amount of the wire insulation from the 9V battery connector
2) Insert the wires into the respective positive and negative rails of the breadboard
-Red: Positive
-Black: Negative

## Step 5: Powering the LED

To Ensure that our LED and resistor are working, we will send power to it.  Notice that one of the LED legs is shorter than the other — the shorter leg is the negative end, and the longer leg is positive.
1) Insert the negative end of the LED into the negative rail, and the positive end into an adjacent hole.
2) Insert the 330 ohm resistor in series with the LED, connecting the positive leg to Vcc (9 Volts).

The LED should be illuminated.  If not, check the orientation of the LED and that all connections are inserted into the breadboard fully.

## Step 6: Adding the Transistor

Next we will add the NPN transistor, giving us control over when the LED turns on and off.  A NPN transistor is a current controlled switch, meaning that a small current flowing into the base will result in current flow from the collector to the emitter.  We will use the audio signal to allow current to flow through the LED, illuminating it. (For a more in-depth explanation of NPN Bipolar Junction Transistors see the following: http://www.electronics-tutorials.ws/transistor/tran_2.html)
1) Insert the NPN transistor into the breadboard so that the 3 different pins are in separate columns.
2) Using a jumper wire, connect the emitter pin to ground.
3) Reorient the LED so that the negative leg is connected to the collector pin.
4) Connect a jumper wire to the base pin. (we will use this for our audio signal later)
Now our switch is almost ready, but the LED will not turn on yet, because we haven't connected anything to the base.

## Step 7: Connecting the Audio Y Cable

We will now connect the Y Cable to the breadboard setup.  For this step, temporarily unplug the battery from the connector.  Looking at the Y Cable, there is a stereo input (standard 3.5 mm headphone jack), and RCA left and right output.  The pin protruding from each connector carries the signal (the positive element), and the outer jacket is ground.  To ensure we get the signal from both left and right channels, we will be using both outputs.
1) Connect an alligator clip to each of the RCA pins.
2) Connect one alligator clip to the ground sheath on one of the channels. (IMPORTANT: ensure that the clips do not touch)
3) Connect the other ends of the two signal-carrying alligator clips to the base pin of the transistor.
4) Connect the other end of the ground alligator clip to a jumper wire inserted in the ground rail of the breadboard.

Now our circuit is almost complete.  We are done with the breadboard, so go ahead and plug the battery in again.

## Step 8: Seeing the Flashing LED

Now we will connect all our cables together to both see and hear the result.
1) Connect the audio jack end of the Y Cable to one of the audio splitter inputs.
2) Connect the headphones or speakers to the other audio splitter input.
3) Connect the other end of the audio splitter to the MP3 player or computer.

## Step 9: Enjoying the Result

1) Ensure that the volume on the device is turned all the way up.
2) Ensure that the battery is connected.
3) Start the music and enjoy the show!

## Step 10: Additional Modifications

This design is very extensible.  Some additional ideas include:
-Filtering out treble, bass, and band frequencies and blinking different colored LEDs
-Separating out the left and right channel to control different LEDs
-Changing the input to be driven by a microphone
-Inserting the circuit into a set of speakers.

In the above video you can clearly see that the quieter tones aren't picked up very well if at all by the circuit,  this issue could be alleviated by using an operational amplifier to amplify the signal.  Unfortunately, this would require either a dual supply or a rail-splitter, both of which are beyond the scope of this tutorial.  If you are interested in reading about amplifiers, have a look here: http://en.wikipedia.org/wiki/Operational_amplifier_applications#Inverting_amplifier

Below is an example of a similar circuit I made that makes use of  high-pass and low-pass filters to separate out the treble and bass signals.  To achieve ideal results in a filtered circuit, it is recommended that an amplifier be implemented.  For more information about filters, have a look at these pages:
http://en.wikipedia.org/wiki/High-pass_filter#First-order_continuous-time_implementation
http://en.wikipedia.org/wiki/Low-pass_filter#Passive_electronic_realization

## Recommendations

16 3.1K
73 6.1K
23 3.0K
104 15K

• ### Lamps Challenge

After all of the detailed explanations no simple circuit diagram? Would be nice in the future.

Please upload a instructable for the above circuit. I mean for the filtered one that has different LEDs for BASS and TREBLE. It will of great help. I couldn't understand your schematic. Please ...!!!

Filters are made from a combination of capacitors, inductors, and resistors. Generally Capacitors and resistors are used over inductors and resistors. A high pass filter is a capacitor in series with a resistor and a low pass is a resistor is series with a capacitor. Your "cut off frequency" fc = 1/(2*pi*R*C). So low pass filters attenuate or cause signal loss for signals lower than the cut off frequency. A high pass filter would be the opposite.

To use separate lights for bass and treble you would need a low pass filter and high pass filter. You would build this circuit twice, hook one to the low pass filter and the other one to the high pass filter.

You can probably find the filters by ripping them out of some old speaker boxes

A plain, straightforward schematic would "be nice".

This is "plain" schematic - I don't know if it is the straight-forward thing your looking for. It makes sense to me, but I have a good bit of electronics knowledge.

You can totally use a op-amp to amplify the signals. Rather than say using a +12 and -12V rail, some operational amplifiers can be ran in a "single supply" configuration. where rather than having a -12V "rail" it is just a ground. It makes your range only 0 to whatever you decided to put your positive rail to be (there are limitations depending on the device you choose).

Now for an audio analog signal - that will have a negative phase, you can easily work around this by implementing a DC offset voltage. Then after the amplification you can implement a "coupling capacitor" to remove the DC offset produced. It is a common thing that is done when designing operational amplifiers out of discrete and active components.

Help me understand why my LED lights up bright as soon as the audio cable is connected but not yet provided audio signal, and then nothing changes when I do provide sound. (I'm using a 1/4 inch jack for audio input, connecting the ring to ground and tip to base of transistor)

get 1 LED to work with the input, then start plugging in the other LEDS, you'll get it, I am sure of it..make sure of all the polarities are correct..

You put the transistor backwards, flip it around.

Also make sure you are using an NPN transistor, and not a PNP.

Check to make sure your audio signal wire is connected to the NPN's base and that the ground is connected to the NPN's emitter.

Is there any significant latency between the audio signal and the triggering of the light? I'm creating this to demonstrate listener-relative sound delay over distance in the context of teaching marching band. I'd like to make sure I know if there's any latency introduced at the point of this setup. Many thanks!

Would love to see the instructable for the filtered circuit also. Also the one for the newest version which has another string of LED's for the midband frequency range.

Nice work and your guides are very easy to follow.