Sub topic 5
Current through a capacitor: i = C dv/dt
This chapter assumes you know Ohm's law, Kirchhoff's laws, the idea of a derivative as a rate of change, and the relation Q = CV from the previous chapters. It builds the capacitor's current-voltage relation from Q = CV and shows how to use it with real waveforms.
From Q = CV to a current law
A resistor ties current to the voltage present at the same instant: v = iR. A capacitor does not work that way. Its current depends on how fast the voltage is changing.
Start with the charge relation for an ideal capacitor with constant capacitance C:
q(t) = C · v(t)
Current is the rate at which charge flows, i = dq/dt. Differentiate both sides. Because C is constant, it comes out of the derivative:
i(t) = dq/dt = C · dv/dt
This is the capacitor's current-voltage relation. It uses the passive sign convention: the current i is defined as flowing into the terminal marked positive for v. If you define i in the opposite direction, a minus sign appears.
Three consequences follow directly:
- If v is constant, dv/dt = 0, so i = 0. A steady voltage means no current.
- If v changes quickly, i is large. A fast change needs a large flow of charge.
- The sign of i follows the sign of dv/dt. Rising voltage means current flows into the positive plate. Falling voltage means current flows out of it.
The units agree: capacitance in farads (F) times a rate of change in volts per second (V/s) gives amperes. One farad is one ampere per volt per second, so 1 F = 1 A·s/V.
Reading the equation as a slope
Since dv/dt is the slope of the voltage graph, you can find the capacitor current by looking at the slope of v(t) and multiplying by C.
| Voltage waveform | dv/dt | Capacitor current |
|---|---|---|
| Constant (DC) | 0 | 0 |
| Straight ramp up | Positive constant | Positive constant |
| Straight ramp down | Negative constant | Negative constant |
| Sine wave | Cosine-shaped | Cosine-shaped, 90° ahead of voltage |
| Voltage step | Infinite at the step | Would need infinite current |
The last row is why capacitor voltage cannot jump in a real circuit. That topic is covered in a later chapter. For now, note that any finite current can only change the voltage at a finite rate.
A worked example: a ramp
A 10 µF capacitor has a voltage that rises linearly from 0 V to 5 V in 2 ms, then holds at 5 V.
During the ramp:
dv/dt = 5 V / 0.002 s = 2500 V/s
i = C · dv/dt = 10×10⁻⁶ F × 2500 V/s = 0.025 A = 25 mA
After the ramp the voltage is constant, so i = 0.
The current waveform is a rectangular pulse of 25 mA lasting 2 ms. The charge delivered is the area under that pulse: 25 mA × 2 ms = 50 µC. This matches Q = CV = 10 µF × 5 V = 50 µC, which is a useful check.
Computing the current numerically
You can check this with a short program that estimates dv/dt from sampled voltage values. The code below builds the ramp-and-hold waveform and finds the current at each time step using finite differences.
C = 10e-6 # capacitance in farads (10 uF)
dt = 0.0005 # time step in seconds (0.5 ms)
# Voltage samples: ramp from 0 V to 5 V over 2 ms, then hold
times = [k * dt for k in range(9)]
volts = [min(5.0, 5.0 * t / 0.002) for t in times]
for k in range(1, len(times)):
dvdt = (volts[k] - volts[k - 1]) / dt
i = C * dvdt
print(f"t = {times[k] * 1000:.1f} ms: v = {volts[k]:.2f} V, i = {i * 1000:.1f} mA")The first four intervals print 25.0 mA, and the rest print 0.0 mA. A finite-difference estimate works well for straight-line segments. For curved waveforms, a smaller time step gives a better estimate.
Worked example: a sine wave
Let v(t) = V_m sin(ωt) across a capacitor C. Then:
i(t) = C · d/dt [Vm sin(ωt)] = ω C Vm cos(ωt)
Two things stand out:
- The peak current is ωCV_m. It grows with frequency ω and with capacitance.
- cos(ωt) = sin(ωt + 90°), so the current leads the voltage by 90°. The current is largest when the voltage crosses zero, because that is where the voltage is changing fastest. The current is zero when the voltage is at its peak, because the slope is flat there.
For example, take C = 1 µF, Vm = 10 V, and f = 1 kHz. Then ω = 2π × 1000 ≈ 6283 rad/s, and the peak current is 6283 × 1×10⁻⁶ × 10 ≈ 62.8 mA. At 100 Hz the same capacitor and voltage give only 6.28 mA. The ratio Vm divided by the peak current is the capacitive reactance, 1/(ωC), which a later chapter develops fully.
Going the other way: voltage from current
Sometimes you know the current and need the voltage. Integrate the current relation:
v(t) = v(t₀) + (1/C) ∫ from t₀ to t of i(τ) dτ
The initial voltage v(t₀) is required. It is the voltage the capacitor already held at the starting time. The integral term is the accumulated charge, divided by C.
For a constant current I, the integral is simple:
v(t) = v(t₀) + (I/C)(t − t₀)
So a constant current produces a linear ramp in voltage. A 100 µF capacitor charged by a constant 2 mA from 0 V rises at 2×10⁻³ / 100×10⁻⁶ = 20 V/s. After 0.25 s it reaches 5 V. Constant-current charging is how ramp generators and many timing circuits work.
C = 100e-6 # farads
I = 2e-3 # constant charging current in amperes
v0 = 0.0 # initial voltage in volts
for t in [0.0, 0.1, 0.25, 0.5]:
v = v0 + (I / C) * t
print(f"t = {t:.2f} s: v = {v:.2f} V")Edge cases and common errors
- Forgetting the initial condition. Integrating current gives only the change in voltage. Always add v(t₀).
- Wrong sign. With the passive sign convention, i = +C dv/dt. If the current arrow points out of the positive terminal, use i = −C dv/dt.
- Treating current as proportional to voltage. A capacitor at 5 V can carry 0 A or 1 A, depending on the slope. Do not apply Ohm's law to a capacitor.
- Mixing units. Convert µF, ms, and mA before computing. A common slip is using 10 µF as 10×10⁻³ F.
- Non-differentiable waveforms. A square wave has instantaneous steps, and the formula would give an infinite current. In a real circuit, resistance and inductance limit the rate. The edge is smooth at some small time scale, and the current is a large, brief spike. When you analyze such a circuit, include the series resistance and use the RC behavior covered in later chapters.
- Time-varying capacitance. The derivation assumed constant C. If C changes with time, as in some sensors, then i = C dv/dt + v dC/dt.
Putting it together
The current-voltage relation gives a quick way to reason about capacitor behavior without any calculation:
- Sketch v(t).
- Mark where the slope is zero. The current is zero there.
- Mark where the slope is steepest. The current peaks there.
- Multiply the slope by C for the numbers.
Exercise
A 22 µF capacitor has a voltage that falls linearly from 12 V to 4 V in 4 ms. What is the current, and in which direction does it flow relative to the passive sign convention?
Show answer
The slope is dv/dt = (4 − 12) V / 0.004 s = −2000 V/s. The current is i = C dv/dt = 22×10⁻⁶ × (−2000) = −0.044 A = −44 mA. The negative sign means the current flows out of the positive terminal, so the capacitor is discharging and supplying 44 mA to the rest of the circuit.
Exercise
A 4.7 µF capacitor starts at 1 V and is charged by a constant current of 3 mA. What is its voltage after 10 ms?
Show answer
The voltage rise is ΔV = (I/C) t = (3×10⁻³ / 4.7×10⁻⁶) × 0.010 ≈ 638.3 V/s × 0.010 s ≈ 6.38 V. Adding the initial voltage gives v ≈ 1 + 6.38 = 7.38 V.
Exercise
A 0.1 µF capacitor has the voltage v(t) = 3 sin(2π · 5000 t) volts. Find the peak current.
Show answer
ω = 2π × 5000 ≈ 31,416 rad/s. The peak current is ωCV_m = 31,416 × 0.1×10⁻⁶ × 3 ≈ 9.42 mA.