Go Down

Topic: I2C communication with a device with a fix adress (Read 956 times) previous topic - next topic

amine244

Hello everyone,

I would like to communicate with two or more of these proximity sensors :
https://www.sparkfun.com/products/10901

The datasheet says they have a fix adress (0x13).
My question is : Is it possible to change that adress in order to communicate with two or more sensors using the same SDA and SCL pins ?
If i'm using a Leonardo or a Mega (which have additional I2C pins) can I wire one sensor to SDA and SCL pins and the second sensor to SDA1 and SCL1 pins ?

Then would I be able to communicate with both sensors despite the fix address ?

Thank you very much in advance :)

Tom Carpenter

#1
Mar 12, 2014, 01:24 am Last Edit: Mar 12, 2014, 01:26 am by Tom Carpenter Reason: 1
The address is fixed, so you can't change it.

You can use two different I2C buses, yes.

To that end, you could use something like this chip:
http://www.nxp.com/products/interface_and_connectivity/i2c/i2c_multiplexers_switches/series/PCA9547.html
There may be a breakout board for this or some other chip with similar functionality.
~Tom~

Caltoa

#2
Mar 12, 2014, 09:55 am Last Edit: Mar 12, 2014, 09:59 am by Caltoa Reason: 1
It is also possible to use a logic chips and make a mux yourself, for example with a simple chip like the 4051
http://playground.arduino.cc/learning/4051
Or the 74hc4052.

You will find more possibilities in the forum, since it is a common question. Try to search for 'i2c mux' or 'i2c switch'.

Do the Arduino Leonardo or Mega have a second I2C bus with SDA1 and SCL1 ? Maybe you have to look harder.
http://arduino.cc/en/Main/ArduinoBoardLeonardo
http://arduino.cc/en/Main/arduinoBoardMega2560

Go Up