Have you noticed that the light on a phone charger or a games console sometimes stays on for a moment after you pull the plug? That's because of a capacitor inside: a small part that stores electricity, a bit like a tiny water tank. In this lesson you fill a capacitor with one press of a button and watch it keep an LED glowing after you let go. Then you put more capacitors side by side, change a resistor, and find out what makes the light last longer. Like every lesson in this path, there is no program to write: the UNO is only the power supply.
What you'll learn
- What a capacitor is and what it stores
- How to find the + and − legs of an electrolytic capacitor
- Why a capacitor fills up fast and empties slowly in this circuit
- What the time constant R × C means, and how to make a light fade faster or slower
- Why capacitors side by side (in parallel) store more
What you need
- UNO R3 board and USB cable (UNO R3 Starter Kit)
- 3 electrolytic capacitors, 100 µF
- 1 push button
- 1 red LED
- Resistors: 220 Ω and 4.7 kΩ (and a 10 kΩ for experiment 2)
- Breadboard and jumper wires (UNO R3 Starter Kit)
What is a capacitor?
Inside a capacitor are two thin metal sheets with a very thin layer of insulation between them, rolled up tight. When you connect it to a battery or to the UNO's 5V, electric charge piles up on one sheet and leaves the other, until the voltage across the capacitor is the same as the supply. Disconnect the supply and the charge stays there, ready to flow out again. That's why a capacitor is like a tank: it fills up, and later it empties.
How much a capacitor can store is its capacitance, measured in farads (F). One farad is huge, so small capacitors use microfarads: 100 µF means 100 millionths of a farad. That's the number printed on the side of yours, next to its highest safe voltage, such as 16V or 25V.
The capacitors in the kit are electrolytic capacitors: small cylinders with two legs. Unlike a resistor, they only work one way round. The long leg is +, and the side with the light stripe and the minus signs (−) is −. Put one in backwards and it can get hot, bulge or even pop, so always check before you plug in the USB cable.
In this path the UNO is only a power supply: plug its USB cable into a computer or a USB phone charger and use its 5V and GND pins. Whatever program is on the board doesn't matter, and you don't need the Arduino IDE yet.
Wiring

Build it step by step
Plug in all the parts first, then add the wires in this order. In each picture the new wires are bright and the ones from earlier steps are faded. Click a picture to see it larger.




| From | To |
|---|---|
| UNO 5V | Bottom + rail (red wire) |
| UNO GND | Bottom − rail (black wire) |
| Push button | Across the middle gap, legs in columns 20 and 22 (rows e and f) |
| + rail | Column 20, row j |
| Resistor 220 Ω (charging) | Column 22, row i to column 26, row i |
| Capacitor 1: long leg (+) | Column 26, row f |
| Capacitor 1: striped leg (−) | Column 27, row f |
| Column 27, row j | − rail |
| Resistor 4.7 kΩ | Column 26, row j to column 34, row j |
| LED long leg (+) | Column 34, row f |
| LED short leg (−) | Column 35, row f |
| Column 35, row j | − rail |
| Capacitors 2 and 3 (for experiment 3) | + legs in column 26, rows g and h; − legs in column 27, rows g and h |
Start with only capacitor 1. You add the other two in experiment 3.
Unplug the USB cable whenever you change the circuit, and plug it back in to test. It only takes a second and protects the board.
Try it
- Plug in the USB cable. Nothing happens yet: the capacitor is empty, and the button keeps it away from 5V.
- Make the room a little darker, then press the button for one second. The LED glows. Let go: the LED doesn't switch off at once. It fades out over a second or two, dimming fastest at the start.
- Press again and let go a few times. Each press fills the capacitor in a blink, and each time it empties slowly through the LED.
- Experiment 2: unplug the USB cable. Swap the 4.7 kΩ resistor for the 10 kΩ one. Plug in and try again. The LED is dimmer, but the glow lasts about twice as long.
- Experiment 3: put the 4.7 kΩ resistor back, and plug capacitors 2 and 3 next to capacitor 1 (see the wiring table). Now the glow lasts about three times as long as with one capacitor.
What you should see

How it works

When you press the button, 5V reaches the capacitor through the 220 Ω resistor. The capacitor fills up almost at once, because 220 Ω lets a lot of current through. At the same time some current flows on through the 4.7 kΩ resistor and the LED, so the LED lights.
When you let go, the button disconnects 5V. Now the capacitor is the only "battery" left, and it pushes its charge out through the 4.7 kΩ resistor and the LED. As it empties, its voltage drops, the current gets smaller and the LED gets dimmer. Below about 1.8 V a red LED hardly glows any more, so it goes dark while there is still a little charge left.
How fast a capacitor fills or empties depends on two numbers multiplied together: the resistance it flows through and its capacitance. This is called the time constant:
- τ = R × C (τ is the Greek letter tau)
- Filling through 220 Ω: 220 Ω × 0.0001 F = 0.022 s. That's why it fills in a blink.
- Emptying through 4.7 kΩ: 4,700 Ω × 0.0001 F = 0.47 s. In that time the light loses most of its brightness, and after 3 to 4 time constants it's gone.
- With 10 kΩ: τ = 1 s, and with three capacitors: 4,700 Ω × 0.0003 F = 1.4 s. That's why the glow lasts about two and three times as long.
After one time constant the capacitor has lost about two thirds of its voltage above the LED's 1.8 V, and after five time constants it is practically empty. Capacitors side by side (in parallel) work like one big tank: their capacitances add up, 100 + 100 + 100 = 300 µF.
Where you find capacitors
Almost every circuit board has capacitors. They smooth the bumpy voltage in chargers, keep a board running through tiny gaps in the power, and set the timing in blinkers and sound circuits. Your UNO has several next to its power socket. The camera flash in a phone and the defibrillator that restarts a heart both use a capacitor that fills up slowly and empties in a flash.
Safety: the capacitors in this lesson only hold 5 V, so they are completely safe to touch. Big capacitors inside mains-powered devices, like old TVs, microwaves and power supplies, can hold a dangerous charge for a long time after the plug is pulled. Never open those devices.
Try this next
- Use the 560 Ω resistor instead of 4.7 kΩ: the LED is much brighter, but the fade is so short you hardly see it. Can you explain why, with τ = R × C?
- Swap the red LED for a green or white one. They need more voltage to light (about 2.5 to 3 V), so the same capacitor keeps them glowing for a shorter time.
- Put two capacitors in series instead (the − leg of one to the + leg of the next). Does the light last longer or shorter? In series, capacitances don't add up: two 100 µF capacitors make only 50 µF.
- When you finish this path, continue with the first lesson of Arduino basics, where you write your first program.
Troubleshooting
- Nothing lights up: check that the USB cable is plugged in (the UNO's ON LED is lit), that the LED's long leg is in column 34, and that the button sits across the middle gap. Turn the button 90° if it seems to be pressed all the time or never.
- The LED switches off at once, with no fade: the capacitor isn't connected. Check that its legs are in columns 26 and 27 and that column 27 goes to the − rail.
- The LED stays on all the time: the button is turned the wrong way, so it connects 5V even when not pressed. Turn it 90°.
- The capacitor gets warm: unplug the USB cable at once. It is in backwards: the striped leg must go to column 27, the − side.
- The glow is very faint: that's normal with 4.7 kΩ, because only a small current flows. Try it in a darker room.