Level: Basic – Observe energy storage in an electrolytic capacitor via LED fading.
Objective and use case
You will build a simple circuit where a capacitor acts as a temporary energy reservoir, keeping an LED illuminated briefly after the power source is disconnected.
-
Why it is useful:
- Demonstrates how capacitors store and release electrical energy.
- Simulates the «smoothing» effect used in power supply adapters to maintain steady voltage.
- Visualizes the RC time constant (the relationship between resistance, capacitance, and time).
- Introduces the concept of «hold-up time» in power failures.
-
Expected outcome:
- Switch ON: The LED lights up immediately.
- Switch OFF: The LED does not turn off instantly; instead, it slowly fades out over several seconds.
- Visual: A smooth transition from bright light to darkness.
- Audience: Students and hobbyists interested in basic component behavior.
Materials
- V1: 9 V DC battery or power supply, function: main energy source.
- S1: SPST toggle switch or push-button, function: controls the connection to the power source.
- C1: 2200 µF electrolytic capacitor (16 V or higher), function: energy storage reservoir.
- R1: 470 Ω resistor, function: LED current limiting and discharge timing control.
- D1: Red LED, function: visual indicator of current flow and stored charge.
Wiring guide
Use the following explicit node connections to build the circuit. The standard ground reference is node 0.
-
Power and Switch:
- Connect the Positive terminal of
V1to nodeVCC. - Connect the Negative terminal of
V1to node0(GND). - Connect one side of switch
S1to nodeVCC. - Connect the other side of switch
S1to nodeV_CAP.
- Connect the Positive terminal of
-
Capacitor (The Tank):
- Connect the Positive (long leg) of
C1to nodeV_CAP. - Connect the Negative (short leg/stripe) of
C1to node0.
- Connect the Positive (long leg) of
-
LED and Resistor (The Load):
- Connect resistor
R1between nodeV_CAPand nodeV_LED. - Connect the Anode (long leg) of
D1to nodeV_LED. - Connect the Cathode (short leg/flat spot) of
D1to node0.
- Connect resistor
Conceptual block diagram

Schematic
Title: Practical case: Visual Charge and Discharge with LED
[ INPUT / CONTROL ] [ STORAGE / BUFFER ] [ OUTPUT / LOAD ]
(Node V_CAP)
[ 9 V Battery ] --(+)--> [ Switch S1 ] -------+-------> [ Resistor R1 ] --> [ LED D1 ] --> GND
|
|
v
[ Capacitor C1 ]
( 2200 uF )
|
GND
Measurements and tests
- Initial State: Ensure
S1is Open (Off). The LED should be dark. - Charge Phase: Close
S1. Observe that the LED lights up instantly. The capacitorC1charges to approximately 9 V almost immediately. - Discharge Phase: Open
S1.- Observe that the LED remains lit but begins to dim.
- Use a stopwatch to measure the time from opening the switch until the LED is completely dark.
- Repeat: Swap
C1for a smaller value (e.g., 100 µF) and observe how the fade time becomes much shorter (almost instant).
SPICE netlist and simulation
Reference SPICE Netlist (ngspice) — excerptFull SPICE netlist (ngspice)
* Practical case: Visual Charge and Discharge with LED
* --- Power Supply (V1) ---
* 9V DC Battery connected to VCC and GND (0)
V1 VCC 0 DC 9
* --- Switch (S1) ---
* Modeled as a Voltage-Controlled Switch to simulate a physical push-button.
* Connections: VCC to V_CAP
* The switch is controlled by the voltage at node 'CTRL'.
S1 VCC V_CAP CTRL 0 SW_PUSH
* Switch Control Source (Simulates User Interaction)
* Simulates pressing the button at T=0.1s, holding for 1s, then releasing.
* PULSE(V1 V2 TD TR TF PW PER)
V_USER_S1 CTRL 0 PULSE(0 5 0.1 1m 1m 1 5)
* Switch Model Definition
* Ron=1 ohm represents wiring/contact resistance.
.model SW_PUSH SW(Vt=2.5 Ron=1 Roff=100Meg)
* ... (truncated in public view) ...
Copy this content into a .cir file and run with ngspice.
* Practical case: Visual Charge and Discharge with LED
* --- Power Supply (V1) ---
* 9V DC Battery connected to VCC and GND (0)
V1 VCC 0 DC 9
* --- Switch (S1) ---
* Modeled as a Voltage-Controlled Switch to simulate a physical push-button.
* Connections: VCC to V_CAP
* The switch is controlled by the voltage at node 'CTRL'.
S1 VCC V_CAP CTRL 0 SW_PUSH
* Switch Control Source (Simulates User Interaction)
* Simulates pressing the button at T=0.1s, holding for 1s, then releasing.
* PULSE(V1 V2 TD TR TF PW PER)
V_USER_S1 CTRL 0 PULSE(0 5 0.1 1m 1m 1 5)
* Switch Model Definition
* Ron=1 ohm represents wiring/contact resistance.
.model SW_PUSH SW(Vt=2.5 Ron=1 Roff=100Meg)
* --- Capacitor (C1) ---
* 2200uF Energy Storage
* Connections: V_CAP to GND (0)
C1 V_CAP 0 2200u
* --- Resistor (R1) ---
* 470 Ohm Current Limiting Resistor
* Connections: V_CAP to V_LED
R1 V_CAP V_LED 470
* --- LED (D1) ---
* Red LED Indicator
* Connections: Anode (V_LED) to Cathode (0)
D1 V_LED 0 D_LED_RED
* LED Model Definition
* Generic Red LED parameters
.model D_LED_RED D(IS=1e-14 N=2 RS=10 BV=5 IBV=10u)
* --- Analysis Commands ---
* The discharge time constant (Tau) = R * C = 470 * 2200e-6 approx 1.03 seconds.
* Simulation runs for 3 seconds to visualize the charge and discharge cycle.
.tran 10m 3s
* --- Output Directives ---
* Prints the capacitor voltage, LED anode voltage, and switch control signal.
.print tran V(V_CAP) V(V_LED) V(CTRL)
.op
.end
Simulation Results (Transient Analysis)
Show raw data table (352 rows)
Index time v(v_cap) v(v_led) v(ctrl) 0 0.000000e+00 8.234122e-01 8.233738e-01 0.000000e+00 1 1.000000e-04 8.234122e-01 8.233738e-01 0.000000e+00 2 2.000000e-04 8.234122e-01 8.233738e-01 0.000000e+00 3 4.000000e-04 8.234122e-01 8.233738e-01 0.000000e+00 4 8.000000e-04 8.234122e-01 8.233738e-01 0.000000e+00 5 1.600000e-03 8.234122e-01 8.233738e-01 0.000000e+00 6 3.200000e-03 8.234122e-01 8.233738e-01 0.000000e+00 7 6.400000e-03 8.234122e-01 8.233738e-01 0.000000e+00 8 1.280000e-02 8.234122e-01 8.233738e-01 0.000000e+00 9 2.280000e-02 8.234122e-01 8.233738e-01 0.000000e+00 10 3.280000e-02 8.234122e-01 8.233738e-01 0.000000e+00 11 4.280000e-02 8.234122e-01 8.233738e-01 0.000000e+00 12 5.280000e-02 8.234122e-01 8.233738e-01 0.000000e+00 13 6.280000e-02 8.234122e-01 8.233738e-01 0.000000e+00 14 7.280000e-02 8.234122e-01 8.233738e-01 0.000000e+00 15 8.280000e-02 8.234122e-01 8.233738e-01 0.000000e+00 16 9.280000e-02 8.234122e-01 8.233738e-01 0.000000e+00 17 1.000000e-01 8.234122e-01 8.233738e-01 0.000000e+00 18 1.001000e-01 8.234122e-01 8.233738e-01 5.000000e-01 19 1.002600e-01 8.234122e-01 8.233738e-01 1.300000e+00 20 1.003075e-01 8.234122e-01 8.233738e-01 1.537500e+00 21 1.003906e-01 8.234122e-01 8.233738e-01 1.953125e+00 22 1.004136e-01 8.234122e-01 8.233738e-01 2.068164e+00 23 1.004539e-01 8.234122e-01 8.233738e-01 2.269482e+00 ... (328 more rows) ...
Common mistakes and how to avoid them
- Reversed Capacitor Polarity: Electrolytic capacitors are polarized. Connecting the negative leg to positive voltage can cause the component to overheat or pop. Solution: Always check the stripe on the side of the capacitor; it marks the negative pin.
- Omitting the Resistor: Connecting the LED directly to the 9 V source (or charged capacitor) without
R1will burn out the LED instantly. Solution: EnsureR1is in series withD1. - Using a very small Capacitor: If
C1is too small (e.g., 100 nF), the discharge will happen so fast the human eye cannot see the fade. Solution: Use values ≥ 1000 µF for visual tests.
Troubleshooting
- LED never lights up:
- Check if
D1is inserted backward (Anode/Cathode swapped). - Verify
S1is actually closing the circuit. - Check battery voltage.
- Check if
- LED turns off instantly (no fade):
C1might be disconnected or open-circuit.C1value is too low.R1value is too high, making the LED too dim to see the tail end of the fade.
- Capacitor gets hot:
- Immediately disconnect power! The polarity of
C1is likely reversed.
- Immediately disconnect power! The polarity of
Possible improvements and extensions
- Variable Timing: Replace
R1with a 1 kΩ potentiometer in series with a 100 Ω fixed resistor. Adjusting the pot will change the discharge time and LED brightness. - Dual Switch Logic: Use a SPDT (Single Pole Double Throw) switch. Connect Node
VCCto Position 1, Node0to Position 2, and the Common pin to the Capacitor/Resistor network. This allows you to actively «dump» the energy to ground or let it fade naturally.
More Practical Cases on Prometeo.blog
Find this product and/or books on this topic on Amazon
As an Amazon Associate, I earn from qualifying purchases. If you buy through this link, you help keep this project running.




