How to read NPN (2N4401) datasheet - Page 1
Forum section: electronics / beginners

author: stafil
author_rank: Regular Contributor
timestamp: March 06, 2020, 10:14:19 pm
content: First of all, apologies as I am a complete newbie. I have read about BJT transistors and I think I understand the basics.I am planning to use a microcontroller to drive an NPN transistor.According to the microcontroller datasheet the current out of the pin can be 25mA max at 3.3V.I am trying to figure out what resistor to put before the base to turn it on.The datasheet is herehttps://www.mccsemi.com/pdf/Products/2N4401(TO-92).pdfI see that the Base Cutoff Current is is 0.1uA. So it's clear when it will be in cutoff mode.However I am having difficult time understanding the current I need for saturation mode.In the On Characteristics I see:Base-Emitter Saturation Voltage (IC=150mAdc, IB=15mAdc) and (IC=500mAdc, IB=50mAdc)If it is not up to me what the maximum IC will be, is it safe to assume that 15mA base current will bring the transistor to saturation mode?

author: greenpossum
author_rank: Frequent Contributor
timestamp: March 06, 2020, 10:19:10 pm
content: You take the minimum transistor gain (at the collector current you intend to run), divide the current by the gain, and that's the base current you need.

author: David Hess
author_rank: Super Contributor
timestamp: March 07, 2020, 12:50:38 am
content: The worse case voltage across the resistor is the output voltage minus the worst case base-emitter saturation voltage:3.3 - 1.2 = 2.1 voltsThe required base current is the collector current divided by the worst case hfe:500 milliamps / 40 = 12.5 milliampsSo the base resistor is 2.1 volts / 12.5 millamps = 160 ohms. The output driver has its own series resistance which could be subtracted from this.Personally I think 12.5 milliamps is pushing it as far as reliability and when driving a potentially unknown load. I would prefer to include overload protection but the above is completely workable.

author: Ian.M
author_rank: Super Contributor
timestamp: March 07, 2020, 03:15:23 am
content: However, if you design for IB=IC/hFE(min)then worst case the transistor wont actually be in saturation. For guaranteed saturation, you need excess base current. As hFEfalls at low temperatures, and high collector currents, if you get a transistor that's at the lower end of the specified hFE(min)range, even if you've used the right hFE(min)for your actual IC, if you've used the calculated minimum Ib, and your transistor is exposed to very low temperatures, you can bet that it *WON'T* be in saturation.Note that all the saturation specs. in the datasheet are at a forced ß of 10 (i.e. IC/IB=10). If you want guaranteed bulletproof saturation, that's what you should design to. In practice, for a hobby circuit in a shirtsleeve environment, you can get away with as little as double the base current calculated from IB=IC/hFE(min)provided you can tolerate a higher VCE(sat).N.B. the OnSemi 2N4401 datasheet has more detailed graphs (and more of them):https://www.onsemi.com/pub/Collateral/MMBT4401-D.PDFAlso, don't expect the MCU's I/O pin to deliver its maximum rated current at an output voltage equal to Vcc. It *WILL* sag significantly, and the drop gets worse with increasing I/O pin output MOSFET junction temperature, and with reduced Vcc. If you are lucky, the MCU datasheet will have at least an indicative IOHvs. VOHgraph, but many omit such graphs. Expecting to get more than 50% of IOH(max)is a mug's game - at low Vcc it may not even deliver that if the pin is shorted to ground - so its prudent to design to a much lower IOHlimit, and even so allow for VOHdroop when calculating the transistor base resistor value.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 08, 2020, 06:45:30 am
content: I had composed a most exquisite post, but it is too large to fit in the margin...So I formatted an article instead:https://www.seventransistorlabs.com/Articles/ProtectedSwitch.htmlCheers,Tim

author: David Hess
author_rank: Super Contributor
timestamp: March 09, 2020, 02:23:27 am
content: Ian.M is correct; the usual design procedure is to operate the transistor at a forced beta which is significantly lower than the specified minimum hfe. The calculations I did just show the absolute minimum drive given the datasheet parameters. I should have made that clear.With that in mind and a minimum base current of 12.5 milliamps, I would use some other arrangement like a second transistor to reduce the current needed from the I/O pin.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 09, 2020, 03:04:26 am
content: Quote from: David Hess on March 09, 2020, 02:23:27 amI don't think this is much of a problem with most MCUs, but it can be important with some embedded devices -- FPGAs for example are usually rated pretty feebly on their GPIO capacity. Presumably they use really tiny transistors so as to save capacitance for input and LVDS operating modes -- but they run afoul of problems like electromigration, and relatively poor ESD sensitivity.The datasheet will say what the DC and peak ratings are, in any case.Also don't forget to respect the total pin currents, for VDD, VSS and so on. 25mA per GPIO might be okay, but the total might be say 100mA, so you can only run four pins at that level, and if you need more (e.g. driving a LED display, worst case 7+ segments at 20mA each), a buffer is worthwhile.The buffer can also be rated for more ESD or other extreme values. It could also be more easily replaced, say if DIP and a socket were used, or a riser board or something. That's almost never bothered with, in commercial design, but hey, it's a possibility at least.Tim