Question about DAC with Arduino UNO

Hi all,

I am currently working on a project that I need an adjustable voltage (3V, 3.5V, 4V, 4.5V) to feed in to the reference voltage input of the comparator. See the circuit diagram below.

I was surfing the forum and the playground from the Arduino website, there are few ways I can
achieve the DAC from the Arduino.Arduino Playground - InterfacingWithHardware

Using OpAmp

R/2R Ladder
http://blog.makezine.com/archive/2008/05/makeit-protodac-shield-fo.html?CMP=OTC-0D6B48984890

Here are my problems.

  1. Which method do you recommend for my application? R/2R Ladder or the one using the op amp?
  2. Can the ADC output an DC voltage (0 to 5V) ?
  3. Am I using the PWM output pin to achieve the process of DAC?

Best Regards,
tayip

Since you only have 4 values a few resistors would suffice. You'd have to work out suitable values - connect one to Vcc and three others to three pins, each acts as a voltage divider if that pin is low, and is out of the circuit if than pinMode is INPUT. the divider ratios need to be 3.5/5, 4/5 and 4.5/5...

No the ADC doesn't output anything, its reads voltages only.

With PWM you would have to low pass filter the waveform appropriately, but you do get 256 output levels.