---
title: RC charging, discharging and τ
heading: One curve for every first-order circuit
eyebrow: C2 · Lesson 7 · RC charging, discharging and τ
xp: 40
---

::: hook
Every circuit with one capacitor and resistors responds to a sudden change the same way: it heads exponentially from where it was to where it's going, at a pace set by one number, τ. Find three things (the starting value, the final value and τ) and you can write down the answer for any such circuit without solving a differential equation. That covers timers, switch debouncers, reset circuits and the edges of every digital signal.

::: play
- A square wave from 0 to 5 V drives an RC circuit. The scope shows the input and the capacitor's voltage.
- With the defaults, each half period lasts five time constants. Does the capacitor fully charge and discharge?
- Raise the frequency until a half period is about one τ. Then go higher. What does the output start to look like, and around what average does it settle?
:::
:::

```sim circuit
V1 in 0 square 0 5 100 Hz   @ 0,0 down
R1 in out 1k                @ 0,0 right
C1 out 0 1u                 @ 2,0 down
slider: R1 100..10k log
slider: C1 100n..10u log
slider: V1.f 10..5k log
scope: v(in), v(out)
time: 0..20m s
meter: v(out)
```

::: predict
## A capacitor charges from 0 V toward 10 V with τ = 2 ms. How long until it reaches 5 V?

- [ ] 1 ms
- [x] About 1.4 ms
- [ ] 2 ms
- [ ] About 6.3 ms

::: reveal
About 1.4 ms. Halfway takes $\tau\ln 2 = 0.69\tau$. The exponential starts fast and slows, so the first half comes sooner than a straight line would suggest, and the last few percent take much longer. To 63% takes exactly τ, and to 99% takes about 4.6τ.
:::
:::

::: nameit
## First-order response

**The universal form.** For any circuit with one capacitor (or one inductor) and resistors, after a sudden change, every voltage and current follows

$$x(t) = x_\infty + \left(x_0 - x_\infty\right)e^{-t/\tau}$$

**The three-step recipe:**

1. **Initial value** $x_0$: just after the change. A capacitor's voltage can't jump, so it starts where it was.
2. **Final value** $x_\infty$: long after, when the capacitor acts as an open circuit.
3. **Time constant** $\tau = R_\text{th}C$, where $R_\text{th}$ is the Thevenin resistance seen from the capacitor's terminals (C1.15) with the sources switched off.

**Milestones.** After $n$ time constants the fraction of the change completed is $1 - e^{-n}$:

| t | τ | 2τ | 3τ | 4τ | 5τ |
|---|---|---|---|---|---|
| done | 63.2% | 86.5% | 95.0% | 98.2% | 99.3% |

**Time to a threshold.** Solving for the time when $x$ reaches a value $x_1$:

$$t = \tau\ln\frac{x_0 - x_\infty}{x_1 - x_\infty}$$

This is how RC timers work: a comparator watches the capacitor and switches when it crosses a threshold.

**Discharging** is the same formula with $x_\infty = 0$: $v = V_0e^{-t/\tau}$.

**The initial slope** points straight at the final value and would reach it in exactly one τ. That's a handy way to read τ off a scope trace.

**Square waves.** If each half period is much longer than τ, the capacitor completes every swing. If it's much shorter, the capacitor barely moves before the input flips, and the output becomes a small triangle wave around the input's average. That's an RC low-pass filter at work (C4).
:::

::: example
## A 100 µF capacitor charges through 10 kΩ from 9 V. What is its voltage after 2 s?

::: solution
1. **Time constant.**
   $$\begin{aligned} \tau &= RC \\ &= 10\ \text{k}\Omega \times 100\ \mu\text{F} \\ &= 1\ \text{s} \end{aligned}$$
2. **Voltage after 2 s.** That's two time constants:
   $$\begin{aligned} v &= 9(1 - e^{-2}) \\ &= 7.78\ \text{V} \end{aligned}$$
   86% of the way.

**Answer:** the capacitor is at 7.78 V after 2 s, 86% of the way to 9 V.
:::
:::

::: example
## A 47 µF capacitor at 12 V discharges through 1 kΩ. When does it reach 1 V?

::: solution
1. **Time constant.**
   $$\begin{aligned} \tau &= RC \\ &= 1\ \text{k}\Omega \times 47\ \mu\text{F} \\ &= 47\ \text{ms} \end{aligned}$$
2. **Time to reach 1 V.**
   $$\begin{aligned} t &= \tau\ln\frac{12}{1} \\ &= 47 \times 2.48\ \text{ms} \\ &= 117\ \text{ms} \end{aligned}$$

**Answer:** it reaches 1 V after 117 ms.
:::
:::

::: example
## A microcontroller's power-on reset holds the chip in reset until an RC node reaches half the supply. With 100 kΩ and 1 µF from 3.3 V, how long is the reset?

::: solution
1. **When the node reaches half the supply.** The node charges as $v = V(1 - e^{-t/RC})$, so it reaches $\frac V2$ when
   $$e^{-t/RC} = \frac12$$
2. **Solve for the time.**
   $$\begin{aligned} t &= RC\ln2 \\ &= 100\ \text{k}\Omega \times 1\ \mu\text{F} \times 0.693 \\ &= 69\ \text{ms} \end{aligned}$$
3. **What the delay is for.** That gives the supply and the oscillator time to settle.
4. **Independent of the supply.** The time doesn't depend on the supply voltage, only on the fraction at which the reset releases, which is why RC timers stay steady as batteries run down.

**Answer:** the reset lasts 69 ms.
:::
:::

::: check
given: V = 5 | 10 | 12; f = 0.3 | 0.6 | 0.8; tau = 1 | 2.2 | 4.7
answer: tau*ln(1/(1 - f))
unit: ms
tolerance: 0.5%

## A capacitor charges from 0 toward {V} V with τ = {tau} ms. How long until it reaches {f} of the final voltage?

::: right
Right. $t = \tau\ln\frac{1}{1 - f}$ = {answer}.
:::

::: misses
- [tau*f] The rise is exponential: solve $1 - e^{-t/\tau} = f$.
- [-tau*ln(f)] Solve for the part still to go: $e^{-t/\tau} = 1 - f$.
- [any] Not yet. $t = \tau\ln\frac{V}{V - v}$.
:::
:::

::: check
given: V0 = 5 | 9 | 12; R = 2.2 | 10; C = 1 | 4.7; t = 1 | 5 | 10
answer: V0*exp(-t/(R*C))
unit: V
tolerance: 0.5%

## A capacitor of {C} µF, charged to {V0} V, discharges through {R} kΩ. What is its voltage after {t} ms?

::: right
Right. $V_0e^{-t/RC}$ = {answer}.
:::

::: misses
- [V0*(1 - exp(-t/(R*C)))] That's how much it has lost. What's left is $V_0e^{-t/\tau}$.
- [V0*exp(-t*R*C)] Divide by τ in the exponent.
- [any] Not yet. $v = V_0e^{-t/\tau}$ with $\tau = RC$.
:::
:::

::: check
given: R1 = 1 | 2 | 10; R2 = 3 | 4 | 6; C = 1 | 10
answer: R1*R2/(R1 + R2)*C
unit: ms
tolerance: 0.5%

## A source charges a {C} µF capacitor through {R1} kΩ, and {R2} kΩ sits in parallel with the capacitor. What is the time constant?

::: right
Right. Seen from the capacitor, with the source shorted, the two resistors are in parallel: $\tau = (R_1 \parallel R_2)C$ = {answer}.
:::

::: misses
- [R1*C] The parallel resistor also discharges the capacitor. Use the Thevenin resistance.
- [(R1 + R2)*C] With the source switched off, the resistors are in parallel.
- [any] Not yet. $\tau = R_\text{th}C$.
:::
:::

::: check
given: v0 = 2 | 3; vf = 8 | 10; n = 1 | 2 | 3
answer: vf + (v0 - vf)*exp(-n)
unit: V
tolerance: 0.5%

## A capacitor starts at {v0} V and heads toward {vf} V. What is its voltage after {n} time constant(s)?

::: right
Right. $v_\infty + (v_0 - v_\infty)e^{-n}$ = {answer}.
:::

::: misses
- [vf*(1 - exp(-n))] That assumes it started from 0 V.
- [v0 + (vf - v0)*exp(-n)] It's the gap to the final value that shrinks: $v_\infty + (v_0 - v_\infty)e^{-n}$.
- [any] Not yet. $x_\infty + (x_0 - x_\infty)e^{-t/\tau}$.
:::
:::

::: check
kind: choice

## On a scope, you draw the tangent to an RC charging curve at its start. Where does it reach the final value?

- [ ] At 5τ
- [x] At exactly τ
- [ ] At 0.69τ
- [ ] Never

::: right
Right. The initial slope is $(x_\infty - x_0)/\tau$, so a straight line at that slope covers the whole change in one τ.
:::

::: misses
- [1] 5τ is when the real curve is 99% done.
- [3] That's when the real curve is halfway.
- [4] The tangent is a straight line; it gets there at τ.
:::
:::

::: check
kind: parts
given: R = 10 | 100; C = 0.1 | 1 | 10; f = 0.5 | 0.7 | 0.9

## A reset node charges through {R} kΩ into {C} µF, and releases when it reaches {f} of the supply.

::: part
answer: R*C
unit: ms
tolerance: 0.5%

### What's the time constant?

::: misses
- [any] τ = RC.
:::
:::

::: part
answer: -R*C*ln(1 - f)
unit: ms
tolerance: 0.5%

### How long is the reset?

::: misses
- [R*C*f] The charge is exponential: $t = -RC\ln(1 - f)$.
- [any] Solve $1 - e^{-t/RC} = f$.
:::
:::
:::

::: check
kind: derivation
vars: V = 1..50, R = 10..1000000, C = 0.000000001..0.001, t = 0..10, f = 0.01..0.99

## A capacitor C charges from empty through R toward V.

::: step
answer: V*(1 - exp(-t/(R*C)))

### What's its voltage at t?
:::

::: step
answer: V/R*exp(-t/(R*C))

### What current flows?
:::

::: step
answer: -R*C*ln(1 - f)

### When does it reach a fraction f of V?
:::

::: right
Right. The time to a given fraction depends only on RC.
:::
:::

::: explain
## Why does every voltage and current in a circuit with one capacitor follow the same exponential with the same τ?

::: model
Seen from the capacitor, the rest of the circuit is a Thevenin equivalent: one source and one resistance. So the capacitor's voltage obeys a single first-order equation, $R_\text{th}C\,dv/dt + v = V_\text{th}$, whose solution moves exponentially from the old value to the new one with $\tau = R_\text{th}C$. Every other voltage and current in the circuit is a linear combination of the capacitor's voltage and the sources, so they all follow the same exponential with the same τ, each between its own initial and final values.
:::
:::

::: practice

::: check
given: tau = 1 | 2 | 5
answer: tau*ln(2)
unit: ms
tolerance: 0.5%

## τ = {tau} ms. How long to charge halfway?

::: misses
- [tau/2] Halfway takes $\tau\ln 2$.
- [any] $\tau\ln 2 \approx 0.69\tau$.
:::
:::

::: check
given: V0 = 10 | 12; n = 1 | 2 | 3
answer: V0*exp(-n)
unit: V
tolerance: 0.5%

## A capacitor at {V0} V discharges for {n}τ. Voltage left?

::: misses
- [V0*(1 - exp(-n))] That's what it lost.
- [any] $V_0e^{-n}$.
:::
:::

::: check
given: R = 1 | 2.2 | 4.7; C = 10 | 22 | 47
answer: 5*R*C
unit: ms
tolerance: 0.5%

## How long does {R} kΩ and {C} µF take to settle within 1% (about 5τ)?

::: misses
- [R*C] That's one τ.
- [any] $5RC$.
:::
:::
:::
