Design a Bipolar to Unipolar Converter to Drive an ADC

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?

summing_amplifier1

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:

image002 (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:

image0031 (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:

image0043 (3)

We can rewrite equation (2) as follows:

image0053 (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.

bipolar_to_unipolar_converter_1

Figure 2

45 thoughts on “Design a Bipolar to Unipolar Converter to Drive an ADC”

  1. 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.

    Reply
    • 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.

      Reply
  2. 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.

    Reply
  3. 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

    Reply
    • 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.

      Reply
      • 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)),

        Summing amplifier transfer function

        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

        Reply
  4. 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?

    Reply
  5. 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

    Reply
    • 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.

      Reply
  6. 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.

    Reply
    • 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.

      Reply
  7. 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.

    Reply
    • 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.

      Reply
  8. 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!!

    Reply
    • 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: https://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.

      Reply
      • 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!

        Reply
      • 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.

        Reply
  9. 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.

    Reply
    • 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.

      Reply
  10. 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…

    Reply
  11. Hi, Please i need high voltage bipolar to unipolar converter, for example +100v to -100v on the bipolar end to 0v to +5v on the unipolar end. How do i go about it? Thanks

    Reply
  12. I cam across this web site when i was lloking for a way to convert bipolar to unipolar (-16v) to make it 3.3v to 5v. its seems to be the solution to my problems i have with a device at work that i am not allowed to manipulate and only have -16v to work with.

    i tried to figure a way to work with the some of the eqoutions and systems you show here. i rattled my brain for a few hours and finally just gave up.

    is there a solution that you may help me with. many Thanks ahead of time. and all help will be much appreciated.

    Reply
    • If the output has a range, 3.3V to 5V, the input has to have a range as well. With one voltage level, -16V, you can have just one voltage level at your circuit output, not two. What is it that you try to accomplish?

      Reply
  13. Hi Adrian,

    I made the circuit in Figure 2. but i did not see the desired results on the output. I guess the problem is the various loadings on the inputs. (both the shifting and the “halving” is off)

    My 5V “source” is a 200k/100k voltage divider connected between 15V and GND.
    My bipolar signal is a +-5V VCO with an output impedance of 1k.

    Reply
  14. hi Adrian !! im reading your article but i don’t know what is different in figure 2 amplifier has Vs+ , Vs- and figure 1 is not . im reading a paper http://gureckislab.org/blog/?p=3027
    the negative voltage is created by ICL7760 so when i feed in 5V and get only -5V out . The v1 in this article need range -5 to 5v , how can i slove that ??

    Reply
    • Figure 1 shows a theoretic setup, to help with the understanding of the calculations. Figure 2 is a practical circuit.
      You already have +5V that you feed into ICL7760. Connect it to the positive supply pin of the op amp as well. And connect the output of ICL7760 to the negative supply pin of the op amp.

      Reply
  15. Hi, Adrian I am using 741 op-amp to convert bipolar ac signal to unipolar with range of +/- 100mv , but the output I got is non-linear. For example, when my input peak to peak is 30mv I got 180mv peak to peak as output and , when 100mv I got 240mv similarly for 1V peak to peak I got 1.2 V. Please suggest what to do to make output linear.
    Thanks

    Reply
    • It looks like you need to increase the power supply. LM741 is not a rail-to-rail op amp. The power supply needs to be at least 3V higher than the maximum output voltage. Te negative supply has to be 3V lower than the minimum output voltage.

      Reply
  16. Hi Adrian, thanks for the article. I am trying to convert a +/- 12V signal to 0-4V for use with an Arduino. I went through your procedure to design the summing amplifier, and I calculated the resistor values at R1 = 12K, R2 = 1K, R3 = 4.2K and R4 = 4.9K, with V2 = 1V. However, when I test the output range, I get -2V to +6V. I’ve triple checked the math and the circuit wiring, but I’m not seeing anything out of place. I’m using a TLO82 Dual BiFET OP Amp (I will eventually need to have six of the same circuit to handle 6 bipolar signals). Would imprecision in the resistor values cause such a large change in the expected outputs?

    Thanks.

    Reply
    • As I understand it, when
      V1 = -12V, output is 0V
      and
      V1 = +12V, output is 4V

      Then the gain is
      output_span/input_span = (4-0)/(12-(-12)) = 4/24 = 0.167
      So, if you choose R1 = R3 = 10k, R2 and R4 are 1.67k (choose the standard values 1.65k or 1.69k).

      With V2 = 0V, the output will swing -2V to +2V. So you need an offset of 2V. Therefore, make V2 = 2V.

      It is simpler to choose equal resistors R1 and R3, R2 and R4. You can also use my calculator published here: MasteringElectronicsDesign.com:Summing Amplifier Calculator.

      Reply
  17. hello, i’m having trouble with my circuit. i’m using Arduino to take the DC 5Volt, for the -5V to 5V i’m using an LFO Module which i can chose the Frequency. I’m tryng on the bredborad with a TL072cn but i have a strange Output, something like 7Volts. i’m also using a +12 -12 power supply for The OpAmp.

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Show Buttons
Hide Buttons
'