DAC Brick

The DAC brick contains a MCP4728 12bit digital to analogue converter attached to an MSOP to DIL adapter board, which provides an I2C port to interface with the ARD brick and four analogue outputs (bottom) - one for each channel.

Serial Port Commands:
dac0=voltage - set dac channel 0
dac1=voltage - set dac channel 1
dac2=voltage - set dac channel 2
dac3=voltage - set dac channel 3
voltage in milivolts; range 0-4096

Python Functions:
ard(port, channel, voltage) - set the dac
channel (0-3)
voltage in millivolts; range 0-4096

In [ ]:
#Example Python code to test a DAC brick connected to an ARD brick

from I2Brick import *

port = I2Brick('COM4')             #Windows: Initialize the serial communication with I2Bricks
#port = I2Brick('/dev/ttyUSB0')    #Linux: Initialize the serial communication with I2Bricks

print(ard(port))                   #Test the communication between the ARD and the PC

dac(port,0,1000)                   #Set dac0 equal to 1V (1000mV)
dac(port,1,2000)                   #Set dac1 equal to 2V (2000mV)
dac(port,2,3000)                   #Set dac2 equal to 3V (3000mV)
dac(port,3,4000)                   #Set dac3 equal to 4V (4000mV)
                    
port.close()

YOUR USE OF THIS SITE IS AT YOUR SOLE RISK - Please read LEGAL DISCLAIMER