In this Post we go beyond the setup of the I2C, SPI and OneWire interfaces on the PI2 and look at how to integrate some common I2C analogue IO devices, specifically the following
DAC8571 Quad 16bit DAC:- http://www.ti.com/lit/ds/symlink/dac8574.pdf costing about $8 each
DAC8571 Single 16bit DAC:- http://www.ti.com/lit/ds/symlink/dac8571.pdf costing about $3 each
ADS1115 Quad 16bit ADC:- http://www.ti.com/lit/ds/symlink/ads1115.pdf costing about $3 each
there are compatable 12, 10 and 8 bit resolution parts costing much less if your needs are not 16bit resolution
For fun and because it also provided the added benefit of level shifting the PI's 3V3 to the 5V required for the devices I have included the TI I2C isolation device:
ISO1541 Low-Power Bidirectional I2C Isolators:- http://www.ti.com/lit/ds/symlink/iso1541.pdf costing about $2 each
This is what the schematic looks like
The video will show you the basics of how these are connected up and isolated from the PI power completly and providing upto 2.5KV isolation to the target devices. I will show how to address and use these parts from the I2C command line tools I2Cset and I2Cget for both the DACS and the ADC. At this point no programming or libraries are required beyond what was setup in the previous video founf here https://www.youtube.com/watch?v=oTOIzdwE84k
This video is not aimed at providing a full application but will provide enough information to allow you to start coding in your favorite scripting or programming language.
Additionally I will show how not paying attention to the addresses used for each device can give the impression that one is not working (Yes, I fell for it myself )
Here is the video