Skip to main content

RC Charge/Discharge

CI

CircuitSim

·

Created Apr 19, 2026

·

Updated Jun 30, 2026

Preview will appear once the owner saves the schematic
Details

Components

—


Schematic

Yes


Simulation

Transient analysis


Copies

Not copied yet

About this circuit

The author hasn't added a description yet.

Circuit notes

RC Charge / Discharge

The Circuit


This circuit demonstrates a capacitor charging and discharging in response to a DC voltage pulse.

image.png

Simulation


  • A transient simulation is run for 20 mS with a 100 uS step size.
  • The voltage Vin is measured between the voltage source V1 and ground.
  • The voltage Vcap is measured between the positive side of the capacitor C1 and ground.
  • The current Ir is measured through the resistor R1.

Notes


Use the RC Time Constant to calculate the capacitor charge / discharge time.

The time to charge the capacitor to ~63.2% is:

τ=RC .{\displaystyle \tau =RC\,.}

Where R is the resistance of R1 and C is the capacitance of C1.

τ=1KΩ⋅1uF .=1mS{\displaystyle \tau =1KΩ \cdot 1uF\,.} = 1mS

In this circuit the first 5V pulse starts at time = 0mS. Therefore we expect the capacitor to charge to:

63.2%⋅5V=3.16V63.2\% \cdot 5V = 3.16V

by time = 1ms1ms

Use the table to check.

Components used

No component metadata available.

SPICE netlist

* **************************************************
* Generated from CircuitSim Schematic
**************************************************
C_C1 VP2 0 1u
R_R1 N2 N1 1K
X_U1 VP1 0 CLOCK DUTY=50 VHIGH=5 VLOW=0 PERIOD=1m
V_VP1 VP1 N1 0
V_IP1 VP2 N2 0

**************************************************
* Models and supporting definitions follow
**************************************************
* Clock generator with duty cycle in percent (0–100)
.subckt CLOCK OUT GND VHIGH=5 VLOW=0 PERIOD=1m DUTY=50
    .param DUTY_FRAC = { DUTY / 100 } * Convert percent to fraction
    .param TON  = { PERIOD * DUTY_FRAC }
    VCLK OUT 0 PULSE( VLOW VHIGH 0 1n 1n {TON} {PERIOD} )
.ends CLOCK

**************************************************
* Simulation settings
**************************************************
.tran 0.00009999999999999999 0.02 0
.save V(VP1) V(VP2) I(V_IP1)
.end

Try this circuit yourself

Free to get started. No download — runs in your browser with a full SPICE engine.