I am trying to use four of the same accelerometer on the same bus and acquire data from each of them using an SD card. Because I am using four of the same accelerometer I need to be able to differentiate between them and I dont know how to find their specific address. I need the specific address so I can tell my arduino which accelerometer to pull data from. essentially it would pull data from 1 then 2 then 3 then 4 and loop back to 1.
2 Answers
You can't have 4 of those on one bus. The maximum is 2.
The pin SA0 defines the least significant bit of the I2C address. From the datasheet:
7 | SA0 | I2C least significant bit of the device I2C address, I2C 7-bit address = 0x1C (SA0 = 0), 0x1D (SA0 = 1).
In fact, as it states on the Adafruit website (if you'd care to read it sometime):
A is the I2C Address select pin. By default this is pulled down to ground with a 10K resistor, for an I2C address of 0x1C. You can also connect it to the 3Vo pin for an address of 0x1D
If you want more than 2 you will either have to have multiple I2C busses or use an I2C multiplexer (such as this one) to select different branches on the same bus.
- 105,851
- 5
- 82
- 139
Power them on one at a time. They don't take much current to run so a GPIO pin would be more than sufficient.
- 2,813
- 11
- 13