Accelerometer with multiple I2C addresses

I’m looking to use 5+ accelerometers. I was wondering if there are any accelerometers with customisable I2C addresses so I can achieve this with I2C comms. A google search and a search of our forum has rendered nothing, so I was curious and wanted to ask.

Use an I2C multiplexer. Then you can use the accelerometer that has the specs you need instead of being forced to use what you can find.

Easily, without an I2C multiplexer.

Most accelerometers have at least one address select input, which allows you to choose between two I2C addresses. Assign 5+ MCU output pins to the address select inputs, and set the select pins so that you address only one accelerometer at a time, using the base I2C address.

I’d like to take readings simultaneously from all 5, rather than cycle between them. I’ve been able to achieve this with 2 as they haven't different I2C addresses. I’d like to scale this up.

Not possible. The MCU can do only one thing at a time.

One way or another you are going to have to query them sequentially. Even if you could find a micro with 5 I2C ports (maybe a SAMD21 or the like), the software would be accessing them sequentially.

If you used an Arduino with 2x CPU cores and 2x i2c buses, or perhaps 2 separate Arduinos, then that could be true. That would explain how you were able to do it using 2 sensors that did not have different addresses: they were not on the same bus.

Is that what you did?

Get a processor (ie. tiny85) for each accelerometer. Trigger them all at once then read the results to a central processor.

No I have not done this - I connected them to the same board. In that case, what are the I2C addresses for?

What do you mean by "at the same time"? Would it matter if they were sampled say 1ms apart? What is the application, why do need 5, why simultaneously?

In that case

the above is not true. The readings may seem like they are simultaneous to you or me, but they are not. The readings are taken in cycle between the two sensors. But so fast that it seems simultaneous. Same can happen with 5.

To understand your comment, is this what you mean?: Connect the pull down pin on 5 accelerometers to 5 GPIO pins and cycle the state of the GPIO pin so only one is high at at time, and then address the relevant accelerometer and the pull a reading from it.

Correct.

I suggest to use arrays to store the data and the output pin numbers used for the address select inputs. That way, one array index can point to any particular sensor.