Transistor: NPN vs PNP, how it works, with live circuits
A transistor lets a small current control a much larger one. Learn its symbol, pins and NPN vs PNP, then flip two live transistor switches in the DCACLab simulator.
On a computer or tablet the full lab is limited without an account; a free account lets you try it in full first. NGSpice charts need an account; saving needs a plan. Create a free account
What is a transistor?
A transistor is a three-pin part in which a small current controls a larger one. This page covers the bipolar junction transistor, or BJT: collector (C), base (B) and emitter (E). A base current lets about beta times as much flow from collector to emitter: fully on or off it is a switch, in between an amplifier. The lab has both kinds, NPN and PNP.
The transistor symbol and its three pins
These are the symbols the lab draws in its Symbols view. The arrow on the emitter points out on an NPN transistor and in on a PNP one. On the lab's part the pins run E, B, C from left to right (real parts vary; check the datasheet); Swap E/C swaps collector and emitter.
NPN vs PNP
Both turn on in opposite ways:
- NPN: on when current flows into the base, about 0.6 V above the emitter in the lab; current flows collector to emitter.
- PNP: on when current flows out of the base, about 0.6 V below the emitter; current flows emitter to collector.
- NPN usually switches the low side: load between the supply and the collector, emitter to ground.
- PNP usually switches the high side: emitter to the supply, load between the collector and ground.
The transistor as a switch
How a transistor works
Three states, with Ib the base current, Ic the collector current and β (beta) the gain:
- Off (cut-off): no base current, almost no collector current: an open switch.
- Amplifying (active region): Ic is about β × Ib. Beta is 100 by default in the lab, so 0.1 mA into the base allows 10 mA.
- Saturated: more base current than the load needs; the load sets Ic, little voltage is left across the transistor, and the switch is closed.
The lab's model is for learning, not for picking a real part: no part numbers, no heating, and no Early effect in the offline engine. The Beta/hFE slider stops at 100; type larger values in its box. With NGSpice on, the model settings also take the forward beta, the Early voltage and the base, collector and emitter resistances.
Transistor vs MOSFET
- Control: a BJT by the current into its base, a MOSFET by the voltage on its gate.
- Drive: a BJT needs base current while on; a MOSFET's gate draws none.
- Turn-on: a BJT at about 0.6 V from base to emitter in the lab, a MOSFET a few volts past its threshold.
- Use: BJTs in small amplifiers and switches; MOSFETs for big loads.
Use it in class
Setting up a class needs a free account. Your free classroom gets a 7-day full-class trial, counted from when the first student joins; after that the classroom stays open for a smaller class.
Keep going
Frequently asked questions
What does a transistor do?
It lets a small current control a larger one: a small base current switches a load on and off, or amplifies a signal.
Which is better for switching, NPN or PNP?
NPN on the low side, turned on by pulling its base up; PNP on the high side, turned on by pulling its base down.
Why does the base need a resistor?
The base-emitter junction acts like a diode: past about 0.6 V its current rises steeply. The resistor sets the base current, here (9 V − 0.6 V) / 10 kΩ, about 0.84 mA.
What is the difference between a transistor and a MOSFET?
A MOSFET is also a transistor: a BJT is controlled by base current, a MOSFET by gate voltage.
Can I simulate a transistor free online?
Yes. The circuits on this page run free in your browser, no account needed. A free account lets you try the full lab, then it switches to a limited mode.
Build your own transistor circuit
Open the lab and wire the NPN low-side switch yourself.