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.
The two circuits below work without an account. 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
Both run on 9 V and light an LED through 470 Ω. A toggle switch drives the base through 10 kΩ; an ammeter shows the LED current, a voltmeter the collector-emitter voltage.
NPN low-side switch
The LED sits between the battery's + and the collector; the emitter goes to ground. With the switch open no current reaches the base, so the transistor is off; real circuits add a base-emitter resistor to hold it off.
- Click the switch. About 0.84 mA flows into the base, the transistor turns fully on and the ammeter reads about 14-16 mA.
- Less than 0.1 V is left from collector to emitter: the transistor is saturated, a closed switch.
- Click it again and the LED goes out. The voltmeter reads about 7.8 V, not 9 V: a tiny leakage current still flows through the LED, which drops about 1.2 V.
PNP high-side switch
The emitter goes to the battery's +, the LED between the collector and ground. Closing the switch pulls the base toward ground through 10 kΩ and turns it on.
- Click the switch. Current flows out of the base and the ammeter reads about 14-16 mA, with less than 0.1 V across the transistor.
- Click it again. The base current stops and the LED goes out.
- Same load and current: the NPN base is pulled up, the PNP base down.
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.
In the NPN switch the base gets about 0.84 mA, enough for 84 mA at beta 100, but the LED passes only about 14-16 mA, so the transistor saturates.
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.
More transistor circuits
Each runs without an account.
- NPN motor driver with a flyback diode – The 12 V motor draws about 5.9 A, so it has a 150 Ω base resistor; for a load this big a MOSFET is the usual choice.
- Voltage-divider bias with two meters – 15 V, 10 kΩ / 4.7 kΩ divider, 3.9 kΩ collector, 3.3 kΩ emitter, beta 200: about 1.2-1.3 mA.
- NPN vs PNP, side by side – The divider-bias circuit and its PNP mirror: both about 1.2-1.3 mA, with the voltages turned around.
- Current mirror with two NPN transistors – 12 V and an 11 kΩ reference: the output copies about 1.0 mA, whatever the load.
- Darlington pair driving an LED – Two NPN transistors wired as one: about 40 µA into the base lights the LED from 5 V.
Use it in class
Each circuit is a ready assignment: change one part, then measure.
NPN switch: replace the LED and its 470 Ω resistor with a 1 kΩ load, vary the base resistor, measure Ic and Vce. At 10 kΩ expect about 9 mA with Vce under 0.1 V (saturated); at 220 kΩ, about 3.8 mA and Vce about 5.2 V (amplifying: Ic ≈ β × Ib).
PNP switch: the same change on the high side; expect the same currents, with the voltages turned around.
Divider bias: change beta from 200 to 100 and measure Ic; it stays at about 1.2-1.3 mA.
Current mirror: change the load from 4.7 kΩ to 1 kΩ or 2.2 kΩ; the output stays at about 1.0 mA.
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.