RC Time Constant: Simulating Charge and Decay Curves

📅
✍️ By CircuPilot Team
← Back to Blog Hub

A resistor and a capacitor in series is the first circuit with a memory. Every other circuit in this article's neighbourhood responds instantly; this one takes time, and how much time is set by a single number.

That number is the time constant, and most of what people need from an RC circuit follows from it.

What the time constant is

τ = R × C

With R in ohms and C in farads, τ comes out in seconds. A 10 kΩ resistor and a 100 nF capacitor give τ = 10,000 × 0.0000001 = 1 millisecond.

What makes it useful is that the curve is always the same shape. Charging, the capacitor voltage is

v(t) = V × (1 − e^(−t/τ))

and discharging it is v(t) = V₀ × e^(−t/τ). Because t only ever appears divided by τ, the percentages are fixed no matter what R and C you picked:

ElapsedCharged toDischarged to
63.2%36.8%
86.5%13.5%
95.0%5.0%
98.2%1.8%
99.3%0.7%

This is the whole reason the time constant is worth memorising. You never need the exponential in practice — you need "63% after one, done after five".

Strictly, it is never done. The curve approaches the supply and never reaches it, so "fully charged" is a convention rather than an event. Five time constants is the convention almost everywhere, because 0.7% is below the noise of anything you are likely to measure.

Why your simulation shows a flat line

This is the part that sends people looking for a broken simulator, and the simulator is usually fine.

A transient analysis starts from the DC operating point. Before the first time point, SPICE solves the circuit at steady state — and at steady state, a capacitor fed from a DC source is already charged. There is no edge for it to respond to. So the plot is a horizontal line at the supply voltage, from t = 0 to the end, and it is correct.

The circuit has no step in it. You have to put one in.

Drive it with a square wave instead. A square wave is a step up followed by a step down, repeating — which is exactly a charge followed by a decay. Set the period to at least ten time constants so each half has time to settle, and both curves appear in one run.

For τ = 1 ms, a 100 Hz square wave gives a 10 ms period: 5 ms high and 5 ms low, five time constants each.

Real numbers

A 5 V square wave at 100 Hz into 10 kΩ and 100 nF, measured at the capacitor with ngspice:

From the rising edgeSimulatedPredicted
1τ = 1 ms3.1534 V3.1606 V
2τ = 2 ms4.3207 V4.3233 V
3τ = 3 ms4.7501 V4.7511 V
5τ = 5 ms4.9663 V4.9663 V
From the falling edgeSimulatedPredicted
1.8259 V1.8394 V
0.6717 V0.6767 V
0.2471 V0.2489 V
0.0335 V0.0337 V

Agreement to within a few millivolts, and the small gap is the time step, not the solver — coarsen the step and it grows, refine it and it shrinks.

Notice the symmetry in the first rows: 3.15 V charging and 1.83 V discharging, which are 63% and 37% of 5 V. Same curve, read from opposite ends.

Pick a time step well below the time constant. A tenth of τ is a reasonable floor and a hundredth is comfortable. The steepest part of the curve is right at the edge, so too coarse a step cuts the corner and the first point comes back visibly wrong — which looks like a solver problem and is arithmetic.

Where the number actually gets used

Debounce. A switch contact chatters for a few milliseconds. An RC on the input with τ of a few milliseconds smooths it below the logic threshold. This is where "five time constants" turns into a design choice.

Reset and power-on delay. An RC from the supply to a reset pin holds it low while the capacitor charges. You size it from how long the rest of the board needs.

Timing an oscillator. The 555 and the two-transistor flasher both set their period from an RC charge to a threshold. If you want to see that, the astable multivibrator is the same exponential doing the work.

Deciding whether a filter is fast enough. A filter that settles in 5τ cannot follow anything changing faster than that — which is the time-domain way of saying it has a cutoff frequency.

Time constant or cutoff frequency?

They describe the same R and C, and they are directly related:

f_c = 1 / (2πRC) = 1 / (2πτ)

A 1 ms time constant is a 159 Hz cutoff. Same components, two different questions:

  • The time constant answers how long does the output take to settle after a step — the time domain, and what a transient analysis shows you.
  • The cutoff frequency answers which frequencies get through — the frequency domain, and what an AC analysis shows you.

Neither is more fundamental. Use whichever matches the question you are asking. If you are designing for the frequency-domain answer, designing an RC low-pass filter works from the cutoff instead.

Try it

Open the simulator, place a resistor and a capacitor in series, drive the input with a square-wave source at 100 Hz, and run a transient analysis to 20 ms. Probe the capacitor node and the curve above is what you get.

Then change one value and watch the timing move with it. Doubling the resistor doubles the time constant; halving the capacitor halves it. The shape never changes — only the horizontal scale — which is the most useful thing about it.

If your transient comes back flat, the source is the first thing to check. And if it comes back as an error instead, why SPICE simulations fail covers the floating-node and missing-ground cases.

Frequently asked questions

How long does a capacitor take to charge?

One time constant, τ = R × C, gets it to 63.2% of the supply. It is treated as fully charged after five time constants, at 99.3%. Strictly it never finishes — the curve is exponential and only approaches the supply — so "fully charged" is a convention, and 5τ is the usual one.

Why is my RC simulation a flat line?

Because a transient analysis starts from the DC operating point, and with a DC source the capacitor is already charged at t = 0. There is no edge to respond to, so the voltage is constant from the first point. Drive the circuit with a square wave or a pulse source instead, and the curve appears.

What is the time constant of a 10 kΩ resistor and a 100 nF capacitor?

1 millisecond. τ = R × C = 10,000 Ω × 0.0000001 F = 0.001 s. The capacitor reaches 3.16 V of a 5 V supply after 1 ms and 4.97 V after 5 ms.

Does the time constant change between charging and discharging?

No. It is the same R × C either way. What changes is the direction: charging rises to 63.2% of the supply in one time constant, discharging falls to 36.8% of where it started. The two numbers add to 100% because they are the same curve read from opposite ends.

Is the time constant the same as the cutoff frequency?

They describe the same circuit and are directly related — f_c = 1 / (2πRC), so a 1 ms time constant is a 159 Hz cutoff. The time constant answers how fast the output settles after a step; the cutoff frequency answers which frequencies get through. Same R and C, two different questions.