Skip to content

RC Circuit: Charging and Discharging a Capacitor

A resistor and a capacitor driven by a square wave show how a capacitor charges and discharges. One number sets the shape of the curve: the time constant τ = R × C.

Schematic of the RC Circuit: Charging and Discharging a Capacitor circuit

Simulation result

The simulator computed these waveforms from the circuit above, over the first 50 ms.

CH1 2 V/divFunction generator outputCH2 2 V/divCapacitor C1 voltage5 ms/div

Numbers from the simulation

Computed by the simulator from the part values in the schematic.

Time constant τ = R × C
1 ms

The circuit is copied into a new project in your workspace. If you are not signed in, you sign in with Google first.

Open in the simulator

How it works

When the square wave steps up to 5 V, the capacitor charges through R1. The current starts large and shrinks, so the capacitor voltage rises quickly at first, then slows down.

After one τ the capacitor reaches 63.2 % of 5 V. After about 5τ it counts as fully charged.

When the wave drops to 0 V, the capacitor discharges through R1 along the same curve, upside down.

Try changing

  1. Raise R1 to 4.7 kΩ. τ becomes 4.7 ms and the CH2 curve gets slower.
  2. Raise the generator to 500 Hz. Half a period is now shorter than 5τ, so the capacitor never fills and CH2 turns almost triangular.

More examples