Capacitor
CircuitSim
·
Created Oct 3, 2026
·
Updated Oct 3, 2026
About this circuit
Watch a capacitor charge and discharge through a resistor. Compare voltage and current over time, measure the RC time constant, and try two value changes.
Circuit notes
Capacitor
A capacitor stores charge, and its voltage changes as current flows. Here, V1 switches from to and back. R1 limits current while C1 charges and discharges. Watch the curved capacitor voltage and the current that fades toward zero.
The charging speed is set by the time constant:
Read the circuit and chart
- Vc — green: voltage across C1, measured from its upper terminal to ground.
- Vs — red: source voltage, showing when charging and discharging begin.
- Ic — blue: current toward C1. Positive current charges it; negative current means it is discharging back through R1 and the source.
The ground symbol defines the reference. The two chart groups use separate voltage and current scales, with a shared time axis. The probes do not materially change the circuit.
Follow one pulse
The circuit starts discharged because V1 is initially at . At about , Vs rises to . Vc rises gradually: a finite current cannot change capacitor voltage instantaneously. The relationship is .
For an ideal voltage step, with measured from the rising edge:
After one time constant, Vc reaches about 63.2% of its final value. After five, it reaches about 99.3%. The source uses short edges, so the following values are approximate:
| Chart time | What to look for |
|---|---|
| Just after | Ic is nearly ; Vc is still near zero. |
| One time constant later: Vc is about and Ic about . | |
| Just before | Vc is about and current is almost zero. |
| Just after | Vs returns to zero; Ic reverses to nearly . Vc remains continuous. |
| One discharge time constant later: Vc is about and Ic about . |
During discharge, , where is time since the falling edge. Setting the source to zero keeps a complete discharge path through R1; it does not disconnect the capacitor.
Charge is . Near , C1 stores about of charge and of energy. These are calculated values, not additional chart traces.
Use CircuitSim
This example runs Transient analysis automatically from 0 to 110 ms. The target and maximum time steps are 50 µs, small compared with the time constant. Normal operating-point initialization is enabled; Use initial conditions is off.
Hover over the chart to compare the traces. Open Table for numeric samples; its saved column order is time, Vc, Vs, Ic. Select a component and edit its value in Properties, then use Run simulation. Leave advanced parameters at their defaults.
Try it
- Double capacitance. Change C1's Capacitance from 10u to 20u. The time constant becomes . Vc reaches about at chart time ; the initial charging current remains nearly .
- Double resistance. Restore C1 to 10u, then change R1's Resistance from 1k to 2k. The time constant is again , but the initial current falls to about . The voltage curve resembles the first experiment while the current is half as large.
Restore C1 = 10u and R1 = 1k, then rerun. V1 uses VI = 0, VP = 5, TD = 5m, TR = TF = 10u, PW = 50m, and Per = 120m. The displayed interval includes one charge–discharge cycle.
Model assumptions
C1 is an ideal, nonpolarized capacitor with no leakage or series resistance. R1 is constant, and the ideal source can supply and absorb current. Real capacitors have tolerance, leakage, parasitic resistance, and voltage limits; polarized types also require the correct polarity. This example isolates charge storage and the RC time constant.
Components used
Components used
3 components
Try this circuit yourself
Free to get started. No download — runs in your browser with a full SPICE engine.