When you connect a capacitor to a voltage through a resistor, it doesn't charge instantly. Its voltage rises quickly at first, then slows down as it approaches the supply voltage. That curve is the basis of delay circuits, timers and signal filters, including the 555 timer.
The time constant τ
τ = R × C
Resistance in ohms and capacitance in farads give τ (tau) in seconds.
Example: 10 kΩ × 100 µF = 10000 × 0.0001 = 1 second.
Why does the curve look like that?
The charging current flows through the resistor, and Ohm's law says that current = (supply voltage − capacitor voltage) ÷ R. At the first instant the capacitor is empty, so the difference is large, the current is at its highest, and the voltage rises quickly. As the capacitor fills, the difference shrinks, the current falls, and charging slows. That's why the voltage approaches the supply voltage without ever quite reaching it.
Notice that the supply voltage itself isn't in τ: a 100 µF capacitor with 10 kΩ takes the same second to reach 63%, whether the supply is 5 V or 12 V. The voltage changes where it ends up, not how fast.
The numbers to remember
| Time | Capacitor has reached this much of the supply |
|---|---|
| 1τ | 63% |
| 2τ | 86% |
| 3τ | 95% |
| 4τ | 98% |
| 5τ | Over 99% (considered fully charged) |
Discharging is the same story in reverse: after one τ the voltage is at 37% of where it started, and after 5τ it's almost zero.
Time to reach a given voltage
t = −τ × ln(1 − Vtarget ÷ Vin)
Example: a capacitor charging from 5 V, and you want to know when it reaches 3.3 V (so a microcontroller reads a "1"):
- t = −τ × ln(1 − 3.3 ÷ 5) ≈ 1.08τ.
- With τ = 1 second → about 1.08 seconds.
Charging current and the moment of connection
The highest current happens at the first instant: I = Vin ÷ R. With 5 V and 10 kΩ that's only half a milliamp. But with almost no resistance, like a 2200 µF filter capacitor connected straight to a power supply, the only resistance is the wires and the capacitor itself, so the momentary current can reach tens of amps. That's what causes the spark when you connect a battery to a circuit with big capacitors, and why some larger devices have an NTC thermistor at the input to limit that current.
Safely discharging big capacitors
A capacitor keeps its charge after you switch the power off, and how long it takes to discharge is also set by RC, where R is whatever is connected across it.
An important repair example: a 470 µF capacitor at 400 V in a switching power supply, with a 100 kΩ bleeder resistor across it:
- τ = 100000 × 0.00047 = 47 seconds.
- To fall below 1% it needs 5τ ≈ 4 minutes.
So if you open the device a minute after unplugging it, the capacitor may still hold more than 100 V. And if that resistor is missing or burnt, it can stay charged for hours. Always measure the voltage across it before touching it, and discharge it through a power resistor (say 1 kΩ, 5 W), not by shorting it with a screwdriver. Read the mains safety rules and the bulging capacitors article.
Practical uses
Power-on reset delay
A resistor and capacitor on the reset pin make the chip wait until the supply has settled before it starts.
Button debouncing
A mechanical button "bounces" when it closes, producing many pulses in the first few milliseconds. A 10 kΩ resistor and a 100 nF capacitor (τ = 1 ms) smooth that bounce before it reaches the microcontroller. The software solution instead of parts is in the buttons and debounce article.
The RC filter
The same resistor and capacitor make a low-pass filter: they pass low frequencies and weaken high ones. The cut-off frequency:
fc = 1 ÷ (2π × R × C)
For example, 1 kΩ and 100 nF → fc ≈ 1.6 kHz.
Notice that τ in this example is 0.1 ms, and the filter weakens signals that change faster than that. So the time constant and the cut-off frequency are two sides of the same thing: one describes it in time, the other in frequency. Filters in detail, and the difference between low-pass and high-pass, are in the RC filters article and the RC filter calculator.
Measuring a capacitor with an Arduino
Since the time to 63% is exactly R × C, you can work out the capacitance from the time:
- Connect the capacitor through a 10 kΩ resistor to a digital pin, and the capacitor-resistor junction to an analog pin.
- Discharge the capacitor first (hold the pin LOW for a while).
- Set the pin HIGH and start a timer with
micros(). - Wait until the reading reaches 63.2% of 1023, about 647.
- Capacitance = time ÷ R. For example, 47000 µs ÷ 10000 Ω = 4.7 µF.
A simple method that suits capacitors from about 1 µF upwards; for smaller values use a bigger resistor.
Delayed turn-off for an LED
An LED that stays lit for a while after you let go of a button: the button charges a capacitor, the capacitor feeds a transistor that drives the LED, and when the button is released the capacitor slowly discharges through the base resistor. The timing is approximate; for an accurate time, use the 555 in monostable mode.
Tips
- Electrolytic capacitors aren't accurate (they can be ±20%) and they leak, so long timings with them are approximate.
- Very large resistors (megohms) are affected by capacitor leakage and by the input resistance of the next circuit, so the timing drifts from the calculation.
- If you need accurate or long timing, a microcontroller or a crystal is far more accurate than RC.
FAQ
Can I make a one-hour timer with RC? In theory yes, with a huge capacitor and resistor; in practice no: the capacitor's leakage would be as big as the charging current, and the timing would be random. For anything longer than a few minutes, use a microcontroller or an RTC clock module.
Why does the capacitor in my circuit charge slower than calculated? Most likely its real value is larger than marked (electrolytics can be +20%), or there's a load on the capacitor taking part of the current. And if you're measuring with a multimeter, its own input resistance discharges the capacitor slightly.
Does an inductor do the same thing? Yes, but the other way round: with an inductor it's the current that builds up gradually, and the time constant is τ = L ÷ R. Read what is an inductor.
Calculate it in a second
The RC charge and discharge calculator works out τ, the times to 63%, 95% and 99%, the voltage after any time, and the time to reach any voltage, with a plot of the curve.