LearnTronics
LED Fade-Off
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.
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.
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.
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.