Already mastered Analog Inputs with the Pi, and looking for a new challenge?  How about: How can I generate an analog output on the Pi?!

There are several ways you can accomplish this, but one of the easiest and most flexible is to use a dedicated IC called a Digital to Analog Convertor (or DAC).  A DAC allows you to specify a numeric value (0..255 for an 8-bit DAC, 0..4095 for a 12-bit DAC, etc.), and the IC will output a voltage based on the supply voltage, and relative to that numeric value.  For example, using a 12-bit DAC like the MCP4725 we'll be using here, setting the value to 2048 on a 3.3V system will results in ~1.65V output on the DAC.

This guide will show you everything you need to know to be able to generate precise analog outputs using your Pi and the MCP4725 12-Bit I2C DAC, from connecting everything up, to how to use our easy Python library.

What You'll Need

The following products are used in this tutorial:
Last updated on 2014-04-18 at 07.06.26 AM Published on 2012-08-17 at 02.39.28 PM