Yup, an opamp as a difference amplifier with 4 resistors. The 5% accuracy requirement means that precision differential amplifiers with built-in matched resistors aren't needed.
Specs used to choose an opamp are usually, but not limited to:
- Bandwidth - highest frequency of the signal in question, roughly gain x bandwidth (frequencies approaching the limit of the amplifier can't be amplified much etc..).
- Input common mode range - how close to the power rails the input can sense.
- Output range - how close the output can get to the power rails. "rail-to-rail" rarely means actually very close to the rails unless the current requirements are very low.
- Power supply range: Modern CMOS opamps usually have a 5.5-6V limit, JFET and bipolar opamps can go up to 32V ish, sometimes higher.
Given the loose requirements I can see why you're a bit overwhelmed, a lot of opamps will fit the bill. But you can narrow it down with the low bandwidth (say <2MHz GBWP required) and the input voltage range being 0-20V - which will marrow it down a far bit.
Really old opamps like the 741 are meh, the LM358 is a common dual opamp that can sense down to the negative rail (0V if you're powering it with 0 - 30V). Very cheap, and its output can
approach the negative rail, but only within about 100mV.
A dual opamp is handy because if one of your signals can only supply ~1mA then you can buffer that signal with the other opamp to prevent the signal being loaded by the difference amplifier inputs.
If you want to buffer both inputs, then a quad opamp like the LM324 is very cheap, similar specs, and available pretty much everywhere.
First link on google:
https://www.electronics-tutorials.ws/opamp/opamp_5.htmlNote it doesn't show the power connections to the opamp, but if your signals are 0-20V, then a single supply of >24V would be fine (higher than the 20V, since many opamps can only sense inputs about 2V lower than its supply voltage, same goes with outputs). If you really want a nice 0V out when both inputs are the same voltage, then you may need a negative supply for the opamp - just to get the output to be true 0V, rather than getting near. That means instead of using GND/0V, you could have -1 or -2V, but its a hassle if you just have a single supply.