Lab

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.

Open the lab

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 transistor symbol, pins E, B and C E B C
NPN transistor
PNP transistor symbol, pins E, B and C E B C
PNP transistor

NPN vs PNP

Both turn on in opposite ways:

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.

Preview of NPN Transistor Low-Side Switch with an LED
Open in the lab Embed Run the circuit right here. To edit it in the full lab, sign in; free accounts have a time limit there.
  1. Click the switch. About 0.84 mA flows into the base, the transistor turns fully on and the ammeter reads about 14-16 mA.
  2. Less than 0.1 V is left from collector to emitter: the transistor is saturated, a closed switch.
  3. 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.

Preview of PNP Transistor High-Side Switch with an LED
Open in the lab Embed Run the circuit right here. To edit it in the full lab, sign in; free accounts have a time limit there.
  1. 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.
  2. Click it again. The base current stops and the LED goes out.
  3. 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:

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

How a MOSFET works, with live circuits

More transistor circuits

Each runs without an account.

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.

Try it with your class

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.

Open the lab