Parts

Transistor

A bipolar transistor, NPN or PNP, from the 2N2222 and BC547 to the TIP120: a small base current lets a much larger one flow from collector to emitter.

This part has a page of its own, with a note on using it and a circuit to try: the part page.

It is the part every class meets the moment a board pin has to run something a board pin cannot run on its own (a motor, a relay coil, a filament lamp, a string of LEDs), and it is the reason those things are never wired straight to a pin.

Pins

Pin What it does
C Collector.
B Base. A little current here controls a lot more at C.
E Emitter.

The legs are drawn where the real part has them. Hold a TO-92 with the flat face toward you and the legs down: a PN2222A, 2N3904, 2N3906 or PN2907A reads E B C from the left, while a BC547, BC548 or BC557 reads C B E. A TIP120 in its TO-220, printing toward you, reads B C E. The picture shows the part from that side, flat face or printing toward you, so it can be copied onto a real breadboard hole for hole. The 2N2222 and 2N2907 models are drawn as the PN2222A and PN2907A, the TO-92 parts a kit has in it.

The rest, the same way:

Reads from the left Models
E B C (TO-92) S8050, S8550, 2N4401, 2N4403
C B E (TO-92) BC337, BC327
E C B (TO-92) 2SA1015
B C E (TO-220, tab on the collector) TIP31C, TIP32C, TIP41C, TIP42C, TIP122, TIP125
E C B (TO-126, printing toward you) BD139, BD140
B C E (TO-264) 2SC5200, 2SA1943

A TO-3 (2N3055, MJ2955) has only two legs, base and emitter, and the metal case is the collector. It is drawn from above, B and E with the collector as a solder lug under one of the mounting screws, which is how a TO-3 is wired.

Changing the model moves the legs to match. A wire names its pin, so it follows the leg; a part sitting in a breadboard stays where it is, its legs now in different holes, exactly as when you swap the real part, and the editor tells you so.

Some makers' parts with the same number differ again (onsemi's P2N2222A is C B E), so for a part from anywhere else the datasheet's pin diagram is the one to follow: a transistor in backwards still conducts a little, with a gain of a few, and is a hard fault to find.

Properties

model: 2N2222 (NPN, the classic 800 mA metal-can switch), BC547 and BC548 (NPN, the European 100 mA small-signal part; the same die on the same card, separated on a real datasheet only by a collector-emitter voltage rating this model does not have), 2N3904 (NPN, the American 200 mA equivalent), TIP120 (an NPN Darlington in TO-220, a 5 A switch with a gain in the thousands), 2N3906 (PNP), 2N2907 (PNP, the 2N2222's complement) or BC557 (PNP, the BC547's).

Then the later ones, NPN with their PNP complements: S8050 and S8550 (the 500 mA pair in Chinese kits), BC337 and BC327 (the European 800 mA pair), 2N4401 and 2N4403 (the American 600 mA pair), TIP31C and TIP32C (3 A, TO-220), TIP41C and TIP42C (6 A, TO-220), BD139 and BD140 (1.5 A, TO-126), 2SC5200 and 2SA1943 (the 15 A audio amplifier pair, TO-264), 2N3055 and MJ2955 (15 A, TO-3), and the TIP122 and TIP125 Darlingtons (5 A, TO-220). A PN2222A is the 2N2222 model, which is drawn as one.

Each model is its manufacturer's own SPICE model card:

Model Card Gain (hFE) at 10 mA, 5 V
2N2222 Philips Q2N2222A 184
BC547, BC548 NXP BC547B 280
2N3904 Fairchild Q2N3904 165
TIP120 ON Semiconductor TIP120 subcircuit about 1930 at 0.5 A, 3 V
2N3906 Fairchild Q2N3906 189
2N2907 Fairchild PN2907A 232
BC557 NXP BC557B 330
S8050, S8550 Fairchild SS8050, SS8550 211, 188
BC337, BC327 Philips BC337-25, BC327-25 283, 384
2N4401, 2N4403 Fairchild 2N4401, 2N4403 179, 218
2SA1015 Fairchild KSA1015 180
TIP31C, TIP32C onsemi TIP31C, TIP32C 178, 192
TIP41C, TIP42C onsemi TIP41C, TIP42C 57, 123
BD139, BD140 Fairchild BD139, BD140 197, 184
2SC5200, 2SA1943 Fairchild 2SC5200, 2SA1943 99, 94
2N3055, MJ2955 onsemi 2N3055, MJ2955 92, 106
TIP122, TIP125 onsemi TIP122, TIP125 subcircuits about 1900 and 1870 at 0.5 A, 3 V

A few of those are worth knowing about. The S8050 and S8550 come from many makers, none of which publishes a model; Fairchild's SS8050 and SS8550 are the same numbers and leg order from a maker that does. The BC337 and BC327 are the -25 gain group, the middle one. The 2SA1015 is Fairchild's KSA1015, sold as its equivalent; that card has one parameter (NK) this model does not, which puts its gain 0.75% high at 10 mA. The onsemi TO-220 cards have a low base-emitter drop at small currents, about 0.52 V at 10 mA where a small transistor is 0.7 V, though their gain is inside the datasheet everywhere it quotes one. A power transistor's gain at 10 mA means little: its datasheet quotes it at amps, where every one of these is inside its range.

Two parts are not offered because no model for them could be used honestly: the 2SC945 (C945), whose makers publish none, and the 2N5551, whose only model may not be redistributed, and Mokxi's SPICE export writes every model it uses out to the file.

beta, vbe and vce_sat are off at zero, which is the card as the vendor wrote it. When they are set they are read as measurements:

  • beta is the current gain Ic / Ib at 10 mA of collector current with 5 V across the transistor (on a Darlington: at 0.5 A and 3 V, the datasheet's own hFE condition, and it is the gain of the pair). The gain keeps the card's shape: lower at microamps, falling off at hundreds of milliamps, and passing through beta at 10 mA. It is not the card's BF parameter, which on every vendor card is a fitting number well above any gain the part really shows. A project saved with beta set keeps the gain it asked for at 10 mA.
  • vbe is the base-emitter drop at 10 mA, which sets the saturation current.
  • vce_sat is the collector-emitter voltage at 10 mA with 1 mA of base current (a forced beta of 10, the datasheet's condition), which sets the reverse gain. The Darlingtons ignore vbe and vce_sat.

legs is package (the order above, the model's real one, which every new part gets) or schematic, which draws C B E from the left whatever the model. Older projects open with schematic, so their breadboards keep every leg in the hole it was in; switch to package to see the real part, and check the holes after.

What the model gets right

Gummel-Poon, the full SPICE transistor model, solved by Newton-Raphson along with everything the transistor is wired to. It is checked against ngspice 42 on the same cards: low-side switches at 10 mA, 100 mA and 500 mA, a PNP high-side switch, an emitter follower, a common-emitter stage's operating point and the TIP120, all to a fraction of a percent.

There is no base-emitter drop written into the part, and no saturation floor. Vbe is whatever the base current makes it (about 0.66 V at a milliamp of collector current and 0.70 V at ten on a 2N2222). The transistor bottoms out because the collector junction goes forward, plus the collector's own bulk resistance times the current. A 2N2222 switching 22 mA on four milliamps of base current sits at about 44 mV.

The gain is not one number. It is lower at microamps (recombination in the base), highest in the milliamps, and falls off at hundreds of milliamps (high level injection). That fall is why "beta times the base current" stops working for big loads. A 2N2222 with a 10 Ω load on 5 V (half an amp) and a 1 k base resistor from a 5 V pin gets 4.1 mA of base current; at that current the gain has fallen below 100, so the transistor never saturates: it passes 389 mA and drops 1.1 V, a third of a watt of heat. With 220 Ω on the base it saturates at 447 mA and 0.53 V, inside the datasheet's VCE(sat) of 1 V at 500 mA.

Because the Early voltage is finite the active region tilts with Vce the way a curve tracer draws it, so a common-emitter stage has a real output resistance and a real gain. The junction capacitances and the charge stored in the base are in the card too, so a stage has a Miller capacitance, a transistor has an fT, and one driven hard into saturation takes a moment to turn off.

A PNP is the same three pins with every voltage and every current the other way round. The probe reports the size of the collector current either way.

The TIP120 is two transistors, not one big one

A Darlington is a driver transistor whose emitter feeds a second transistor's base, on one die, with two bleed resistors and a reverse diode the package really has. It is modeled as exactly that, ON Semiconductor's own subcircuit: two Gummel-Poon transistors, 10 kΩ from the base to the node between them and 1 kΩ from there to the emitter (the datasheet's sketch says "about 8 k" and "about 120"; the vendor's model, fitted to measured parts, says otherwise), and the reverse diode. The three things that make a Darlington different are all things one transistor cannot do:

  • Its base-emitter drop is two junctions, about 1.4 V at an amp rather than 0.7, so the base resistor from a 5 V pin passes a good deal less than you would work out for a single transistor.
  • It cannot saturate. With a 12 Ω load on 12 V and 1 k from a 5 V pin, the collector bottoms out at about 0.6 V and no lower, because the output transistor's collector is tied to the driver's. At an amp that is more than half a watt of heat in the part, and it is why a Darlington driving a motor needs a heatsink where a logic-level MOSFET does not.
  • Its gain collapses at low current, to about 15 at 0.1 mA of base current, because the 10 kΩ bleed takes the base current instead of the driver. That is why a Darlington datasheet does not quote hFE below half an amp.

The TIP122 and its PNP complement the TIP125 are the same circuit on onsemi's own models for each, and behave the same way.

What it does not model

Gain spread: each model is one card, so two parts out of the same bag are identical, where a real 2N2222's datasheet quotes 100 to 300 at one operating point alone. No breakdown: nothing avalanches at the datasheet's V(BR)CEO. No self-heating: the junctions sit at the simulation's temperature however much power the part dissipates. No thermal limit at all: this part will pass ten amps and report it honestly, where a real 2N2222 would let the smoke out at one. Nor a safe operating area, which is what really limits a 2N3055 or a 2SC5200 in an amplifier: the datasheet's curve of how much current it may carry at each voltage is not checked here.

Common mistakes

Leaving out the base resistor. Without one, the base-emitter junction is a bare diode across whatever is driving it, which either draws far more current than a GPIO pin can source or clamps the drive voltage to 0.7 V and does nothing useful.

See it in action

Motor on a transistor is built entirely around this one part doing its one job. Open it at /templates.

The NPN transistor as a switch page works through sizing the base resistor on a live 2N2222 driving a motor, and MOSFET vs BJT switches the same half-amp load with a 2N2222 and an IRLZ44N side by side.

How many LEDs can one Arduino pin drive? shows the point where a pin should hand the current to a 2N2222 or a 2N7000 instead.

The Arduino DC motor guide runs a gear motor from an Uno's pin 9 through a 2N2222, with the speed it reaches at each PWM duty.