DAC to generate 0-10V constant output

I would need a DAC conveter that could generate constant (or slowly changing, not audio) tension values from 0 to 10V, that will be used eg to drive solid state relays or other systems that need analog input.
How would you do that ? I was thinking in a 12 bit serial DAC. Can someone recommend me a device to do so ?
Any idea based on PWM ?
Thanks !

You have two options that I can think of.

  1. Use the existing 8 bit PWM analogWrite() command. You would have to wire the pwm output pin to a switching transistor wired to +10vdc, and then follow that with a low pass filter (resistor/capacitor network).

  2. Use a external DAC module. Most/many don't do 0-10vdc output so you might have to follow the analog output with a opamp configured for X2 gain. Here is a 2 channel DAC unit I have orded but it's not due in for another few days at best, so I can't give you a report on it. http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=270632079322&ssPageName=STRK:MEWNX:IT

Lefty

It seems to me that the DAC option would work better, but (I hope) it must be a +10V chip, I would prefer to keep the component count as low as possible.
Thanks for your reply, that board looks great. What a pitty the +5V max.

Here is a circuit that will do what you want:

http://ruggedcircuits.com/html/circuit__20.html

-- The Aussie Shield: breakout all 28 pins to quick-connect terminals

Thanks ! But will the output have some kind of (small) oscillation ? It should noise-free to drive another circuit.

It depends how sensitive the receiver is. The amount of oscillation is set by the components R1 and C1. These form a lowpass filter with -3dB frequency 1/(2*pi*R1*C1), or 16 Hz. For every factor of 10 increase in frequency the attenuation is another -20dB, so -23dB at 160 Hz, -43 dB at 1600 Hz, etc.

If you set the PWM frequency fairly high (e.g., 16 kHz) then the attenuation will be -63 dB. This means that the original 0V-5V oscillation coming from the Arduino pin will only be about 5V * (10^(-63/20)) = 3.5mV in amplitude at the oscillation frequency. That is not very big. There will be oscillations at overtones of that frequency but they will be even tinier.

You can also make the filter more aggressive by, for example, changing C1 to be 10uF or R1 to be 100k, etc. Either one of these changes will result in an amplitude of only -83dB from 5V, or 354 microvolts.

However, the more aggressive you make the filter the longer it takes for a new analog output value to take hold (i.e., the response time gets longer). The time constant of the circuit T=R1*C1 gives you a sense for how long this takes. After 5T you can assume the analog output has settled to its new value.

-- The Rugged Motor Driver: two H-bridges, more power than an L298, fully protected

RuggedCircuits: Here is a circuit that will do what you want:

http://ruggedcircuits.com/html/circuit__20.html

-- The Aussie Shield: breakout all 28 pins to quick-connect terminals

Hello RuggedCircuits, possible to upload again that circuit since it now links to a dead page.

Thanks very much.