0
\$\begingroup\$

I have recently downloaded and am familiarising myself with LTspice, and to do so I started with a basic circuit. I had never used a scope prior to this and thought a capacitor discharging to an LED would be a good start.

The problem is that the pulse from the power supply syncs with the capacitor and LED. I expected the scope to show the current dropping gradually after the power stops. I have tried cap values from 50 μF to 1 F.

Traces on the scope are Green = Power Supply (V), Red = Capacitor, Blue = LED. The window in bottom right of picture shows the pulse settings.

What am I doing wrong?

Screenshot of circuit/scope in LTspice


Added resistor as suggested, unsure what parasitic resistance/capacitance the power supply would have:

Added suggested resistor

After adding suggested diode:

Added suggested diode

\$\endgroup\$
5
  • 5
    \$\begingroup\$ You need an ideal diode in series with your voltage source. Otherwise, the current from the capacitor drains rapidly back through it. \$\endgroup\$
    – Dave Tweed
    Feb 7 at 1:36
  • 1
    \$\begingroup\$ Since you’re a beginner, I should point out that your LED is not really an LED. It’s using the default model D which represents a silicon PN junction diode. I suggest right-clicking it and selecting an actual LED part number. \$\endgroup\$
    – Ste Kulov
    Feb 7 at 13:03
  • \$\begingroup\$ Thanks I had tried that, I couldn't find any that we 2V 20mA, nor would it let me change the values. I will play with some of the others there. \$\endgroup\$
    – Smi Jay
    Feb 7 at 14:24
  • \$\begingroup\$ Try the QTLP690C. It’s the closest thing to a generic red or green indicator LED. \$\endgroup\$
    – Ste Kulov
    Feb 8 at 6:34
  • \$\begingroup\$ Thank you, I will try that. :) \$\endgroup\$
    – Smi Jay
    Feb 12 at 7:16

2 Answers 2

3
\$\begingroup\$

The voltage source and the capacitor are in parallel. Therefore, whatever voltage is across one, is also across the other. The the "pulse" directive is gives an "ideal" response. Whatever is given in the directive is enforced. So, when the voltage falls in the directive command, the voltage will fall across the capacitor.

As mentioned in a comment, the behavior you hope for can be (in theory) achieved by adding a diode in series with the voltage source. However, be aware that since your LED and resistor permit significant currents to flow, the capacitor will discharge quite quickly, (relative to your multi-second time frame) unless C is very large.

\$\endgroup\$
2
\$\begingroup\$

In Spice, voltage sources have zero impedance by default. Whatever voltage they are set to is what you will measure across them regardless of what other components they are connected to. So in your circuit when the pulse is on it’s 5 V and when it’s off it’s 0 V, and the capacitor will be charged and discharged pretty much instantly. If you plot the current through the capacitor you’ll probably see a very high current when the pulse switches.

Current sources are the opposite, they act as if they have a very high if not infinite impedance.

Adding some series resistance to the supply or adding a diode as Dave Tweed mentioned in the comments should give you a result more like you were expecting.

\$\endgroup\$
2
  • \$\begingroup\$ I did as you both suggested and got more of what I was expecting, thank you. There is an option in Power Supply for parasitic properties for resistance and capacitance. Is there a ball park value that would give me good results? I tried low values to allow for wire resistance within the circuit but it didn't show anything on the scope. \$\endgroup\$
    – Smi Jay
    Feb 7 at 4:33
  • \$\begingroup\$ @SmiJay You can use the parasitic resistance or just put a resistor in series. The value would depend on the capacitance and pulse timing. You’ve got it in a simulator, try some different values and see what happens. \$\endgroup\$
    – GodJihyo
    Feb 7 at 5:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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