Here's a link to the wiring schematic that was removed
In this Instructable, I'll show you how to sync LEDs to music. I know this have been done before multiple times but this time I'll try to do it as clear and easy as possible. My camera is bad so please bare with me.
I've also made a video tutorial!
Remove these ads by
Signing UpStep 1: What you need
Parts:
9 volt battery
9 volt battery clip
*TIP31 (Or other NPN transistor)
*2 LEDs
*220 ohm resistor
wire
audio cable or old headphones
Additional:
If you have a breadboard you only need:
a knife or scissors
(optional) 3 alligator clips
If you want to make it permanent you'll need:
Soldering iron and solder
on/off switch
(optional) project enclosure




































Visit Our Store »
Go Pro Today »




http://www.youtube.com/watch?v=VsuG48KyaKI
2. or do i have to wire them in parallel?
3. i am using a computer power supply.
Depending on the voltage the transistor(s) might get hot, look into using a heatsink if this is the case. Make sure the mA wont fry the LEDs, make sure to use proper resistors for your circut. You wire them in series, as I do in the instructable but with more than two LEDs. (Per channel if you're planning on a stereo setup)
Does it blink faintly in rhythm, or just glow faintly? If the latter is the case you might have a short or an improper grounding.
I used 4 LED's on a 9v with a 220 (not 220 thousand) resistance.
I think that's your problem right there. I have no idea what battery you are using that gives out 4.8 volts though, would need some more information if I were to help you out here.
Try to use this http://led.linear1.org/led.wiz to find proper resistance values for your build. Enter one channel at a time.
Still impressive though for the low component count, I did something similar for my college project using RGB LEDs which is here: http://www.youtube.com/watch?v=rWAARGyPp5Q
Basically there is an electret microphone and a preamp like this:
http://www.qsl.net/va3iul/Homebrew_RF_Circuit_Design_Ideas/Microphone_Preamp_Electret.gif
The output of which then goes to 3 passive RC filters at 117Hz (bass), 1170Hz (med) and 4650Hz (high), then the output of the filters is smoothed using a fairly large capacitor, to give a slow fade as the volume of the 3 frequency components changed. If you miss out the smoothing caps it quickly gives you a headache as the flashing is too fast.
The 3 smoothed values then go into 3 analogue ports of a microcontroller (PIC 16F74 running @ 4MHz), and it uses pulse width modulation to control the brightness, according to the corresponding analogue value. 2 were implemented via the CCP modules and the other is bit-bashed. If I was going to make it again I would use the 16F737 as it has 3 CCPs on it, makes it much easier and frees up your software to do other things in the background if you want to make it a bit more intelligent.
The circuit is very experimental, and you would need a decent knowledge of assembler code to get it working. If you feel like giving it a go I can send you a copy of the .asm file, its all commented to explain how it works. It is only a couple of pages of code though so nothing too complex.
Also where can you get the passive RC filters?
I posted below that I found a great site that helped me with filter design, its here: http://www.electronics-tutorials.ws/filter/filter_4.html
The RC filters are easy enough to make, as long as you get your calculations right you cant go wrong really. Just find a decent component supplier, or buy a resistor/capacitor kit from ebay (under £5 generally) and you'll have almost limitless combinations of filters you can make.
with the at being the symbol, and no spaces of course.
So the filters have no coding involved... and the microcontroller makes the light flash based on how its coded? This seems a little over my head right now haha, but certainly cool.
But I agree its far from ideal, and red is still the dominant colour. If I had the time I would have made changes to offset the red PWM value down a bit, increase the blue quite a lot, and increase the green a bit. Also the frequency response of my filters is poor, as they have a much wider range than I wanted.
Another idea would to have the LEDs cycle through the colours...mabey...
The only problem with this is that it wakes everyone up when I get up!
But seriously that sounds really good,how long did it take and what programing language did you use?
I used assembler and a PIC16F74. I can provide you with the .asm file if you like, though I have to say my annotation of it is a bit messy.
But mabey a project for the future...
http://www.electronics-tutorials.ws/filter/filter_4.html
Theyre really simple to get working. Your bass wants to be around 100Hz and treble above 3kHz.
However, open that image and replace the last string in the URL saying "SMALL" or "MEDIUM" with "LARGE" to see a much clearer version. ;)
Btw how do we change the capacitor value? or how do we determine it?
C = 1 / (2 * Pi * f * R)
Therefore if your frequency was 100Hz like in the example, and your resistor was 1000 Ohms, then you'd do 1 / (2 * Pi * 100 * 1000) = 1 / 628318 = 1.59E-6
This means 1.59 with the decimal point shifted 6 places to the left, or 0.00000159 Farads, which is near enough 1.6 microfarads. Hope this clears it up a bit as it can be quite confusing!
To try and simplify it a bit:
So say you had your 3kHz filter, you might get anything from 2kHz to 4kHz coming through it, so things like guitars and violins etc will be passed through it and come out the other side, but bass guitars and really high frequency things like whistles may not be. Basically anything coming through it decreases in loudness the further from that 3kHz it is, it will still be there at even 5 or 6kHz, but many times lower voltage/quieter.
You can probably feed that signal straight into a transistor and you should see if you have your bass LED and your treble LED next to eachother there should be a difference in brightness as you step up through the frequencies.
I tried to upload an mp3 file I made that goes through all the frequencies slowly but it seems all the upload sites are blocked at work! I will try it later from home if I get chance...
They're quite small though, depends on your soldering skill level as they're surface mount parts (have no connecting wires, you have to place them flat to the board, tweezers help!). To be honest though its for the bass side anyway so you'll probably get away with anything between 1uF and 2uF.
Just get the components that are fairly close to the values specified, but aren't hard to find. Like if you had calculated a 630 Ohm resistor for a design, in most cases a 680 Ohm would do the job as this is the closest commonly manufactured value - search for 'E12 series' to find out what values are available.
http://www.instructables.com/files/deriv/FLY/8U5P/G145S9RT/FLY8U5PG145S9RT.LARGE.jpg