Sub topic 10
Charging and Discharging Through a Resistor: The Time Constant
This chapter assumes you know Ohm's law, Kirchhoff's laws, the exponential function, and the capacitor relations Q = CV and i = C dv/dt. It also assumes you know that a capacitor's voltage cannot jump and that a capacitor acts as an open circuit in DC steady state.
The setup
Connect a source Vs through a resistor R to a capacitor C that starts at 0 V. At t = 0 the switch closes. The capacitor voltage cannot jump, so vC(0) = 0 and the resistor initially sees the full source voltage. The starting current is Vs/R.
As charge builds up, vC rises and the voltage across the resistor, Vs − vC, falls. The current falls with it. In the end the capacitor reaches Vs and the current is zero.
Deriving the charging equation
Apply KVL around the loop and use i = C dvC/dt:
Vs = R·i + vC = RC·(dvC/dt) + vC
This is a first-order differential equation. With vC(0) = 0 the solution is:
vC(t) = Vs(1 − e^(−t/τ)), where τ = RC
The current follows from i = C dvC/dt:
i(t) = (Vs/R)·e^(−t/τ)
The product τ = RC is the time constant. Its unit is seconds, because ohms times farads equals seconds.
Reading the time constant
The exponential reaches fixed fractions of its final value at multiples of τ.
| Time | Charging vC (fraction of Vs) | Remaining gap |
|---|---|---|
| 1τ | 63.2% | 36.8% |
| 2τ | 86.5% | 13.5% |
| 3τ | 95.0% | 5.0% |
| 5τ | 99.3% | 0.7% |
Engineers often treat the circuit as settled after 5τ. A larger R or a larger C gives a larger τ and a slower response.
The initial slope of vC is Vs/τ. If the voltage kept rising at that rate, it would reach Vs exactly at t = τ. This gives a quick graphical check.
import math
Vs = 5.0 # source voltage in volts
R = 10e3 # resistance in ohms
C = 100e-6 # capacitance in farads
tau = R * C # time constant in seconds (1.0 s here)
for k in range(0, 6):
t = k * tau
vc = Vs * (1 - math.exp(-t / tau))
print(f"t = {k} tau: vC = {vc:.3f} V")With these values, τ = 10 kΩ × 100 µF = 1 s. After one second vC is 3.161 V, which is 63.2% of 5 V.
Discharging
Now suppose the capacitor holds V0 and the source is replaced by a short, so the capacitor discharges through R. KVL gives RC·(dvC/dt) + vC = 0, and the solution is:
vC(t) = V0·e^(−t/τ)
The same τ applies. The voltage falls to 36.8% of V0 after one time constant and is below 1% after 5τ. The current has the same magnitude pattern, V0/R at the start and decaying exponentially, but it flows in the opposite direction from the charging current.
The general method
Any first-order RC circuit with a constant source follows one pattern:
v(t) = v(∞) + [v(0⁺) − v(∞)]·e^(−t/τ)
To use it:
- Find v(0⁺) from the capacitor voltage just before the change. Continuity means it stays the same.
- Find v(∞) by treating the capacitor as an open circuit.
- Find τ = Req·C, where Req is the resistance seen by the capacitor with sources turned off.
- Substitute into the formula.
Exercise
A 12 V source charges an initially empty 47 µF capacitor through a 22 kΩ resistor. Find τ, the capacitor voltage at t = 1.03 s, and the initial current.
Show answer
τ = RC = 22,000 × 47×10⁻⁶ = 1.034 s. At t = 1.03 s, which is about one time constant, vC = 12(1 − e^(−1)) ≈ 7.6 V. The initial current is Vs/R = 12/22,000 ≈ 0.545 mA.
Exercise
A capacitor is charged to 9 V, then discharges through a 100 kΩ resistor. After 2.2 s the voltage is 3.31 V. What is C?
Show answer
vC/V0 = 3.31/9 = 0.368, which is e^(−1), so t = τ = 2.2 s. Then C = τ/R = 2.2/100,000 = 22 µF.