I am doing calculations for an RC circuit to create a first order low pass filter. The input is a 5V peak periodic square wave with a 10kHz frequency. The resistor is 220 Ohms and the Capacitor is 100nF.

When I calculate it I get an output of 4.95V however on the simulation I only get 3.96V. What am I doing wrong?

Calculation for 5V peak 10kHz RC circuit

LTSpice simulation

  • \$\begingroup\$ Use step inputs when finding time constants, not square waves \$\endgroup\$ – Voltage Spike Aug 1 '19 at 17:55

The period of your square wave is 100 us, but its duty cycle is 50%, so the input is at +5 V for only 50 us, not 100, before switching again.

This means it's only at +5 V for about 2.3 time constants rather than 4.6, and it's not able to come as close to fully charging the capacitor as it would have if kept at that voltage longer.

As another answer points out, you've also assumed a 5 V voltage step, while your simulation applies a 10 V step.

There's also a small effect because the simulator assumes the voltage source was at -5 V for a "very long time" before the simulation started, so there is a transient effect at the beginning of the simulation. You can see the 2nd peak in your output reaches a slightly higher voltage than the first one. You should let the simulation run for several (10?) cycles before measuring the peak voltage if you want a result close to the steady state behavior.

| improve this answer | |
  • \$\begingroup\$ So the simulation is wrong because of the assumption of the 5V voltage step, right? Can you please show me how to change this to 10V step? \$\endgroup\$ – Jared Aug 1 '19 at 18:03
  • \$\begingroup\$ The simulation has a 10 V step. Your hand calculation assumed a 5 V step. Do you want to change the simulation to match the hand calculation or vice versa? \$\endgroup\$ – The Photon Aug 1 '19 at 18:15
  • \$\begingroup\$ I want to change the hand calculation please. \$\endgroup\$ – Jared Aug 1 '19 at 18:19
  • \$\begingroup\$ To match what you simulated, the formula (for the first half cycle) should be \$v(t) = -5 + 10[1-\exp(-t/\tau)]\$, and \$t\$ should be 50 us, not 100 us. \$\endgroup\$ – The Photon Aug 1 '19 at 18:20
  • \$\begingroup\$ If you don't mind, could you please also show me the other way around(To match my calculated results). Thank you so much for all the help \$\endgroup\$ – Jared Aug 1 '19 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.