Simulation problem because of minor change

Thread Starter

Hadar

Joined Mar 18, 2022
6
Hi everyone, and thanks for the help.
Im trying to check on LTSpice the function of two components in the same configuration: lm741, lm339.
I thought that there would be a diffrence but I encountered a simulation problem regarding the lm339.
first of all the circuit with the 741:
1647623750145.png
The code of 741 is attached as the 339 code.
and I saw as i expected:
1647623970896.png
The green graph is for the AC source just for checking.
now I changed the component to the 339:
1647624049438.png
But now the simulation seem to be stuck/ working very slow (guessing because somthing is wrong):
1647624140412.png
1647624487702.png
after a long time I'll eventually get the "normal" graph as in the 741 but then the Vout will be different and not the way I calculated it to be:
1647624254061.png
why does this happen? I checked the parameters that a 339 can get as inputs and it seem to be fine? what is the difference from the 741 that causes the problem?
Big Thanks, Hadar.
 

Attachments

dl324

Joined Mar 30, 2015
16,909
Welcome to AAC!
what is the difference from the 741 that causes the problem?
LM393 LM339 is open collector and needs a pull up resistor to Vcc.
EDIT2: corrected device number. Use the dual part number instead of quad.

Your schematics would be easier to read if you used the common multipliers (e.g. 10M instead of 10000000). When using such large resistor values, you need to consider the input bias currents of the opamp/comparator inputs.

EDIT: Schematics are also easier to read if you follow the normal conventions: ground always points down, wires are drawn with angles that are multiples of 90 degrees (with some exceptions), and unnecessary wire bends are avoided.
 
Last edited:

Thread Starter

Hadar

Joined Mar 18, 2022
6
Welcome to AAC!

LM393 LM339 is open collector and needs a pull up resistor to Vcc.
EDIT2: corrected device number. Use the dual part number instead of quad.

Your schematics would be easier to read if you used the common multipliers (e.g. 10M instead of 10000000). When using such large resistor values, you need to consider the input bias currents of the opamp/comparator inputs.

EDIT: Schematics are also easier to read if you follow the normal conventions: ground always points down, wires are drawn with angles that are multiples of 90 degrees (with some exceptions), and unnecessary wire bends are avoided.
Hi and thanks, Im not familiar with the pull up resistor idea, where should I put it and with what value? why does the 741 doesn't require it?
about the multipliers , I know but for some reason LTspice showed me error notes when I used "k" and "meg".

hi Hadar,

Is this the same project work as MoranZ.?
This link.
https://forum.allaboutcircuits.com/threads/high-voltage-differential-amplifier.185661/post-1717712


Moderation.
yep.
 

ericgibbs

Joined Jan 29, 2010
18,841
hi Hadar,
That is OK, providing you are not the same person, using two usernames.??

This also appears to homework, please advise.

BTW: the 741 & LM339 lib files are OK, downloading the actual asc file you are using would help you get replies.


Mod.
 

Thread Starter

Hadar

Joined Mar 18, 2022
6
hi Hadar,
That is OK, providing you are not the same person, using two usernames.??

This also appears to homework, please advise.

BTW: the 741 & LM339 lib files are OK, downloading the actual asc file you are using would help you get replies.


Mod.
We are two different persons and it is no homework, rather a project we wanted to do.
Great idea I'll upload it later!
Thanks

741 requires bipolar supplies. It is NOT characterized for single supply operation -- even if the simulation allows it.
What about the 339, is it also requires bipolar supplies?
 

Papabravo

Joined Feb 24, 2006
21,225
We are two different persons and it is no homework, rather a project we wanted to do.
Great idea I'll upload it later!
Thanks


What about the 339, is it also requires bipolar supplies?
No the LM339 is a quad comparator (same as the LM393 dual comparator) and it works just fine from a single supply, but as has been noted the output is a digital open collector configuration. The 741 is an operational amplifier, much older than the LM339(LM393) and is for all practical purposes useless and obsolete.
 

dl324

Joined Mar 30, 2015
16,909
Im not familiar with the pull up resistor idea, where should I put it and with what value? why does the 741 doesn't require it?
Most, if not all, comparators from that era had uncommitted collector outputs. This LM339 schematic is from an onsemi datasheet:
1647632434699.png
The pull-up resistor value depends on what you intend to drive with the output. You should also note that the output can't sink as much current as an LM741.

LM741 schematic from a National Semiconductor datasheet:
1647632540340.png
about the multipliers , I know but for some reason LTspice showed me error notes when I used "k" and "meg".
I don't use LTspice much, but 'k' and 'M' have always worked for me.

As noted, LM741 was not designed to work with a single supply or bipolar supplies of much less than +/-15V. With a 5V supply, the guaranteed common mode input range is typically 2-3V and it isn't guaranteed to function with such a low power supply voltage:
1647632702757.png
1647632737758.png

LM741 was a very good opamp when it was first introduced. However you need to pay attention to it's limitations. It is far from being obsolete; I'm currently troubleshooting a vintage power supply that uses LM741 and the quad version. It is still quite useful to teach students to appreciate more modern devices.

On the other hand, LM339 was designed to work from a 5V supply. As were LM358/LM324 opamps.
 

eetech00

Joined Jun 8, 2013
3,934
Hi everyone, and thanks for the help.
Im trying to check on LTSpice the function of two components in the same configuration: lm741, lm339.
......
why does this happen? I checked the parameters that a 339 can get as inputs and it seem to be fine? what is the difference from the 741 that causes the problem?
Big Thanks, Hadar.
It doesn't work because you are comparing two different types of devices and circuits.

The 741 is an (old) bi-polar supply opamp configured as a differential amplifier.
The LM339 is a single supply comparator configured as a comparator with hysteresis (whether you realize or not).

So..you are comparing the wrong devices and circuits...
 

Papabravo

Joined Feb 24, 2006
21,225
It doesn't work because you are comparing two different types of devices and circuits.

The 741 is an (old) bi-polar supply opamp configured as a differential amplifier.
The LM339 is a single supply comparator configured as a comparator with hysteresis (whether you realize or not).

So..you are comparing the wrong devices and circuits...
How many times and in how may ways do we have to say it?
 
Top