Confirm transistor math

Discussion in 'General Electronics Chat' started by jappy, Nov 30, 2008.

  1. jappy

    Thread Starter Member

    Nov 28, 2008
    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:[​IMG]

    Here is my math (formulas used from this site):
    Code ( (Unknown Language)):
    2. load current Ic =       [U]supply voltage Vs[/U]    
    3.                              load resistance RL
    5. hFE(min)  >   5 ×       [U]  load current Ic  [/U]    
    6.                                max. IC current
    8. Rb =           [U]Vc × hFE[/U]                where Vc = IC supply voltage        
    9.                  5 × Ic           (in a simple circuit with one supply this is Vs)
    10. _______________________________________________________
    12. .02 A or 20mA Ic =  [U]12Vs[/U]
    13.                          600 Ohm R  [FONT=&quot]L[/FONT]
    15.  (note: 150 * 4 = 600)
    18. hFE(min)  >   5 ×    [U]  20mA__
    19. [/U]                             20mA
    20. 75(min)  >   5  
    23. RB =  [U]5Vc × 75
    24. [/U]          5 × 20mA  
    26. where Vc = IC supply voltage        
    27.   (in a simple circuit with one supply this is Vs)
    29. RB = 3.75 ohm
    Is this correct a 3.75 ohm base resistor?
  2. SgtWookie


    Jul 17, 2007

    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:
    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.
  3. Audioguru


    Dec 20, 2007
    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.
  4. jappy

    Thread Starter Member

    Nov 28, 2008
    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.

  5. hobbyist

    AAC Fanatic!

    Aug 10, 2008
    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.
  6. Audioguru


    Dec 20, 2007
    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.

    The On Characteristics have VCE(sat) showing it.

    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."
  7. Ron H

    AAC Fanatic!

    Apr 14, 2005
    Nothing beats designing before you breadboard. You can avoid a lot of unpleasant surprises by doing it in that order.:rolleyes:
  8. Audioguru


    Dec 20, 2007
    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.
  9. jappy

    Thread Starter Member

    Nov 28, 2008
    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?
  10. Audioguru


    Dec 20, 2007
    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.
  11. Ron H

    AAC Fanatic!

    Apr 14, 2005
    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.
  12. nomurphy

    AAC Fanatic!

    Aug 8, 2005
    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: Dec 1, 2008