How a capacitor works

A capacitor is a little store for electric charge. Flip the switch and watch the LED: it flashes while the capacitor fills, then goes dark when it is full. Flip it back and the stored charge comes out the other way and lights the red LED. Then throw the knife switch to parallel and see the capacitor keep the LED glowing on its own. Anything blue on the board can be clicked or dragged.

mAVVoltage knob: drag up or downFlips per second: drag up or downBattery: clickAuto flip: clickAC: clickFill / Empty switch: click to flipKnife switch: click to change series / parallel
Current: dots on the wires; the bold trace is the LEDs' currentIn parallel, the dotted trace is the capacitor's own current: up while it fills, down while it emptiesHow full the capacitor is: its voltage, the second traceThe supply's voltage: the faint traceBlue: a part you can click or dragA supply, a resistor, two LEDs and a capacitor. The knife switch wires the LEDs and the capacitor in series (lever back) or in parallel (lever forward). In series, current flows only while the capacitor's charge is changing, so the LED goes dark when it is full. In parallel, the capacitor stores charge beside the LEDs and keeps them lit after the supply is unplugged. No charge ever crosses the gap between the plates.
Each LED is a one-way door: current only passes the way its triangle points. While the capacitor fills, current flows forward, so the green one lights. While it empties, the current comes back the other way, so the red one lights. The little arrows on the wires move at the speed of the current.

Try this sets the parts for you

Right now read from the same model that moves the parts

How full the capacitor is
Current through the LEDs
From the supply
Into the capacitor
Green LED
Red LED
Charge stored, q = C·v
Fill time, τ = R·C
First rush of current
Capacitor resists AC by

What each part does

The capacitor q = C·v

Two metal plates with a gap between them. The supply pushes charge onto one plate and pulls the same amount off the other plate, but nothing can jump the gap. Watch the dots: they stop at the plates. As charge piles up, it pushes back against the supply. When it pushes back as hard as the supply pushes, the flow stops. The capacitor is full.

Bigger plates (more overlap) have room for more charge, so they take longer to fill. That number is the capacitance, C, in microfarads (µF).

The LEDs about 2 V to light

An LED lets current through one way only, and it lights while current flows. The green one faces the way the current goes while the capacitor fills. The red one faces the other way, so it only lights when the capacitor empties. Neither lights when nothing is flowing, even if the switch is on.

An LED needs about 2 volts before any current flows. That is why the capacitor stops about 2 V short of the supply.

The resistor i = v / R

A long, thin wire that slows the flow, like a narrow pipe into a bucket. A bigger resistor means a smaller current, a dimmer LED and a slower fill. It also protects the LED: without it, the first rush of current would be big enough to burn it out.

The fill time is τ = R × C. After one τ the capacitor is about ⅔ full, and after five it is all but full.

Series or parallel?

Series (knife switch lever back): the LEDs and the capacitor are in one line, so every bit of charge that reaches the capacitor has passed through an LED. The LED shows you the capacitor's current: it lights only while the capacitor is filling or emptying.

Parallel (lever forward): the capacitor sits across the LEDs, like a water tank beside a tap. It has to fill up past about 2 V before the LED gets anything, so the LED comes on late. Unplug the supply and the capacitor drains through the LED, which keeps glowing for a while with no supply at all. That is why capacitors are used to keep power steady. The LED board has its own 470 Ω resistor to protect the LEDs in this wiring.

Why AC seems to go "through" a capacitor

With AC the supply keeps changing direction, so the capacitor fills one way, empties, then fills the other way, again and again. It never gets the chance to be full, so current keeps flowing in the wires and both LEDs light by turns. Faster flipping or a bigger capacitor means it is even further from full each time, so more current flows and the LEDs glow brighter. Steady DC from a battery stops as soon as the capacitor is full. That is the main rule of a capacitor: it blocks steady current but passes changing current.