# 12-bit DAC Output to +/-10v Signal [duplicate]

Suppose we want a +/-10v control signal, where 0x0 (to the DAC) = -10v and 0xFFF = +10v.

Firstly, how do we alter the signal so that we can have a negative voltage, dependant on the DAC input?

Secondly, how can we scale the signal so that it fits within the -10 to +10 range?

• I am not sure what is your application.(I am assuming the output of the DAC is finally handled by some analog circuits.) First you need to make the output of DAC smooth (using a low pass filter.) You can look at the use of 'level shifter' to shift the voltage to negative values. A simple one will be using a diode. Op amps can be made use for Scaling operation. Make sure you look at the frequency response for each of them. A problem you might encounter is getting a negative voltage supply if don't have already. – Jinu Dec 23 '16 at 4:19
• "to the DAC" - What DAC? Did you have a model in mind? Something that is part of your processor? Or, if you're just thrashing about, you use a 12-bit bipolar DAC, probably using +/- 15 volt power suppliles. 12 bits in, +/- 10 volts out. Easy peasy. But why do we have to guess what you mean? Do you think that we are psychic? – WhatRoughBeast Dec 23 '16 at 4:24
• @WhatRoughBeast, Sorry should have been more clear. The DAC will be unipolar. Probably DAC0800. – M-R Dec 23 '16 at 4:26
• @MartinRand - Well, in that case you Google on "DAC0800", go to the data sheet, and follow the circuit shown in the data sheet. – WhatRoughBeast Dec 23 '16 at 4:33

a straightforward solution would be to use an opamp configured as a difference amplifier.

There's plenty of good material on the web about it. Here's one: http://www.electronics-tutorials.ws/opamp/opamp_5.html

Let's say your DAC outputs 0V to 2.048V for code 0x000 to code 0xFFF (fairly common) and you want a swing of +/-10 Volts. So the gain you want is 20 Volts / 2.048V = 9.77

The circuit is below. So you just need R3 that many times bigger than R1.

The trick is to reference once side of the input to the "halfway point" of your DAC output range. So here, I'm referencing it to 1.024V. This way, the amplifier sees a difference (V_R2 - V_R1) on its inputs of -1.024V at code 0x000, and +1.024V at code 0xFFF. Then the opamp applies the gain of 9.77 to that difference and, voila, you get your -10V to +10V output swing.

For the voltage reference, just do a search on Mouser or Digikey. You will find a ton out there that put out nice "binary" values like 1.024V and 2.048V.

The difference amp configuration is super useful. I hope that helps, -Vince • Would you provide the op-amp with 20V? – M-R Feb 2 '18 at 15:55
• And How would you go about creating a 97.7K resistance? Would this be a matter of linking several smaller resistors in series? – M-R Feb 2 '18 at 16:15
• Wow, this was a while back. Several ways. 1) You can find resistor ratios that are close to 9.77 of each other. R1 doesn't have to be 10k, just the R3/R1 and R4/R2 ratio is 9.77. 2) You can replace one of them with a trim pot and adjust manually (this would be done in the "old days"), or 3) Use a 10:1 ratio (e.g. 100k and 10k) and then digitally scale the DAC value in your SW to limit DAC output to 2.000 Volts. If you're going for accuracy, you would put a calibration step in SW anyway to cal out DAC errors and store cal in non-volatile memory. Option 3) is the modern way to do it. – Vince Patron Feb 2 '18 at 17:37
• Option 3 does seem like the most straightforward. Would Vref then need to be 1V? Not entirely sure what you mean by calibration step, etc. Thanks :) – M-R Feb 2 '18 at 17:48
• Oh, right. Vref would be 1V in this case. Regarding calibration, a typical DAC system will have maybe 2% or 3% total error. If you want better than this, you can spend lots of money for a better DAC, or you institute a step in the factory that compares your device with an accurate reference instrument to calculate the error. You then store correction values in your device so it can correct its own readings. This is what's done if you're building a very accurate instrument. Calibration is done for each device (but adds extra cost). – Vince Patron Feb 2 '18 at 18:58

Start with a potential divider that maps the DAC output midpoint to 0V. If the DAC midpoint voltage is +1.25 volts, then a -1.25 reference voltage and two 1kohm resistors will produce 0V for the remapped output at the junction of the resistors.

Now, if the DAC produced 0V at it's output, the remapped output would be -0.625 volts. If the DAC produced the full 2.5 volts, the remapped output would be +0.625 volts.

So, a 0 to 2.5 volts DAC output is mapped to -0.625 volts to +0.625 volts using two 1 kohm resistors and a negative voltage of 1.25 volts. Next, amplify that remapped voltage using a non-inverting amplifier to convert +/-0.625 volts to +/-10 volts and you have your solution (gain = 16).

As with any solution to this, the op-amp will need power supplies of a little greater than +/- 10V but this depends on the op-amp. +/-15 volt supplies would be fairly standard.

Use a precision shunt reference to generate -1.25 volts.

A perfectly straightforward way to address the problem is to choose a DAC such as the DAC0800, although this is an 8-bit DAC, and you have specified 12-bit output values. Looking at the data sheet, Figure 23 gives you the circuit you want simulate this circuit – Schematic created using CircuitLab The op amp must be driven from at least +/- 12 volts, and +/- 15 is a better planning figure. Since the DAC0800 should be driven from +/- 15, that's the way to go.

Note that R1, R3 and R4 should be 0.1% resistors. You can use lower tolerances but your DAC output levels will not be defined to 1 lsb. (1/256) = 0.4%) And if you do go to a 12-bit DAC you should simply buy one with voltage output. If you insist on using a DAC0800-like DAC with 12 bits, your resistor tolerances should be 0.025%, since 1/4096 = .000244. Just personally, I'd go with buying a DAC with voltage outputs, but it's your choice.

Digital inputs to the DAC0800 are not shown, but are necessary.

Applying a difference in midpoint Voltage shifts your offset separate from gain adjust. This is done on inverting input scaled down by inverting gain to Vref.

This allows any offset from polar to bipolar. For precision, both must be separate and tuneable or self-calibrated with a precision Vref.