Electrical – Op-Amp inputs are sinking too much current in comparator mode

comparatoroperational-amplifier

So I basically designed a circuit to limit the current flowing through a 250 ohm resistor by shutting down the current path using a mosfet when current goes above 30 ma:

enter image description here

R1 is the 250 ohm resistor that needs to be protected from over-current.

R4 and R6 create a voltage of 7.5 voltage for the comparator

R5 and R3 limit the voltage falling on mosfet gate to 10 volts.

if more than 30 ma pass through R1, the generated voltage will go above 7.5 volt and the op-Amp output will become zero shutting down the mosfet.

I have a slight problem. When v1 (is equal to zero volts) the currents of negative and positive op-amp inputs are +/-2.5 ma.

If I increase v1 to 4 volts, aforementioned currents reduce to 1 ma.

At v1 = 10 volts, they reduce to 250ua.

These values are too high. According to the datasheet of the op-amp, the input bias and offset currents shouldn't have exceeded 1.5na.

What am I doing wrong? What is the problem here?

In fact the output of the op-amp never becomes zero and R4 and R6 never create the 7.5 volt reference for the comparator. The voltage is always lower even going down to about 3 volts when v1 =0.

P.S. Simulations are performed using LTSpice.

Best Answer

Modern op-amps aren't meant to be used as comparators. If you want a comparator, use a comparator, not an op-amp.

Observe the simplified schematic in the datasheet: enter image description here

The diodes I circled protect the device from extreme excursions in the differential input voltage. You might be able to get it to work by adding 10 or 100 kohms in series with the op-amp inputs, but it would be better to just buy a part designed to work as a comparator.

Also notice that this is not a rail-to-rail input op-amp. All bets are off if you use it with 0 V on the input and on V-.