Accelerometer with more than 2 I2C addresses

Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Locked
User avatar
Dalex85
 
Posts: 3
Joined: Mon Jun 05, 2023 10:57 am

Accelerometer with more than 2 I2C addresses

Post by Dalex85 »

Hello everyone,
is there a accelerometer that has more than 2 I2C addresses to choose from? So far I only found accelerometers with maximum 2 I2C addresses which can be choosen by high/low at a specific pin. However, in my project I need to connect more than 2 accelerometers to an arduino and I don't want to use separate cables to single select the address pin of the accelerometers.
Thank you very much for your help!
Daniel

User avatar
dastels
 
Posts: 15655
Joined: Tue Oct 20, 2015 3:22 pm

Re: Accelerometer with more than 2 I2C addresses

Post by dastels »

You could use an I2C multiplexer https://www.adafruit.com/product/2717 for up to 8 sensors, or https://www.adafruit.com/product/5663 for up to 4. There are STEMMA-QT versions of each. That way you can choose an accelerometer based on capabilities/features rather than number of possible addresses.

Dave

User avatar
Dalex85
 
Posts: 3
Joined: Mon Jun 05, 2023 10:57 am

Re: Accelerometer with more than 2 I2C addresses

Post by Dalex85 »

Thank you very much for your help. I heard about the multiplexer but as far as I understand this would again mean that each accelerometer needs to be connected with 2 individual cables sda and scl (Plus and ground can be identical for all the accelerometers). I was hoping I could use the full I2C capabilities by connecting all accelerometers to the same sda and scl which means 4 cables in total for all accelerometers.

User avatar
dastels
 
Posts: 15655
Joined: Tue Oct 20, 2015 3:22 pm

Re: Accelerometer with more than 2 I2C addresses

Post by dastels »

Yes, the multiplexor require separate I2C lines between the multiplexor and each sensor.

If you want more than 2 I think your options are limited. I see several accels that can have one of 2 addresses, but to go beyond 2 it looks like you'll need to use a multiplexor.

Dave

User avatar
Dalex85
 
Posts: 3
Joined: Mon Jun 05, 2023 10:57 am

Re: Accelerometer with more than 2 I2C addresses

Post by Dalex85 »

Thank you again Dave! This is helpful confirmation that there really are no accels with more addresses and my research war correct. I therefore will use separate digital outs to put one accel address pin at a time on high and contact this accel and the other accels later.

User avatar
dastels
 
Posts: 15655
Joined: Tue Oct 20, 2015 3:22 pm

Re: Accelerometer with more than 2 I2C addresses

Post by dastels »

That's unusual approach. So you mean to have them all at one address and switch the one you want to talk to to the second address when you want to talk to it? If so, you should confirm that it will actually work... they may read the address bit only on powerup.

Dave

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

Re: Accelerometer with more than 2 I2C addresses

Post by adafruit_support_bill »

I've used the 'dynamic address pin' hack before with success. But Dave has a good point: some chips only read the state of the address pin(s) at power-up. Best to read the fine print of the data sheet and/or test before venturing too far down that path.

Locked
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

Return to “Internet of Things: Adafruit IO and Wippersnapper”