9
\$\begingroup\$

How can I implement (or maybe there is an IC that already does that) a board whose input would be I2C and output would be analog voltage (0V - 5V) ?

Eventually I would like to connect a couple of those to the IO pins of an arduino effectively creating digital to analog outputs.

\$\endgroup\$

5 Answers 5

12
\$\begingroup\$

Consider the Microchip TC1321 it's an I2C digital to analog converter (DAC) with 10 bits of resolution (4.88mV/step), available in SOIC8 (you'll need an easy to solder adapter board [eg sparkfun's or futurlec's) and operates from 5 volts. If you're OK with only 8 bits (19.5mV/step) consider the TC1320.

Both chips are available from Mouser or Microchip Direct for around $2.

If you can use SPI instead of I2C, your options are easier, the MCP4821 and MCP4822 are single and dual SPI DAC chips that come in nice PDIP8 packages. Again they cost about $2 from the usual places (mouser, digikey, microchip direct, farnell).

\$\endgroup\$
6
  • \$\begingroup\$ Why not put the actual urls underneath, the main text in the style of footnotes? \$\endgroup\$
    – Amos
    Nov 11, 2009 at 12:18
  • \$\begingroup\$ @Amos, because the formatter does a good job of recognizing URLs in many formats, and the 'new user' filter hits on count(links) > 1, regardless of their formatting. I lost an extensive answer the first day for the same reason (I posted it and didn't see the error message). \$\endgroup\$ Nov 11, 2009 at 21:21
  • \$\begingroup\$ Right, I hadn't realised. \$\endgroup\$
    – Amos
    Nov 11, 2009 at 23:54
  • \$\begingroup\$ It's a digital-to-analog converter, not analog-to-digital. \$\endgroup\$
    – endolith
    Nov 17, 2009 at 17:25
  • \$\begingroup\$ And you should be able to edit your post and add the links now that you have some reputation. \$\endgroup\$
    – endolith
    Nov 17, 2009 at 17:26
7
\$\begingroup\$

Depending on what you are driving, if you have an Arduino you already have three to six Analog outputs, as you can use the AnalogWrite function to set the duty cycle of the PWM pins. The frequency is approximately 490 Hz, more than sufficient for LEDs (again, it depends on your application). You can set the value from 0 to 255, giving you a resolution of (5v / 256 =) .020V.

You need to determine if 490 Hz is a sufficient rate, but PWM is used to simulate analog voltage for many applications, and it may fit yours without extra parts or programming.

You may also consider using a filter (capacitor-resistor network) to smooth out the square wave. It'll give you more leeway in the applications you can control, and passives are cheap, but depending on your application it may not even be necessary.

http://www.arduino.cc/en/Reference/AnalogWrite

\$\endgroup\$
4
\$\begingroup\$

You'd need an I2C based digital to analog convertor (DAC) of some type, a quick search turned up the following:

http://www.sparkfun.com/commerce/product_info.php?products_id=8736

\$\endgroup\$
3
\$\begingroup\$

Just so you know, an AVR (the chip used in an Arduino) can already produce 'analog' voltages via using PWM + a capacitor to smooth the waveform (capacitor is not even needed in some cases). It's not quite as high resolution as a dedicated DAC chip, but it is good enough for many needs.

\$\endgroup\$
1
\$\begingroup\$

Here is a Wikipedia entry on digital Potentiometers. These digital pots can act as analog output on the arduino. It would act as a regular potentiometer sweeping across all voltages from 0 - 5V through serial(of some sort) commands. If you didn't have to have I2C then you could use this digital pot from Parralax or this chip from Jameco. The only I2C chips I have seen are all surface mount instead of through-hole, this makes them harder to work with and. Here is the link to all of Jameco's I2C digital potentiometers. I hope this was helpful and the best of luck!

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Digital pots are generally used to set the gain or attenuation of an external circuit in a few discrete steps (256). To get a DC voltage out of it, you'd need to connect this to a voltage source, but it's really not the application these are meant for. A DAC, on the other hand, outputs a voltage directly, and will generally have many more steps and more accuracy. A DAC is what this poster is looking for. \$\endgroup\$
    – endolith
    Nov 17, 2009 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.