If you are designing a timing circuit, sizing a soft-start resistor, or debugging a power supply inrush issue, you need more than a conceptual understanding of how capacitors store energy. You need the exact math. The equation of charging and discharging of a capacitor dictates the exponential voltage and current curves that define RC (resistor-capacitor) network behavior.
Whether you are calculating how long a 555 timer takes to trigger or sizing a bleeder resistor for a 400V camera flash circuit, the foundational math remains identical. Below, we break down the core formulas, define every variable, map out the common unit traps that ruin calculations, and walk through strict, unit-tracked bench examples.
The Core Equation of Charging and Discharging of a Capacitor
The behavior of a capacitor in a simple series RC circuit is governed by first-order differential equations. When a DC voltage is applied, the capacitor charges exponentially; when the source is removed and the circuit is closed, it discharges exponentially. According to Electronics Tutorials, the instantaneous voltage and current are modeled as follows:
Charging Phase Equations
When an uncharged capacitor is connected to a DC source through a resistor:
- Voltage:
Vc(t) = Vs(1 - e-t/RC) - Current:
Ic(t) = (Vs / R) * e-t/RC
Discharging Phase Equations
When a charged capacitor is disconnected from the source and allowed to discharge through a resistor:
- Voltage:
Vc(t) = V0 * e-t/RC - Current:
Ic(t) = -(V0 / R) * e-t/RC
Symbol Definitions and Rearranged Forms
Before plugging numbers into a calculator, you must map the physical components on your bench to the mathematical symbols. The time constant, denoted as Tau (τ), is the product of R and C and represents the time required for the voltage to reach ~63.2% of its final value.
| Symbol | Parameter Name | Standard SI Unit | Typical Bench Range |
|---|---|---|---|
Vc(t) | Instantaneous capacitor voltage at time t | Volts (V) | 0V to 400V |
Vs | Source supply voltage (charging) | Volts (V) | 3.3V to 48V |
V0 | Initial capacitor voltage (discharging) | Volts (V) | 5V to 400V |
t | Elapsed time | Seconds (s) | 1μs to 10s |
R | Series resistance | Ohms (Ω) | 10Ω to 1MΩ |
C | Capacitance | Farads (F) | 100pF to 10,000μF |
e | Euler's number (mathematical constant) | Dimensionless | ~2.71828 |
τ | Time constant (R × C) | Seconds (s) | 1μs to 5s |
Rearranged Forms for Circuit Design
On the bench, you rarely solve for Vc. Usually, you know your target voltage and need to select a resistor or calculate a delay time. Here are the algebraic rearrangements for the charging equation:
- Solve for time (t):
t = -RC * ln(1 - (Vc / Vs)) - Solve for resistance (R):
R = -t / (C * ln(1 - (Vc / Vs))) - Solve for capacitance (C):
C = -t / (R * ln(1 - (Vc / Vs))) - Solve for source voltage (Vs):
Vs = Vc / (1 - e-t/RC)
When the Formula Applies (and When It Breaks)
The equation of charging and discharging of a capacitor is an idealized model. It provides highly accurate results for standard DC bench circuits, but it relies on strict assumptions. If your physical circuit violates these assumptions, the math will lie to you.
Core Assumptions
- Constant DC Source: The supply voltage
Vsmust not sag under the initial inrush load. If you are charging a massive capacitor bank from a weak 12V wall wart that droops to 8V, the formula fails. - Lumped, Constant R and C: The resistance and capacitance must remain static. It does not account for the Equivalent Series Resistance (ESR) of the capacitor or the temperature coefficient of the resistor heating up under high initial current.
- No Parasitic Inductance: At high frequencies or with physically large components, parasitic inductance (ESL) turns the RC circuit into an RLC circuit, introducing ringing that this first-order equation cannot predict.
The Unit Mistakes That Break the Math
The most common reason an RC calculation yields a physically impossible answer is a failure to convert prefixes to base SI units. The time constant τ = R * C only outputs seconds if R is in Ohms and C is in Farads.
Realistic Answer Magnitudes
Context is your best sanity check. In hobbyist and commercial low-voltage DC electronics, time constants usually range from 10 microseconds to 5 seconds. If your calculation for a 555 timer delay yields 4,500 seconds, you dropped a micro prefix. If your calculated charging current for a 5V logic circuit is 400 Amps, your resistance value is missing a 'kilo' prefix.
Worked Problems with Strict Unit Tracking
Let us apply the equations to two common bench scenarios, explicitly tracking unit conversions at every step to prevent multiplier errors. For deeper theoretical derivations, HyperPhysics RC Circuits provides excellent calculus-based proofs.
Problem 1: Timing a Microcontroller Wake-Up (Charging)
Scenario: You are designing a soft-start delay. A 12V DC source charges a 220 μF capacitor through a 4.7 kΩ resistor. A comparator triggers a relay when the capacitor reaches 9V. How long does the relay take to engage?
- Convert to base SI units:
Vs = 12 V
Vc = 9 V
R = 4.7 kΩ = 4,700 Ω
C = 220 μF = 0.00022 F - Calculate the time constant (τ):
τ = R * C = 4,700 * 0.00022 = 1.034 seconds - Select the rearranged charging formula for time:
t = -RC * ln(1 - (Vc / Vs)) - Substitute and solve:
t = -1.034 * ln(1 - (9 / 12))
t = -1.034 * ln(1 - 0.75)
t = -1.034 * ln(0.25)
t = -1.034 * -1.38629
t = 1.433 seconds
Result: The relay will engage after 1.433 seconds.
Problem 2: High-Voltage Bleeder Resistor Sizing (Discharging)
Scenario: A camera flash circuit uses a 1,000 μF capacitor charged to 400V. A 220 kΩ bleeder resistor is placed in parallel to discharge it when powered off. What is the voltage remaining across the capacitor 3 minutes after power-off?
- Convert to base SI units:
V0 = 400 V
R = 220 kΩ = 220,000 Ω
C = 1,000 μF = 0.001 F
t = 3 minutes = 180 seconds - Calculate the time constant (τ):
τ = 220,000 * 0.001 = 220 seconds - Substitute into the discharging voltage formula:
Vc(t) = V0 * e-t/RC
Vc(180) = 400 * e-180 / 220
Vc(180) = 400 * e-0.8181
Vc(180) = 400 * 0.44127
Vc(180) = 176.5 V
Result: After 3 minutes, the capacitor still holds 176.5V. This highlights a critical safety reality: 3 minutes is less than one time constant (220s). The capacitor remains highly lethal, proving the bleeder resistor value is too high for safe rapid discharge.
Real-World Scenario: Audio Amplifier Pre-Charge Failure
Equations on paper are clean; physical components are not. Here is a real-world bench failure where a misunderstanding of the charging curve led to destroyed hardware.
The Setup
An engineer was building a 50V DC linear power supply for a high-power Class AB audio amplifier. The filter bank consisted of two massive 10,000 μF electrolytic capacitors (total C = 0.02 F). To prevent the mains breaker from tripping due to inrush current, they designed a pre-charge circuit: a 100 Ω 50W power resistor in series with the supply, bypassed by a 12V automotive relay. The control logic was set to close the relay (shorting out the resistor) 50 milliseconds after power-on.
The Numbers
Let us run the charging equation to see what the capacitor voltage actually was at the moment the relay engaged.
Vs = 50 VR = 100 ΩC = 0.02 Fτ = 100 * 0.02 = 2.0 secondst = 50 ms = 0.05 seconds
Vc(0.05) = 50 * (1 - e-0.05 / 2.0)
Vc(0.05) = 50 * (1 - e-0.025)
Vc(0.05) = 50 * (1 - 0.9753)
Vc(0.05) = 50 * 0.0247 = 1.235 V
The Outcome
At 50ms, the capacitor bank had only charged to 1.235V. When the relay closed, it suddenly connected the 50V source directly to a capacitor sitting at 1.2V. The resulting potential difference of ~48.7V caused a massive, instantaneous inrush current that vastly exceeded the relay's contact rating. The contacts arc-welded shut, the 100 Ω resistor remained permanently bypassed, and the next power cycle tripped the 20A mains breaker instantly.
What Went Wrong and The Fix
The engineer assumed 50ms was 'plenty of time' for a soft-start, confusing high-frequency switching times with macroscopic RC time constants. A capacitor reaches ~95% of its source voltage at 3τ. In this circuit, 3τ = 6.0 seconds.
The Fix: The engineer reprogrammed the microcontroller timer to close the relay at 6.5 seconds, ensuring the capacitors were fully charged and inrush current was negligible before the resistor was bypassed. For a more elegant, solid-state solution, they could have replaced the timed relay and power resistor entirely with an NTC (Negative Temperature Coefficient) thermistor, which naturally increases in resistance when cold and drops as it heats up from the initial current flow.






