I want to trigger an interrupt on an ATMEGA328P, when the current of a load is below a certain value.
Therefore I designed the following differential amp circuit using an LM358
Below picture shows the LTSpice circuit.
With the following parameters for the LM358.
The LTSpice simulation shows the following voltage at the output voltage vs. load current:
After the simulation, I build this circuit. The potentiometer is used to adjust the gain slightly
But after building it up, I cannot get it working. From 0 to 100mA Rload the output of the OPAMP remains at 3.8V (5V VCC - VRailOffset). Even with RLoad disconnected the output voltage remains at 3.8V. The voltage measured at the 10Ohm current sense resistor is correct.
The adjustment potentiometer has no effect at all to the output state. I tried different resistor values already (1k/22k and 100k/2Meg).
What am I missing here?