# LTSpice Sallen-Key Filter

I'm new to simulations on LTSpice with op amps (and LTSpice in general).

I've been trying to simulate a Sallen-Key low pass filter and the simulation is nowhere near my calculations plotted with $$\Mathematica\$$.

This is what I did:

And this is what it yields:

But http://sim.okawa-denshi.jp/en/OPstool.php simulator and also Mathematica yields this:

Which looks alright.

• Perhaps you have the wrong transfer function for Mathematica? Not sure how we can troubleshoot this issue. I apologize for saying this but I don't think anyone here is going to be able to help you out because Mathematica costs money.
– user103380
Jun 24, 2019 at 22:03
• @KingDuken The point is not the graph on Mathematica, that is the correct one, I also checked it with the free simulator sim.okawa-denshi.jp/en/OPstool.php. Jun 24, 2019 at 22:07
• do you mean 0.1 farad or 0.1 micro farad? Jun 24, 2019 at 22:15
• I used 0.1 F . . Jun 24, 2019 at 22:18
• I see 2 problems: 1) V2 and V3 both appear to be positive voltages with respect to ground., 2) The output impedance of a 741, even closed loop, is more than the impedance of a 0.1F capacitor at frequencies above 1 Hz, maybe even lower (the impedance of a 0.1F capacitor is only 0.016 ohms at 100 Hz. Why are you using such weird values as 0.001 ohms and 10 F capacitors. Rescale your components to more practical values and redo the simulation. Jun 24, 2019 at 22:33

First off. If you want the calculations to match up, then you need to use an ideal amplifier. The ideal amplifier in LT spice is found in the opamps folder, you need to add the spice line

.lib opamp.sub


for lt spice to find the library for the part.

Then set the ideal opamp's open loop gain to something insanely high like

Aol=10000000K

and the gain bandwidth product to something insanely fast like:

GBW=10000Meg

The reason you need to use an ideal opamp is because filter tools assume that there are no losses and ideal opamps (unless they have a section to change the op amp). The GBWP and open loop gain create a pole, which hampers the opamp's ability to function at high frequencies

Secondly, your not using the same numbers in each of the tools:

and here are my numbers...

it looks like the graphs match up to me. But only up until about 100kHz where the amplifier starts to make a difference again.

It would be extremely hard to build a filter with the values you have chosen for components. Traces and wires have miliohms of resistance, so choose values that are not in that range, otherwise you wouldn't be able to bulid this circuit. Caps in the farad range are also undesirable because they are bulky and expensive.

• Thanks you! I thought the LM741 was good enough Jun 24, 2019 at 22:47
• It probably is, but it depends on how much stop band you need. What are you feeding Vout into? Jun 24, 2019 at 22:48
• Into nothing, I'm just learning about op amps and simulations Jun 24, 2019 at 22:49

Your resistor and capacitor values insanely wrong for a real circuit. You need to change them by a factor of 1,000,000 or more (up for the resistors, down for the caps -- you want to maintain the same R*C product). Try 1k$$\\Omega\$$ resistors and 0.1 and 10 $$\\mu\$$F caps. For a real circuit, you'd probably go up another order of magnitude on the resistors and down on the caps.

Edit: Every case is different, but for most normal use cases choosing a center R value of 5000$$\\Omega\$$ is a good starting point. You can go lower if it's a power op-amp, you have to go higher if it's a "low power" op-amp.

When and why gets complicated (there's issues of bandwidth and noise when you get too high, issues of the amplifier being able to drive its own feedback network if you get too low). If you don't know -- 2k to 10k!