Skip to content
LearnTronics menu

LearnTronics

LED Fade-Off

Tutorial Index

Recipe #24 — led fade-off

A large capacitor can make stored electrical energy visible. Charge it, remove the charging command, and let the capacitor keep a transistor conducting while its voltage slowly decays.

LED FADE-OFF — STORED CHARGE +9 V PUSH TO CHARGE R1 4.7 kΩ C1 470 µF RB 10 kΩ B C E +9 V 1 kΩ LED Release the button: C1 discharges slowly → transistor current falls → LED fades
Press: the button charges C1 and turns Q1 on. Release: C1 keeps supplying base current for a while, then its voltage falls and the LED fades.

Put some numbers on it

For a simple RC circuit, the characteristic time is the time constant, written as τ = R × C. One time constant does not mean the capacitor is completely charged or discharged. After one time constant, about 63% of a charging change has occurred, or about 37% of a discharging voltage remains. After about five time constants, a simple RC circuit is very close to its final value.

Charging approximation: τ = R1 × C1 = 4.7 kΩ × 470 µF ≈ 2.2 s
Fade/discharge approximation: τ = RB × C1 = 10 kΩ × 470 µF ≈ 4.7 s

The resistance ratio is about 10 kΩ / 4.7 kΩ = 2.1. In the simple RC approximation, the discharge path therefore has a time constant a little more than twice the charging path. That is why the circuit can charge fairly quickly but fade more slowly after the button is released.

Changing either resistor affects a different part of the action. A smaller R1 charges C1 faster; a larger R1 charges it more slowly. A larger RB generally lengthens the fade by reducing the discharge current into Q1's base; a smaller RB allows more base current but drains C1 faster, shortening the fade.

These are useful teaching approximations rather than an exact prediction of visible fade time. Q1's base-emitter junction loads the capacitor, and the LED stops appearing bright well before C1 reaches zero volts, so the real circuit does not behave like an isolated resistor-capacitor network.

The capacitor is a temporary energy store

C1 stores charge while the button is pressed. After the charging path is opened, that stored charge has only the discharge path through RB and the transistor base, so the voltage falls gradually instead of instantly.

VC(t) = V0 e−t/RC

The fade is not perfectly linear

Exponential capacitor discharge, transistor base-emitter behavior, and LED brightness perception all make the visible fade non-linear. That is useful here: the circuit lets the eye see an RC transient directly.

Try these yourself

What keeps the LED on briefly after the pushbutton is released?
C1 remains charged and supplies decreasing base current to Q1.
What happens if C1 is made much larger?
More capacitance stores more charge for a given voltage and increases the discharge time constant.
Is the fade expected to be perfectly linear with time?
The capacitor voltage decays exponentially and the transistor and LED are also non-linear devices.