Circuit 3D

How a transistor works

A transistor is an electronic switch with no moving parts: a small current into one pin controls a much larger current through the other two. The most common kind, the bipolar junction transistor (BJT), has a base, a collector and an emitter, and its gain sets how much bigger the controlled current can be. With a gain of 100, 50 µA into the base lets up to 5 mA flow through the collector.

IC = gain × IB

where IC is the collector current, IB the base current, and the gain, also written hFE or β, is often 100 or more for a small transistor.

Used as a switch it turns a load fully on or off; used as an amplifier it makes a small signal bigger.

What is a transistor?

A transistor is a semiconductor component that uses a small current or voltage to control a larger current, which makes it a switch or an amplifier.

Inside, a bipolar junction transistor is three thin layers of doped silicon, forming two PN junctions like a diode’s. A small current into the middle layer lets a far larger one flow through all three, which is how a tiny signal from a sensor or a chip can switch a lamp, a motor or a buzzer.

About 830 µA into the base lets about 14.5 mA through the LED: the transistor is fully on.

Figure 1. The lab’s transistor and a red LED. A small current into the transistor’s base switches on a far bigger one through the LED.

What is the difference between NPN and PNP transistors?

NPN and PNP transistors are mirror images: an NPN switches on when its base is pulled about 0.7 V above its emitter, and a PNP when its base is pulled 0.7 V below.

Each has three pins. The base is the control; the collector and emitter carry the controlled current. NPN transistors are the more common choice for switching a load to ground; see the common transistors for real parts and pinouts.

B, base C, collector E, emitter

NPN: on when the base is about 0.7 V above the emitter; current flows in at the collector and out at the emitter.

Figure 2. The two kinds of bipolar transistor. The arrow on the emitter points the way conventional current flows.

How does a transistor amplify?

A transistor amplifies because its collector current follows the base current multiplied by its gain, so with a gain of 100, a 50 µA change at the base makes a 5 mA change at the collector.

The gain, hFE or β, varies from part to part and with temperature, so circuits are designed not to depend on its exact value; an op amp uses feedback to do just that. Once the load allows no more current, the transistor is saturated: fully on, and working as a closed switch.

01002001020 Base current (µA) mA

IC = gain × IB = 100 × 50 µA = 5 mA

Figure 3. Collector current against base current. It rises in step with the base, gain times over, until the LED path caps it at 14.5 mA.

How does a transistor work as a switch?

A transistor works as a switch by running fully on or fully off: give its base more than enough current and it saturates, dropping only about 0.2 V; give it none and it turns off.

A resistor in series with the base sets that current and protects the base from too much. Microcontrollers use transistors this way to drive loads that need more current than their pins can supply.

What is the difference between a BJT and a MOSFET?

A BJT is controlled by the current into its base; a MOSFET by the voltage on its gate, which draws almost no current once it is set.

MOSFETs switch large currents efficiently and fill digital chips; BJTs remain common for small switching and amplifying jobs, where their steady gain and low cost suit.

How do you choose a base resistor?

To choose a base resistor, divide the load current by the gain, allow about 5 times that, and apply Ohm’s law after the base’s 0.7 V: a 5 V signal switching 20 mA needs 3.9 kΩ.

Example 1: choose a base resistor

A 5 V signal should switch a 20 mA load through an NPN transistor. What base resistor does it need?

Given
a 5 V signal, a load of 20 mA, and a gain of at least 100
Find
the base resistor, RB
Solution
The least base current that works: 20 mA ÷ 100 = 200 µAFor a solid switch, give it 5 times that: 1 mARB = (5 V − 0.7 V) ÷ 1 mA ≈ 4.3 kΩ; the next standard size down is 3.9 kΩ
Answer
RB ≈ 3.9 kΩ

Example 2: find the collector current

A transistor with a gain of 100 gets 50 µA into its base. How much current can flow into its collector?

Given
a gain of 100, a base current of 50 µA, and a load that allows more
Find
the collector current, IC
Solution
IC = gain × IB = 100 × 50 µA = 5 mA
Answer
IC = 5 mA

Summary

Key equations

  • IC = gain × IB before the load limits it
  • RB = (V − 0.7 V) ÷ IB the base resistor

Key terms

Base (B)
The pin whose small current controls the transistor.
Collector and emitter
The pins the controlled current flows between.
Gain (hFE, β)
How many times the base current the collector can carry.
Saturation
Fully on: the load sets the current.

Practice problems

  1. A transistor with a gain of 200 gets 50 µA into its base. What collector current can it pass?

  2. Which pin controls a bipolar transistor?

  3. About what voltage must an NPN’s base sit above its emitter to switch on?

  4. A switch transistor is fully on. What sets the current through its load?

  5. Which way does the emitter arrow point on an NPN symbol?

FAQ

What do transistors do, in simple terms?

They let a small current switch or control a bigger one, like a tap that a fingertip can turn on to release a much larger flow.

Is a transistor a switch or an amplifier?

Both. Driven fully on or off it is a switch; held between the two, its output follows its input at a larger size, which is amplifying.

What is hFE on a transistor?

Its DC current gain: the collector current divided by the base current. Small general-purpose transistors are often 100 to 300.

Why does a transistor need a base resistor?

Without one, the base–emitter junction acts like a diode straight across the supply, so too much current flows and can destroy it. The resistor sets a safe base current.

How many transistors are in a computer chip?

Billions. A modern processor packs tens of billions of tiny transistors, each switching on and off billions of times a second.

Who invented the transistor?

The first working transistor was built at Bell Labs in the United States in 1947.

How do you tell if a transistor is NPN or PNP?

Check its part number against the datasheet; on a schematic, the emitter arrow points out for NPN and in for PNP.

What is a 2N3904?

A common small NPN transistor, rated for up to 200 mA and 40 V, with a gain of 100 or more; the 2N3906 is its PNP twin.

What is a PNP transistor?

A transistor that switches on when its base is pulled about 0.7 V below its emitter, so it usually switches the positive side of a load; the 2N3906 is a common one.

What is a 2N2222?

A common small NPN transistor like the 2N3904 but rated for more current, up to 600 mA at 40 V, with a gain of about 100 or more.

What is a Darlington transistor?

Two transistors joined so the first’s emitter current drives the second’s base, multiplying their gains, so two gains of 100 make about 10,000; it drops about 1.2 V or more when on.