The fundamental charging and discharging a capacitor formula defines the voltage across a capacitor over time in a series RC (resistor-capacitor) circuit. When charging from a 0V initial state toward a DC source voltage, the voltage at time t is calculated as V(t) = Vs(1 - e-t/RC). When discharging from an initial voltage to 0V, the formula is V(t) = V0e-t/RC. These equations assume ideal components, constant DC sources, and operation within the standard RC time domain where parasitic inductance is negligible.
The Core Charging and Discharging a Capacitor Formula
To apply these equations on the bench or in simulation, you must understand every variable. The derivation of these formulas stems from Kirchhoff's Voltage Law (KVL) applied to a series RC loop, resulting in a first-order linear differential equation. The solution to this differential equation yields the exponential curves that characterize capacitor behavior according to standard physics models.
Symbol Definition Table
| Symbol | Parameter | Standard Unit | Practical Bench Notes |
|---|---|---|---|
V(t) |
Voltage across capacitor at time t | Volts (V) | The target variable you are usually solving for or measuring with a DMM. |
Vs |
Source / Supply Voltage | Volts (V) | The maximum asymptotic voltage during charging. |
V0 |
Initial Voltage | Volts (V) | The starting voltage at t=0 before discharging begins. |
R |
Resistance | Ohms (Ω) | Includes intentional resistors plus wiring and ESR. |
C |
Capacitance | Farads (F) | Must be converted from µF or nF to base Farads for math. |
t |
Time elapsed | Seconds (s) | The independent variable; often what you solve for in timing circuits. |
e |
Euler's number | Dimensionless | Mathematical constant ≈ 2.71828. |
τ (tau) |
RC Time Constant | Seconds (s) | The product of R × C. At 1τ, a capacitor reaches ~63.2% of Vs. |
When the Formula Applies (and Its Assumptions)
This model assumes a lumped-parameter circuit. It holds true for DC switching events, soft-start circuits, 555 timer thresholds, and basic analog filters. It fails or requires heavy modification when:
- High-Frequency AC is present: Parasitic inductance (ESL) and skin effect dominate, requiring complex impedance (Z) calculations rather than simple DC resistance.
- Very high di/dt switching occurs: The Equivalent Series Resistance (ESR) and Equivalent Series Inductance (ESL) of the physical capacitor (like a Panasonic FR series aluminum electrolytic) create voltage spikes that the ideal formula ignores.
- Dielectric Absorption is significant: In high-precision sample-and-hold circuits, the dielectric 'soaks up' charge and releases it slowly, causing the tail end of the discharge curve to deviate from the pure exponential prediction.
Rearranged Forms: Solving for Time, Resistance, and Capacitance
On the workbench, you rarely just solve for V(t). Usually, you have a target voltage threshold (like the 2/3 Vcc trigger of an NE555) and need to select R or C to hit a specific timing delay. Here are the algebraically rearranged forms for the charging equation:
• Time (t):
t = -RC × ln(1 - V(t)/Vs)• Resistance (R):
R = -t / [C × ln(1 - V(t)/Vs)]• Capacitance (C):
C = -t / [R × ln(1 - V(t)/Vs)]• Source Voltage (Vs):
Vs = V(t) / (1 - e-t/RC)
For the discharging equation, the rearranged form to solve for time is simpler because there is no 1 - term inside the logarithm:
t = -RC × ln(V(t) / V0)
Worked Example 1: Calculating Charge Time to a Specific Voltage
Scenario: You are designing a soft-start circuit for a custom audio amplifier. You have a 12V DC supply (Vs), a 470µF electrolytic capacitor (C), and a 2.2kΩ current-limiting resistor (R). The relay control circuit triggers when the capacitor reaches 9V. How long does this take?
Step-by-Step Derivation with Unit Tracking
- Identify and convert variables to base SI units:
Vs = 12 V
V(t) = 9 V
R = 2,200 Ω
C = 470 µF = 0.00047 F - Calculate the Time Constant (τ):
τ = R × C
τ = 2,200 Ω × 0.00047 F = 1.034 seconds - Apply the rearranged charging time formula:
t = -τ × ln(1 - V(t) / Vs)
t = -1.034 s × ln(1 - 9 V / 12 V) - Solve the inner fraction and logarithm:
1 - (9/12) = 1 - 0.75 = 0.25
ln(0.25) ≈ -1.38629 - Final Multiplication:
t = -1.034 s × -1.38629
t ≈ 1.433 seconds
Result: The relay will trigger approximately 1.43 seconds after power is applied. This aligns with standard RC charging curve characteristics, as 9V is 75% of 12V, which should occur between 1τ (63.2%) and 2τ (86.5%).
Worked Example 2: Discharge Time and Realistic Magnitude Checks
Scenario: You are servicing a camera flash circuit. The main flash capacitor is charged to 330V (V0). The capacitance is 100µF (C). A 100kΩ bleeder resistor (R) is placed in parallel to discharge it when powered off. How long until it reaches a 'safe-to-touch' threshold of 50V (V(t))?
Step-by-Step Discharge Calculation
- Base SI Units:
V0 = 330 V
V(t) = 50 V
R = 100,000 Ω
C = 100 µF = 0.0001 F - Calculate τ:
τ = 100,000 Ω × 0.0001 F = 10 seconds - Apply the rearranged discharging time formula:
t = -τ × ln(V(t) / V0)
t = -10 s × ln(50 V / 330 V) - Solve the logarithm:
50 / 330 ≈ 0.1515
ln(0.1515) ≈ -1.887 - Final Calculation:
t = -10 s × -1.887 = 18.87 seconds
Realistic Answer Magnitude Check
Does 18.87 seconds make sense? In RC circuits, 5τ (50 seconds) is the rule-of-thumb for 'fully discharged' (down to <1% of V0). Since 50V is roughly 15% of 330V, we expect the answer to be less than 5τ but more than 1τ (which would drop it to 36.8%, or ~121V). At 2τ (20 seconds), voltage drops to 13.5% (~44.5V). Our answer of 18.87 seconds sits perfectly between 1τ and 2τ. The math holds up to reality.
Common Unit Mistakes That Break the Math
The most frequent reason hobbyists and students get wildly incorrect answers is failing to convert prefixed units into base SI units before plugging them into the natural logarithm. If your answer is off by a factor of 1,000 or 1,000,000, check these traps:
- The Microfarad Trap: 1 µF is
1 × 10-6 F(0.000001 F), not10-3. Entering '470' instead of '0.00047' for a 470µF cap will result in a time constant that is a million times too large. - The Kilohm/Megohm Trap: A 100kΩ resistor must be entered as
100,000, not100. - Mixing Time Domains: The formula natively outputs
tin seconds. If you are working with an ESP32 microcontroller timer that expects milliseconds or microseconds, you must multiply the finaltresult by 1,000 or 1,000,000 after the calculation, not during the τ derivation. - Ignoring DMM Loading: If you are measuring the discharge of a very high-impedance circuit (e.g., R = 10MΩ), your digital multimeter's internal input impedance (typically 10MΩ) acts as a parallel resistor. The actual discharge R is now 5MΩ, cutting your calculated time in half. The formula isn't wrong; your assumed R value is.
FAQ: Charging and Discharging a Capacitor Formula
How does ESR affect the charging and discharging a capacitor formula?
Equivalent Series Resistance (ESR) acts as an additional, unavoidable resistor in series with your intentional resistor R. For large timing circuits (e.g., R = 10kΩ), a typical aluminum electrolytic ESR of 0.5Ω is mathematically irrelevant (10,000.5 vs 10,000). However, in high-current, low-resistance applications like a spot welder pulse circuit where intentional R might be 0.01Ω, an ESR of 0.02Ω triples the actual resistance. In these cases, you must use Rtotal = Rintentional + RESR in the formula, and account for the initial voltage step caused by current hitting the ESR instantly at t=0.
Why does the charging and discharging a capacitor formula use the natural logarithm (ln)?
The natural logarithm (base e) appears because the rate of voltage change across the capacitor is directly proportional to the voltage difference remaining. As the capacitor charges, the voltage difference between the source and the capacitor shrinks, which reduces the current, which in turn slows the charging rate. This continuous feedback loop—where the derivative of a function is proportional to the function itself—is the exact mathematical definition of the exponential function ex. The inverse operation to solve for time in an exponential equation is the natural log.
Can I use the charging and discharging a capacitor formula for AC circuits?
No. The standard time-domain formulas provided here apply strictly to DC step responses (switching a DC source on or off). In AC circuits, the voltage source is continuously changing direction and magnitude (usually sinusoidally). To analyze capacitors in AC, you must abandon the time-domain exponential formula and use frequency-domain complex impedance: Zc = 1 / (jωC), where ω is the angular frequency. You then use AC voltage divider rules and phasor math to find magnitudes and phase shifts.
What is a realistic answer magnitude for the RC time constant in hobby electronics?
The magnitude of τ depends entirely on the application domain:
• Microcontroller GPIO / ADC Filtering: R is typically 1kΩ to 10kΩ, C is 10nF to 100nF. τ is in the microsecond range (e.g., 100µs).
• 555 Timers and LED Faders: R is 10kΩ to 1MΩ, C is 1µF to 100µF. τ is in the millisecond to low second range.
• Power Supply Soft-Starts / Audio Coupling: R is 10Ω to 1kΩ, C is 1,000µF to 10,000µF. τ is in the 1 to 10 second range.
If your calculation for an Arduino debouncing filter yields a τ of 45 seconds, you have almost certainly forgotten to convert microfarads to farads.






