NEARFIELD·TOOLS

RC time constant calculator

How long a capacitor takes to charge or discharge through a resistor to the voltage that matters, the voltage after any time, or the resistor or capacitor for a delay you want, with the worst case your tolerances allow and the load that can stop it ever getting there.

The other end of the capacitor is the 0 V reference, and the resistor runs from the capacitor to the supply (charging) or to the voltage it discharges toward. A load is anything else across the capacitor: an input, a divider, a bleeder, or an electrolytic's own leakage.

—
time constant τ = R·C
—
time to reach the threshold
—
worst case
—
peak current, at t = 0
capacitor voltage fastest and slowest tolerance corners threshold and final voltage
Timet / τVoltageOf the wayCurrent in R

“Of the way” is how far the capacitor has gone from its starting voltage toward the voltage it settles at. It depends only on t/τ, so those rows are the same for every RC circuit. The highlighted row is your threshold or your time.

How this is calculated

A capacitor charging or discharging through a resistor moves toward a final voltage along an exponential. If it starts at V0 and heads for V∞, then after a time t

v(t) = V∞ + (V0 − V∞)·e−t/τ,    τ = R·C

Charging and discharging are the same equation: charging from 0 V toward a supply is V0 = 0, V∞ = Vs, which gives the familiar Vs(1 − e−t/τ); discharging toward 0 V gives V0·e−t/τ. Turned around, the time to reach a threshold Vt is

t = τ · ln[(V0 − V∞) / (Vt − V∞)]

which has an answer only when Vt lies between where the capacitor starts and where it is going. Ten kilohms and 10 µF make τ = 100 ms, and charging from 0 V to 3.5 V on a 5 V supply takes τ·ln(5/1.5) = 120.4 ms. Solving for the resistor or the capacitor is the same expression divided through: R = t / (C·ln[…]), and the page then gives the nearest values you can buy (E24 and E96 for resistors, E6 and E12 for capacitors) with the time each one actually gives.

The numbers worth remembering

Because every RC circuit follows the same curve in units of τ, a handful of multiples cover most design work. After 0.693 τ (ln 2) the capacitor is half way; after 1 τ it is 63.2 % of the way; after 2 τ 86.5 %, 3 τ 95.0 %, 4 τ 98.2 % and 5 τ 99.3 %. The 10–90 % rise time is 2.197 τ, and the 30–70 % rise time the I2C specification uses is 0.847 τ, which is what sets the largest I2C pull-up resistor a bus can take. A 555 timer is built on exactly these numbers: it charges an RC from ⅓ to ⅔ of the supply, half the remaining distance, so every interval it times is τ·ln 2.

“Fully charged after 5 τ” is a convention, not physics. The exponential never arrives; 5 τ is just where the remaining 0.7 % stops mattering for most purposes. If you need 0.1 %, that is 6.9 τ, and an ADC that has to settle to half a bit of 16 bits needs 11.8 τ.

Why the worst case is wider than you think

The time is proportional to R·C, so the tolerances multiply. A 1 % resistor with a ±20 % electrolytic gives a delay anywhere from 0.99 × 0.8 = 79 % to 1.01 × 1.2 = 121 % of the nominal, before temperature or ageing; a −20/+80 % capacitor (Z5U and Y5V ceramics, some old electrolytics) stretches that to 182 %. If the timing matters, buy the precision in the capacitor, use film or C0G, and remember that a class 2 ceramic also loses capacitance with DC bias and temperature. The capacitor code calculator reads the tolerance and dielectric off a part you already have.

The threshold is the other half. A microcontroller pin specified with VIH = 0.7·VDD only promises that 3.5 V on a 5 V rail reads as high. The real switching point is somewhere below that, and a Schmitt-trigger input switches somewhere inside a window the datasheet gives as a range, not a value. Enter that spread as the threshold tolerance and the worst case includes it. The closer the threshold sits to the final voltage, the more it matters: past about 3 τ the curve is nearly flat, so a small change in threshold or supply moves the time a lot, and the page warns when you are there.

The load that stops it arriving

Anything across the capacitor, whether an input resistance, a divider, a bleeder resistor, or an electrolytic's leakage, forms a voltage divider with the charging resistor. The capacitor then charges toward the divider's output, Vs·RL/(R + RL), not toward the supply, and with a shorter time constant, (R ∥ RL)·C. That is Thévenin's theorem, and it means a threshold above the divider voltage is never reached at all. A 1 MΩ timing resistor into an input with 1 MΩ to ground never charges past half the supply. The page reports the voltage the load holds it at, and the largest resistor that still reaches the threshold.

Where the energy goes

Charging a capacitor from 0 V through a resistor burns exactly as much energy in the resistor as ends up stored in the capacitor, ½CV², whatever the resistance. A smaller resistor dissipates the same energy faster. The page gives both figures for the interval you are looking at, which is the number to check when a resistor limits the inrush into a large capacitor.

FAQ

Why 63 %?

Because after one time constant the remaining distance has shrunk by a factor of e: 1/e = 36.8 % is left, so 63.2 % has been covered. Nothing physical happens at 63 %; it is just where the exponential's own unit of time lands. The half-way point, 0.693 τ, is often more useful.

How long does a capacitor take to discharge to a safe voltage?

Set the mode to discharging, enter the voltage it starts at, the bleeder resistor and the capacitance, and put the voltage you consider safe as the threshold. A 470 µF capacitor at 400 V through a 100 kΩ bleeder has τ = 47 s and needs 47 s · ln(400/50) = 98 s to fall to 50 V. That is the nominal time; use the slow end of the worst case, and measure before you touch it. If the capacitor is on a supply that is still connected, it may not discharge at all.

What does a power-on reset or switch debounce need?

For a reset delay, choose the threshold as the input's guaranteed high level and use the slowest corner as the shortest delay you will get. For a debounce, the capacitor must not reach the threshold during the bounce, so it is the fastest corner that has to outlast the bounce. Either way, an input without hysteresis can switch several times while a slow edge crosses its threshold, which is why these circuits normally feed a Schmitt-trigger input.

Is the time constant the same thing as a filter's cutoff?

Yes, the same R and C viewed from the other side: the cutoff of a first-order RC filter is fc = 1/(2π·τ). The RC filter calculator gives the frequency response: gain, phase and the −3 dB point.

Does the resistor value matter, or only R·C?

R·C sets the timing, and R alone sets the current: the peak current is the full voltage step divided by R, at t = 0. A small R with a large C draws a big inrush that a regulator, a switch contact or a microcontroller pin may not tolerate. A very large R (megohms) makes leakage, input current and board contamination part of the circuit. Between about 1 kΩ and 1 MΩ both problems stay small.

Can I charge with a constant current instead?

Then the voltage rises in a straight line, V = I·t/C, and there is no time constant. A current source such as an LM317 in current-source mode does that, and timing becomes linear and much less sensitive to the threshold.