Skip to main content

Capacitance

The previous pages covered resistors (which oppose current) and the basics of how capacitors are used for decoupling. This page goes deeper: what capacitance actually is, the physics behind it, how to reason about capacitor values, and — concretely — why the capacitors on this project's breakout boards are the right size for the job and when you would need more.


What Is Capacitance?

A capacitor consists of two conductive plates separated by an insulating layer (the dielectric). When you apply a voltage across the plates, charge accumulates on them — positive charge on one plate, negative on the other. The insulator prevents charge from flowing between the plates directly, so the charge stays put.

The amount of charge that can be stored for a given voltage is called capacitance:

Q=C×VQ = C \times V

Where:

  • QQ is stored charge in coulombs (C)
  • CC is capacitance in farads (F)
  • VV is voltage across the capacitor in volts

A capacitor with a larger CC stores more charge at the same voltage. Larger plates, a thinner dielectric, and a dielectric material that polarises easily all increase CC.

The farad is enormous

One farad is the capacitance that stores one coulomb of charge at one volt. One coulomb is the charge carried by roughly six billion billion electrons. In practice, almost no discrete capacitor comes close to 1 F. The common unit prefixes you will see:

UnitValueTypical use
µF (microfarad)10⁻⁶ FBulk decoupling, filter capacitors
nF (nanofarad)10⁻⁹ FMid-frequency decoupling
pF (picofarad)10⁻¹² FHigh-frequency RF circuits, crystal load caps

The 100 nF ceramic capacitors used for chip decoupling store about 330 nanocoulombs at 3.3 V — a tiny amount of charge, but delivered fast enough to matter.


Charging and Discharging: The RC Time Constant

A capacitor does not charge or discharge instantaneously. When you connect a capacitor through a resistor to a voltage source, the current starts high and decays exponentially as the capacitor charges:

RC charging circuit: V_in feeds through resistor R to a junction; capacitor C connects from the junction to GND; V_cap(t) is measured at the junction

The time constant τ (tau) is:

τ=R×C\tau = R \times C

After one time constant τ, the capacitor has charged to about 63% of the final voltage. After 5τ, it is essentially fully charged (>99%).

The software analogy

Think of the RC circuit as a rate limiter. The resistor constrains how fast charge can flow into the capacitor, just like a token bucket limits how fast requests pass through. Large R or large C → slower rate → longer time to reach the target voltage. The I2C pull-up discussion in Essential Components is exactly this: the pull-up resistance and the bus capacitance form an RC circuit that limits how fast the signal can rise from LOW to HIGH.

Why the time constant matters

The RC time constant governs:

  1. Signal edges: A slower RC means slower rising and falling edges. Too slow, and a digital receiver cannot tell apart a 0 and a 1 at high data rates.
  2. Filter cutoff: An RC circuit filters out frequencies above fc=1/(2π×R×C)f_c = 1 / (2\pi \times R \times C). Below that frequency, signals pass through; above it, they are attenuated.
  3. Decoupling effectiveness: A decoupling capacitor works by presenting a low impedance at high frequencies. The impedance of a capacitor is Z=1/(2π×f×C)Z = 1 / (2\pi \times f \times C). At higher frequencies, Z drops — the capacitor becomes a better short circuit to GND for high-frequency noise.

What Capacitors Do in a Circuit

Capacitance has three primary jobs. Each exploits a different aspect of the Q = CV relationship.

1. Bypassing high-frequency noise

When a digital chip switches, it draws a brief, sharp burst of current — too fast for the power supply to respond through the inductance of the wires. A small capacitor (100 nF) physically close to the chip's power pin acts as a local reservoir: it delivers charge during the burst, then recharges slowly from the supply.

This is why placement is critical. The inductance L of a wire segment is roughly 1–2 nH/cm. Even a 5 cm trace has ~10 nH of inductance. At the frequencies a fast MCU switches (tens to hundreds of MHz), that inductance is enough to block current:

Zwire=2π×f×L=2π×100 MHz×10 nH6 ΩZ_{\text{wire}} = 2\pi \times f \times L = 2\pi \times 100\ \text{MHz} \times 10\ \text{nH} \approx 6\ \Omega

Six ohms at 100 mA means a 0.6 V drop — enough to destabilise the chip's supply. A 100 nF capacitor placed within 1–2 mm of the VCC pin has much less series inductance and can respond in nanoseconds.

2. Absorbing low-frequency current transients

Higher-capacitance capacitors (10 µF, 100 µF) handle slower, larger current surges — the kind that come from an amplifier suddenly playing a loud note or from the MCU starting a WiFi transmission.

For a transient drawing extra current IburstI_{\text{burst}} over time Δt\Delta t, the voltage droop on the supply rail is:

ΔV=(Iburst×Δt)/C\Delta V = (I_{\text{burst}} \times \Delta t) / C

A larger capacitor keeps ΔV small. This is bulk decoupling: the capacitor is not fast enough to handle MHz-scale switching noise, but it handles audio-rate current variations that the power supply cannot respond to quickly enough.

3. Filtering

In an RC low-pass filter, the capacitor passes high-frequency signals to GND, attenuating them before they reach the output. You do not build explicit RC filters in this project, but the same physics governs I2C signal rise times, power supply ripple rejection, and audio amplifier stability.


How Much Capacitance Does This Project Need?

Each breakout board in this project (DS3231, MAX98357A) includes its own decoupling capacitors. You do not need to add external ones during normal breadboard construction. Here is why the values on those boards are sufficient.

High-frequency decoupling: 100 nF ceramic

The ESP32-S3 and DS3231 switch at digital rates (MHz). The standard 100 nF ceramic capacitor covers this:

  • At 10 MHz: Z=1/(2π×10 MHz×100 nF)0.16 ΩZ = 1 / (2\pi \times 10\ \text{MHz} \times 100\ \text{nF}) \approx 0.16\ \Omega
  • At 100 MHz: Z0.016 ΩZ \approx 0.016\ \Omega

Those impedances are low enough to short out high-frequency noise to GND before it reaches the chip's core. The physical size of 0402 or 0603 ceramics (used on breakout boards) also minimises parasitic inductance.

Bulk decoupling: audio amplifier transients

The MAX98357A is the heaviest transient load in this project. At moderate volume it draws around 100–200 mA from the 5 V rail; at peak (full output into 4 Ω) it can draw close to 500 mA. The difference — roughly 300 mA — arrives in bursts at audio frequencies (20 Hz–20 kHz).

At 1 kHz, a half-cycle lasts 0.5 ms. To limit the voltage droop on the 5 V rail to under 100 mV during a 300 mA surge over 0.5 ms:

C=(Iburst×Δt)/ΔVC=(0.3 A×0.5 ms)/0.1 VC=1500 μFC = (I_{\text{burst}} \times \Delta t) / \Delta V \\ C = (0.3\ \text{A} \times 0.5\ \text{ms}) / 0.1\ \text{V} \\ C = 1500\ \mu\text{F}

That looks alarming — but it assumes the power supply contributes nothing during those 0.5 ms. A real USB charger can respond in tens of microseconds, not half a millisecond. If the supply responds in ~20 µs:

C=(0.3 A×20 μs)/0.1 V=60 μFC = (0.3\ \text{A} \times 20\ \mu\text{s}) / 0.1\ \text{V} = 60\ \mu\text{F}

A 100 µF electrolytic capacitor on the 5 V rail near the MAX98357A covers this comfortably. The MAX98357A breakout board includes a 10 µF ceramic in this role, and at the audio volumes appropriate for a bedside clock the resulting ripple is inaudible and too small to cause brownouts.

The USB cable's inductance (~1–2 µH for a typical 1 m cable) also creates transient voltage spikes when current changes quickly:

Vspike=L×(dI/dt)=2 μH×(300 mA/20 μs)=30 mVV_{\text{spike}} = L \times (dI/dt) = 2\ \mu\text{H} \times (300\ \text{mA} / 20\ \mu\text{s}) = 30\ \text{mV}

Thirty millivolts is well within the 100 mV tolerance most regulators can handle. On a well-wired breadboard with a quality USB cable, the on-board capacitors handle this without help.

The 3.3 V rail

The 3.3 V rail is more stable because its largest consumer — the ESP32 during WiFi transmit — is already decoupled by the capacitors on the DevKitC-1 board (there are several tens of µF on that board's 3.3 V rail). The DS3231 is a low-current peripheral. No additional bulk capacitance is needed during breadboard assembly.


When You Would Need More Capacitance

This project sits in a comfortable region. The loads are moderate and the supply is a regulated USB charger. Here is what changes that calculus:

Higher-current loads

A stepper motor driver can demand 1–2 A in steps lasting tens of microseconds. The current spike equation applies directly: to limit droop to 100 mV with a 2 A step lasting 50 µs, you need 1,000 µF. Motor controllers routinely specify a large electrolytic (100–2200 µF) on the motor supply rail for exactly this reason.

Sources with high internal resistance

A lithium-ion battery has low internal resistance when new (~50–100 mΩ), but a long supply wire or a battery approaching end-of-life increases effective resistance. If your supply cannot hold voltage during transients, you compensate with capacitance. Embedded systems running from coin cells or thin wires often add 470 µF–1000 µF bulk caps that would be overkill on a USB supply.

Longer power traces

On a custom PCB, the trace from the power connector to a hungry component adds inductance. A 10 cm trace can have 10–20 nH of parasitic inductance — enough to create significant voltage spikes during fast current steps. PCB layout guides for power converters specify placing bulk capacitors as close to the load as possible to minimise the effective inductance between cap and load.

Higher audio power

If you replaced the 4 Ω / 2–3 W speaker with a 10 W amplifier module, peak current demands would roughly triple. You would need 300–470 µF on the supply rail, and a USB supply rated for 3+ A.

Voltage regulators with poor transient response

Some linear regulators respond slowly to load steps — their loop bandwidth limits how quickly they can correct the output voltage. Datasheets specify a minimum output capacitor to ensure stability and specify the transient droop at a given load step. When you design around an LDO rather than using a pre-made board, this minimum capacitor is not optional.


Summary

ConceptKey takeaway
CapacitanceC=Q/VC = Q/V. More capacitance → more stored charge at the same voltage.
FaradEnormous unit. Most capacitors are µF, nF, or pF.
RC time constantτ=RC\tau = RC. Governs how fast a capacitor charges, and the cutoff frequency of RC filters.
Capacitor impedanceZ=1/(2πfC)Z = 1/(2\pi \cdot f \cdot C). Drops at higher frequencies — capacitors become better short circuits for high-frequency noise.
HF decoupling100 nF ceramic, physically close to the chip's VCC pin. Handles MHz-scale switching transients.
Bulk decoupling10–100 µF, near high-current loads. Handles audio-rate or WiFi-rate current surges.
This projectBreakout boards include all required decoupling. No external caps needed on a breadboard under normal conditions.
When to add moreHigher-current loads (motors, bigger amps), high-resistance supplies, long power traces, or slow regulators.