Intro: Blinking Leds to the Beat!
CAUTION! LED's BLINKING WITH THE MUSIC MAY GET YOU INSANE!
This instructable is about blinking some LED's according to the beat of any music!
The idea behind this process is really simple, and the circuit is really small.
The main concept is:
1-Low pass filter for the input signal
2-Amplify the voltage this resulting signal
3-Apply it to the base of a transistor!
2x 15K Ohms resistor
1x 10K Ohms resistor
2x 1K Ohm resistor
1x 100K Ohms potentiometer
1x 390 Ohms resistor
2x 100nF ceramic capacitor
1x Red led (power indicator)
1x Blue led (any color)
1x Male 3,5mm audio jack
1x Female 3,5mm audio jack
1x two position switch
1x 100K Ohms potentiometer
These optional itens are used to complement the circuit, where you can turn off the music blinking stuff and choose the led's brightness from 0-100%. It makes part of the board I designed, but its not totally necessary for a protoboard project!
Step 1: The Project
1 - The Filter:
Focusing on low frequencies (beats) I chose a Sallen–Key topology low pass active filter (Image 1).
The cut off frequency is given by "fo" (equation on Image 2). By testing some values, I found out that a cut off frequency of 100 Hz is good enough for electronic/rap music!
You may need to test some frequencies based on the kind of music you hear. You may also choose another kind of filter, let's say, a high pass, of band-pass, in order to blink the led according to your needs.
R1 = R2 = 15K Ohms
C1 = C2 = 100 nF
You may also see on the last picture a bode plot of the gain of filter I used, you can see a cut off frequency smaller than the calculated one, around 60 - 70 Hz! So make sure not believe only on the equations!
For the operational amplifiers, I used a LM358N.
2 - The gain:
Testing some output volumes of my notebook and measuring the voltage, I found out that a gain of 100 times would work for me. The voltages that I have on a low volume (around 15 mV rms) combined with a 100 times gain is enough to produce a output of 1.5V.
You may need to measure your own voltage levels and calculate the necessary gain to achieve a minimum voltage around 1 to 1,5V. It also depends on the transistor you are going to use, so you may need to change your gain based on it.
The gain is obtained with a simple non inverting voltage amplifier (Image 3), and it is calculated by "G" (equation on Image 4).
Rf = 100K Ohms Potentiometer
Rg = 1K Ohm
3 - The transistor:
For this project, I used a TIP 122 with a 1K Ohm base resistor according to the Image 5.
Step 2: The Circuit
Merging all the three circuits we had on the last step, and with an additional control of led brightness (it's called dimmer, and it is separate of the blinking stuff) we have the following project!
I have attached the layout of the board.
Note that S1 refers to the switch between the center pad and the two others of each side.
- When the switch is to the left, Pot 2 will control the voltage applied to the resistor connected to the base of the transistor, allowing you to control the brightness of the leds from 0% to 100%.
- When the switch if to the right, Pot 1 will let you control the gain of the audio signal applied to the resistor connected to the base of the transistor.
Step 3: Soldering
This step is just used to show you some pictures of the assembly!
-Never forget to use a thin layer of thermal paste to transfer the heat to the heatsink!
Step 4: Test It!
And that's it, here's the final result and a little stop motion of the components soldering.
I hope you enjoy this circuit, and remember to like the video and comment here if you have any doubt! =D