Sub topic 4
Discharging a Capacitor Through a Resistor
This chapter assumes you know Ohm's law, KVL, and KCL, and that you can differentiate and integrate exponentials. It also assumes you have seen a first-order linear differential equation. The chapter derives the source-free RC response and checks it numerically.
The circuit and its equation
A capacitor C holds an initial voltage V0 at t = 0. A switch then connects it across a resistor R, with no source in the loop. This is the natural, or source-free, response. The energy stored in the capacitor drives everything that follows.
Write KCL at the top node. The current leaving the capacitor through the resistor equals the resistor current:
- Capacitor current, taken as leaving the top plate: i = -C dv/dt
- Resistor current: i = v/R
Setting them equal gives:
C dv/dt + v/R = 0Dividing by C gives the standard first-order form:
dv/dt + v/(RC) = 0Solving by separation of variables
Rearrange and integrate from the initial condition:
dv/v = -dt/(RC)
ln v(t) - ln V0 = -t/(RC)
v(t) = V0 e^(-t/RC)Define the time constant tau = RC. Then:
v(t) = V0 e^(-t/tau), t >= 0The resistor current follows from Ohm's law: i(t) = (V0/R) e^(-t/tau). The current jumps from 0 to V0/R when the switch closes. The capacitor voltage cannot jump, but the resistor current can.
The loop in the diagram explains the exponential shape. A smaller voltage drives a smaller current, so the voltage falls more slowly as it decays. The rate of decay is always proportional to the remaining voltage.
Reading the curve
The table shows the fraction of V0 left after whole multiples of tau.
| Time | v(t)/V0 |
|---|---|
| 0 | 1.000 |
| 1 tau | 0.368 |
| 2 tau | 0.135 |
| 3 tau | 0.050 |
| 5 tau | 0.007 |
After one time constant, the voltage has dropped to about 36.8% of its starting value. After five time constants, less than 1% remains, so engineers usually treat the capacitor as fully discharged.
Worked example
A 100 nF capacitor starts at 5 V and discharges through 10 kΩ.
- tau = RC = 10e3 × 100e-9 = 1 ms.
- v(t) = 5 e^(-t/1 ms) V.
- At t = 2 ms, v = 5 × 0.135 = 0.677 V.
- The initial resistor current is 5 V / 10 kΩ = 0.5 mA.
The following program evaluates the same curve.
import math
R = 10e3 # ohms
C = 100e-9 # farads
V0 = 5.0 # initial capacitor voltage
tau = R * C # 1 ms
for k in range(6):
t = k * tau
v = V0 * math.exp(-t / tau)
i = v / R
print(f"t = {k} tau: v_C = {v:.3f} V, i = {i * 1000:.3f} mA")Energy check
The capacitor starts with energy (1/2) C V0^2. For the example, that is 0.5 × 100e-9 × 25 = 1.25 µJ. The resistor dissipates the integral of v²/R over all time, which equals exactly (1/2) C V0^2. All the stored energy ends up as heat in R.
Common errors
- Sign of the capacitor current. Using i = +C dv/dt with the current defined as leaving the capacitor gives a decay with a positive exponent. Match the sign to your current direction.
- Using the wrong resistance. In larger circuits, R must be the resistance seen by the capacitor terminals with sources turned off. A later chapter covers this.
- Expecting the current to be continuous. Only the capacitor voltage is continuous at the switching instant.
- Treating tau as the total decay time. The voltage has not reached zero at 1 tau. Use about 5 tau as the practical settling time.
Exercise
A 2.2 µF capacitor charged to 12 V discharges through a 4.7 kΩ resistor. Find tau, the voltage at t = 20 ms, and the time for the voltage to fall to 1 V.
Show answer
tau = 4.7e3 × 2.2e-6 = 10.34 ms. At t = 20 ms, v = 12 e^(-20/10.34) = 12 × 0.1445 = 1.73 V. For v = 1 V, solve 1 = 12 e^(-t/tau), so t = tau ln 12 = 10.34 ms × 2.485 = 25.7 ms.