edit: I also found out that with a LM741, that problem does not occur.

edit: First of all, this is not a "should I use LM324 as a comparator or not" question. Besides that, I just wonder the reason for this behaviour. I will paste one of my comments also here, since I think it describes the part I don't understand better.

However, I don't understand why it is related to opAmp's capability of resposing fast. The output goes 0 as soon as V+ goes below V-. So it looks like it does not have a problem with catching up. Rather, it, not understandably(to me, at least), goes high again while no change occurs in the state of V- to V+.

enter image description here

Why does not output stay at 0 but rises again high? I am talking about the yellow rectangle portion. The signal at the non-inverting input is higher than Vref on the inverting input for that duration. I would expect it to stay at GND as long as V- > V+.

I am using LM324 model from Texas Instruments Website.

Update : For all who might be having difficulties in such applications, I figured out this will be a better solution, after the answer of Marcus Müller.

enter image description here

  • \$\begingroup\$ OK, first of all, after been told multiple times, you still use an opamp as a comparator, and that's not what they're designed for, and that means that they can (and will) misbehave, so even if we didn't have an explanation for this, this would simply be answered with "you abuse a component, you get strange behaviour". \$\endgroup\$ Dec 14, 2019 at 13:23
  • \$\begingroup\$ @MarcusMüller I am looking for the reason why this happens. Even if I won't use it as a comparator, I wonder the origin of this problem. \$\endgroup\$
    – muyustan
    Dec 14, 2019 at 13:29
  • 2
    \$\begingroup\$ Read here electronics.stackexchange.com/questions/432775/… and here electronics.stackexchange.com/questions/234575/… \$\endgroup\$
    – G36
    Dec 14, 2019 at 14:58

3 Answers 3


You're getting phase reversal because you are taking the input below the negative supply rail. Add a negative voltage rail (-9V) to the op amp and it'll be OK.

  • \$\begingroup\$ Yes!, this was the problem. If I never apply an input level which is not within the range (-vcc,+vcc) or (gnd,9v) in this case, then the problem vanishes. Now, the only remaining question is why this is not the situation with LM741, it operates fine with input voltage below GND. Thanks anyway. \$\endgroup\$
    – muyustan
    Dec 14, 2019 at 14:49
  • \$\begingroup\$ The 741 data sheet recommended limits for input voltage range is +&- 13V with a +&- 15 voltage supply. So the input range is limited and the datasheet specified limit should be kept to.Maybe someone could comment on how to extrapolate the data sheet figures for a 9V supply? \$\endgroup\$
    – user173271
    Dec 14, 2019 at 15:02
  • \$\begingroup\$ more importantly, with a +9V and gnd type supplying. It does accept input levels below gnd, without creating a problem. \$\endgroup\$
    – muyustan
    Dec 14, 2019 at 15:04
  • \$\begingroup\$ “Without creating a problem” is a strong (and unwarranted) assertion. You have not yet detected the problem that is created by exceeding the absolute maximum datasheet limits. \$\endgroup\$ Dec 14, 2019 at 18:00

Your SPICE simulation certainly appears to include the phase reversal characteristic of the LM324 opamp. In hopes of finding the semiconductor mechanism that is the root-cause of phase reversal, looked at TI's subcircuit definition of this chip. Alas, no luck - they faked it with this snippet from their complex subcircuit model for LMx24:


It seems unfair to criticize TI for this fakery...we should thank them for including this deadly characteristic.

The mechanism for phase-reversal likely lies hidden in substrate semiconductor junctions, which are in the devil's realm. It is possible that no SPICE models can easily accommodate the devil's work. I have yet to see a comprehensive explanation.

  • \$\begingroup\$ I cannot understand that code, I have nearly no knowledge in spice syntax. Also could not figure out what MID refers. Maybe you may explain it here when you are available. Thanks anyway. \$\endgroup\$
    – muyustan
    Dec 14, 2019 at 18:13

As you've been told before, too, opamps have limited bandwidth and slew rate¹.

Any bandwidth limitation mathematically implies delay.

That's what you're seeing here: The opamp doesn't react faster than that; it's bandwidth-limited.

Also, as you've noticed in the answers to other questions you've asked, there's opamp imperfections like offset voltages and latch-up behaviour, which do exactly that, shift the offsets and delay changing an extreme output state. And as you've learned in this answer² about using an opamp as comparator, these offsets will mess with your applications in an open-loop configuration³.

So, this question is really just a demonstration of "told you so, now go and use a comparator if you want a comparator". Please read all the comments and answers you get dilligently – there's a lot of answers in there already!

all quotations from answers and comments you've already gotten.

¹: Op-amps used as comparators can have very long recovery times from saturation as well as slow output slew rate

²: They should have low input offsets so you get precise switching.

²: They don't latch up. Op-amps can take some time to come out of saturation so this introduces a time delay.

³: We generally don't use op-amps open-loop. We apply feedback to control the gain and linearise the output

  • \$\begingroup\$ thanks, then using an opAmp as comparator will lead such problems. Please see my edit(update) in the question. Now it is a better implementation( I hope so) . \$\endgroup\$
    – muyustan
    Dec 14, 2019 at 13:42
  • \$\begingroup\$ However, I don't understand why it is related to opAmps capability of resposing fast. The output goes 0 as soon as V+ goes below V-. So it looks like it does not have a problem with catching up. Rather, it not understandably(to me, at least) goes high again while no change occurs in the state of V- to V+. By the way, I do read all comments and appreciate them, please see following comment which lead me again to be looking into using LM324 instead of LM393. electronics.stackexchange.com/questions/471648/… \$\endgroup\$
    – muyustan
    Dec 14, 2019 at 13:46
  • \$\begingroup\$ read my answer. \$\endgroup\$ Dec 14, 2019 at 13:47
  • \$\begingroup\$ I mean, the takeaway from my answer is "diligently read answers you get". And then you ask what it is about latching behaviour... which means you haven't really read my answer and understood it. Please ask questions whenever you don't understand anything in an answer! It's annoying to have to repeat what one said. \$\endgroup\$ Dec 14, 2019 at 13:48
  • \$\begingroup\$ No, I have read your answer and asked in the above comment the part which I don't understand still totaly by explaining it. Maybe I cannot get it, but I don't do not reading your or others answers or comments. \$\endgroup\$
    – muyustan
    Dec 14, 2019 at 13:50

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.