Electronic – how to resolve LM358’s huge error as a current sense differential amplifier

current measurementdiff-ampoperational-amplifier

I've built a current sense differential amplifier that measures the voltage across a 1 Ohm resistor, to give me a reading for the current through it.

I've connected it as follows, all resistors are matched 10k to give a gain of 1:

schematic

(Image source: Electronics Tutorials)

I am powering it from a single rail 12 volt source. The problem is even though this is a rail to rail opamp (Output Low swing from 5-20mV) I'm getting a constant error of 0.62V and it seems the opamp is not able to go below this value.

I have tried to resolve this by connected Vout to ground using a 10k resistor, but that makes no difference whatsoever.

I tried it with dual supply configuration (+8V, -8V) and that seems to resolve the issue. However I want to run this off a single supply rail, so this is not a viable option.

How can I resolve this? I'm trying to measure the voltage drop across a 1 ohm resistor to give me a reading for current through the circuit (0-1V represents 0-1 A) so I can set up a current limit. A better way (or practice) to doing this is also welcomed. The initial (but not ideal) fix I can think of, is to offset the readings by a few volts?

Edit:

Changed R1-R4 from 10k to 100k and I'm down to about 30-50mV!

Best Answer

LM358 is not a rail-to-rail opamp (neither input nor output).

The input CM range includes the negative rail and the output can swing close to the negative rail under the correct conditions, however this configuration passes current If to the output, and if that current exceeds (typically) about 50uA then the output can no longer swing all that close to the negative rail. This is all in the datasheet.

Your choices are to use a better op-amp (but it still will have to sink current so it can never get all the way to the negative rail) or create a negative supply. Up to you.