The Voltage Plug generates up to four 0 .. 3.3V levels using MCP4725 12-bit DAC’s controlled from I2C:
This sketch switches between 0 and 4095, displaying as 1.2 mV and 3.295 V on my multimeter, respectively:
The cycle time was set to 5 seconds to give my auto-ranging multimeter time to adjust itself.
There is room for 4 DAC chips, which seems like a bit of overkill, but I couldn’t think of anything else to put there and the board looked so empty :) – perhaps some sort of voltage-follower op-amp or amplifier stage would make more sense? Anyway, I’ll probably remove two of those chips from the plug again.
The MCP4725 only has one pin to specify the lower address bit. There are in fact 4 different chips available from the manufacturer, to support up to 8 DAC’s on a single I2C bus. Since I got the “A3″ version – and since I mixed up high and low again – this particular test uses address 0×67. For the final version I’ll fix the low-address bit and use “A0″ versions, i.e. 0×60 and 0×61.