How to connect multiple I2C sensors of the same type

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
maybecoding
 
Posts: 89
Joined: Sat May 03, 2014 3:03 am

How to connect multiple I2C sensors of the same type

Post by maybecoding »

I am curious to know if there is a way to connect multiple I2C sensors of the same type, to either a trinket pro, a Teensy 3.1 or a BeagleBoneBlack.

I am evaluating the feasibility to connect sensors that are of the same type; the main problem is that most sensors has no more than 1 register that you can swap for the address, so 2 is the max that you can hook up on a I2C chain. Is there anything sold on the store, that would allow me to use sensors and address them so they don't conflict with each other?

I have a couple of MPU6050 and also the ones sold on Adafruit has the same limitation of 2 address per chip. If you have only one I2C channel, how do you chain multiple sensors and not make them conflict?

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: How to connect multiple I2C sensors of the same type

Post by adafruit_support_bill »

If your devices do not have configurable addresses, you can use Software I2C to set up another bus on different pins: http://playground.arduino.cc/Main/SoftwareI2CLibrary

There are also hardware i2c multiplexor chips from manufacturers such as Ti and NXP.

User avatar
maybecoding
 
Posts: 89
Joined: Sat May 03, 2014 3:03 am

Re: How to connect multiple I2C sensors of the same type

Post by maybecoding »

Interesting!

So using that library, you create a new I2C bus on different pins? I thought that you are restricted in the number of I2C bus by the pin that the MC expose for that particular use. Would this work on a trinket pro with 6 sensors (3 I2C channels basically)?

Is Adafruit planning to sell I2C multiplexor ? Not sure how many customers may be interested in it, but probably anyone that needs more than 2 sensors of the same type may find them useful :)

Thanks Bill!

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: How to connect multiple I2C sensors of the same type

Post by adafruit_support_bill »

So using that library, you create a new I2C bus on different pins? I thought that you are restricted in the number of I2C bus by the pin that the MC expose for that particular use.
The library emulates an i2c bus in software. It is a bit slower and less efficient than the hardware i2c bus, but it does get around problems with address conflicts.
Would this work on a trinket pro with 6 sensors (3 I2C channels basically)?
It should.
Is Adafruit planning to sell I2C multiplexor ? Not sure how many customers may be interested in it, but probably anyone that needs more than 2 sensors of the same type may find them useful :)
Not sure if there are plans for one. I will mention it to the design team.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”