Jan said:
I have several LEDs that use the same voltage, they will be on and off
at different times, so the current usage will not be the same, can they
still share a resistor, when they are in parallel to the resistor ?
Also can a transistor be used to switch a lower voltage than the control?
If not would a simple resistor before the base (green line) help ?
I have a drawing of my idea
http://codebin.dk/stuff/resistor_transistor_basics.jpg
The 100R matches 0.02A (each led) with a 2V drop from supply to the LED.
If you turn on more than 1 led at the same time, how they
divide the current through the series resistor is a bit
undefined, depending on how well they and their switch
match. but even with good matching, having two on at the
same time, they will be dimmer than when only one is on. I
would give each its own current limiting resistor unless I
was sure that only one would be on at a time.
Transistors take at least a diode drop (about .6 to .7 volts
base to emitter to switch on. The collector to emitter
voltage is fairly independent of the turn on process.
I think I would put the three NPN transistors in the ground
side of the LED circuits, emitter to ground, collector to
LED, with a separate resistor between each LED and the +5
supply. Is the transistor control signal also a +5 or
ground voltage? If so, a base resistor of about 4.7k would
be about right to control the base current to about 1/20th
of the collector current. That should be enough to turn the
transistors on to less than a diode drop, collector to emitter.
This assumes that the control signal is positive when you
want the LED to be on.
You could also drive the LEDs with the transistor acting as
a voltage follower (that copies the control voltage except
for a diode drop in the signal) with the base connected
directly to the control voltage, the collector to +5 and the
emitter to the resistor and LED in series to ground. The
saves 3 base resistors, but wastes a good fraction of a volt
more across the transistor, so you may need to lower the LED
resistor a bit to compensate.