I2C Devices and Ports

I have been using the Photon for the past 1 month and for my project, I have to attach 2 I2C devices 2 each. So it’s like 4 devices on D0, D1. Is there any way to do this?
I know that I have to change address’ of the same device. How can I do this? The sensors which I am usng are- IR Temp and Range Finders both by Sparkfun.

Can someone help me out? Or has somebody tried this?

@skasat, can you provide links to the exact devices from Sparkfun?

IR TEMP- https://learn.sparkfun.com/tutorials/mlx90614-ir-thermometer-hookup-guide?_ga=1.239714692.648566008.1475263165

Range Finder- https://learn.sparkfun.com/tutorials/vl6180-hookup-guide?_ga=1.164308280.648566008.1475263165

@skasat, neither of these parts have programmable I2C addresses so you can only have one of each on a bus. To use pairs of these on the same bus you will need an I2C multiplexer which “hides” each I2C device from the others on the bus. You simply select the device you want to connect to (like a channel) and then do the I2C transactions as you normally would. Adafruit has a good one which has 8 channels:

3 Likes

On the VL sensor there are two pins ID0 and ID1 which seem to be undocumented, but one comment on the SparkFun board suggests these can be used as address selectors
https://learn.sparkfun.com/tutorials/vl6180-hookup-guide/discuss

2 Likes