Sub topic 7
Charging a Capacitor: The RC Step Response
This chapter assumes you know Ohm's law, KVL, the capacitor relation i = C dv/dt, and how to solve a first-order linear differential equation. It also assumes you know that capacitor voltage cannot jump. Here you derive how a capacitor charges when a constant source is suddenly connected, and you read the result in terms of the time constant.
The Setup
A step response is the behavior of a circuit after a source switches from zero to a constant value. Take a series circuit: a source V, a resistor R, and a capacitor C that starts uncharged. At t = 0 the source is connected.
KVL around the loop gives V = R i + vC. The capacitor current is i = C dvC/dt. Substituting:
RC dvC/dt + vC = V
Divide by RC and write tau = RC:
dvC/dt = (V - vC) / tau
The rate of change is proportional to the remaining gap between the source and the capacitor voltage. A large gap means fast charging, and a small gap means slow charging.
Solving the Equation
The solution is a particular (final) value plus a decaying natural part:
v_C(t) = V + A e^(-t/tau)
Continuity requires vC(0+) = vC(0-) = 0, so A = -V. The result is:
v_C(t) = V (1 - e^(-t/tau)), for t ≥ 0
The current follows from i = C dv_C/dt:
i(t) = (V/R) e^(-t/tau)
At t = 0+ the capacitor acts like a short circuit, so the current jumps to V/R. In the long run the capacitor acts like an open circuit and the current falls to zero. The current can jump. The capacitor voltage cannot.
Reading the Curve with Tau
Evaluate the voltage at whole multiples of tau:
| Time | v_C as fraction of V |
|---|---|
| 1 tau | 0.632 |
| 2 tau | 0.865 |
| 3 tau | 0.950 |
| 5 tau | 0.993 |
After one time constant the capacitor has covered about 63% of the remaining distance to V. After five, it is within 1% of the final value, and engineers usually treat the circuit as settled.
The following program prints these values for R = 10 kΩ, C = 100 nF, and V = 5 V.
import math
R = 10e3 # ohms
C = 100e-9 # farads
V = 5.0 # volts, step source
tau = R * C # 1 ms
for k in range(6):
t = k * tau
v = V * (1 - math.exp(-t / tau))
print(f"t = {k} tau: v_C = {v:.3f} V")The output rises from 0.000 V at t = 0 to 4.966 V at t = 5 tau.
Common Errors
- Using tau = R/C or tau = C/R instead of RC. Check units: ohms times farads gives seconds.
- Forgetting that the capacitor may start with a nonzero voltage. In that case the amplitude A is v_C(0) - V, not -V.
- Applying the formula with t measured from the wrong instant. Always start the clock at the switching time.
- Treating the resistor voltage as constant. It equals V - v_C and decays as e^(-t/tau).
Exercise
A 12 V source charges an initially uncharged 47 µF capacitor through a 22 kΩ resistor. Find tau, the capacitor voltage at t = 1.034 s, and the current at t = 0+.
Show answer
tau = RC = 22e3 × 47e-6 = 1.034 s. At t = tau, v_C = 12 × (1 - e^-1) = 12 × 0.632 = 7.58 V. At t = 0+ the capacitor acts as a short, so i = V/R = 12 / 22e3 = 0.545 mA.
Exercise
The capacitor in a circuit with tau = 2 ms starts at 0 V and charges toward 10 V. How long does it take to reach 9 V?
Show answer
Solve 9 = 10(1 - e^(-t/tau)), so e^(-t/tau) = 0.1. Then t = tau ln 10 = 2 ms × 2.303 = 4.6 ms.