The common emitter circuit I suggested earlier: (View using a fixed-pitch font)
. V+ . | . [R2] . | . [LED] . | . C .Von--[R1]--B NPN . Q1 E . | . GND
Allows you to use a voltage way below V+ for the PWM control (Von) you want to implement, with absolutely no speed penalty, and by choosing R1 properly allows you to make beta variations in various Q1's irrelevant.
For example, if you were to use a 12V LED supply and an LED string of
4 LEDs with a drop of 2.2V per LED with a current of 20mA through the string, the circuit would look something like this: 9.1V / .+12V>--[R2]---+ . |A . [LED] . | . [LED] . | . [LED] . | . [LED] . |K . +-- ----------+With Q1's Vce(sat) equal to about 0.3V and the drop across the string equal to about 8.8V, what's left for R2 to drop is about 3.3V.
With 20mA through the string the value of R2 would be:
12V - 9V R2 = ---------- = 150 ohms. 0.02AWith 20 mA through it, a 2N3904 will have an inherent beta of over
100,:but for our purposes, if we drive the base with 10% of the collector current we'll force the circuit to have a beta of 10, no matter what, which will get rid of any of the issues surrounding "suicide" biasing. Assuming Von is a logic level which varies from 0V to 5V, and that Q1 has a Vbe(sat) of 0.9V with an Ic of 20mA, then R1 has to drop 4.1V with 2mA through it, which comes out to 2050 ohms.
2000 ohms is a standard 5% value, and would be fine for R1.For R2, 150 ohms is a standard value, and with 20mA through it it would dissipate:
P = I²R = 0.02A² * 150R = 60 milliwatts,
so if you're using thru-hole parts a 1/4 watt package would be fine; likewise for R1.