I need to amplify a 0.15-0.8 V very low frequency signal to the 0-10 V range of an ADC. I'm having a hard time figuring out why an INA126 does work as expected with dual supply but seems not to work with a single supply.
In order to use the full range of the ADC, the Gain needs to be: (VOUT_MAX-VOUT_MIN) / (VIN_MAX-VIN_MIN) = (10-0) / (0.8-0.15) = 10 / 0.65 = 15.384. The offset to be substracted is 0.15 V before amplification or 0.15 * 15.384 = ~2.31 V after amplification.
According to the datasheet, the Gain of INA126 is defined as 5 + 80k / Rg. Hence, Rg needs to be 80k / (15.384 - 5) = 7.704k. Also according to the datasheet, the REF pin can be used to level shift the output. So, by providing -2.31 V to that pin, the offset of the output should be 0.
Using dual supply and a voltage divider to get -2.31 V from the -12 V rail does work as expected:
However, since the input and the output are always positive, I would like to get rid of the negative power rail and have V- connected to ground. First, I tried the following:
It produces a constant 11.65 V output. Upon a quick thought, it can be expected not to work because REF is ground and the input (0.15-0.8V) might be too close to the rail. However, I find it surprising that the output is 11.65 V rather than 0 V, both in simulation (using TINA-TI V9) and on the breadboard.
According to section 7.4.1 of the datasheet:
The INAx126 can be used on single power supplies from 2.7 V to 36 V. Use the output REF pin to level shift the internal output voltage into a linear operating condition. Ideally, connect the REF pin to a potential that is midsupply to avoid saturating the output of the amplifiers.
So, I tried setting REF to 5V (mid range of the output). On the breadboard, that seemed to output a constant 0.41 V output. In simulation, it seems to change when the input is 0.7-0.8 V:
Suprisingly, if I set REF through a 0 V power supply, in simulation it seems to amplify the input when it's above 0.4 V with a gain of 3.54 / 0.8 = 4.425; when it's below 0.4 V the output is constant 0.41 V:
I can't understand why this is different from connecting REF to ground (which produces a 11.65 V output). Setting Rg to 1 ohm in this setup produces a 4.69 V output when the input is 0.8 V, so it's a gain of 5.8625. Setting Rg to 80k produces a 2.56 V output when the input is 0.8 V, so it's a gain of 3.2. I don't see any equation in the datasheet which might explain those values.
For completeness, if I offset both VIN- and VIN+ by at least 5 V, while connecting REF to ground, the single supply setup works as expected and the output is in the range 2.31-12.31 V (saturated at the max because the supply is 12 V). Offsetting them by less than 5 V reduces the range. For instance, with 4 V the minimum output is saturated at 2.41 V, instead of 2.31 V; and with 3 V it's saturated at 3.28 V.
I feel this issue might be related to the Input Common-Mode Range (Sections 6.7 and 8.2.2.4 of the datasheet) but I cannot guess the math to analytically calculate which is the minimum input common-mode voltage that is required for this specific application. For now, I don't expect to substract the offset when using a single supply, which I could easily do with the dual supply setup.