Author Options:

arduino - sound controlled rgb leds Answered

hey guys,

i am modding my basement and i am using the following ible:


there is a link at the bottom that takes you to a website:


there is a schematic, and from other forums i am told that the irf9530 mofset has a rating of 12A
that means a total of 48A for the entire circuit as 12A for each channel r-g-b and the 4th UV, now is that safe for the entire circuit and is a pc power supply capable of delivering such amounts of current in a 12V format?

i am alo looking for leds that go with this project and found this store in ebay:


if you scroll down, what does the table tell about the leds? like the voltage and current required?

i am a complete noob at electronics but i am good at soldering and am willing to learn...i have a habit but don't know if its good or bad but until i know how something fundamentally works i cannot blindly accept its function so on that note, if anybody is also willing to explain the workings of the circuit please do so, any insight is greatly appreciated...

thankx for any help...

****************************************ABOVE METHOD SCRAPPED****************************

the above method is no longer possible since no one has the parts for the above schematic here in my city, so now i have resorted to arduino to save the day...

my idea is to have audio going into the arduino and analyzed to out put a "visualizer" in R-G-B channels. this then goes to a transistor which controls three chains in parallel of 1 watt leds. each chain as five 1 watt leds in series. each led is [voltage coming soon] and 350mA ... now i haven't ordered any parts yet, and not even the arduino but will tomorrow and so i need to know if this setup is going to work and i have seen others do it like this fellow:


this is exactly what i want to do but at a bigger scale. i don't know what type of transistor i will use but i have a handfull of 2n3772 and 2n3055 and 2n188a on me...

i know i am throwing out random components but i am still not giving up, even if it means missing newyears deadline...


I ordered 45 of the 1 watt leds (15 for each of R, G, B), an arduino, and 5 IRF540 Mosfets... now after discussing this and getting plenty of help on other forums i have been told and i know why it is so, that the mosfets i ordered has a gate-source voltage of +/- 20V and a gate-threshold voltage of 2.0V - 4.0V. the arduino can only output 5V with 40mA, so now i need a driver circuit for each mosfet...any ideas are welcome...

so any of the above transistors would work? i have a bunch of 2n3904 transistors on hand, so all i hae to do is use the same "schematic" but with different resistor values and instead of the BC337, i should use 2n3904... thankx...you are a life saver, i asked someone on another forum and they gave me this hugely complicated driver circuit to drive the mosfets...thankx

they might work. just try them C945 is a transistor i like to use everywhere (its like duct tape for some folks) cause it fits most needs and you have lots of them in every crt monitor or power supply you can find in the trash you may need to change the 10 K resistor between the arduino and the transistor base. about 1 K is ok for the ones with higher current capability and lower amplification (like C945)

nice to know that there is "duct tape" transistor out there, unfortunately i don't have access to any electronics shop right now and its christmas and i am still waiting for my order to come in...so ya, i am stuck with the 2n3904 transistor.

it is duct tape cause you can find it in huge amounts in trashed electronics and dont have to buy in its parameters its actually inferior to lots of other common transistors

i really don't have a lot of stuff to salvage since over the summer, we cleaned our house and recycled a lot of our electronics

yea i guess youre right (laying on the sleeping mat in a thin shirt)

yeah well, you are lucky, in 8 years, the snow never sticks to our roadsbut this year, the roads we travel on at 120 kph, is now a giant parking lot...even our trains are running slower (electric trains that are 100% powered by windmills).

ok, i scraped this schematic after going to the local electronics shop and coming back only to find out that they don't have the mega8-p controller and the mosfets...so i scraped this schematic and am going to order an arduino "2009". now i want to control a new set of leds which are going to be the 1 watt 350 mA leds. I don't know what the leds are rated at but i am assuming 3.4V? so if i have 15 leds in each R-G-B channel and the leds are in the following order:

|-5 leds in series-|
|-5 leds in series-|
|-5 leds in series-|

5 leds in series and having three of these strands in parallel, how much voltage and current is that? and if so, how and what type of transistor (i figured out that i need a NPN transistor) but to what specs i need them to be is what i don't know...

this setup should hopefully save me from being more that screwed by new years if all this works out...

thankx for your patience and all the help given...

the sum voltage of the leds in series should be less than the supply voltage

3.4 V fit 3 times in 12 V. therefore each string can be at most 3 leds (so there is enough voltage for all the leds) and you need 5 strings in parallel

there should be resistor in each series

there should be no wire connected in parallel to the leds (the |-----------------| part in the drawing)

if you use a fet look for the correct voltage (i see you done it right)

whenever you use fet or transistor check that it can stand the current of all the strings. the current of 1 series string is same as of 1 led

if you cannot get fet or transistor for high enough current you may want to use few of them together so each drives only one or some of the strings

so the 5V travels to the mofset and the mofset amplifies the signal to 12V and so many amps? so the 5V regulator will deliver power to the avr and there is a seperate 12V in for the leds...am i correct?

not exactly. the mosfet does not amplify the 5 V. it switches the 12 V high A (that it gets from the power supply) the way the 5 V low A line tells it to. it acts as a relay - switch in one circuit that is controlled by another circuit actually the control goes thru 2 levels. at level 1 (bc337 transistor) the 5 V low A controls 12 V a bit higher but still low A. at level 2 (mosfet) the 12 V low A controls 12 V high A if you use a computer power supply you can take 5 V directly from it (red wires) and not need the 7805 12 A at 12 V are 144 W. its 1000+ normal leds or 100+ higher power leds and overkill for a room. you are unlikely to have that amount of leds in the entire system. you may use the 12 A mosfets but it does not mean that you actually have 12 A current giving the mosfets a good heatsink never harms (and is essential at loads way lower than 12 A. maybe you need it allready at 1 A etc it depends on the mosfet) if you are going to exceed the current the power supply gives on the 12 V then power some leds from the more capable 5 V power output (begin with the red and then yellow rails) energy saving extra : i'd power the controller itself from 5 V standby (there is such output in the power supply) and let the controller control the green wire of the supply. this way the system goes to stand by automatically if all lights are off (and is ready to switch on again at any moment)

out of the specs you need forward voltage (3.4 V) and forward current (20 mA)

you enter them in online led calculator and it suggests you a way how to connect all the leds

if you have question on something i said above then ask it

also, how much do the leds get powered by in volts and amps?

the link i give above shows the power of most things in there

power of one led is voltage X current. example 3.4 V X 20 mA = 0.068 W

connect the leds as the link shows. then in what you made the 12 V labeled entry connects to the output of the mosfet. the untitled entry connects to earth

what if i want to join the leds in a parallel chain per channel (R-G-B)? would i have to put a resistor at each anode of the led or at the anode at the beginning of the chain?

for one channel its like follows. for each channel go the same way (led voltage and other stuff may vary so use the wizard again) use the wizard to design how to connect all the leds of one channel you get a block of leds and resistors with just 2 main wires. build it as the computer shows. if you connect it direcly to 12 V (or whatever volt you designed it for) it should work connect the main + wire of the block to the output of the mosfet and - wire to earth

the wizard is telling me to put the leds in a 5x20 array with 100 leds total and its showing the resistors at ground of each set of 5...is that right?

i did not get the same (3.4 V 20 mA leds 12 V mosfet) what are the forward voltage and forward current of your leds ? what voltage does the mosfet work at ?

led forward voltage of 1.9V and current of 20 mA, a hundred of those at 12V mosfet, i got an array of 5 leds in series with a resistor at the end and 20 of these sets in parallel...

then its ok btw the 'X leds + Y extra leds' options are usually better then the 'perfet' arrays. here you may want to still use the 5 X 20 cause the 6 led arrays need 11.4 V and its too close to 12 (some leds may not work if the voltage drops a bit due to the load)

thnkx, for the leds though r they all joined to the same ground?

the schematic from the german site? All it is is a microcontroller (think of it as a little box that you program that drives it's pins high (5 volts) or low (ground) depending on what you tell it to do in the code. The mosfets are just for amplifying the signal because the AVR (microcontroller) can't deliver enough current. The schematic up top is a simple 5 volts regulator (so you can hook up 12 volts and it'll regulate it down to 5 volts for the AVR.

get high power LEDs there are 1Watt ones available