Shop OBEX P1 Docs P2 Docs Learn Events
Transistor Selection Help (Experts only please) — Parallax Forums

Transistor Selection Help (Experts only please)

beazleybubbeazleybub Posts: 102
edited 2008-10-28 14:07 in General Discussion
Let me start out by saying in no way am I am electrical engenieer and I need some help here.


Can someone explain to me how to choose the right NPN transistor?

The relay is an OUAZ-SH-105D,405 and runs on 5V http://relays.tycoelectronics.com/datasheets/OUAZ.pdf
The relays coil current @ 5V is 90.9 mA

I know that I need a transistor that the maximum collector current Ic(max) is 100mA

The problem I am having is calculating the required hFE for the transistor.
(Nor do I know what hFE stands for)

What was reccomended to me was that the transistor's minimum current gain hFE (min) must be at least five times the load current Ic divided by the maximum output current from the IC.

The maximum output current for the BS2sx pin is 30mA and the·Load·Current is 90.9mA (Relay Coil)
So that would be 90.9mA / 30mA = ·3.03 x 5 = 15.15mA.

I went to digikey in the bipolar transistor section to look for a NPN and
under the part filter I see the section that says
"DC Current Gain (hFE)" (Min) @ Ic, Vce but thats where I get stuck.

I do not understand how to read that section to decide which to choose.
I know I need to choose hFE that is at least 15.15mA but the filter window says things like 9 @ 500mA, 2V.
I realize that the first part is the hFE but what's the @ 500mA ,2v? This is the part that's stumping me.

Thanks for any help in this.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
How can there be·nothing? Nothing is something!

Post Edited (beazleybub) : 10/23/2008 6:26:46 AM GMT
«1

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-20 21:39
    I'm not sure where you got your formula. If your relay coil current is 90mA and the Stamp can provide 20mA (not 30mA ... don't count on 30mA), you need a minimum gain of 90mA / 20mA = 4.5 because transistors are current amplifiers. Because hFE will vary with current and applied voltage, not to mention temperature, you add some fudge factors. Any hFE greater than 20 is more than enough, so that's the minimum I'd use. The current (500mA) and voltage (2V) on the Digikey site are probably the conditions where the hFE was measured. Best thing is to look at the transistor's datasheet. A general purpose NPN switching transistor that's readily available and cheap is the 2N2222A (sometimes PN2222A) which has an hFE of at least 30 at full current (500mA). A typical datasheet is www.eng.yale.edu/ee-labs/morse/compo/datasheets/2N2222.pdf.
  • $WMc%$WMc% Posts: 1,884
    edited 2008-10-21 01:06
    freaked.gif·Why don't You just use an NMOSFET?????__IRL510__ is totally Sat. @ 5 volts w/ no Gate-I/O drain!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!(well maybe a few Tril.of an AMP.)




    ············· ________________$WMc%______________out____________

    ·········

    Post Edited ($WMc%) : 10/23/2008 11:17:24 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-21 02:30
    Actually, that's not quite true. An IRL510 is designed to be saturated at a gate voltage of 5V. An IRF510 needs more than 5V to saturate at high currents. Look at the curves on the datasheets for gate voltage vs. drain current.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-10-21 02:44
    My goodness, here we go again. For the nth time, boys and girls, the IRF510 is UNSUITABLE for use with logic circuits. Its saturation current is spec'd at a VGS of 10V, not 5V. This transistor's part number has only wormed its way into the popular vernacular because Radio Shack carries them. Why? I have no idea. Maybe they can get them cheap.

    A much better choice for control by logic circuitry is the IRLZ34N. With VGS = 5V, its "on" resistance is a mere 0.046 ohms. Compare that with an "on" resistance of 0.400 ohms at VGS = 10V for the IRF510.

    -Phil
  • metron9metron9 Posts: 1,100
    edited 2008-10-21 06:06
    How about this 25V TrenchMOS rdson 0.0041 at 4.5V at 100amp

    http://www.nxp.com/acrobat_download/datasheets/PH2625L_2.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • beazleybubbeazleybub Posts: 102
    edited 2008-10-21 07:32
    Mike,

    I got my formula here http://www.kpsec.freeuk.com/trancirc.htm

    The information I was going by is about 3/4 down the page at the "Choosing a suitable NPN transistor".

    The guide points out "The transistor's minimum current gain hFE(min) must be at least five times the load current Ic divided by the maximum output current from the IC"

    I see where you are coming from about not counting on 30mA
    (Just because your Vette can go 145MPH does not mean you should push it to the limit)

    Thank you

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    How can there be·nothing? Nothing is something!

    Post Edited (beazleybub) : 10/21/2008 7:56:15 AM GMT
  • Jesse HastyJesse Hasty Posts: 29
    edited 2008-10-21 12:38
    4·points:
    1) I have successfully used a 2n222 triode to trigger a relay many times. If it won't do the trick chose a triode that will only draw 2ma or so. Not need to tax the BS output at all.

    2) It seems to me a 12v relay would work better and draw less current.

    3) I would avoid the use of MOS devices in this application because MOS is susceptible to damage and false triggering from voltage spikes. The coil will create all sorts of voltage spikes as will the ambient environment.

    4) I would use a static switch here. I has a high input impedance which will protect the BS from overload, and the BS can be further protected by using a resistor between the static switch and the output pin. 220 ohms would do nicely. In addition the static switch will never wear out and shuts off at the zero crossing of an AC load, thus generation no arcing or high voltage transient on the load side.. I have one in an application where it is turning a resistive load on and off at every cycle of 120 v AC source, or 120 times a seconds, It has worked for 17 years approximately 65 hours a week.· They cost a few dollars more, but last many times longer and do an excellent·job of protecting both your computer and your load.· I even use solid state motor starters now unless it absolutely positively must be insanely cheap.·

    Post Edited (Jesse Hasty) : 10/21/2008 12:47:33 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-21 13:04
    beazleybub,
    I see where you got it. You'll certainly be safe at 5x the minimum needed gain. I don't think you should take it as a requirement so much as a reasonable starting point.

    Jesse,
    2) 5V is what is readily available, so a 5V coil voltage is the easiest to use here. If you've got 12V already, you can certainly use it, but it wouldn't work "better". Less current is not necessarily better. You're not talking about a lot of current (100mA).

    3) MOSFETs are excellent in this application. All transistors are susceptible to damage. You have to be careful about static, but that's not a big deal. Before gate diodes were used to protect MOS gates, this was a real problem. Now most MOS transistors are pretty resistant. Preventing false triggering from noise is not a big problem either. If necessary, use a pulldown resistor. You need a diode across the relay coil to protect against the voltage produced by the magnetic field collapse, but you'd need that for any transistor.

    4) What do you mean by a "static switch"? A simple transistor switch is simple, reliable, and cheap.
  • metron9metron9 Posts: 1,100
    edited 2008-10-21 13:27
    To Mike Greens point on MOS devices. There are mosfets that do not have internal diode protection so watch for that in your selection. The one i submitted with the ultralow rdson can take repetitive avalanche energy of unclamped inductive load of 7.1A or 2.5 mJ. Very rugged as well as the IRLZ34N with 6.8 mJ rating.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • Jesse HastyJesse Hasty Posts: 29
    edited 2008-10-21 13:42
    By static switch I mean electronic relay. We called them static switches when they first came out because they had optical isolators on the input side and really didn't care what was happening on the output side, so they had no real impact on the control computer.·

    Old habits die hard. I was around when the first FETs came into general availability. I once got really burned on a job because they were so susceptible to noise and destruction. That bad experience has colored my thinking to this day. Your are right, there are robust units available. In fact, the input side of the static switches I like so much are MOS devices.

    Post Edited (Jesse Hasty) : 10/21/2008 1:51:34 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-10-21 14:15
    beazleybub,

    Something that I have not seen mentioned in this post...· Make sure that you have a current limiting resistor on the base of your transistor if you decide to use a bi-polar.

    Here is a FAQ that might help... Don't get HOT choosing the wrong transistor

    Even though it references a motor in the schematic, a Relay, Light bulb, Solenoid, etc. could just as easily be substituted.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-10-21 16:52
    To Beau's admonition regarding bipolar transistors, let me add one regarding MOSFETs: A resistor from gate to Vss is a must. This will prevent the transistor from conducting when the Stamp is in reset and the pin is floating. Also, the body diode internal to most MOSFETs will not protect it against inductive load voltage spikes. (It's in the wrong place in the circuit.) MOSFETs require the same external diode protection across an inductive load that bipolar transistors do. (That said, there are some four-pin MOSFET swithces that include the extra protection diode, and some MOSFETs have zener diodes between drain and source to shunt overvoltage spikes to Vss. None of those mentioned in this thread has either feature.)

    -Phil
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-10-21 18:24
    In a nutshell, and I'm over-simplifying the matter,·hfe or ß, is the current gain you could expect; IC =·ß X IB

    Post Edit -- IC ≈ IE

    Post Edited (PJ Allen) : 10/21/2008 6:32:45 PM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-10-21 18:34
    hFE is the dimensionless ratio of the transistor's collector current to its base current, viz: iC / iB. This is also referred to as "beta" or current gain.

    As to what the letters "hFE" stand for, I have no idea. A web search turned up nothing.

    -Phil
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-10-21 19:18
    hFE is also the "amplification" of the transistor. When the transistor is in the "linear" region of its operation, if the hFE (or Beta) is 5, then when you put 5 ma through the Base-Emitter path, then 50 mA will flow through the Collector-Emitter path.

    Usually, in digital applications you don't want to keep the transistor in its linear region, you want to either turn it 'off' or 'saturate' it 'on'. When saturated, further current (beyond that needed to 'saturate' the transistor) put in the base junction doesn't result in increased current in the Collector-Emitter path, because the Collector-Emitter path is already maxed out.

    Correction: D'oh, 5 * 5 == 25 mA, not 50.· Sorry about that.

    Post Edited (allanlane5) : 10/21/2008 9:04:45 PM GMT
  • Fe2o3FishFe2o3Fish Posts: 170
    edited 2008-10-21 19:34
    Without going upstairs to visit my OLD engineering books,
    Google turned up this page on Yahoo: smile.gif

    http://answers.yahoo.com/question/index?qid=20080327120501AAY6jqp

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rusty-
    --
    Rusty Haddock <=> AE5AE
    **Out yonder in the Van Alstyne (TX) Metropolitan Area**
    Microsoft is to software what McDonalds is to gourmet cooking
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-10-21 20:44
    Phil Pilgrim (PhiPi) said...
    hFE is the dimensionless ratio of the transistor's collector current to its base current, viz: iC / iB. This is also referred to as "beta" or current gain.
    As to what the letters "hFE" stand for, I have no idea. A web search turned up nothing.
    -Phil
    According to Yahoo! Answers, hfe and hFE (yes, they are different) can be described at the following link.· I consider myself more educated now.

    http://answers.yahoo.com/question/index?qid=20080327120501AAY6jqp

    P.S. - Phil, while not as efficient, have you ever used the IRL520 MOSFET in logic control?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering


    Post Edited (Chris Savage (Parallax)) : 10/21/2008 8:49:53 PM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-10-21 21:09
    Thanks, Chris! This was driving me crazy. ("hybrid Forward Emitter": who would've guessed?)

    I've never used the IRL520. From the specs, it looks like a logic-switchable equivalent to the IRF520 (the IRF510's bigger brother), so it should work fine in logic control apps. It has one distinct advantage over the IRLZ34N: much lower gate capacitance, which means it can be switched faster (e.g. in PWM circuits) without special driver circuitry. It's "on" state resistance is about 6x that of the '34', however. Nothing good comes without tradeoffs! smile.gif

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Just a few PropSTICK Kit bare PCBs left!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-10-21 21:12
    That is true. I wanted to throw that one out there as we have used it here at Parallax for some prototyping and it has been a good component. Of course, I also have a stockpile of these so… [noparse];)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-10-22 12:03
    PN2222, 2N3904, 2N2222A -- all fine choices.

    A 1K-4.7KΩ between the Stamp output and the transistor Base and be done with it.

    Post Edit -- IB = ( Vstamp_out - VBE ) / RB
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-10-22 12:55
    And Vbe when saturated is 0.7 volts. Vce when saturated is about 0.1 volts.

    Or, in other words:

    · IB = ( Vstamp_out - 0.7 ) / RB

    Post Edited (allanlane5) : 10/22/2008 6:52:35 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-10-22 14:36
    I’m just curious (this is for the original poster) about your first schematic. In that, is that a top-down view of the transistor? If so, it seems to me that if you’re using a 2N2222A or 2N3904 small signal diode that the leads are in the wrong order. On these transistors (and many similar NPN) the pin order when looking at the flat part of the package, leads down is Emitter, Base, Collector.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • beazleybubbeazleybub Posts: 102
    edited 2008-10-22 14:55
    I used a 2n3904

    Whoops I drew my key wrong! I have it backwards. The actual design is CBE top down.

    (I have since deleted those images from this post)

    Thanks for pointing that out.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    How can there be·nothing? Nothing is something!

    Post Edited (beazleybub) : 10/28/2008 7:36:09 AM GMT
  • $WMc%$WMc% Posts: 1,884
    edited 2008-10-23 23:26
    Thanks Mike

    For catching My (typo) "IRF". I have edited My post.....Details,Details,Details................



    _______________$WMc%________
  • beazleybubbeazleybub Posts: 102
    edited 2008-10-25 08:12
    I have a better understanding about the theory and operation of a transistor but still do not fully understand exactly how hFE or "Beta" is affected by current, voltages temperature or resistance.
    ·
    When I look at a transistors data sheet and see that a particular transistor has a minimum hFE of 35 @ 200mA, 2V and a maximum hFE of 300 I am led to believe that in order for the transistor to become "saturated" you have to at least meet a hFE of 35 but can't exceed 300. This is where all of my confusion is about transistors.

    I basically understand how to choose a base resistor and how to determine minimum hFE but can't grasp how to choose which·transistor would suit a particular situation best.
    ·
    However, I may have found a more reliable solution by just simply using a relay driver·IC, eliminating the need for fudge factors and guess work on my part.
    ·
    Here is a link to a relay driver that might work well for a 5 V relay.
    ·
    [url=mhtml:{7335AF52-1042-49AF-80BF-6F4A483FEEE4}mid://00000004/!x-usc:http://www.mouser.com/Search/ProductDetail.aspx?qs=ZXBb0xZ9WeAm1igmTYH1CQ%3d%3d]http://www.mouser.com/Search/ProductDetail.aspx?qs=ZXBb0xZ9WeAm1igmTYH1CQ==[/url]
    ·
    I still am open to anyone that would be so kind to help me fully understand·hFE "Beta" and how to·calculate which transistor to use if I chose to use a transistor.
    ·
    Once again here is the information for my circuit. [noparse]:)[/noparse]

    Relay operating voltage 5 V
    Relay resistance 55 ohm
    Relay current 90.9 mA @ 5 V
    Transistor Style NPN
    Base Signal 5 V·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    How can there be·nothing? Nothing is something!

    Post Edited (beazleybub) : 10/28/2008 7:41:35 AM GMT
  • be80bebe80be Posts: 56
    edited 2008-10-25 16:52
    If you want a npn switch you can use any 2N3904 2N4400 2N2222 with a 1kohm resistor on the base and you'll get about 100Milliamps at the collector
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-25 17:08
    It's pretty simple for a switching application where the collector goes to the load and the base to the I/O pin (and the emitter is grounded).

    1) The maximum voltage between the collector and emitter when the transistor is off has to be less than Vce Max. In other words, the maximum supply voltage to the load has to be less than the rating of the transistor.

    2) The maximum collector current Ic has to be greater than the amount of current expected to flow through the load.

    3) The current gain of the transistor (minimum hFE) has to be greater than needed to produce the amount of current needed by the load given the amount of base current available. In other words, hFE > maximum load current / minimum base current. Usually the base current is set by a series resistor between the base and the I/O pin and the capability of the I/O pin to supply current. For most microcontrollers, this will be no more than 20mA.

    4) The power dissipation capability of the transistor case and any heatsink has to match the amount of heat expected to be produced. If the transistor has enough base current to saturate (which depends partly on the hFE), this is usually the load current x Vce-sat. Typically, the Vce-sat is 0.3V, but depends on the transistor construction and would be in the datasheet.

    As you've noticed, transistors can have widely varying gains. For switching applications, you're interested in the minimum gain because you either want the transistor to be off or to conduct "fully" (saturated) when your I/O goes high.

    Post Edited (Mike Green) : 10/25/2008 5:17:07 PM GMT
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-10-26 00:39
    Hello -- new to the forum, but I'm an experienced design engineer, and am running relays with a Stamp.

    A little tutorial -- may be redundant, for I didn't real all the replies from people who aren't sure. Since we are talking about DC parameters, hFE is of interest and hfe is not. hFE is the DC current gain. You have 30 ma available from the Stamp to drive the base, and you want to drive, say, a 100 ma load (relay coil). The required hFE is 100/30, or about 3.33 -- not a very demanding specification.

    Let us assume you select a transistor whose hFE is 10. Then you will need 100ma/hFE = 100ma/10 = 10 ma of base current. Double this and drive the base with 20 ma. You will need a resistor between the Stamp output pin and the transistor base, to limit the current. How many ohms? Well, you're driving from about 4.8 volts or, so, and the drop across the base-emitter junction in many NPN silicon transistors will be in the range 0.4 to 0.7 volts. Assume the worst, 0.7 volts, and the voltage across the resistor is 4.8-0.7=4.1 volts. Calculate the resistance, R = E /I = 4.1/0.020 = 205 ohms. Use a 220 or 330 ohm resistor, because the hFE of any actual transistor is going to be much more than our 3.33.

    What transistor? That depends, a little, on the relay. What's the relay coil voltage? Maybe 12 volts. So the transistor needs to withstand 12 volts Vce when in cutoff. Not very demanding.

    What power will the transistor dissipate? Assume its saturation voltage (when conducting) is 1 volt. It'll be less, but we need a margin of safety. One volt drop across the transistor when conducting, and the current is 100 ma -- so the transistor dissipates 100 milliwatts. Most silicon transistors will handle this without a heat sink.

    So here's our transistor spec: 100 mw dissipation, minimum hFE 3.33, and we'd like a saturation voltage under 1 volt. We need a maximum collector voltage at least twice the relay-coil supply voltage, for safety.

    Our specs are not demanding at all -- it's easy to find a transistor that will do. I use 2n3053 for these things, because I have lots of them on hand. But many other types will serve as well, and most are smaller physically.

    When the transistor, whatever type it is, shuts off current through the relay coil, the coil's inductance will resist the change in current. That's what inductors do. Place a rectifier diode across the relay coil to carry this current while it decays, so it won't force current through your transistor when the transistor is trying to shut it off. Place the diode in the direction that will NOT conduct when the coil is "on". This is how you rotect your transistor from a quick and mysterious death.

    -- Carl Hayes
  • beazleybubbeazleybub Posts: 102
    edited 2008-10-26 01:03
    Carl,

    Nice explanation thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    How can there be·nothing? Nothing is something!
  • be80bebe80be Posts: 56
    edited 2008-10-26 03:58
    The secret to making a transistor switch work properly is to get the transistor in a saturation state. For this to happen we need to know the maximum load current for the device to be turned on and the minimum HFE of the transistor. For example, if we have a load that requires 100MA of current and a transistor with a minimum HFE of 100, we can then calculate the minimum base current required to saturate the transistor as follows:

    Minimum base current = 100 MA / 100
    Minimum base current = 1 MA So any 2n2222a 2n3904 and 2n4401 that you can get for $3.59 at radio shack and you get 15 of them lol would work. And if you used a 1kohm resistor to base it would only sink 5ma that would give you a lot left for led flashing lol I made a h bridge with 2 2n3906 pnp and to 2n3904 and when the motor stalls out it will pull 200ma thay don't even get hot . Running it pulls 100ma
    Take a look at this site http://www.rason.org/Projects/transwit/transwit.htm

    If it works use it If not try again. Works for me lol

    Post Edited (be80be) : 10/26/2008 4:04:13 AM GMT
Sign In or Register to comment.