Thanks for the reply cyclegadget,but in my case will be: (5V-3V) / 0.02A = 100 ohms?I used 1.1v as an example. If your leds drop 3volts, then yes 100 ohms is correct.and what is the reason for the 22k-ohm resistors connected to the transistors?is it correct? In this case, the transistor is an amplifier. The base requires a smaller current to control the collector to emitter circuit. The 22k-ohm resistor protects the base from over-current damage. http://en.wikipedia.org/wiki/Transistorthanks again
THANK YOU dc42,now it is more clear, so if I want for example to have a plan with 12 leds, for that I could use a transistor that supports 12x20mA = 240mA;then 2N2222A is ok for my experiece?http://www.datasheetcatalog.org/datasheet/philips/2N2222.pdf1. Collector current> 240mA2. Vce(sat) above the current I want to switch3. hfe > 50 4... ?is it correct?
And what is the best resistance for the ground?