YOU WILL NEED THIS BOARD

ADC Pi
8 Channel 17-bit Single-Ended Analogue to Digital Converter for the Raspberry Pi and Single-Board Computers
£14.39 ex VAT
C++ Library to use with ADC Pi Raspberry Pi development board.
The example CPP files can be found in /ABElectronics_CPP_Libraries/ADCPi/demos
Downloading and Installing the library
To download to your Raspberry Pi type in the terminal:
git clone https://github.com/abelectronicsuk/ABElectronics_CPP_Libraries.git
Classes:
ADCPi(uint8_t address1, uint8_t address2, uint8_t rate)
Parameter: address1 - I2C address of ADC chip 1. 0x68 to 0x6F
Parameter: address2 - I2C address of ADC chip 2. 0x68 to 0x6F
Parameter: rate - Bit rate for ADC sampling. 12, 14, 16 or 18
Methods:
read_voltage(uint8_t channel)
Read the voltage from the selected channel.
Parameter: channel - 1 to 8
Returns: (double) number between 0 and 5.06
read_raw(uint8_t channel)
Read the raw value from the selected channel.
Parameter: channel - 1 to 8
Returns: (uint32_t) raw number
set_pga(uint8_t gain)
Set the gain of the PGA on the chip.
Parameter: gain - 1, 2, 4, 8
Returns: null
set_bit_rate(uint8_t rate)
Set the sample bit rate of the ADC.
Parameter: rate - 12, 14, 16, 18
12 = 12 bit (240SPS max)
14 = 14 bit (60SPS max)
16 = 16 bit (15SPS max)
18 = 18 bit (3.75SPS max)
Returns: null
set_conversion_mode(uint8_t mode)
Set the conversion mode for the ADC.
Parameter: mode - 0 = One-shot conversion, 1 = Continuous conversion
Returns: null
Also useful for your Raspberry Pi project
Temperature & Sensing
1 Wire Pi Plus
Connect dozens of 1-Wire sensors - temperature, iButtons, EEPROMs - via a single GPIO pin. Stacks directly on the 40-pin header.
Analogue I/O
ADC Pi
Read up to 8 analogue inputs - perfect for pairing with your temperature sensors or other analogue-output devices.
All-in-one
Expander Pi
Combines ADC, DAC, 32 GPIO ports and a real-time clock on one board. The most versatile board for complex Raspberry Pi projects.