differential amplifier with offset - Page 1
Forum section: electronics / beginners

author: Simon
author_rank: Unknown
timestamp: October 09, 2015, 09:33:27 am
content: if i takehttps://en.wikipedia.org/wiki/Differential_amplifier#/media/File:Op-Amp_Differential_Amplifier.svgAnd connect the RG to a voltage other than ground would this have the effect of adding that voltage offset to the output ?Basically i want to measure the difference between two voltages but the difference could be negative or positive so i want to bias it to stay in the positive working range.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 09, 2015, 09:40:19 am
content: Yes.By "ground", they really mean: "this is the voltage against which the output is measured".Put another way, since the output isn't also specified as differential, we take the differenceto groundby convention.Of course, if you put any random voltage source in place of ground, its Thevenin equivalent resistance must be subtracted from Rg. The circuit is "differential" only as long as the labeled reference nodes are true voltage sources.Tim

author: Simon
author_rank: Unknown
timestamp: October 09, 2015, 09:49:17 am
content: Quote from: T3sl4co1l on October 09, 2015, 09:40:19 amHang on, you mean i need to alter Rg to effectively keep the same current in Rg as there would have been had I connected it to ground to keep the balance of the input resistors ?

author: Andy Watson
author_rank: Super Contributor
timestamp: October 09, 2015, 09:54:23 am
content: Rg references both inputs and output to ground - if you change it, you change the reference for the whole circuit - I'm not sure that that is what you want.

author: Simon
author_rank: Unknown
timestamp: October 09, 2015, 10:18:00 am
content: Quote from: Andy Watson on October 09, 2015, 09:54:23 amActually it is. I want to measure the difference between two voltages and add an offset so that my +/-0.25V range is shifted up to 0-0.5V range (uC's really hate negative voltages....)

author: mikerj
author_rank: Super Contributor
timestamp: October 09, 2015, 10:24:41 am
content: Quote from: Simon on October 09, 2015, 09:49:17 amIf the voltage source you are using to provide the offset has a non-negligible impedance (e.g. if you used a voltage divider) then yes. If you add additional impedance to any part of the circuit you seriously degrade the performance of the amp e.g. common mode rejection.

author: Simon
author_rank: Unknown
timestamp: October 09, 2015, 10:26:57 am
content: Quote from: mikerj on October 09, 2015, 10:24:41 amI'd use a voltage reference of some sort or a resistor divider of significantly lower impedance.

author: Performa01
author_rank: Super Contributor
timestamp: October 09, 2015, 10:59:54 am
content: "significantly lower" isn't good enough.If you alter any of the resistors by just 1%, CMRR will already be limited to 40dB maximum. And that in turn defeats the purpose of a differential amplifier...This also means, you have to use resistors with better than 0.1% tolerance in the first place, so to get at least somewhere near 60dB of CMRR. 0.01% would be better of course - that's also why we usually don't build differential amps with discrete resistors but use appropriate ICs for this instead.

author: Simon
author_rank: Unknown
timestamp: October 09, 2015, 11:33:33 am
content: then i will just use a summing amplifier to add my required offset. the absolute value coming out is not a problem, but the relationship between the two inputs must remain constant.

author: max_torque
author_rank: Super Contributor
timestamp: October 09, 2015, 12:03:19 pm
content: I'm not sure you need a differential amplifier?Just take each voltage,multiply it by the gain, then offset it back to the mid point of your ADC. As you whole system has a common ground potential, you don't need to worry about CMRR and don't need an (expensive)instrumentation amplifer approach. In fact, as oyu aren't going anywhere near the rails, and are worried about DC, then any jelly bean amp should do.Also, knowing the application, you can get a higher resolution for the low voltage inputs by use reducing the ADC reference voltage!With a 1V ref, you'd have a resolution of better than 1mV.For all these things, get a copy of SPICE downloaded and try some circuits out!

author: Simon
author_rank: Unknown
timestamp: October 09, 2015, 12:26:16 pm
content: Well as I'm only interested in the difference between the reference and a DUT and that it stay's constant-ish, I was thinking of taking that difference before feeding it into a uC, that way I immediately reduce the scale I'm trying to measure and get better ADC resolution as I can reduce the reference voltage as you say. As we know it's all relative. The initial offset between the test peice and the sample(s) can be up to +/-0.2375V so lets say a total range of 0.5V after adding 0.25V to it to make it all the right side of ground to include deviations on top that we are looking for so using the 1 or 1.1V reference that means i could still amplify it by 2x and get maximum resolution.I suppose the other method is to oversample as we discussed, I'm torn both ways between all digital and doing analogue preprosessing (nothing like being given a blank sheet to get your teeth into and do some learning and testing) All I need to achieve is a slightly better (ok 1 order of magnitude) accuracy than in the application and I'm off the hookof course bearing in mind that as I'm comparing 2 measurements I assume that inaccuracy due to the ADC doubles from 0.5LSB to 1LSB if I do all digital. but again just another factor of oversampling and that can be overcome.

author: Simon
author_rank: Unknown
timestamp: October 09, 2015, 04:29:52 pm
content: Quote from: Performa01 on October 09, 2015, 10:59:54 amThen the voltage refrence (that can source and sink) is the best if I did that.

author: Performa01
author_rank: Super Contributor
timestamp: October 09, 2015, 07:38:46 pm
content: Quote from: Simon on October 09, 2015, 04:29:52 pmYes, indeed.Generally, it is a good idea to use a differential amplifier for small signal acquisition. Even when the signal is referenced to the same ground as the ADC, there will always be significant noise and offset errors as there is no such thing like an ideal ground. Not to mention mains hum, which is just about omnipresent. This is why common mode rejection is so important. Since you need 0.01% resistor tolerance in order to get anywhere near 80dB of CMRR, it is also a good idea to use an integrated differential amplifier with guaranteed CMRR specs, like the INA series from BB/TI.

author: Simon
author_rank: Unknown
timestamp: October 09, 2015, 07:45:26 pm
content: I'm not using a differential amplifier (in the form of an opamp) for noise imunity but to take the difference between a reference sensor and the sample under test. Because I'm more interested that both have a constant offset as they are presurized together I'm only actually interested in measuring the difference between the two not the absolute values.The other method is oversampling the ADC so that I get a higher resolution anyway and don't need to "expand" the range with lots of analogue front end. Considering i will have 4 reference sensors (2 of each type) and three test samples (2 of 1 sort and 1 of another) that is a lot of analogue front end I'll end up with whereas with oversampling the ADC in a uC I just need to take 7 ADC readings and do the math. The signals will not change during measurement because I control the prssure so no hurry to take a measurement.

author: Zero999
author_rank: Super Contributor
timestamp: October 09, 2015, 07:56:15 pm
content: All is explained in the PDF linked below:http://www.ti.com/lit/an/sloa097/sloa097.pdf

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 10, 2015, 03:18:40 am
content: you need to add Rref+Vref into the differential equation, (Rref is internal resistance of the Vref source, you can find the equation for the OP opamp setup somewhere in the net) and start from there... possibly Rg is a multiturn trimpot to balance the equation...

author: Simon
author_rank: Unknown
timestamp: October 10, 2015, 04:56:35 pm
content: Well given the sheer amount of circuitry rewuired I think I'll just over sample my ADC in this case now that I know that the application is only working to a resolution of 10 bit I can over sample by a couple of bits and know that I'll be accurate enough.

author: c4757p
author_rank: Super Contributor
timestamp: October 10, 2015, 05:47:09 pm
content: inamp, yohttp://www.analog.com/en/products/amplifiers/instrumentation-amplifiers.htmlQuote from: max_torque on October 09, 2015, 12:03:19 pmThatisa differential amplifier, with the differencing bit done in software. It suffers from the same problems.

author: Zero999
author_rank: Super Contributor
timestamp: October 10, 2015, 06:26:16 pm
content: I agree, that's probably the best solution.Quote from: Mechatrommer on October 10, 2015, 03:18:40 amI don't see any need for that. It's all simple arithmetic. Run through the formulas on the PDF. For educational purposes (he's decided to do something else) take Simon's figures.VOUTfs = 0.5VVOUTzs = 0VVINfs = 0.25VINzs = -0.25VVREF= 5V Use the 5V regulated rail, which has a very low impedance.m = (VOUTfs - VOUTzs)/(VINfs - VINzs) = (0.5 - 0)/(0.25 - -0.25) = 1b = VOUTzs - m×VINzs = 0 - 1×-0.25 = 0.25Both m & b are positive so see section 3.R1 = 10kR2 = (VREF×R1×m)/b = (5×10k×1)/0.25 = 200kRf = 10kRg = (R2×Rf)/(m×(R1+R2) - R2) = (200k×10k)/(1×(10k+200k)-200k) = 2000k/(210k-200k) = 200kPersonally, as this would be interfacing with an MCU, I'd increase the output scale to 5V and add a potential divider to the 5V reference, as the input impedance can be higher whilst still using convenient resistor values.Notice that R2 is now 820k, rather than the expected 1M because the output impedance of the potential divider is 180k: 820k + 180k = 1M

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 11, 2015, 03:32:52 am
content: Quote from: Hero999 on October 10, 2015, 06:26:16 pmsorry maybe i missed the latest figure or decision in this thread... i only see a figure in the original post and then he talked about oversampling...anyway HMMV..