Projects Raspberry Pi

Raspberry Pi I2C Microchip MCP3428 ADC Reading

Using aMicrochip MCP3428 ADC via I2C and the Raspberry Pi to read voltages

The code sample below shows how to read the ADC values from the MCP3428 16-Bit, Multi-Channel Analog-to-Digital Converter with I2C™ Interface and On-Board Reference by Microchip via I2C on the Raspberry Pi using Python.

The code on this page has been replaced with updated code on Github.

https://github.com/abelectronicsuk/ABElectronics_Python_Libraries/tree/master/ADCPi/demos

 

ADC Chip Addresses

adc_address1 = 0x68
adc_address2 = 0x69

channel1 = 0x98
channel2 = 0xB8
channel3 = 0xD8
channel4 = 0xF8

Pin assignment on our interface board:

adc_address1 - channel1 - pin 3
adc_address1 - channel2 - pin 4
adc_address1 - channel3 - pin 1
adc_address1 - channel4 - pin 2


adc_address2 - channel1 - pin 7
adc_address2 - channel2 - pin 8
adc_address2 - channel3 - pin 5
adc_address2 - channel4 - pin 6


ADC Address Config:

L & L = 0x68
F & F = 0x68
L & F = 0x69
L & H = 0x6A
F & L = 0x6B
H & L = 0x6C
H & F = 0x6D
H & H = 0x6E
F & H = 0x6F

Screen Shot of the data returned from the converter.

Screen Shot of the data returned

Permalink


comments

Leave a reply

Your email address will not be published. Required fields are marked *

Share this post

Support the blog

AB Electronics Raspberry Pi shop