I'm trying to use an opamp (LM324N) to measure the voltage between its 2 inputs. The simple circuit is attached. What I find is that the voltage measured at Vout is always 'off' by a significant amount, say around 100mV. I've tried replacing the various resistors R1 thru R4 with a 25 turn 10 kΩ trimpots but I have not been able to find a setting that would raise Vout to the same voltage as the inputs. For example, an input voltage of 3.2 V will give a Vout of around 3.1 V. Is there a way I can add some bias or compensation to 'tune' the circuit to give the correct output? While the example shows input voltages of 0 V and 3.2 V, this is just for demonstration. In reality, while the input voltages will never differ by more than 4 V, they can be any combination of voltages from 0 to 16 V, e.g. 5 and 8.2 V or 10.5 and 13 V.
Thanks for any guidance on this.