DEV Community

Evgenii Konkin
Evgenii Konkin

Posted on

The Engineering Math Behind Capacitor RC Timing: From Natural Logs to Circuit Design

A 1 µF capacitor charged through a 1 MΩ resistor takes about 5 seconds to reach 99.3% of the source voltage. That same capacitor, with a 10 Ω resistor, reaches the same level in 50 microseconds. The range spans five orders of magnitude, all governed by one simple equation involving a natural logarithm.

The Formula

The RC timing equation is:

τ = R × C

For charging:
t = -R × C × ln(1 - Vt / Vs)

For discharging:
t = -R × C × ln(Vt / Vi)
Enter fullscreen mode Exit fullscreen mode

Where:

  • R is resistance in ohms (Ω) – after converting from your chosen unit (Ω, kΩ, MΩ). Resistance opposes current, slowing the voltage change.
  • C is capacitance in farads (F) – after converting from µF, nF, etc. Capacitance stores charge; larger capacitance means more charge needed to change voltage.
  • τ (RC time constant) is the product R×C in seconds. After one τ, the voltage reaches about 63.2% of its final value.
  • Vs is the source voltage (charging) or initial voltage (discharging) in volts.
  • Vt is the target voltage in volts.
  • ln is the natural logarithm. Why? Because the rate of voltage change is proportional to the difference from the final value – a differential equation that yields an exponential solution. The logarithm inverts that exponential to solve for time.

Worked Example 1: Charging a Timing Capacitor

Scenario: You need a delay of about 2 seconds before a circuit activates. Choose R and C.

  • Resistance: 100 kΩ (unit: kΩ → 100,000 Ω)
  • Capacitance: 22 µF (unit: µF → 0.000022 F)
  • Mode: Charge
  • Source Voltage: 12 V
  • Target Voltage: 7.6 V (approximately 63.2% of 12 V, i.e., one time constant)

Step 1: Compute τ

R = 100,000 Ω
C = 0.000022 F
τ = 100,000 × 0.000022 = 2.2 s
Enter fullscreen mode Exit fullscreen mode

Step 2: Compute log argument for charging

Vt / Vs = 7.6 / 12 = 0.6333
1 - Vt/Vs = 0.3667
Enter fullscreen mode Exit fullscreen mode

Step 3: Compute charge time

t = -τ × ln(1 - Vt/Vs)
t = -2.2 × ln(0.3667)
t = -2.2 × (-1.003) = 2.207 s
Enter fullscreen mode Exit fullscreen mode

Result: 2.207 seconds, classified as MODERATE by the Result Intelligence System. The circuit will activate after about 2.2 seconds.

Worked Example 2: Discharging a Filter Capacitor

Scenario: A 470 µF capacitor charged to 24 V must discharge to below 5 V within 0.5 seconds to meet safety requirements.

  • Resistance: 220 Ω
  • Capacitance: 470 µF (0.00047 F)
  • Mode: Discharge
  • Initial Voltage: 24 V
  • Target Voltage: 5 V

Step 1: Compute τ

τ = 220 × 0.00047 = 0.1034 s
Enter fullscreen mode Exit fullscreen mode

Step 2: Compute log argument for discharging

Vt / Vi = 5 / 24 = 0.2083
Enter fullscreen mode Exit fullscreen mode

Step 3: Compute discharge time

t = -τ × ln(Vt/Vi)
t = -0.1034 × ln(0.2083)
t = -0.1034 × (-1.568) = 0.162 s
Enter fullscreen mode Exit fullscreen mode

Result: 0.162 seconds, classified as FAST. The requirement is met with margin.

What Engineers Often Miss

  1. The asymptotic approach matters: Reaching 99% of final voltage takes about 4.6τ, but reaching 99.9% takes 6.9τ. For precision timing, don't assume a single τ is enough.
  2. Parasitic capacitance and resistance: PCB traces and component leads add stray capacitance (a few pF) and resistance (milliohms). In high-speed circuits, these can shift τ by 10% or more.
  3. Tolerance stacking: Resistors and capacitors have tolerances (often 5-20%). Worst-case τ can vary by 25% or more. Always design with margins.

Try the Calculator

Use the Capacitor Charge/Discharge Time Calculator to quickly explore RC timing scenarios with instant results and intelligence classification.

Top comments (0)