Author Topic: Base Resistor for NPN BJT used as a switch  (Read 6964 times)

0 Members and 1 Guest are viewing this topic.

Offline WatthTopic starter

  • Regular Contributor
  • *
  • Posts: 241
  • Country: fr
Base Resistor for NPN BJT used as a switch
« on: August 01, 2016, 07:46:51 pm »
Howdy,

For now i used MOSFETs to transfer digital signal from a logical source to a load. For this purpose MOSFETs are quite simple: no need to control the gate current, you just need a pull down R, for which you don't need to be accurate.

Now, for an equivalent case with a BJT.
If I understood correctly contrary to a mosfet, BJT don't have a high impedance between base and collector when saturated; so a resistor is needed to limit current at the base (and thus not fry the source and/or the BJT).
Context : signal comes from a logic IC, which can provide 25mA MAX at 5V.
The load takes up to around 100mA at 5V.
In between, this guy: http://docs-europe.electrocomponents.com/webdocs/1276/0900766b81276adc.pdf
What value should the resistor in series with the base have?
Thanks a lot!
Because "Matth" was already taken.
 

Offline Signal32

  • Frequent Contributor
  • **
  • Posts: 251
  • Country: us
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2320
  • Country: au
Re: Base Resistor for NPN BJT used as a switch
« Reply #2 on: August 01, 2016, 08:14:14 pm »
This is covered early in chapter 2 of the fable "Art of Electronics" book.

Since you want the transistor to be switched on, i.e., in saturation, figure 16 from the datasheet is what you want. Conveniently, Ic = 100mA is what you specified in the problem, and it's one of the curves from the datasheet (the rightmost one).

Next, you have to decide how much drop across the transistor you're willing to tolerate. If Vce = 1V, then your load only sees 4V. If Vce = 0.5V, then your load sees 4.5V, and so on. Unlike a FET, it is unreasonable to expect perfection here, a BJT will always have 0.1 - 0.2V of Vce drop in the best case.

In any case, pick the drop you're willing to accept on the Y axis, and read off the base current on the X axis. Unfortunately the values go off the screen for really high base currents, but you can easily extrapolate. We can't tell you what a sensible drop is in your case, you have to decide that -- your load might be perfectly happy with a 0.5V drop, in which case 4mA of base current (don't forget to bring that up to 8mA for a safety factor) will be fine. You could push a lot more current through the base, but the gains will be rapidly diminishing, and the increased power dissipation of your IC might be worse that the ever-so-slightly increased voltage delivered to the load. This is a compromise we can't make for you (nor can any magic website), but at least you know the graph to refer to. Once you've decided on a base current, it's easy to calculate the resistor that will provide that current (resistor = 4.3V / current).

Note that transistors vary hugely from sample to sample, so you want to double the base current from what you read off the graph.

~260R resistor.
Use this website to calculate:
http://www.petervis.com/GCSE_Design_and_Technology_Electronic_Products/transistor_base_resistor_calculator/transistor_base_resistor_calculator.html

I have to call this out as questionable. Don't get me wrong, 260R will probably work fine, but I have to ask you where you got your hFE value from? Because the value of 30 from the datasheet is for Vce = 1.0V, which is hardly convincing saturation. Also, it looks like you didn't even use 30, because I seem to be getting a even smaller resistance than you on the website.
« Last Edit: August 01, 2016, 08:24:55 pm by rs20 »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9936
  • Country: us
Re: Base Resistor for NPN BJT used as a switch
« Reply #3 on: August 01, 2016, 08:29:09 pm »
From Figure 16 in the datasheet, we see that for a 100 mA load, we will need 10 mA of base current to get the device saturated.  So, a realistic hFE is just 10.

Now, that 5V logic signal probably won't pull all the way up to 5V with a 10 mA load so let's just guess we can really get just 4.5V and the Vbesat is 0.7V.  So, we have 4.5 - 0.7 or about 3.8V to drop across the resistor at 10 mA.  That takes a 380 Ohm resistor.

Try it and see!  With the output energized, is the base voltage about 0.7V?  Is the drop across the transistor matching up with the datasheet Figure 16 (0.35V)?
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2320
  • Country: au
Re: Base Resistor for NPN BJT used as a switch
« Reply #4 on: August 01, 2016, 08:58:54 pm »
From Figure 16 in the datasheet, we see that for a 100 mA load, we will need 10 mA of base current to get the device saturated.  So, a realistic hFE is just 10.

And that's just a typical value (as it's derived from a graph for a typical device), not even a guaranteed minimum!
 

Offline KE5FX

  • Super Contributor
  • ***
  • Posts: 2014
  • Country: us
    • KE5FX.COM
Re: Base Resistor for NPN BJT used as a switch
« Reply #5 on: August 01, 2016, 09:52:13 pm »
Yeah, that calculator is simultaneously oversimplified and overcomplicated.  Just take the desired collector current, multiply it by 10, divide it by hFE, and that's your required base current with plenty of margin.  The resistor is then selected to provide this amount of current with your available base drive voltage. 

You can subtract 0.6 from the control voltage if you like, but the act of derating hFE by 10x should give you plenty of margin even without taking Vbe into account.

TL;DR: 220 ohms for 1.8V logic, 470 ohms for 1.8V-5V, and 2.2K for everything else is usually fine.  If the transistor gets hot, use a smaller resistor.  If the logic gate gets hot, use a bigger one. 
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9936
  • Country: us
Re: Base Resistor for NPN BJT used as a switch
« Reply #6 on: August 01, 2016, 10:54:50 pm »
Yeah, that calculator is simultaneously oversimplified and overcomplicated.  Just take the desired collector current, multiply it by 10, divide it by hFE, and that's your required base current with plenty of margin.  The resistor is then selected to provide this amount of current with your available base drive voltage. 

You can subtract 0.6 from the control voltage if you like, but the act of derating hFE by 10x should give you plenty of margin even without taking Vbe into account.

TL;DR: 220 ohms for 1.8V logic, 470 ohms for 1.8V-5V, and 2.2K for everything else is usually fine.  If the transistor gets hot, use a smaller resistor.  If the logic gate gets hot, use a bigger one.

That calculation requires more base current than the source can deliver (10 x 0.100 / 30 => 33 mA).  As the source current increases, the output voltage drops so an even smaller resistor is required.  Not to mention, the base current is down to 1/3 of the collector current - that might be common for a 2N3055 but not for these small signal transistors.

I would try something in the 220-390 Ohm range and see if the transistor goes into saturation.

There are probably better transistors and there is always the possibility of using a Darlington pair.
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2320
  • Country: au
Re: Base Resistor for NPN BJT used as a switch
« Reply #7 on: August 02, 2016, 12:22:02 am »
There are probably better transistors and there is always the possibility of using a Darlington pair.

A Darlington pair is a horrible solution for a switching solution, it doubles the Vce(sat). If you need extra gain, connect the first transistor's collector via a resistor to Vcc, not to the collector of the second resistor (as is the meaning of the term 'Darlington').

I agree that a FET would be a considerably better choice.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9936
  • Country: us
Re: Base Resistor for NPN BJT used as a switch
« Reply #8 on: August 02, 2016, 02:16:49 am »
There are probably better transistors and there is always the possibility of using a Darlington pair.

A Darlington pair is a horrible solution for a switching solution, it doubles the Vce(sat). If you need extra gain, connect the first transistor's collector via a resistor to Vcc, not to the collector of the second resistor (as is the meaning of the term 'Darlington').

I agree that a FET would be a considerably better choice.

If the OP chose a proper relay driver IC, it would be a Darlington.  Yes, they are a regrettable choice but they work pretty well.  Vcesat will be approx. 1V for the ULN1003 driver.  Maybe that's ok, we don't have all of the parameters.  At least gain won't be an issue.

Let's face it, the chosen transistor is way out of its league.  It's a 10 mA device that struggles with loads near 100 mA.  Something like the 2N4922 would be a better choice.  Almost anything in a TO-220 or TO-225 case will work better.

http://www.onsemi.com/pub_link/Collateral/2N4921-D.PDF

A MOSFET is really the way to go, particularly a 'logic level' MOSFET like the IRLZ44 which is fully turned on with 5V of gate to source voltage.  TO-220 package might be a hangup.  There are others...

https://arduinodiy.wordpress.com/2012/05/02/using-mosfets-with-ttl-levels/

 

Offline KE5FX

  • Super Contributor
  • ***
  • Posts: 2014
  • Country: us
    • KE5FX.COM
Re: Base Resistor for NPN BJT used as a switch
« Reply #9 on: August 02, 2016, 02:26:44 am »
Pretty rare for Vce(sat) to be the limiting factor in a basic switching or relay-drive application. 

But yes, in the general case, the right thing to do is use a FET.  There are single FETs with Rds(on) of a few dozen milliohms with 1.8V CMOS driving the gate.
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2320
  • Country: au
Re: Base Resistor for NPN BJT used as a switch
« Reply #10 on: August 02, 2016, 04:09:11 am »
If you're going to explicitly arrange two BJTs as a "darlington pair", why not just connect the first collector to the right place instead? It may be true that the darlington could work "well enough", but why not instead halve power wastage for free?
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9936
  • Country: us
Re: Base Resistor for NPN BJT used as a switch
« Reply #11 on: August 02, 2016, 05:58:24 am »
If you're going to explicitly arrange two BJTs as a "darlington pair", why not just connect the first collector to the right place instead? It may be true that the darlington could work "well enough", but why not instead halve power wastage for free?

There must be a reason the device exists, the designers had a plan...  I think it comes down to power consumption.

When we cascade common emitter amplifiers, the first stage is usually pretty easy to drive.  But it will have a fairly low collector resistor because that resistor has to provide all of the base current for the second stage.  Fine, it will work if the resistor is low enough.  However, the resistor will be dissipating maximum power whenever the relay is off because the first stage pulls it to ground to shut off the second stage.  So, all the time the relay is off, the first stage is wasting power.

In the case of the Darlington, when the relay is off, both transistors are off and no power is being wasted.

To be fair, the wasted power doesn't amount to much.  If we're talking about a 220 Ohm resistor and a 5V circuit, the power dissipation is just 114 mW.
 

Offline anishb92

  • Newbie
  • Posts: 1
  • Country: in
Re: Base Resistor for NPN BJT used as a switch
« Reply #12 on: August 02, 2016, 06:19:58 am »
Vin=Vcc=5V,
@IC = 100 mAdc, VCE = 1.0 Vdc.... DCGain (Hfe)- 30min
           0.1            5-0.7
Ib = -------- =   ---------
           30              Rb

Rb ~ 1.2K
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9936
  • Country: us
Re: Base Resistor for NPN BJT used as a switch
« Reply #13 on: August 02, 2016, 01:48:33 pm »
Vin=Vcc=5V,
@IC = 100 mAdc, VCE = 1.0 Vdc.... DCGain (Hfe)- 30min
           0.1            5-0.7
Ib = -------- =   ---------
           30              Rb

Rb ~ 1.2K

This works if you assume the hFE is 30 as indicated in the Electrical Characteristics table.  But in Figure 16, there is an entirely different result - 10.  So, the resistor might be a maximum of 400 but that assumes that the controller can pull the signal to 5V while delivering 10 mA and that is unlikely.  So an even lower value is required, somewhere around 380 Ohms.
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7978
  • Country: nl
  • Current job: ATEX product design
Re: Base Resistor for NPN BJT used as a switch
« Reply #14 on: August 02, 2016, 02:40:40 pm »
1k. If you need more base current, BJT is not the solution. There are so called "digital transistors" which have built in resistors.
 

Offline WatthTopic starter

  • Regular Contributor
  • *
  • Posts: 241
  • Country: fr
Re: Base Resistor for NPN BJT used as a switch
« Reply #15 on: August 02, 2016, 08:25:17 pm »
Thanks everyone for your contributions. It is much appreciated.

I was trying to use the BJT since I already have them.
Now I see it's waaay simpler to use mosfets.
I guess something like this: http://www.onsemi.com/pub_link/Collateral/NTR4003N-D.PDF (ONsemi NTR4003N) is suited for this use, and have more than sufficient ratings.
Because "Matth" was already taken.
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2320
  • Country: au
Re: Base Resistor for NPN BJT used as a switch
« Reply #16 on: August 02, 2016, 08:36:08 pm »
Indeed, it's a better idea to use a FET in this application, but just to be sure: you shouldn't be intimidated by the depth of the discussion in this thread. Resistances anywhere between 250 ohm and 1 kiloohm would have probably appeared to work OK (assuming the load isn't too fussy) -- just because there's some healthy discussion over what the absolutely most optimal resistance is, doesn't mean that there isn't actually a fair bit of wiggle room to work in (if anything, it proves that there is wiggle room!) Some of our suggestions would have given the load 4V, others 4.5V or more. No big difference, most of the time!
 

Offline WatthTopic starter

  • Regular Contributor
  • *
  • Posts: 241
  • Country: fr
Re: Base Resistor for NPN BJT used as a switch
« Reply #17 on: August 02, 2016, 08:44:15 pm »
Indeed, it's a better idea to use a FET in this application, but just to be sure: you shouldn't be intimidated by the depth of the discussion in this thread. Resistances anywhere between 250 ohm and 1 kiloohm would have probably appeared to work OK (assuming the load isn't too fussy) -- just because there's some healthy discussion over what the absolutely most optimal resistance is, doesn't mean that there isn't actually a fair bit of wiggle room to work in (if anything, it proves that there is wiggle room!) Some of our suggestions would have given the load 4V, others 4.5V or more. No big difference, most of the time!
The project is some kind of led array. Each transistors handles less than 100mA.
I'll make some breakout boards for sot-23, and experiment with different R values with the BJTs.
Because "Matth" was already taken.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf