Electronic circuits · no code

Capacitor Charge & Discharge

A 1000 µF capacitor is charged with one pushbutton and discharged through an LED with another: you will see the stored energy being used up gradually.

  • LevelBeginner
  • Time20 min
  • Power9 V DC
  • CategoryPower supplies

Bill of materials

Everything you need to build it, with the reference you will see on the schematic.

Bill of materials
Qty Part Ref.
2 Pushbutton S1, S2
2 470 Ω resistor (yellow-violet-brown) R1, R2
1 1 mF electrolytic capacitor C1
1 red LED D1
1 9 V battery with snap clip BT1
1 Breadboard (400 tie-points or more)
6 Jumper wires

Missing parts? The kits recommended by Impeca Tech include almost all of them. See the kits

Schematic & wiring

On the left, the circuit diagram; on the right, the same circuit built on a breadboard. Both connect exactly the same things.

Circuit diagram of “Capacitor Charge & Discharge”
Circuit diagram
Breadboard layout of “Capacitor Charge & Discharge”
Breadboard layout

Wire it step by step

  1. Place the components
    • Pushbutton S1 straddling the centre channel of the breadboard: two legs on top (3f and 5f) and two below (3e and 5e).
    • 470 Ω resistor R1 (bands: yellow, violet, brown, gold): one leg in 6f and the other in 9f (either way round).
    • 1 mF electrolytic capacitor C1: the leg marked with the stripe and the − sign in 13g and the other leg (+) in 12g. Reversed, it can be damaged.
    • Pushbutton S2 straddling the centre channel of the breadboard: two legs on top (12f and 14f) and two below (12e and 14e).
    • 470 Ω resistor R2 (bands: yellow, violet, brown, gold): one leg in 7h and the other in 10h (either way round).
    • red LED D1: the long leg (+, anode) in 10f and the short leg (−, cathode, flat side) in 11f.
  2. Add the jumper wires
    • Red wire: from 3j to the + (red) rail.
    • Orange wire: from 3d to 6j.
    • Turquoise wire: from 9j to 12j.
    • Purple wire: from 12d to 7j.
    • Black wire: from 11j to the − (blue) rail.
    • Black wire: from 13j to the − (blue) rail.
  3. Connect the battery
    • Connect the 9 V battery to its clip: the clip’s red lead to the + (red) rail and the black one to the − (blue) rail. Do this last, once everything else is in place.
  4. Test the circuit
    • Hold S1 down for about 3 seconds and release it: the LED stays off. Press and hold S2: the LED lights and gradually loses brightness. Press S2 again without recharging and it will glow much less.

How to read the holes: the letter is the row and the number is the column of the breadboard (for example 7f). The red (+) and blue (−) rails are the two long lines along the edge.

How does it work?

  1. 1You press S1
  2. 2The capacitor charges to 9 V
  3. 3You press S2
  4. 4The LED glows and slowly fades

The capacitor stores electric charge. Pressing S1 fills it through R1 in about 2 or 3 seconds, until it almost reaches the battery voltage. Release S1 and press S2 and the stored charge flows out through R2 and the LED: it starts at about 14 mA and drops quickly as the capacitor empties: within a few seconds the LED almost goes out. The larger the capacitance, the longer the discharge lasts.

Testing & troubleshooting

What you should see

Charge with S1 (0–3 s), discharge with S2 (5–14 s)
Capacitor voltage after charging≈ 8.98 V
LED current when S2 is pressed≈ 12 mA
LED current 2 s later≈ 0.31 mA

Approximate values, calculated with typical parts. With real parts they can vary by 10 % or more.

If something does not work

The LED does not light when S2 is pressed?

The capacitor has to be charged with S1 first. Also check that the capacitor stripe (−) is on the − rail side and that the LED has its long leg towards R2.

What if I put the capacitor in backwards?

Electrolytic capacitors are polarised: backwards they can heat up, swell or even burst. If it feels hot, disconnect the battery and replace it.

Want to automate this circuit with code?

Learn how to program sensors and custom schedules in our e-book “Arduino from Scratch”.