LM358 common mode voltage in spice

Thread Starter

rpschultz

Joined Nov 23, 2022
808
I have this simulation of an LM358 with a HPF and LPF on both sides. I'd like to look at the common mode voltage rejection of the LM358. It should be Vcc-1.7. How would I see this?
 

Attachments

crutschow

Joined Mar 14, 2008
38,316
I'd like to look at the common mode voltage rejection of the LM358. It should be Vcc-1.7. How would I see this?
Do you want to look at the voltage rejection (its ability to ignore changes in common-mode voltage) or the actual voltage?

The common-move voltage is just V1 or V3 (which should be essentially equal if the op amp is in its linear region), so just run a .op (DC Op Pnt) simulation.
 

Thread Starter

rpschultz

Joined Nov 23, 2022
808
I'd like to send it a sine wave that max peak exceeds 3.3v and look at it's response. I'm wanting to use this to limit the signal into an esp32. Powering the LM358 off 5v, knowing that it shouldn't output anything more than 3v3 which is the limit of the input to an exp32. I don't think that's the .op, it just shows the dc voltages.
 

crutschow

Joined Mar 14, 2008
38,316
I'd like to send it a sine wave that max peak exceeds 3.3v and look at it's response. I'm wanting to use this to limit the signal into an esp32. Powering the LM358 off 5v, knowing that it shouldn't output anything more than 3v3 which is the limit of the input to an exp32. I don't think that's the .op, it just shows the dc voltages.
Okay, now you are asking for something completely different from what I understand in your first post.
This question has nothing to do with common-mode rejection.

So just change V3 to a sinewave of the desired frequency and amplitude, and then do a transient response for a time to show a few cycles of the sinewave.
 

Thread Starter

rpschultz

Joined Nov 23, 2022
808
Ah ok. Here's an input of 100hz, 0.1v amplitude. Gain of 1. Looks like that is amplitude of +/- 0.1v.
1742313331433.png

Gain of 32: Seems to be clipping at 4v, which tells me the library file thinks it's common move voltage is -1v?
1742313396157.png

Now if I increase the signal to 1v, it gets really square. Excellent.
1742313481294.png

Datasheet says voltage range is V-1.5v.
1742313574431.png

Maybe I need an updated library file?
 

Attachments

Alec_t

Joined Sep 17, 2013
15,101
The datasheet or model may assume a particular output current. Try with a greater load, e.g. short out C1 temporarily and see what the op-amp output node voltage is.
 

0ri0n

Joined Jan 7, 2025
160
Gain of 32: Seems to be clipping at 4v, which tells me the library file thinks it's common move voltage is -1v?
The "thinking" is solely your job ;-).

What is the voltage that is common to the (+) and (-) inputs of your op amp? In your case that voltage is primarily determined by the DC voltage you bias the (+) input with, which depends upon Vcc and the ratio R1/R2. This voltage, incl. the AC voltage applied at the input of the amplifier, floating on top of the DC bias voltage, should never leave the CM voltage range (0...3.5V @ Vcc=5V) stated in the datasheet.

The output clipping levels depend upon the specs of the output stage. If you are looking for a more symmetrical clipping, raise the level of the input bias voltage (R1/R2 ratio) somewhat until you are satisfied with the outcome.
 
Top