Compare 2 voltages to get difference

hi
here a more "classic" electronics question:
I have 2 varying power sources 0-6V ( mostly over 5V) DC.
I would like to make a pure electronics circuit ( without arduino) to output the difference voltage of the 2 sources.
so for example if source A is 6V and source B is 5V I only get 1v out: the difference. source A is always a little higher than source B. but they can also be the same voltage sometimes.
voltages vary constantly.

the other solution would of course be to measure both with arduino and calculate..
thanks

If its just difference you want, a simple op-amp wired as difference amplifier will do the job. Just use 1% or better tolerance resistors for accuracy. If you want even more accuracy you can use an op-amp based instrumentation amplfier.

Difference amplifier article

Instrumentation amplifier article

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.