Powering LED's
shanebaty
Posts: 30
Okay I am new to this, sorry if this is not the right place. A basic stamp is used in this project, so this is the first place I thought to ask.
I am working on a project that has 216 LED's. I am using the basic stamp to control them to make designs. My plan is to use a transistor to power 9 LED's at a time, and 3 transistors to one IO pin on the stamp. So 1 pin turns on 3 transistors which turn on 9 LED's. So 27 LED's total to 1 IO pin.
My Question is, would the 2N3904 NPN Transistor be able to handle the current from 9 LED's? I just wanted to hear a second opinion before I started Burning up transistors.
Thank You :-)
I am working on a project that has 216 LED's. I am using the basic stamp to control them to make designs. My plan is to use a transistor to power 9 LED's at a time, and 3 transistors to one IO pin on the stamp. So 1 pin turns on 3 transistors which turn on 9 LED's. So 27 LED's total to 1 IO pin.
My Question is, would the 2N3904 NPN Transistor be able to handle the current from 9 LED's? I just wanted to hear a second opinion before I started Burning up transistors.
Thank You :-)
Comments
Assume you completely turn the transistor on (saturate it - provide enough base current so it's completely on - see here).
You didn't say how much current your LEDs take - assume 20mA each (for a standard LED - find the datasheet for your LEDs)
Look up the datasheet for your 2N3904 transistors (here). You want to know the maximum collector current (200mA for Fairchild's).
There's still the question of heat dissipation. A transistor isn't a perfect switch. There's still a voltage drop across it even when saturated. Usually this is 0.3V. At 200mA, this is a power loss of 200mA x 0.3V = 600mW. You'll have to look at the ambient temperature and how the transistor is mounted to figure out whether it can get rid of that amount of heat continuously.
Then there's the question of maintaining saturation. You'll have to look at the gain (hFE) curves for the transistor to see how much base current is needed to put the transistor into saturation at 200mA collector current. This usually varies widely from transistor to transistor, so you have to use the minimum gain for a "worst case" situation. They don't give the values you need directly, but it looks like around 100, so you'd need at least 2mA base current, maybe 5mA to play it safe. If this isn't enough, the transistor will get hotter faster. The base resistor sets the amount of base current.
If you want to drive 3 transistors, you'll need 3x that amount of current from the Stamp pin. You look at the Microchip 16F57 datasheet because that's the microprocessor used in the BS2 (here - page 57). There are current limits for each individual I/O pin, for groups of 8, and for the whole device.
You are going to need a fairly healthy supply as well: 4.3A @ 20mA / LED plus losses due to heat and your more than 6A probably.
You were right. They are 20mA each, i forgot to put that in the first post. I wasn't planning on having 20mA of current for them, 7mA is at about the lowest brightness I need. So if i have 5v and put around a 700ohm resistor in series with each LED , then i should get at about the 7mA that i want. Is that correct? So then would i would just be using around 63mA per transistor?
And i looked at the data sheet but its been a while since i have looked at those graphs so I am still a little confused about them. Am i supposed to be looking at the " Base Emitter Voltage vs Collector current"?
Rseries = (Vin - Vf - 0.3V) / 7mA
Where Vin is the voltage applied across the LED / resistor / transistor string.
Vf is the forward voltage of the LED (or the total of several in series)
The 0.3V is the presumed saturation voltage of the transistor.
For 3 red LEDs in series with a 6V Vin, you'd have R = (6 - 3x1.7 - 0.3)/0.007 = 0.6/0.007 = 84 Ohms
You'd usually pick the next highest standard value like 91. You could also use 82 Ohms with a slight increase in current.
and as far as the colors, that is the reason i was going to have 3 transistors per pin. one transistor for red another for blue and a third for green
You can use a red, a green, and a blue in series for 1.7V + 2.1V + 3.3V = 7.1V and run the strings off a 7.5V R/C battery with an appropriate resistor. You could also use a 9V battery pack. Don't use a 9V radio battery. They don't store enough energy for significant use.
You put the strings in parallel, driven by one transistor. Each string of LEDs (plus its resistor) should work off the same voltage so you can put them in parallel.
You might want to keep the LEDs together that have the same color with each I/O pin controlling a different color. That way you can change the color of the display by switching one or combinations of colors on and off.