# Single supply positive-only signal amplification using INA126 (two op-amp in-amp)

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.

Internally there are two op-amps in this type of in-amp:

If Vin(-) is grounded and Vref >= 0, and Vin(+) is > 0 then the output of the lower op-amp will have to be below ground. Without a supply that allows that (and it won't get all the way to the negative supply) the lower op-amp cannot balance.

The current going into the inverting input of the lower op-amp is Vin(+)/Rg so the output of the lower op-amp has to be able to get to -Vin(10KΩ/Rg). From the datasheet it looks like it needs about a volt more (more negative that is) than that.

Connecting Vref to some voltage greater than ground only makes things worse.

Most likely the answer in this case is to change out the in-amp and put in an op-amp.

since the input and the output are always positive, I would like to get rid of the negative power rail

You need to look at the internal node voltages as well, not only input and output. Internally, there are two op-amps and a bunch of resistors in that in-amp. You can simulate those to get a feel for what happens internally, with a given reference voltage. Remember that those op-amps are not rail-to-rail input/output. Their input and output range has to be deduced from the diamond plot.

I cannot guess the math to analytically calculate which is the minimum input common-mode voltage that is required for this specific application.

You don't need to analytically calculate it. Start with the vendor-provided common-mode range specifications. For in-amps they are usually in the form of a so-called diamond plot. That plot can be extended mentally, as long as you understand the architecture of the in-amp.

In the datasheet, reference figure 6-6:

The dashed line in this figure encloses the input-output range for a single 5V supply, with 2.5V VREF. It can be mentally expanded to +12V/0V supplies, with a 6V VREF.

Why an INA126 does work as expected with dual supply but seems not to work with a single supply.

The problems are (at least):

1. VREF must be coming from a low-impedance source, like the output of an op-amp, for pretty much every in-amp out there. INA126 is no different. VREF input is a low-impedance node compared to the signal input pin impedances. The resistive divider must be buffered by an op-amp.

2. It will work with a single supply, but the reference voltage needs to be in the same place, relative to supplies, where it was with dual supplies. Set VREF to the average of positive and negative supply. For a single 12V supply, VREF must be 6V for maximum output voltage swing IIRC.

3. The input common mode range does not extend to 0V, so the input voltages need to be higher than what you're trying to amplify - as you have well noted.

Generally speaking, there's no need for an instrumentation amplifier. A much cheaper op-amp will outperform it. The differential amplification and common mode rejection of an in-amp is a performance tradeoff. When a non-inamp will do the job, using an in-amp is a pessimization.

Gain needs to be 10 / 0.65 = 15.384

It should be lower that 15.4, because:

1. We're not using 0% tolerance ("ideal") resistors.

2. The amplifier has a non-zero offset.

3. The ADC input range may be a few mV short of the 0V and 10V limits in practice.

Given what's practical, design for about 0.3V headroom from the limits of the ADC input range, and the resultant gain will be about 14.3, not 15.4.

The following circuit achieves that:

simulate this circuit – Schematic created using CircuitLab

Cheap and easy.

The 135mV can be obtained by scaling down a reference voltage. Say we get 2.5V from a cheap voltage reference like TL431. We then need to divide it down so that the Thevenin source resistance will be 1kΩ. That way, we'll need a total of 3 resistors in the circuit. We need to solve the set of the following two equations,

\begin{aligned} \frac{V_{out}}{V_{ref}} &= \frac{R_a}{R_a+R_b} \\ \frac{1}{R_{Th}} &= \frac{1}{R_a}+\frac{1}{R_b} \end{aligned}

where Vout=0.135V, Vref=2.5V, RTh=1kΩ.

This system has the following solution:

\begin{aligned} R_a &= R_{Th} \frac{V_{ref}}{V_{ref}-V_{out}} \\ R_b &= R_{Th} \frac{V_{ref}}{V_{out}} \end{aligned},

numerically Ra=1057Ω Rb=18,519Ω.

Since those values are hard to come by, we can rescale to the nearest 1% E96 series resistance values:

simulate this circuit

Since TL431 is a shunt regulator, it needs a pull-up resistor to +12V supply. Rpu=3.3kΩ will drive about 3mA through the TL431. The current through Rb is on the order of 0.1mA and can be ignored relative to 3mA.

Cf is added to improve the stability of the op-amp when driving a slightly capacitive load.

When selecting op-amps, pay attention to input common mode including the region from 0V to 1V, and output voltage range between 0V to (V+)-2V at least, ideally output should be rail-to-rail.

OA1 could in principle be an LM358 with output pulled down by a 10kΩ resistor, or better a 0.2mA current sink. It won't do well beyond say 10-12 bits of ADC resolution of course, but for a proof of concept it will work OK. It is drifty and doesn't have great gain and is noisy, but for some applications it can be suitable. I'm not sure what your application is, so it's hard to say.

If you wanted to use LM358 or its brethren (LM2904, LM2902, LM324), in a particularly retro-cheap-chic design, the output current sink can be fashioned from the 2nd half of the op-amp and 2 out of 3 N-MOS devices in the CD4007 transistor array, as follows:

simulate this circuit

I don't expect that anyone would want to put something like this to actual use today, but 45 years ago, this circuit would not have been all that much out of place in a low-cost low-precision application :)

With theoretical calibration curve parameters, the measurement will be accurate to about ±3% within say 10-40°C. With 0.5% metal or thin-film resistors, it'll be around ±1%.

Higher accuracies will require trimmer potentiometers - one for zero, another for gain. I highly advise against that in serial production, unless it's a very small-volume product. Use high-quality brand name trimmer pots.

Otherwise, you'll do a system calibration on each unit so that the parameters of the linear relationship between the ADC reading and input voltage can be obtained. This will bring the accuracy across a reasonable temperature range to well within ±0.1%.

Plenty of textbook teaching assignments have pupils calculate ideal resistor values for op-amp circuits to do level translation and amplification to scale and shift a signal to fit exactly into a given output range.

These assignments miss an important point: nobody in practice should be doing it, except in special circumstances. A range of an ADC is not really meant to be utilized to 100% nominally. The nominal range must be smaller, so that the various nonlinearities, offsets, voltage tolerances and resistor tolerances don't preclude a usable measurement.

The datasheet says that the acceptable common mode input range does not extend to either supply rail (see $$\V_{CM}\$$ on page 7). In fact it's really bad; with the negative supply at 0V, the minimum acceptable potential at either input is +3.5V.

That means your second circuit, with the inverting input grounded, can't possibly work.

Your scheme is ok, make sure the rails are fixed with respect to ground. Also realize that you may have common mode issues running the inst amp with the negative tied to ground. If the signal VIN is mostly in the middle of the range most of the time, you should be ok, but if you want the full range then don't change to the other scheme.