Most Analog to Digital Converters have a unipolar input that can be a problem when designing bipolar circuits. Some common ADC input voltage ranges are 0 to 2.5 V, or 0 to 5 V. However, the analog circuit that drives the ADC can have voltage swings of, –1 V to +1 V, –2 V to +2 V , –5 V to +5 V, and so on. Bringing the ADC input below ground is a big No-No, because the current from input will flow through the chip substrate creating irreversible changes in the ADC and damage it. So, how do we connect a bipolar front end circuit with a unipolar ADC? Enters the bipolar to unipolar converter. Let’s design one.

The converter can be designed with a summing amplifier, as in Figure 1. How do we calculate the resistors?

**Figure 1**

For this, let’s take a numeric example. Let’s say we have a –5 V to +5 V input, and we need the converter to output a voltage range of 0 to +5 V for an ADC with the same input range. If the converter output has to swing in the same direction as the input, which means no phase change, the design requirements are as follows:

If Vin = –5 V, then Vout = 0 V,

If Vin = +5 V, then Vout = +5 V,

where with Vin I noted the converter input voltage and with Vout, the output voltage.

One can use the mathematical approach I described in this article, Solving the Summing Amplifier. However, in this case things are simple. We can easily determine the gain and offset of the bipolar to unipolar converter, from the design requirements. This method is more intuitive than the math approach, adding to the idea that Electronics design is an art form.

Any linear circuit has a gain and an offset. The general equation is as follows:

_{} |
(1) |

There are two unknowns here, Gain and Voffset. But, since the output swing is half the input range, the gain has to be 0.5. Let’s note that down: Gain = 0.5.

Now, to determine the circuit offset, we can replace in equation (1) one of the input/output conditions, say Vin = -5 V and Vout = 0 V and determine Voffset. Even so, let’s make this more fun and reason to find out what the offset should be. If we use a gain of 0.5, the output will swing from –2.5V to +2.5V. To make the output go from 0 V to +5 V, we need to add an offset of +2.5 V. Hence, Voffset = +2.5 V.

With the gain and offset known, let’s write equation (1) again:

_{} |
(2) |

It should be clear now, why I chose a summing amplifier. There is a plus sign between Vin and offset. Now, let’s look at the summing amplifier transfer function:

_{} |
(3) |

We can rewrite equation (2) as follows:

_{} |
(4) |

If V1 = Vin and V2 = 5 V, it is clear that we do not need 1 + R4/R3. This means that R4 is zero (just a short circuit) and R3 is infinity (disconnected). Also, if R1 = R2, the ratios R1/(R1+R2) and R2/(R1+R2) are equal and equal with 1/2.

We can choose any practical value for R1 and R2, say 10 kOhm. With this, the bipolar to unipolar converter design is done and it is shown in Figure 2.

**Figure 2**

Can you also show the math method to design the converter? I am interested in the converter with input -2V to +2V and output 0 to +5V. I also would like to know how can I design the converter so the output reaches just below +5V, maybe 4.9V.

Thank you for your time.

jorgecosta, start with the summing amplifier transfer function (equation 3 in this article). Write 2 equations, one for 0V output and one for 5V output as follows:

0V = (-2V*R2/(R1+R2) + 5V*R1/(R1+R2)) * (1+R4/R3)

5V = (+2V*R2/(R1+R2) + 5V*R1/(R1+R2)) * (1+R4/R3)

This system has 2 unknowns: R1/R2 and R4/R3. Solve, choose R3 = 10k and R2 = 10k and calculate R1 = 4.02k and R4 = 7.5k.

If you need the output voltage range to be 0 to 4.9V just replace 5 with 4.9 in the previous equations. The new equations are as follows:

0V = (-2V*R2/(R1+R2) + 5V*R1/(R1+R2)) * (1+R4/R3)

4.9V = (+2V*R2/(R1+R2) + 5V*R1/(R1+R2)) * (1+R4/R3)

The result is R3 = 10k, R2 = 10k, R1 = 4.02k and R4 = 7.15k.

Thank you very much!

Having trouble converting an input signal with the range of -5V to +5V to an output range of 0V to 3V. V2 has a value of 3.3V.

Indeed, if you calculate the resistors with V2 = 3.3V and the input range of -5V to +5V, one of the resistors is negative. A negative resistor means that the circuit needs an extra voltage source to be able to output 0 to +3V.

There are two solutions:

1. Reduce V2. A non-inverting summing amplifier cannot have a sub-unity gain, so it cannot attenuate signals by changing the gain resistors R3 and R4. From an input range of 10V, the output range has to be 3V. This is attenuation. One can always attenuate the input range by making R2 smaller than R1. As a consequence, V2 has to be reduced as well. Therefore, as an example, use two 10k resistors to get 1.65V from your 3.3V source. Use another op amp in a voltage follower configuration to feed 1.65V to R2. With 1.65V as V2, the resistors are: R1=10k, R2=3.32k, R3=10k, R4=2.1k.

2. Use a 3 input non-inverting summing amplifier. Two inputs are V1 and V2 and the third is connected to ground. The third input resistor will create an extra attenuator for both V1 and V2. The advantage is that you need just one op amp. The disadvantage is that the calculations are more complex, but not unbearable. There is more to this than I can write in this comment, so I will write an article about this method. Please subscribe to this website using the RSS feed. The article should be up soon.

===============

Update: I published this article. You can find it here:Design a Bipolar to Unipolar Converter with a 3-input Summing Amplifier

I calculate resistors values as described in the document and the results are:

R1=10k, R2=3.3k, R3=10k, R4=3.3k not 2.1k.

Please calculate again. With R1=10k, R2=3.32k, R3=10k, R4=2.1k, V2 = 1.65V, Vin = -5 to +5V and Vout = 0 to 3V, and considering the transfer function shown in this article (equation (3)),

the calculation is as follows:

For -5V input

Vout = (-5*3.32/(10+3.32) + 1.65*10/(10+3.32)) * (1+2.1/10) = -0.009V

For +5V input

Vout = (+5*3.32/(10+3.32) + 1.65*10/(10+3.32)) * (1+2.1/10) = 3.007V

Thank you very much for the quick feedback! Much appreciated.

After testing the circuit from the discussion above, I am noticing some loading on the circuit behind my V1. I have an AC-coupling buffer amplifier that supplies V1. When I place an o-scope on the V1 line, prior to R1, I see a voltage offset proportional to the reference voltage, V2. Is there any way to stop this circuit from loading the circuit that is supplying V1?

ChiTownRick, there should be no loading unless your R1 and R2 resistors are really small. Please send me your schematic. I will send you my email address at the address you left me.

I am a little lost on the mathematics of system 3.. How are you solving for r1 and r4?

I have a +- 10v input signal and need 0-5 out; but after racking my brain I still haven’t arrived at any of your examples…

Thank you in advance! for further breaking down the equations

The input voltage range is -10V to +10V, which means a span of 20V. The output voltage range is 0 to 5V, so the output span is 5V. Therefore, your converter gain has to be 5V/20V = 0.25. With just a gain of 0.25V and no offset, the output will be -2.5V to +2.5V. So you need an offset of +2.5V to bringing to a range of 0 to 5V. Therefore, equation (1) becomes

Vout = Vin * 0.25 + 2.5

Now, comparing with the summing amplifier equation (3), two expressions are equal if their coefficients are equal. So, assigning Vin to V1, and making V2 = 2.5V, you get

R2/(R1+R2)*(1+R4/R3) = 0.25 and

2.5*R1/(R1+R2)*(1+R4/R3) = 2.5

There are 4 unknowns in this system, so choose 2 of them, say R1 = R3 = 10k. Solving the system of equations for R2 and R4 we get R2 = 2.5k and R4 = 2.5k. Hope this helps. You can see the schematic of this bipolar to unipolar converter in my article MasteringElectronicsDesign.com: Bipolar to Unipolar Converters Based on a Summing Amplifier Configuration.

I wish to use the circuit in Figure 2 to read a sensor (range -5V to +5V) into the analog in pin of an arduino(range ov to 5v). In figure 2 i am unsure of the role of the op amp. Will the circuit with only the 2 resistors provide me with the output i am looking for.

Many ADC manufacturers require the ADC input to be fed from a low impedance source. The reason is the input capacitance of the ADC, especially for sample and hold ADCs. That’s exactly what the op amp in Figure 2 does. It is a buffer, with a low output impedance, approx 20 ohms. If there is no op amp, you would feed the ADC input from a high impedance of 5k. Together with the ADC input capacitance, that high impedance would create a delay in the sample and hold, forcing you to slow down the conversion rate to give the capacitive time to charge. That is why I always recommend an op amp to buffer that high impedance.

In the case of Arduino, if the board has an ATmega32 processor, here is what the manufacturer has to say at the ADC section, page 209:

“The ADC is optimized for analog signals with an output impedance of approximately 10k or less. If such a source is used, the sampling time will be negligible. If a source with higher impedance is used, the sampling time will depend on how long time the source needs to charge the S/H capacitor, which can vary widely. The user is recommended to only use low impedance sources with slowly varying signals, since this minimizes the required charge transfer to the S/H capacitor.”

Since the manufacturer says that the ADC can work with an output impedance of 10k or less, it means that you can remove the op amp and use just the two resistors I show in Figure 2. If your Arduino board uses a different processor, you need to look up the ADC specs the same way I did, to figure out if you can remove the op amp or not.

This is a great site, which made me read all the topics here.

I’ve a doubt regarding this converter. Can I use LM741 opamp? If yes, What would be the power supply required for it?

Thanks.

It depends on your application, but yes you should be able to use LM741. The positive power supply, should be greater than the highest signal level at any of the op amp pins. The negative supply, should be lower than the lowest signal level at any of the op amp pins.

Hey Adrian,

I am trying to dampen my range down. My input range is 0-5V but my adc can only handle 0-1.8V. This signal is coming from a microphone and I believe if I apply 5V to the microphone, it will offset it at Vcc/2, so in this case the offset would be 2.5V. The signal is set at 2.5V but will vary from 0-5V. If my input span is 5V and my output span is 1.7V, then my gain is .34. I’m having trouble with the math on what to make my variables in the equations. Can you help out?

Thank you!!

You can do it two ways:

1. If your microphone amplifier output impedance is low, you can use a simple attenuator with two resistors to bring your 0-5V span to 0-1.8V. Then you need a voltage repeater to connect to your ADC, because most of the ADCs require a low impedance circuit in the input.

2. You can use the calculator shown in my article: http://masteringelectronicsdesign.com/differential-amplifier-calculator-2/. If you plug in your numbers for input and output you will see that R1 and R2 form the attenuator I was talking about, V2 does not matter and R3 can be very large (disconnected). You will end up with an attenuator and a voltage repeater. So, for R2 = 10k, the result is R1 = 17.78k (choose 17.8k 1% standard value), R4 = 0k (short circuit), R3 is very large (just remove it) and V2 does not matter.

Ok awesome. I am trying to implement this but am still having issues. So for the op amp, I can use any basic one? Like the LM741cn for example?

When you say V2 does not matter, do you mean it can be any voltage or it can be ground? Because when you say R3 is very large so just remove it, doesn’t that make it an open circuit, so essentially nothing could be connected to the inverting input other than the output?

Also, what do the power supply rails V+ and V- have to be? Could they be 5V and ground respectively?

Thanks again!

Since you disconnect R3, then yes, you do not need V2.

LM741 should work as well, but not at 0-5V power supply. Minimum power supply voltage is +/-5V.

Better go to Digikey.com or Mouser.com and look for a rail-to-rail op amp, with the power supply between 0 and 5V. You need rail-to-rail, because the output has to go down to 0V. Non rail-to-rail op amps need a headroom of -2.5V to output 0V.

Hi Adrian, Exactly what I was looking for. Many thanks. BTW, If I select an instrumentation OPAMP, will it give me the best accuracy – both in terms of linearity and conversion.

I will rig up the circuit with an LM324 and give you the feedback prior to embarking on Instrumentation OPAMP.

thanks once again.

Could you tell me the Vin1, Vin2, Vout1, Vout2 values that are used in the summing amplifier equation for the Sourcemeter ( http://pv.mit.edu/home/education/resources-for-educators/build-your-own-sourcemeter/ )? Thanks.

First, let’s look at Arduino Nano. It has 8 analog inputs connected to an ADC. with one of them, A1, it measures the op amp output which is used in a summing amplifier configuration. Arduino can measure voltages up to 5V, but the reference voltage can be programmed lower. The article says that the reference is 1.1V, so the ADC can measure a voltage between 0 and 1.1V.

The summing amplifier has a 0.1 ohm resistor connected to V- of the DUT and 3k resistor. The article says that, at that point, the voltage is between -3mV to +3mV. The other resistor, 12k has a voltage set by the DAC MCP4822 pin 6, Vb. The voltage level should be such that the op amp output is somewhere in the middle of the 0 to 1.1V trip of the ADC, say 0.5V. So, Vb has to be 25mV, because the transfer function between Vb and Arduino A1 is

25mV * 3k/(3k+12k) * (1+30k/0.3k) = 0.505V.

Between V- = +/-3mV and Arduino A1, the transfer function is

+/-3mV * 12k/(3k+12k) * (1+30k/0.3k) = +/-0.242V

Summing the two voltages at the op amp output, the voltage seen by Arduino ADC at pin A1 is between 0.263V and 0.747V.

Hi Adrian,

I have a project where I would like to use the bi polar converter set up as +/- 1V in and 3.3 out with a 5V ref. In addition I would like to be able to trim the gain with a pot. It’s not clear to me how I might do that… Would R4 be the gain part of the circuit?

Thanks…

Yes, R4 is the gain. In equation (3), 1+R4/R3 multiplies the sum. When R4 = 0, the gain is one. Then the gain increases with the ratio R4/R3.