Base Resistor for NPN BJT used as a switch - Page 1
Forum section: electronics / beginners

author: Watth
author_rank: Frequent Contributor
timestamp: August 01, 2016, 07:46:51 pm
content: 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.pdfWhat value should the resistor in series with the base have?Thanks a lot!

author: Signal32
author_rank: Frequent Contributor
timestamp: August 01, 2016, 07:50:24 pm
content: ~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

author: rs20
author_rank: Super Contributor
timestamp: August 01, 2016, 08:14:14 pm
content: 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.Quote from: Signal32 on August 01, 2016, 07:50:24 pmI 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.

author: rstofer
author_rank: Super Contributor
timestamp: August 01, 2016, 08:29:09 pm
content: 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 hFEis 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)?

author: rs20
author_rank: Super Contributor
timestamp: August 01, 2016, 08:58:54 pm
content: Quote from: rstofer on August 01, 2016, 08:29:09 pmAnd that's just atypicalvalue (as it's derived from a graph for atypicaldevice), not even a guaranteed minimum!

author: KE5FX
author_rank: Super Contributor
timestamp: August 01, 2016, 09:52:13 pm
content: 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.

author: rstofer
author_rank: Super Contributor
timestamp: August 01, 2016, 10:54:50 pm
content: Quote from: KE5FX on August 01, 2016, 09:52:13 pmThat 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.

author: rs20
author_rank: Super Contributor
timestamp: August 02, 2016, 12:22:02 am
content: Quote from: rstofer on August 01, 2016, 10:54:50 pmA 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.

author: rstofer
author_rank: Super Contributor
timestamp: August 02, 2016, 02:16:49 am
content: Quote from: rs20 on August 02, 2016, 12:22:02 amIf 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.PDFA 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/

author: KE5FX
author_rank: Super Contributor
timestamp: August 02, 2016, 02:26:44 am
content: 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.

author: rs20
author_rank: Super Contributor
timestamp: August 02, 2016, 04:09:11 am
content: 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?

author: rstofer
author_rank: Super Contributor
timestamp: August 02, 2016, 05:58:24 am
content: Quote from: rs20 on August 02, 2016, 04:09:11 amThere 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.

author: anishb92
author_rank: Newbie
timestamp: August 02, 2016, 06:19:58 am
content: Vin=Vcc=5V,@IC = 100 mAdc, VCE = 1.0 Vdc.... DCGain (Hfe)- 30min0.1 5-0.7Ib = -------- = ---------30 RbRb ~ 1.2K

author: rstofer
author_rank: Super Contributor
timestamp: August 02, 2016, 01:48:33 pm
content: Quote from: anishb92 on August 02, 2016, 06:19:58 amThis works if you assume the hFEis 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.

author: tszaboo
author_rank: Super Contributor
timestamp: August 02, 2016, 02:40:40 pm
content: 1k. If you need more base current, BJT is not the solution. There are so called "digital transistors" which have built in resistors.

author: Watth
author_rank: Frequent Contributor
timestamp: August 02, 2016, 08:25:17 pm
content: 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.

author: rs20
author_rank: Super Contributor
timestamp: August 02, 2016, 08:36:08 pm
content: Indeed, it's a better idea to use a FET in this application, but just to be sure: you shouldn't beintimidatedby 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 thereiswiggle room!) Some of our suggestions would have given the load 4V, others 4.5V or more. No big difference, most of the time!

author: Watth
author_rank: Frequent Contributor
timestamp: August 02, 2016, 08:44:15 pm
content: Quote from: rs20 on August 02, 2016, 08:36:08 pmThe 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.