Capacitors and Transistors
Learn how capacitors store charge and set timing with the RC time constant, and how a transistor lets a small current switch a much larger one.
Welcome back!
Step 1 of 11Learn
The LED that fades out slowly
Build a circuit with a battery, a resistor, an LED and a big capacitor connected across the LED. Disconnect the battery and something odd happens: the LED doesn't snap off. It fades out over a second or two. For that moment, the capacitor is acting like a tiny, fast-emptying battery.
A capacitor stores electric charge on two metal plates separated by an insulator. Connect it to a voltage and charge builds up on the plates until the capacitor's voltage matches the supply. Disconnect the supply and the capacitor can release that charge back into the circuit.
Capacitance is measured in farads (F), but one farad is huge, so you'll usually see:
- microfarads (μF), millionths of a farad: 1 μF to 1,000 μF in typical projects;
- nanofarads (nF) and picofarads (pF) for tiny capacitors in radio and timing circuits.
Capacitors have many jobs:
- Smoothing power: a capacitor near a chip supplies quick bursts of current and smooths out dips and noise.
- Timing: with a resistor, a capacitor charges at a predictable rate, setting delays and blink rates.
- Filtering signals, such as removing noise from a sensor reading.
- Storing energy for a short burst, like a camera flash.
Electrolytic capacitors (the cylindrical ones) are polarized: the stripe marks the negative leg, and connecting them backward can make them bulge or burst. Small ceramic capacitors can go either way.
Step 2 of 11Practice · Choose one
A cylindrical electrolytic capacitor has a stripe with minus signs down one side. What does that mark?
Step 3 of 11Diagram
Reading an electrolytic capacitor
Tap a shape with to see more.
- Electrolytic capacitor
- Stripe with − signs
Marks the negative leg. Reversing it can make the capacitor bulge or burst.
- Longer leg = +
Goes toward the more positive side of the circuit.
- Capacitance, e.g. 470 μF
How much charge it stores per volt.
- Voltage rating, e.g. 16 V
Use a rating comfortably above your supply voltage.
- Scored top (vent)
Lets gas escape safely if the part fails.
Step 4 of 11Learn
The RC time constant
When a capacitor charges through a resistor, it doesn't fill at a steady rate. At first current flows fast; as the capacitor's voltage rises, there's less voltage left across the resistor, so the current slows. The voltage climbs quickly, then more and more slowly, following a curve.
The speed is set by the time constant, written with the Greek letter tau (τ):
τ = R × C
With R in ohms and C in farads, τ comes out in seconds. A handy shortcut: kΩ × μF = milliseconds.
- After 1 τ, the capacitor reaches about 63% of the supply voltage.
- After about 5 τ, it's over 99%, and engineers treat it as fully charged.
Example: 10 kΩ and 100 μF: τ = 10,000 × 0.0001 = 1 second. The capacitor reaches 63% of the supply after 1 second and is practically full after about 5 seconds.
Discharging follows a mirror-image curve: after 1 τ, about 37% of the voltage remains.
This simple relationship is behind countless timers, debounce circuits for buttons, flashing lights and filters. Change R or C and you change the timing. Doubling either one doubles the time. Use the explorer to see the charging curve for different values.
Step 5 of 11Explore
Capacitor charging curve
Voltage across a capacitor charging through a resistor from a supply. The time axis is in seconds; R is in kilohms and C in microfarads, so R × C / 1000 gives τ in seconds.
- Time constant τ
- 1 s
- Voltage after 1 τ
- 5.69 V
- Nearly full after 5 τ
- 5 s
Step 6 of 11Practice · Work it out
A 47 kΩ resistor charges a 100 μF capacitor. What is the time constant τ, in seconds?
Step 7 of 11Practice · Chart
How full a capacitor gets after each time constant
Every time constant (τ = R × C) closes about 63% of the remaining gap.
After how many time constants is the capacitor about 95% charged?
Tap the point that answers the question, then press Check.
| Item | Charge level |
|---|---|
| 0 τ | 0% |
| 1 τ | 63% |
| 2 τ | 86% |
| 3 τ | 95% |
| 4 τ | 98% |
| 5 τ | 99.3% |
Step 8 of 11Learn
Transistors: tiny switches that changed the world
A transistor is a semiconductor device that lets a small signal control a much larger current. It's the building block of every computer chip: a modern processor contains billions of them, switching on and off billions of times a second.
In beginner circuits, the most common use is as a switch. A microcontroller pin can supply only a small current, often 20 mA or less, but you might want to drive a motor, a buzzer or a strip of LEDs drawing hundreds of milliamps. A transistor does the heavy lifting.
An NPN bipolar transistor has three legs: base, collector and emitter. A small current into the base allows a much larger current to flow from collector to emitter. The ratio is the current gain, often around 100 or more for small transistors: 2 mA into the base can allow up to about 200 mA through the collector. To use it as a switch, you give the base enough current to turn it fully on, through a resistor (often around 1 kΩ from a 5 V pin) that limits the base current.
A MOSFET is another type, controlled by voltage on its gate rather than current. Logic-level MOSFETs switch fully on with 5 V or even 3.3 V at the gate and can handle large currents, which makes them popular for motors and LED strips.
When switching motors, relays or other coils, add a flyback diode across the coil. When the current is switched off, a coil produces a voltage spike that can destroy the transistor; the diode gives that energy a safe path.
Step 9 of 11Diagram
A transistor used as a switch
A tiny current from a microcontroller pin controls a much bigger current through the load.
Tap a shape with to see more.
- Microcontroller pin (5 V)
Can only supply a few milliamps safely.
- Base resistor (1 kΩ)
Limits the base current to about 4 mA.
- Transistor base
The small base current turns the transistor on.
- Collector to emitter
Now conducts a large current, up to hundreds of milliamps.
- Motor or LED strip
Gets its power from the supply, not from the pin.
Step 10 of 11Note
Step 11 of 11Practice · Select all that apply
Which statements about transistors are true? Select all that apply.
Select all that apply.
Lesson complete!