The capacitor voltage equation defines how the voltage across a capacitor changes over time when charging or discharging through a resistor. For any DC step-response in an RC (resistor-capacitor) circuit, the universal transient formula is:

V(t) = Vf + (Vi - Vf)e-t/RC

While many textbooks split this into separate 'charging' and 'discharging' formulas, this single generalized equation handles every scenario—including partially charged starting states—provided you track your initial and final boundary conditions correctly. Below is the complete derivation reference, algebraic rearrangements, and bench-tested worked examples to keep your unit conversions from ruining your timing circuits.

The Core Equation and Symbol Definitions

To use the formula accurately, every variable must be converted to its base SI unit before calculation. The most common point of failure for hobbyists and students is plugging microfarads directly into the equation without converting to farads.

Symbol Parameter Base SI Unit Common Hobbyist Unit
V(t) Instantaneous voltage at time t Volts (V) Volts (V)
Vf Final target voltage (source or ground) Volts (V) Volts (V)
Vi Initial voltage at t = 0 Volts (V) Volts (V)
e Euler's number (natural logarithm base) Constant (~2.71828) Constant (~2.71828)
t Elapsed time Seconds (s) Milliseconds (ms)
R Circuit resistance Ohms (Ω) Kilohms (kΩ)
C Capacitance Farads (F) Microfarads (μF)
RC (τ) Time constant (Tau) Seconds (s) Seconds (s)

For a deeper theoretical foundation on how the differential equation I = C(dV/dt) integrates into this exponential form, refer to the Georgia State University HyperPhysics RC circuit modules.

Rearranged Forms: Solving for Time, Resistance, and Capacitance

On the workbench, you rarely need to find V(t). Usually, you have a target voltage threshold (like a Schmitt trigger logic high) and need to size the resistor or capacitor to hit that threshold at a specific time. Here are the algebraic rearrangements of the capacitor voltage equation, solving for the other variables.

Solving for Time (t)

Use this to find how long it takes to reach a specific voltage threshold.

t = -RC × ln( (V(t) - Vf) / (Vi - Vf) )

Solving for Resistance (R)

Use this to select a resistor value for a desired timing delay with a fixed capacitor.

R = -t / [ C × ln( (V(t) - Vf) / (Vi - Vf) ) ]

Solving for Capacitance (C)

Use this to size a capacitor when your resistor is constrained by power dissipation or availability.

C = -t / [ R × ln( (V(t) - Vf) / (Vi - Vf) ) ]

Assumptions, Unit Mistakes, and Realistic Magnitudes

When the Formula Applies (and Its Assumptions)

The capacitor voltage equation assumes an ideal DC step input. It requires:

  • Constant DC Source: The supply voltage (Vf) must not sag or ripple during the charge cycle.
  • Ideal Components: It ignores Equivalent Series Resistance (ESR) and dielectric absorption. For large electrolytic capacitors (e.g., >1000μF), ESR will slightly reduce the initial charging current spike, making the real-world curve deviate from the ideal math in the first few milliseconds.
  • Step-Function Input: The switch closes instantly. If your voltage source ramps up (like a soft-start circuit), this equation is invalid.

The Unit Mistake That Breaks Everything

The most catastrophic mistake in RC timing calculations is failing to convert microfarads (μF) to farads (F). If you use C = 100 instead of C = 0.0001 for a 100μF capacitor, your calculated time constant (τ = RC) will be off by a factor of one million. A circuit you expect to time out in 1 second will actually take 11.5 days. Always write your unit conversions explicitly in your scratchpad.

What a Realistic Answer Magnitude Looks Like

In 5V logic circuits (like an Arduino or ESP32 reset line), typical RC values are R = 10kΩ and C = 100nF (0.1μF). This yields a time constant (τ) of 1 millisecond. If your calculation for a simple debounce or reset circuit yields a time constant of 45 seconds, you have likely dropped a decimal place in your capacitance conversion. For a comprehensive look at practical RC timing applications in logic design, the All About Circuits DC textbook chapter on time constants provides excellent benchmark ranges.

Worked Examples with Strict Unit Tracking

Below are two bench-realistic problems. Notice how every intermediate step explicitly tracks the unit conversion to prevent magnitude errors.

Problem 1: Charging a Supercapacitor for a Memory Backup

Scenario: You have a 5.0V DC rail charging a 0.47F supercapacitor through a 100Ω current-limiting resistor. The capacitor starts completely dead (0V). What is the voltage across the capacitor at exactly 20 seconds?

  1. Identify and Convert Variables:
    • Vf = 5.0 V
    • Vi = 0 V
    • R = 100 Ω (Already in base SI)
    • C = 0.47 F (Already in base SI)
    • t = 20 s
  2. Calculate the Time Constant (τ):
    • τ = R × C = 100 Ω × 0.47 F = 47 seconds.
  3. Apply the Capacitor Voltage Equation:
    • V(20) = 5.0 + (0 - 5.0)e-20 / 47
    • V(20) = 5.0 - 5.0(e-0.4255)
    • V(20) = 5.0 - 5.0(0.6534)
    • V(20) = 5.0 - 3.267
  4. Final Answer: V(20) = 1.73 Volts. (At roughly 0.42 time constants, it makes physical sense that it is less than halfway charged).

Problem 2: Discharging a Camera Flash Capacitor to a Safe Threshold

Scenario: A camera flash circuit uses a 330μF capacitor charged to 300V DC. When powered off, it discharges through a 220kΩ bleeder resistor. How long will it take for the voltage to drop to a safe-to-touch threshold of 30V?

  1. Identify and Convert Variables:
    • Vf = 0 V (Discharging to ground)
    • Vi = 300 V
    • V(t) = 30 V (Target threshold)
    • R = 220,000 Ω (Converted from 220kΩ)
    • C = 0.00033 F (Converted from 330μF)
  2. Calculate the Time Constant (τ):
    • τ = 220,000 × 0.00033 = 72.6 seconds.
  3. Apply the Rearranged Time Equation:
    • t = -RC × ln( (V(t) - Vf) / (Vi - Vf) )
    • t = -72.6 × ln( (30 - 0) / (300 - 0) )
    • t = -72.6 × ln( 30 / 300 )
    • t = -72.6 × ln( 0.1 )
    • t = -72.6 × (-2.3025)
  4. Final Answer: t = 167.16 seconds (approx. 2 minutes and 47 seconds). This highlights why high-voltage flash circuits require physical discharge tools rather than relying solely on bleeder resistors for immediate bench safety.

Frequently Asked Questions

Why does the capacitor voltage equation use the natural logarithm base (e)?

The base e appears because the rate of voltage change across a capacitor is directly proportional to the remaining voltage difference. As the capacitor charges, the voltage difference between the source and the capacitor shrinks, which reduces the current, which in turn slows down the charging rate. This self-limiting feedback loop is the literal definition of exponential decay/growth, which is mathematically modeled by the natural logarithm base e in calculus.

How does the capacitor voltage equation change for AC circuits?

The transient DC equation provided above does not apply to steady-state AC circuits. In AC, the capacitor is constantly charging and reversing polarity. Instead of a time-domain exponential equation, AC analysis uses complex impedance (Zc = 1 / jωC) and phasor math to calculate voltage division and phase shifts. The voltage magnitude depends on the frequency of the AC signal, not a simple elapsed time constant.

What happens to the capacitor voltage equation if the initial voltage is not zero?

That is exactly why we use the generalized form V(t) = Vf + (Vi - Vf)e-t/RC instead of the simplified textbook version V(t) = Vs(1 - e-t/RC). If your capacitor starts at 2V and is charging toward 12V, you simply plug Vi = 2 and Vf = 12 into the generalized formula. The simplified version assumes Vi is always exactly 0V, which fails in circuits where a capacitor is rapidly toggled between logic states before fully discharging.

Can I use the capacitor voltage equation to size a supercapacitor for a UPS?

You can use it to calculate the theoretical hold-up time, but real-world supercapacitors have massive Equivalent Series Resistance (ESR) and high leakage currents. As the voltage drops under load, the ESR causes an immediate voltage sag (V = I × RESR) before the exponential decay even begins. For UPS sizing, you must use the energy formula (E = 0.5CV²) and derate the usable capacitance by 20-30% to account for ESR losses and the non-linear voltage drop-off of your DC-DC boost converter's minimum input threshold.