Fading a bank of LED's

So for the current project I'm working on, I need to use the arduino to fade in a bank (~20) of parallel LED's. Obviously this is more current than the arduino itself can source, so I need to have the Arduino controlling a transistor that controls the LED's (which are being powered by an outside source).

My question - it seems to me that the PWM used to fade a single LED will no longer work when applied to LED's controlled by a transistor, because the transistor will just be rapidly pulled high and not create a fade...

Does anyone have any help on how I might circumvent this?

(Or am I wrong, and can PWM be used to fade a transistor?)

Quick google searching on how to fade an LED without using PWM brings up this circuit:


Which I suppose could be made work using digital outputs alone... But I would like to avoid as much extraneous circuit building as possible.

So If anyone has any ideas on how to make it happen in a simpler fashion- I would love to hear them.

I have used PWM to control the speed of a DC motor controlled through a transistor without any problems, so it should be possible.

Beautiful. I'll give it a shot. Do you know what type of transistor you were using, by any chance?

PWM will work fine through a transistor. Even the cheapest transistor can switch on and off in microseconds.

Try this schematic:


If uyou use a TIP102 with a small heatsink, you can easily control 50 leds drawing 20ma each.


I was using a TIP120, but you are probably better of following Daniels advice and use a TIP1023 wit a heat sink

Where would the TIP1023 go? Would it replace the 2n2222 in the diagram?

See how PWM works:-

Would it replace the 2n2222 in the diagram?