1
\$\begingroup\$

I have an extremely simple comparator circuit:

enter image description here

The voltage at pin 7 goes into positive saturation when a positive input voltage is presented at pin 5.

I'm simulating this using SPICE in KiCad. Here's the output:

enter image description here

As expected when +5V is presented at pin 5, pin 7 goes high. But why, oh why, is the current through R3 (shown with the red I(R3) line) listed as negative, and similarly positive when the input is -5V?

I feel like I might have misunderstood some fundamental concept of opamps.

\$\endgroup\$
1
  • 4
    \$\begingroup\$ Turn R3 around. Now is it positive? \$\endgroup\$
    – The Photon
    May 17, 2020 at 23:14

1 Answer 1

3
\$\begingroup\$

Pin 1 and pin 2 are unshown on resistors in most simulators but, nevertheless the simulator will use one pin or the other as the reference for current direction. Which one does your simulator use as the positive pin? Try rotating the resistor so that pins are reversed and note the new current polarity.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ This is correct -- one pin is chosen as the reference for current direction -- and it's a very common "bookkeeping error" and confusion point for beginners solving circuits by hand as well as by simulation. See also the chapter Labeling Voltages, Currents, and Nodes which talks about the two terminals of the resistor as R1.nA and R1.nB, defining current as positive flowing into the specified terminal. But it isn't possible to tell which terminal is which by inspecting the schematic graphically. \$\endgroup\$
    – compumike
    May 17, 2020 at 23:33
  • \$\begingroup\$ Thank you! It's so blindingly obvious now it's been pointed out! \$\endgroup\$
    – donturner
    May 18, 2020 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.