What is a transistor?
What does a transistor do?
Think of a transistor as a tap on a water pipe. Turning the handle takes very little effort, yet it controls a powerful flow of water. In a transistor, the "handle" is a small current or voltage on one pin, and the "flow" is a much larger current through the other two pins.
- As a switch: a small signal turns the main current fully on or fully off. A microcontroller pin that can only supply a little current can use a transistor to switch a motor, a relay or a bright light.
- As an amplifier: a small, changing signal makes a larger copy of itself in the main current. This is how a weak signal from a microphone or guitar pickup is made strong enough to drive a speaker.
How does a transistor work?
Transistors are made from semiconductors, usually silicon. Pure silicon barely conducts, but adding tiny amounts of other elements, called doping, changes that. N-type silicon has extra free electrons, and p-type silicon has "holes" where electrons are missing. A transistor is a sandwich of these layers. Where they meet, a thin region forms that blocks current until the right signal opens it.
The NPN transistor: base, collector and emitter
The classic transistor, the bipolar junction transistor (BJT), has three pins. In the common NPN type, current flows in at the collector and out at the emitter, but only when a small current flows into the middle pin, the base.
- No base current: the transistor is off, and almost no current flows from collector to emitter.
- A small base current: a much larger collector current flows. The ratio is the current gain, written β or hFE. With a gain of 100, a base current of 0.02 mA lets 2 mA flow through the collector.
- Enough base current: the transistor is fully on, called saturated, and acts like a closed switch.
A silicon BJT needs about 0.7 V between base and emitter before it starts to conduct, as Electronics Tutorials explains. Gains vary a lot between transistor types, from around 20 in high current power transistors to over 1,000 in some small ones.
The MOSFET: switched by voltage
The other main family is the field effect transistor, and the most common kind is the MOSFET. Its pins are the gate, source and drain. A voltage on the gate creates a thin conducting channel between source and drain. The gate is insulated, so almost no current flows into it: a MOSFET is controlled by voltage, not current. That makes it use very little power when it isn't switching, which is why chips are built from MOSFETs.
| BJT (for example NPN) | MOSFET | |
|---|---|---|
| Pins | Base, collector, emitter | Gate, source, drain |
| Controlled by | A small base current | A gate voltage |
| Current into the control pin | Small but not zero | Almost none |
| Typical uses | Simple switching and audio amplifiers | Computer chips, power supplies, motor drivers |
Worked example: a transistor switching an LED
A 5 V control signal should switch on an LED powered by a 9 V battery. The LED needs 20 mA and drops 2 V. We use an NPN transistor with a gain of 100 and a base resistor of 2.2 kΩ.
Step 1: the base current. About 0.7 V is lost across the base and emitter, so the base resistor has 5 − 0.7 = 4.3 V across it. By Ohm's law, I = V ÷ R = 4.3 ÷ 2200 = 0.00195 A, which is 1.95 mA.
Step 2: is that enough? With a gain of 100, the transistor could pass up to 100 × 1.95 = 195 mA. The LED only needs 20 mA, so the transistor will be fully on, like a closed switch.
Step 3: the LED's resistor. When saturated, a small transistor drops about 0.2 V. That leaves 9 − 2 − 0.2 = 6.8 V across the LED's resistor, so R = 6.8 ÷ 0.020 = 340 Ω. You would pick the nearest standard value above it, so the current stays safely under 20 mA.
The 5 V signal only supplies about 2 mA, yet it controls the LED's 20 mA from a separate 9 V supply. That is the whole point of a transistor switch. Swap the 5 V signal for a light sensor in a potential divider and you have an automatic night light. You can build the sensor half of that circuit in our Circuit Builder.
Try one: this question asks you to size the resistor that protects an LED.
Size the series resistor for a given LED current.
Press Mark to have your answer marked in the Circuits course.
Transistors in computers
A computer stores and processes everything as 1s and 0s, on and off. A transistor switch is a perfect on/off device, and wiring a few together makes a logic gate. In the CMOS technology used in almost all chips, a NOT gate takes 2 transistors and a two input NAND gate takes 4. Combine millions of gates and you get adders, memory and a whole processor.
Because they are so small, the numbers are huge. Apple says its M4 chip, announced in May 2024, contains 28 billion transistors. Our guide to how a CPU works shows what they do. Try this question to see a gate's rule in action:
Predict a logic gate's output from its inputs.
Press Mark to have your answer marked in the Circuits course.
Who invented the transistor?
The first working transistor was made at Bell Telephone Laboratories in the USA in December 1947, by John Bardeen and Walter Brattain, working in William Shockley's group. It was a point contact transistor, made of gold contacts pressed onto a piece of germanium. Shockley went on to design the junction transistor. The three shared the 1956 Nobel Prize in Physics "for their researches on semiconductors and their discovery of the transistor effect", as Bell Labs records.
Before transistors, electronics used vacuum tubes (valves in the UK): glass bulbs that were large, fragile, power hungry and hot. Transistors replaced them and made portable radios, calculators and, eventually, smartphones possible.
Common mistakes
- Thinking a transistor creates energy. An amplifier's bigger output comes from the power supply. The transistor only controls it.
- Leaving out the base resistor. Without one, the base draws too much current and the transistor or the control pin can be damaged.
- Mixing up the pins. Pin order differs between models, so check the datasheet before wiring.
- Assuming IC = β × IB when the transistor is fully on. In saturation, the outside circuit limits the current, not the gain.
- Confusing a transistor with a diode. A diode has two pins and only lets current one way. A transistor has three and lets one current control another.
Common questions
What does a transistor do in simple terms?
What are the 3 pins of a transistor?
What is the difference between NPN and PNP transistors?
How many transistors are in a computer?
Why are transistors important?
Is a transistor a semiconductor?
Revision cards
Read the front, say your answer, then flip to check.
Where to go next
- Solve it
Circuit Builder
Build any DC circuit with meters, lamps, LEDs and sensors, and see live readings
Open the tool - Learn it
Circuits
Resistors, capacitors and logic gates: build and understand real circuits
Start the course - Test it
High School Physics
A new exam-style paper every day, with instant marking and a mark scheme
Start today's paper