I'm trying to design a cost effective method to measure the current my board draws from its supply (in this case a 5V USB connector).
So the design I came up with uses a single 1m ohm shunt and an op amp based differential amplifier circuit to increase the drop across the shunt resistor to a level I can use. I was hoping to start with a simple differential amplifier design with few parts so I can keep the cost and area low.
When I setup the circuit in LTspice, the simulated gain/output voltage I get is very different from the value I get using the transfer function I derived for the circuit.
I tried re-simulating with different op amps in LTspice but none of them give a result is even close to the theoretical value.
My questions:
1. Is there something I'm doing wrong here or does it just come down to the op amp models in LTspice?
2. If the op amp models are contributing to the difference, is there a way to get the theoretical value in simulation? (just curious)
3. As far as I know the single-supply aspect of the design should not effect the output unless the output voltage goes higher than the supply or am I missing something?
My circuit:
