100nF

Capacitor charge and discharge time calculator

The RC time constant and the exponential it governs: the voltage on a capacitor at any moment while it charges or discharges through a resistor, the time it takes to reach a threshold, and the current and energy the resistor sees on the way, from any starting voltage.

5.00 V0.00 V1τ2τ3τ4τ5τ63 % at τ3.30 V at 10.8 mstime, τ = 10.0 ms
Fig 1 — charging from 0.00 V towards 5.00 V with τ = 10.0 ms: 3.16 V at one time constant, 99.3 % of the way at five.
Time constant τ = R·C
10.0 ms · 99 % of the way at 5τ = 50.0 ms
Voltage at 10.0 ms
3.16 V · 63.2 % of the way
Time to reach 3.30 V
10.8 ms · 1.08 τ
After 1τ · 2τ · 3τ · 4τ · 5τ
3.16 V · 4.32 V · 4.75 V · 4.91 V · 4.97 V
Current at t = 0 · power in the resistor then
500 µA · 2.50 mW
Energy stored at the end · lost in the resistor
12.5 µJ · 12.5 µJ

Charging from zero, the resistor dissipates exactly as much energy as the capacitor ends up storing, whatever its value: a small resistor only makes the same loss happen faster and at a higher peak current.

How this is calculated

Standard: Würth Elektronik SN015 — Contact debounce circuit for switches

τ=R C\tau = R\,C
SN015 Eq 1. "During one time constant the voltage will rise to 63% of its final value or fall to 37% of its final value. In both cases, 99% is reached after five time constants."
VC(t)=Vfinal+(Vstart−Vfinal)e−t/τV_C(t) = V_{final} + \left(V_{start} - V_{final}\right) e^{-t/\tau}
SN015 Eq 3, U_out = U_in(1 − e^(−t/τ)), generalised to any starting voltage: the same law charges from a partly-charged capacitor and discharges from a charged one.
t=−τln⁡ ⁣(Vfinal−VtargetVfinal−Vstart)t = -\tau \ln\!\left(\frac{V_{final} - V_{target}}{V_{final} - V_{start}}\right)
The same equation solved for time: what a threshold asks. Two thirds of the swing takes 1.1τ, half takes 0.69τ, 90 % takes 2.3τ.
I(0)=Vfinal−VstartR,ER=12C(Vfinal−Vstart)2I(0) = \frac{V_{final} - V_{start}}{R}, \qquad E_R = \tfrac{1}{2} C \left(V_{final} - V_{start}\right)^2
The current at the first instant, and the energy the resistor dissipates over the whole charge, which from zero equals the ½CV² the capacitor stores whatever the resistor is.

Assumptions

What sets a capacitor's charge and discharge time

A capacitor charged through a resistor never fills at a steady rate, because the current that fills it is set by the voltage still to go: I = (Vsupply − VC)/R, largest at the first instant and falling as the capacitor catches up. The result is the exponential that SN015 writes as Uout = Uin(1 − e−t/τ), with one number governing everything: the time constant τ = R·C. The note states what τ means in the two directions at once: "during one time constant the voltage will rise to 63% of its final value or fall to 37% of its final value. In both cases, 99% is reached after five time constants."

The 63 % is 1 − 1/e and the 37 % is 1/e, and neither depends on the voltage, the resistor or the capacitor separately, only on their product. That is what makes τ the useful number: a 10 kΩ resistor with a 1 µF capacitor and a 1 kΩ resistor with 10 µF behave identically in time, and differ only in the current the first one draws, which is ten times smaller. The calculator takes any starting voltage, not just zero, because the case that matters on a board is usually a second cycle: a debounce capacitor that had not finished discharging, a reset capacitor after a brown-out, a sample capacitor holding the last value.

Run backwards, the same law gives the time to reach a voltage, which is the question a threshold asks: t = −τ·ln((Vfinal − Vtarget)/(Vfinal − Vstart)). A logic input that switches at two thirds of the supply is crossed at 1.1τ; one that switches at half is crossed at 0.69τ; a comparator set at 90 % waits 2.3τ. The calculator solves this directly and draws where on the curve it lands.

Two quantities that surprise. The current at t = 0 is the full supply over the resistor, so a 12 V rail into 100 µF through 10 Ω starts at 1.2 A and 14.4 W, however briefly. And charging from zero, the resistor dissipates exactly as much energy as the capacitor ends up holding, ½CV², whatever the resistor's value: a smaller resistor does not save that energy, it spends it faster.

RC time constant chart

τ = R·C for the values in a drawer, computed by the calculator above. Multiply the row and column and the table is the same; its use is that the answer is already in the unit a debounce, a reset or a filter is thought about in.

R \ C100 pF1 nF10 nF100 nF1 µF10 µF100 µF
100 Ω10.0 ns100 ns1.00 µs10.0 µs100 µs1.00 ms10.0 ms
1 kΩ100 ns1.00 µs10.0 µs100 µs1.00 ms10.0 ms100 ms
10 kΩ1.00 µs10.0 µs100 µs1.00 ms10.0 ms100 ms1.00 s
100 kΩ10.0 µs100 µs1.00 ms10.0 ms100 ms1.00 s10.0 s
1 MΩ100 µs1.00 ms10.0 ms100 ms1.00 s10.0 s100 s

How far the charge has got after each time constant

The fraction of the swing completed, and the fraction still to go, at the points people quote. SN015's two figures are the 1τ and 5τ rows; the rest are the same exponential evaluated by the calculator.

TimeCharged, % of the wayStill to goDischarging: remaining, % of start
0.5τ39.3 %60.7 %60.7 %
0.7τ50.3 %49.7 %49.7 %
1τ63.2 %36.8 %36.8 %
2τ86.5 %13.5 %13.5 %
3τ95.0 %5.0 %5.0 %
4τ98.17 %1.83 %1.83 %
5τ99.33 %0.67 %0.67 %
7τ99.91 %0.09 %0.09 %

The last column is why a discharge "to zero" is a matter of definition. After 5τ a 5 V capacitor still holds 34 mV; a comparator with a 10 mV threshold needs 6.2τ, and a leakage path of its own decides what happens after that.

Worked example: SN015's debounce capacitor, 10 kΩ and 1 µF on 5 V

The defaults are the note's calculation example: a 10 ms time constant on a 5 V rail, with the voltage read at 10 ms and the time found to a 3.3 V threshold.

τ           = 10 kΩ × 1 µF                     = 10 ms
V at 10 ms  = 5 × (1 − e^−1)                   = 3.16 V    (SN015: "63 % (3.15 V)")
t to 3.3 V  = −10 ms × ln((5 − 3.3) / 5)       = 10.8 ms   (1.08 τ)
V at 5τ     = 5 × (1 − e^−5)                   = 4.97 V    (99.3 %)
I at t = 0  = 5 / 10 kΩ                        = 500 µA;  2.5 mW in the resistor
energy      = ½ × 1 µF × 5²                    = 12.5 µJ stored, 12.5 µJ lost in R

Discharged through the same resistor from 5 V, the capacitor is at 1.84 V after one τ and at 34 mV after five, and reaches a 0.8 V logic low threshold at 1.83τ, 18.3 ms. The two directions are mirror images of one another, which is what the note's "rise to 63 % or fall to 37 %" says in one sentence.

Where the RC law stops being valid

The source has resistance. The R in τ is everything in the path: the series resistor, the output impedance of the pin or regulator driving it, and any trace worth counting. A microcontroller pin driving a large capacitor directly has tens of ohms of its own, and the current at t = 0 is limited by that and by the pin's rating, not by the wire.

The capacitance is not the marked value. A class II ceramic at its rated voltage can have lost half its capacitance to DC bias, and τ with it; an electrolytic runs ±20 % from the reel. The law is exact; the C put into it rarely is.

Leakage and dielectric absorption. A real capacitor has a parallel resistance, so a discharge never quite reaches zero and a charged capacitor left open slowly loses its voltage. Dielectric absorption goes the other way: a capacitor discharged to zero and released recovers some tenths of a per cent of its previous voltage on its own, which matters for sample-and-hold and for nothing much else.

Large signals through a diode or a switch. A diode in the path drops a forward voltage that the exponential does not include, which is how SN015's own diode variant gets different charge and discharge times from the same capacitor; a MOSFET switch adds its on-resistance, which changes with gate drive during the first microseconds.

Very fast edges. Below a few nanoseconds the lead and trace inductance forms an LC with the capacitor and the current does not start at V/R; it rings. Thedecoupling calculator is where that regime lives.

Common capacitor charge time mistakes

Further reading