NPN transistor switch help

Discussion in 'General Electronics Chat' started by live4soccer7, May 15, 2009.

  1. live4soccer7

    Thread Starter Well-Known Member

    Jun 7, 2008
    88
    0
    I am trying to create this circuit because the voltage 3.2 active whether the device is on or off and I don't want my leds on when I have the device off so I'm using a switched voltage that I found as seen in the picture of 2.2v. I need this because 2.2v isn't enough to light my leds bright enough. I am using blue leds and I wrote some of the specs in the picture. Here is the transistor I'm using (datasheet):

    DataSheet

    I'm not sure how to calculate the resistor value needed. I know the transistor needs roughly .7v to be fully on so if I take 2.2-.7=1.5v. I'm not sure what current I should be using to make the calculation for the resistor value that I need. I've been reading quite a bit and found this page pretty helpful for as far as I've gotten so far:

    Trasistor Switching Circuit

    It seems Ib has to do with the gain or hfe of the NPN transistor, but that is where I get lost in the datasheet. It shows many values in the sheet for this.

    I believe -------- Ib=Ic(80mA)/hfe

    If this is incorrect please correct me as I'm learning, but I'm not sure which value to use for hfe and why.
     
  2. Darren Holdstock

    Active Member

    Feb 10, 2009
    262
    11
    The value of hFE for that transistor will vary wildly, but all you need is a guaranteed minimum. You certainly can't rely on hFE to set the collector current. To saturate the transistor properly, as a good rule of thumb make Ic=10xIb.

    You'll need current limiting resistors in series with each LED, and make sure there's about a volt (at a guess - can be checked by calculation) at least dropped across each resistor or the LED current will be uncontrollable due to tolerance spread of the diode forward voltage drop.

    Paralleling the LEDs without individual resistors will also make the brightnesses uneven and the currents uncontrollable, so don't do that.
     
  3. live4soccer7

    Thread Starter Well-Known Member

    Jun 7, 2008
    88
    0
    So: Ib=Ic/10 ----- Ib=.08A/10 -----Ib = .008A

    Rb (base resistor) = 1.5/.008 ----> Rb = 187.5ohm

    Is this correct?

    Also, I was looking at the datasheet more and it is possibly making more sense in regards to hfe. Here is what is says:


    ----------------------------------------hfe
    Ic = 50 mA, VCE = 1.0 V 60
    Ic= 100 mA, VCE = 1.0 V 30



    Does this mean when the Ic current is at 50mA then the hfe is 60 and when at 100mA then 30? I'm not quite sure what the VCE = 1.0V means. Can anyone enlighten?​
     
    Last edited: May 15, 2009
  4. DonQ

    Active Member

    May 6, 2009
    320
    11
    Even the title of the question says "NPN transistor switch help", with switch being the operative word here. Switches are not used to set a current, they just switch... full-off to full-on (or very nearly so).

    To use as a switch, you really want to "super-saturate" it. When you do this, the C-E voltage will drop to about 0.3V or so (yes, even less than the B-E voltage).

    To do this, do your calculations using an hfe much less than what is listed in the data-sheet. The suggestion to use hfe=10 is not unreasonable. This will make it so that the hfe you are actually operating at doesn't matter, since you will be supplying much more base current than what is actually needed for analog use. The base resistor here is very non-critical.

    As far as the meaning of the values in the data-sheet:
    The hfe values in the data-sheet are almost useless in this case. They say that if you only supply enough base current to cause the C-E voltage to drop to 1.0V, your hfe will be what's listed. Since you will be supplying much more base current than this, you will not be operating at this hfe.



    Set the LED current using the difference between the supply voltage and the sum of all the LED voltage drops, and including the transistor C-E voltage. This means that you may have to do something different with the LEDs because the total voltage drop you are expecting seems to be larger than your supply voltage.

    Since these voltage drops are not exact, even being close to the supply voltage doesn't give you enough leeway to properly select a series resistor.

    For example: If, after subtracting all the voltage drops, you only have 0.3V left, plus or minus 0.4V, it will be much harder to pick the proper resistor than if you have 2.0V, plus or minus 0.4V.
     
  5. live4soccer7

    Thread Starter Well-Known Member

    Jun 7, 2008
    88
    0
    Thanks for the reply. You had some very good information.

    Well the leds should use up all of the voltage that is supplied. That is the highest voltage source in my device 3.2v.

    I believe in the data sheet it says the transistor is good up to 100mA, does this mean the current running through the base from the switch voltage? Or the current running from the leds (C->E) or the addition of them both?

    For supersaturation i would want to be sure to get the current through the base to be pretty high as long as i don't exceed the rating of the transistor (100mA)?
     
  6. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    Your LEDs are probably not 3.2V. They might be 3.0V or they might be 3.4V.

    If they are actually only 3.0V and you apply 3.2V to them then they will instantly burn out, or the transistor will burn out.
    LEDs need a current-limiting resistor in series with each one and a supply voltage that is high enough for them to light properly even if their actual voltage is 3.4V.
     
  7. Darren Holdstock

    Active Member

    Feb 10, 2009
    262
    11
    Good points all, and Audioguru raises the (usually conveniently overlooked) issue of tolerancing. The LED forward voltage drop can fall within quite a wide range, and it's alarming to see how this affects the spread of the LED current. For tighter current control it's best to drop at least a few volts across the LED current limit resistor, but as you've only got 3.2 V to play with, the best you can do is drop about 1 V. You might have to lose the blue LED and go with old-fashioned red, yellow or green. If you really must have blue then you need extra complexity in the circuit, as in this article from EDN: Drive a blue LED from a 3 V battery (pdf).

    It might do to look for a slightly bigger transistor, as 80 mA through a 100 mA device is pushing it a bit close to the edge. You'll want one with at least Ic(max)=150 mA and a nice low Vce(sat) at the 80 mA you're running at. A good rule of thumb for increased component reliability is to derate everything to about 2/3 (maybe 3/4 at a pinch) of the datasheet spec.
     
  8. DonQ

    Active Member

    May 6, 2009
    320
    11
    This is the max collector current.
     
  9. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    Powering LEDs without a current limiting resistor is not a good idea.

    Increase the 3.2V to 5V for example and use a current limiting resistor for each LED to limit the current through them. Use a 1K resistor at the base.
     
  10. live4soccer7

    Thread Starter Well-Known Member

    Jun 7, 2008
    88
    0
    3.2v is the highest voltage in my device. I can always use small value resistors. How did you come up with a 1k resistor? I just want to know how to do the calculations myself. I like to learn thoroughly about what I'm doing instead of just doing it.
     
  11. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    If you can't have a higher voltage than 3.2V then it would be better to buy LEDs with a forward operating voltage of about 2V.
     
  12. live4soccer7

    Thread Starter Well-Known Member

    Jun 7, 2008
    88
    0
    I'm not too concerned with the voltage for the leds. I'm concerned about learning how to use the transistor correctly as a switch and how you calculated the 1k for the base.
     
  13. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    You find Ic, then divide by the transistor gain at saturation to find Ib. Finally you calculate the base resistor according to the applied control voltage.
     
  14. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    Look at the datasheet for the transistor.

    ON CHARACTERISTICS:
    VCE (sat) Collector-Emitter Saturation Voltage= 0.95V max
    when the collector current is 50mA and the base current is 5mA.
    They are telling you to use a base current that is 1/10th the collector current, not the base current calculated from the hFE.
    Use hFE in a calculation for a transistor that is not a switch and has plenty of collector to emitter voltage.

    For a collector current of 80mA the base-emitter voltage shown on the graph is 0.8V.
    The base resistor value is (2.2V - 0.8V)/ 8mA= 175 ohms (not 1k ohms). Use 180 ohms.
     
  15. live4soccer7

    Thread Starter Well-Known Member

    Jun 7, 2008
    88
    0
    Thanks for the explanation. That is about what I was figuring a while back. Also I was reading somewhere that it may be smart to put a resistor from the base to emitter to make sure no current is flowing when it is off.

    Any thoughts or ideas on this?
     
  16. live4soccer7

    Thread Starter Well-Known Member

    Jun 7, 2008
    88
    0
    which graph of these two were you looking at? I'm not really sure of the difference in meaning between them.

    It appears for saturation it would take about .88-.89v or so at 25c with 80mA through Collector Emitter.
     
  17. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    In your case you have to look at saturation.
     
  18. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    The written specs state the max saturation voltage that is expected.
    The graphs show only typical values.
     
  19. live4soccer7

    Thread Starter Well-Known Member

    Jun 7, 2008
    88
    0
    results from the first test:

    It definitely turns on and has full voltage going through when the device is on, but when it is off the lights are flickering. I have some more detailed specs.

    The always on voltage is 3.15v
    Leds are rated at 3.0-3.6v and 20mA (4 leds in parallel, drawing a total 80mA)
    The switch voltage is 1.99v

    I used a .8v requirement for the transistor.

    2v-.8v=1.2v
    1/10 of Ice = 8mA (.008A)

    1.2/.008=Rb

    Rb = 150 ohm

    I used a 150 ohm and wired it all up correctly and I get the results I stated above. Any ideas on what is wrong? For the led I ran from the always on source to the leds and then from the negatives on the leds to the collector and then from emitter to the ground. The switch voltage goes to the 150ohm resistor and then to the base on the transistor.

    Ideas?
     
  20. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    LEDs, 555s, Flashers, and Light Chasers

    Bill's Index

    :D

    I threw together this schematic using PaintCAD, a bunch of templates that you can use with M/S Paint (or any other graphic program you might have). If you are interested in them look at my blog for the 1. Introduction and Paint as CAD in the Index.

    [​IMG]

    Did I read your post correctly, you have LEDs with a Vf of 3.6V, and you're wanting to power them with 3.3V? You need a power supply around .5V greater than the Vf of the LEDs.

    Transistor β does play a part in this, but the number is notoriously unreliable. For this configuration figure the base current is 1/10 of what the collector current is.
     
Loading...