op-amp as a differental amplifier
Javalin
Posts: 892
Hello,
Can somebody point me in the direction of a simple guide to using op-amps as a differential amplifer?
I have a ACS712 current sensor which gives 185mv per 1amp current, so a maximum of 925mv. It zero's at 2.5v. I want to amplify the 925mv to 2.5 so I have -5 to +5amps reading as 0v and 5v.
Similar to https://www.sparkfun.com/products/8883 - but I can't figure it out using my circuit sim program, it doesn't work!
Thanks,
James
Can somebody point me in the direction of a simple guide to using op-amps as a differential amplifer?
I have a ACS712 current sensor which gives 185mv per 1amp current, so a maximum of 925mv. It zero's at 2.5v. I want to amplify the 925mv to 2.5 so I have -5 to +5amps reading as 0v and 5v.
Similar to https://www.sparkfun.com/products/8883 - but I can't figure it out using my circuit sim program, it doesn't work!
Thanks,
James
Comments
To expand a bit more on the posts above. It is a current output so you can convert current to volts with a resistor. Normally op amp circuits are build with a + and - supply (eg +/-12V) and everything is calculated with reference to 0V. But you can create a "virtual earth" and for a 5V supply it is very convenient to make the virtual earth 2.5V. The virtual earth can be two resistors as a voltage divider, two 1k resistors for example. Or you could use two 100k resistors and then an op amp voltage follower. This latter means the virtual earth is more stable, or in technical terms, has a lower impedance.
It so happens that what you want to do centres around 2.5V. So you don't need a differential amp - all you need is an inverting or non inverting amp. So that is just an op amp and two resistors.
If you look at the non inverting amp circuit you can see there is the "earth". Instead of connecting this to 0V, it goes to 2.5V. If that 2.5V is from another op amp that is fine. If it comes from a voltage divider then the resistors on the divider need to be a lot less than the resistors around the op amp. Maybe 100x less. But you don't want too much current wasted in the divider. So it all becomes a compromise and maybe you use 1k dividers and resistors in the range 100k to 500k around the op amp.
But there is another answer. Look at the inverting amplifier circuit. In that circuit the + of the op amp goes directly to the earth. So you don't need to worry so much about the impedance of the virtual earth circuit. So what you could do is use a single op amp, two 1k resistors to produce 2.5V which goes to the + of the op amp, then circuitsoft's two resistors for the gain. So that is just 4 resistors and one op amp.
The catch there is that the signal is inverted. So no current will be 2.5V output, and 1 amp will (I think) read 2V.
Another consideration is the rail to rail voltage. Garden variety op amps like the 741 or 324 can only go within 1.5V of the supply, which for a 5V supply means the output is only 1.5V to 3.5V. So you can use a rail to rail op amp like the CA3140 instead.
Is this going into an A to D? If so there might be even simpler circuits and you might not even need an op amp.
TI has a guide called "OP Amps for Everyone". Very well written guide to using op amps. Sec 3-6 for general diff amp, and section A 3-9 for single supply diff amp applications. Also good layout practices. IIRC, National Semi had a configuration guide of sorts showing lots of different possibilities.
FF
mV/A is not the same as ma so maybe that is a typo.
@circuitsoft, we probably need to draw up a schematic here, because the voltage divider resistor values for the virtual earth are not so important for a inverting amp but they are important in a non inverting amplifier as current is flowing from the op amp into the voltage divider and will change the value of the reference.
If this is going into an A to D it should be possible to leave out the op amp which should simplify things.
sorry i did mean 185mv, not ma!
Thanks for the replies chaps, I will read and digest.
James
Like this?
I haven't read op-amps for everybody yet, but I will do.
James
@Dr_Acula, Javalin has drawn up exactly the circuit I have in mind. There are no more resistors needed, unless you're trying to balance the circuit for input current, in which case you'll want to add a (10.2 | 10.2 | 8.66)=3.21Kohm resistor in series with the non-inverting input, but that may not be necessary depending on what op-amp is used and how much precision is needed.
Cool - that works on my circuit sim program (livewire)
Thanks for the help!
James
BTW if anyone wants to try a free online simulator, check out https://www.circuitlab.com/editor/
Question about resistor selection for a test circuit (as shown) to produce a 1amp, 2amp, 4amp current flow for testing/calibration purposes, etc. (obviously I will use a 12r, 6r and 3r - but 12r shown)
Confused about what wattage to select for the resistor? P=VI says 12watts?
or is there a better way to do this?
James
PS - also how you do account for battery voltages, i.e. a 12.6v battery (charged) and a 12r resistor produces 1.05amps. Really want 1amp/2amp/4amp for reference testing.
As for resistor power, you're correct that the circuit you drew will dissipate 12 watts from the resistor, but a resistor dissipating its rated power will get very hot. Generally, you want to double power ratings of resistors. That also gives you margin-of-error for other input voltages.