I'm trying to build a current sensing circuit which translates the current directly into voltage so it can then be read by a micro.
It is an op amp buffer and an op amp comparator in series; I actually used a circuit similar to Dave Jone's uSupply current sense part hoping I won't forget anything and it could just work.
The OpAmp I'm using is ST LM358 (
datasheet); the current shunt resistor is 1R, load resistor is 470R, all other resistors are 10K; the power is provided by a 8.9V battery. Schematic is attached (hopefully not too crusty...)
The voltage on the shunt is about 20 mV and the current is about 20 mA, as expected. But when I measured the voltage between ground and sense output, I got about 2.1V which is ~10^2 bigger than the expected 20mV. When I measured the voltage between ground and the output of the op amp buffer, I got about 7.9V, which is about 1V lower than expected.
The comparator seems to work correctly, however the buffer drops the voltage by about 1 volt and I can't figure out why.
What am I missing?