Confirm transistor math

Thread Starter

jappy

Joined Nov 28, 2008
13
Hey All,
I am trying to finish up on a Christmas project and I need some one to verify my transistor math. My goal is to determine if the NPN Transistor 2N2222A is correct and the appropriate base resistor. Here are the specs:

-Shift Register: DIP-16, SN74HC595NE4, Spec Sheet, Input Voltage 5v, Max Ic Current (of one pin) 20mA(?)

-NPN Transistor: 2N2222A, Spec Sheet, Ic max = 800mA, hFE specs:
hFE (Ic = 10mA, Vce 10v) = 75
hFE (Ic = 150mA, Vce 10v) = 100
hFE (Ic = 500mA, Vce 10v) = 40

-Red LED; Foward Voltage = 2v, Foward current = 30mA with a 150 ohm resistor.

Here is the schmatic:


Here is my math (formulas used from this site):
Rich (BB code):
load current Ic =       supply voltage Vs     
                             load resistance RL

hFE(min)  >   5 ×         load current Ic       
                               max. IC current

Rb =           Vc × hFE                where Vc = IC supply voltage         
                 5 × Ic           (in a simple circuit with one supply this is Vs) 
_______________________________________________________

.02 A or 20mA Ic =  12Vs
                         600 Ohm R  L

 (note: 150 * 4 = 600)


hFE(min)  >   5 ×      20mA__ 
                             20mA
75(min)  >   5  


RB =  5Vc × 75
          5 × 20mA   
   
where Vc = IC supply voltage         
  (in a simple circuit with one supply this is Vs)

RB = 3.75 ohm
Is this correct a 3.75 ohm base resistor?
 

SgtWookie

Joined Jul 17, 2007
22,230
Nope!

Looking at the datasheet, it appears that Vo(high) is about 0.5v less than Vcc.
Your transistor starts conducting when Vbe exceeds about 0.62v
So, let's subtract those two from Vcc:
5v-(0.5v+0.62v)=3.88v
They're giving those voltage ratings with current output at -4mA and -6mA, so let's limit the output current to be within that range; say 5mA:
Rbase = Voltage/Current = 3.88/5mA = 776 Ohms
The closest standard value equal to or greater than 776 Ohms is 820 Ohms.
Since I=E/R, base current = 3.88/820 = 4.73mA

That should be plenty of current to light up your LEDs.
 

Audioguru

Joined Dec 20, 2007
11,248
With 150 ohm current-limiting resistors for the LEDs, their total current is 107mA.

hfe is used for a linear amplifier transistor that has 10V from collector to emitter. Here the transistor is used as a saturated switch. Its datasheet recommends a base current that is 1/10th its collector current. So its base current should be 10.7mA. Its base voltage will be about 0.8V.

The 74HC595 datasheet does not spec a 10.7mA load but maybe its output would have a 1V drop and be 4.0V.

The base resistor should be (4.0V - 0.8V)/10.7mA= 300 ohms.
 

Thread Starter

jappy

Joined Nov 28, 2008
13
Ok, so I am really confused!
-Where did the 107mA's come from?
-Where does the spec sheet call for 1/10th the collector current?
-When using a transistor as a saturated switch is hFE irrelevant?

Sorry guys, I'm just trying to learn so I wont have to bug you all when I'm trying to do this again. Can someone recommend a good tutorial link covering which transistor to pick and how to decide on a base resistor. Right now I feel like I'm in the dark.

Thanks.
 

hobbyist

Joined Aug 10, 2008
892
Ok, so I am really confused!

Sorry guys, I'm just trying to learn so I wont have to bug you all when I'm trying to do this again. Can someone recommend a good tutorial link covering which transistor to pick and how to decide on a base resistor. Right now I feel like I'm in the dark.

Thanks.
Just looking at your schem. it wouldn't be hard to breadboard the circuit, leaving out the shift register, and start with a base resistor around 10k
ohms, and begining changing this resistance value until you get the visual output on the leds, your looking for.
Then check to see if your transistor burns your fingers, or any other components getting too hot to the touch, and experiment by taking voltage measurements across the series resitor of one line of your leds, then solve for the current by taking this volt. drop divided by that resistor.
Then take that value and multiply it by the total number of columns and that will give you the amount of collector current needed to produce the desired results. That way you can have an idea of what collector and base voltage is nessecary for this part of your project.

Nothing beats breadbording during a design.
 

Audioguru

Joined Dec 20, 2007
11,248
-Where did the 107mA's come from?
You said you have 2.0V LEDs and 150 ohm current-limiting resistors.
Four 2.0V LEDs are 8V. The supply is 12V so 4V is across each 150 ohm resistor which is 4V/150 ohms= 26.7mA in each string.
You have four strings which make a total current of 26.7mA x 4= 107mA.

-Where does the spec sheet call for 1/10th the collector current?
The On Characteristics have VCE(sat) showing it.

-When using a transistor as a saturated switch is hFE irrelevant?
Yes.
hFE is used for a linear amplifying transistor that has plenty of collector to emitter voltage (10V for the 2N2222A). Your formulas site says:
"When a transistor is saturated the collector-emitter voltage VCE is reduced to almost 0V.
When a transistor is saturated the collector current Ic is determined by the supply voltage and the external resistance in the collector circuit, not by the transistor's current gain. As a result the ratio Ic/IB for a saturated transistor is less than the current gain hFE."
 

Attachments

Ron H

Joined Apr 14, 2005
7,063
Just looking at your schem. it wouldn't be hard to breadboard the circuit, leaving out the shift register, and start with a base resistor around 10k
ohms, and begining changing this resistance value until you get the visual output on the leds, your looking for.
Then check to see if your transistor burns your fingers, or any other components getting too hot to the touch, and experiment by taking voltage measurements across the series resitor of one line of your leds, then solve for the current by taking this volt. drop divided by that resistor.
Then take that value and multiply it by the total number of columns and that will give you the amount of collector current needed to produce the desired results. That way you can have an idea of what collector and base voltage is nessecary for this part of your project.

Nothing beats breadboarding during a design.
Nothing beats designing before you breadboard. You can avoid a lot of unpleasant surprises by doing it in that order.:rolleyes:
 

Audioguru

Joined Dec 20, 2007
11,248
I always use a transistor's minimum or maximum spec's so that all circuits I make will work.
Some people use "typical" spec's then find that some of their circuits work and others don't.

You can't buy a transistor with typical or better spec's. So use the minimum and maximum spec's.
 

Thread Starter

jappy

Joined Nov 28, 2008
13
Yeah, I'm all about planning ahead. However, determining which transistor to use and what base resistor to use with it seems to be scrambling my brains. Is there some formula I could use to make my life easier when trying to determine these two things?
 

Audioguru

Joined Dec 20, 2007
11,248
Use a transistor that can handle the current without burning out.
Use a base current that is 1/10th the collector current.
Ohm's Law is used to calculate the value of the base resistor.
 

Ron H

Joined Apr 14, 2005
7,063
Yeah, I'm all about planning ahead. However, determining which transistor to use and what base resistor to use with it seems to be scrambling my brains. Is there some formula I could use to make my life easier when trying to determine these two things?
First, you need to know some approximations. For low-current switching (≈100mA or less):
1. The collector-emitter saturation voltage is between zero and maybe 0.3V. (See Fig. 2 in the datasheet).
In order to ensure saturation, the base current should be ≈Ic/10. Notice that in Figs. 2 and 3, β=10. This means forced beta, i.e., Ic/Ib. More is OK, sometimes a little less is OK.
2. The base-emitter voltage is ≈0.6 to 0.8V, depending on base current. See Fig. 3.

First, calculate your collector current. In this case, if you assume the transistor collector voltage is zero, then each LED current limiting resistor will have about 4V across it. So the current in each leg is (4/150)=26.7mA. Since you have 4 legs, the collector current will be about 107mA.
You need to set the base current to 107mA/10=10.7mA. The base voltage will be about 0.8V. Keep in mind that your HC595 does not have zero output resistance. From the Voh specs in the datasheet, you can deduce that the high level output resistance (call it Rhi) is about 100 ohms. Ib=(Vcc-0.8)/(Rb+Rhi). Calculating, Rb≈300Ω, as Audioguru said.
Notice that, when calculating the base resistor, everything is based on approximations and rules of thumb. If your base current is less than Ic/10 by 20%, it will probably work OK.
 

nomurphy

Joined Aug 8, 2005
567
If you have 4 LED's that drop 2V each, then 4 X 2V = 8V, and 12V - 8V = 4V ballast, and 4V/150ohms = .027A, and .027A x 4sets = 0.108A total.

Now, if you want to save your driver, you can calculate the base resistor value by using the hFE number. See by the datasheet that the hFE is a minimum of 100 at 150mA.

The collector current of 108mA/100hFE = 1.1mA.
The driver voltage of 5V - 0.8Vbe = 4.2V.
4.2V/1.1mA = 3.8K (use a 3.3K).

What does this mean? You won't be driving the xstr into full saturation, but you won't notice the difference either, and the burden on the shift register is significantly reduced (especially if you are using more than one output like this).

Full saturation is best when switching fast signals where losses are critical, but it doesn't matter here. The difference is about an extra 100mV or so drop across the transistor, which is negligible.

Try it, and measure between the collector and emitter (GND) -- I bet it's around 250mV. 250mV x 108mA = 27mW which is no problem for the xstr to dissipate.

If you want to experiment, place a 200 ohm resistor in series with a 5K pot as the base resistor. Measure the voltage between the collector and emitter (GND) as you adjust the pot, and see if/when you can notice a difference in the LED brightness or xstr temperature.
 
Last edited:
Top