LTSpicie - op amp wrong output

Thread Starter

mondo90

Joined May 16, 2025
122
Hi,

I sketch this simple diagram in LTSpicie that utilizes op-amp (a generic one) powered by a single supply 0 - Vcc. Surprisingly the output swings negative:
1763282909664.png

How is that possible LTSpicie generates this irrational output?
 

eetech00

Joined Jun 8, 2013
4,704
Hi,

I sketch this simple diagram in LTSpicie that utilizes op-amp (a generic one) powered by a single supply 0 - Vcc. Surprisingly the output swings negative:
View attachment 358929

How is that possible LTSpicie generates this irrational output?
The different universal opamp model "levels" provide increasing levels of opamp simulation effects.
The universal opamp model "level 2" you chose to use does not simulate power supply effects.
Use universal opamp model level 3 or higher.
 

Thread Starter

mondo90

Joined May 16, 2025
122
Thanks, that sort of make sense but I wonder, what is a model that doesn't take power supply into consideration good for? Also, how can I know what each "level" really simulate?

In general I wanted to work with NE5332x op amp but couldn't find it in the library of lt spicie, what is the standard way to include/add it to my library of models? If it is not possible, how can I select an op amp closest to the desired?
 

crutschow

Joined Mar 14, 2008
38,317
what is a model that doesn't take power supply into consideration good for?
If you want an idealized op amp simulation and are not concerned about real op amp limitations.
how can I know what each "level" really simulate?
Look at the description for the model (below):

1763314587818.png
I wanted to work with NE5332x op amp
Put the .asy file below into the LTC sym/Opamp folder and the .sub file into the LTS lib\sub folder.
Then close and open LTspice and it should show up in the OpAmps component listing.
 

Attachments

Thread Starter

mondo90

Joined May 16, 2025
122
Thank you @crutschow.
Before I have added your model for NE5532, I gave a more realistic op amp model a try:
1763316088923.png
This one on the other hand, keeps the output near 0, what is the reason for that?

As for the addition of NE5532, @crutschow , I think you gave me the incorrect *.sub file for NE555, can you please copy the one for NE5532?

Thanks
 

Thread Starter

mondo90

Joined May 16, 2025
122
Thanks @crutschow , now I am able to simulate NE5532:
1763319246501.png
However the output sits right at 1.65 instead of a sine wave, why?
Similarly for the "universal op amp 5", the output is very low amplitude sine wave (micro volts):
1763319420094.png
 

crutschow

Joined Mar 14, 2008
38,317
Your supply voltage is too low.
You apparently didn't look at the data sheet.
The NE5532 needs a single supply minimum of 10V (below):
1763320501194.png
For 3.3V operation you need to select an op amp that is specified for that voltage.

And you need to bias the op amps at or near 1/2 the supply voltage when using a single supply (below):
Your circuit was biasing the outputs negatively (since it's an inverting amplifier).

1763321099326.png
 
Last edited:

Thread Starter

mondo90

Joined May 16, 2025
122
Thanks @crutschow, I was just switching different op amps in that place and forgot to update V1. Anyway, I think this op-amp won't work as a preamp for analog mic, because I can't offset it to go from 0 up to ~3V range. I have replaced it with JRC4558 for now, and it looks much better:
1763343573525.png
However I have a problem with AC analysis that shows the gain is <4db, while the trans analysis shows ~30db, is that because now I am using a generic op amp again (I just names in JRC4558)?
1763343693668.png
 
Last edited:

0ri0n

Joined Jan 7, 2025
160
However I have a problem with AC analysis that shows the gain is <4db, while the trans analysis shows ~30db, is that because now I am using a generic op amp again (I just names in JRC4558)?
You have to plot V(out) / V(mic). Plotting only V(out) will result in a "voltage gain" of only 1.5 (3.521dB) because your 1.5Vp AC output voltage is referenced to the default value of 1Vp.
 

crutschow

Joined Mar 14, 2008
38,317
I can't offset it to go from 0 up to ~3V range.
Don't understand what that means(?)
You add a series capacitor on the output to remove the DC offset.
However I have a problem with AC analysis that shows the gain is <4db,
AC analysis uses a linear model for all active devices, so the AC voltage value doesn't affect the amplifier response (no signal clipping for example).
Since the dB value is referenced to 1V in LTspice, just set the AC source voltage to 1V and the output will be in dB gain.
 
Last edited:

Thread Starter

mondo90

Joined May 16, 2025
122
Don't understand what that means(?)
You add a series capacitor on the output to remove the DC offset.
The thing is, I need to feed ADC with this output, and ADC range is 0 - 3V. So I think I have two options, either offset the non inverting terminal so that the output peaks in 0-3V range (and this is what I did on schematic above). Or bias ADC input at 1,5V and connect the series capacitor from op-amp (as you suggested). Do you agree @crutschow?


AC analysis uses a linear model for all active devices, so the AC voltage value doesn't affect the amplifier response (no signal clipping for example).
Hmm I am not sure I got your point here, are you saying that the AC analysis doesn't take power supply limits into an account so if I overshoot with gain it will still show it correctly in db gain? Certainly in transit response I see output clipping.
Anyway the problem I had here was caused because I apparently forgot how to plot a signal in reference to some other, I did V(out, mic) thinking that mic will be treated as a reference but as @0ri0n pointed out the correct way of doing it is V(out)/V(mic)
Thanks @0ri0n!
 

ericgibbs

Joined Jan 29, 2010
21,390
hi m90.
Is the ADC a part of an MCU.?
You could consider using a Schottky diode clamp up to the 3v3 Vcc supply, with a series diode.
This would limit the ADC input to a maximum of ~3.3v

E
 

crutschow

Joined Mar 14, 2008
38,317
offset the non inverting terminal so that the output peaks in 0-3V range
Yes, that is what I would do.
are you saying that the AC analysis doesn't take power supply limits into an account
Exactly.
It completed ignores the non-linear characteristics of a real circuit, such as supply limits that are shown the the Transient Analysis, which uses the non-linear models for the active devices.
Even if the theoretical output were 10,000 volts, it would still plot the AC gain correctly.
 

Thread Starter

mondo90

Joined May 16, 2025
122
Is the ADC a part of an MCU.?
Yes, it is.
You could consider using a Schottky diode clamp up to the 3v3 Vcc supply, with a series diode.
This would limit the ADC input to a maximum of ~3.3v
Hmm, not sure if this is a good idea, the diode will load audio signal, I would rather make sure the preamp doesn't hit the ADC threshold.

Even if the theoretical output were 10,000 volts, it would still plot the AC gain correctly.
Thank you, it is a valuable information.
 
Top