Detecting Multiple Accelerometers[Solved]

Hello All,

First post, mostly out of curiosity. I’ve currently got a pair of the ADXL345 Accelerometers and I’m trying to tinker with a python script that can read data from both at the same time. I know they both work as I can swap them out in any of the IC2 Ports and they work flawlessly. I’m a bit at a loss though on how I would go about reading in from both at the same time?

I have three ideas about it, but I’d love the communities input.

  1. Adjust the Address in the python script i.e def init(self, address = 0x52): vs def init(self, address = 0x54):
  2. Purchase A Second GrovePi+ Shield and Run the Second Accelerometer off that.
  3. Purchase or cobble together some sort of jumper cable that will allow me to daisy chain the accelerometers.

As for my code at this point I am simply attempting to tinker with the provide .py files before I build my own to gain an understanding of their operation.

Thanks for the help!

Hi @VanDroid,

Accelerometer sensor adxl345 supports the change of device address. This requires a change of wiring from the sensor in the hardware, which may not be supported in grove module.
Can you send us a picture of the top and bottom of the grove module so that we can reconfirm.
The easiest way to use multiple accelerometer, is to use another accelerometer of a different model, so that it will have a different device address.


Hi @Shoban,

Thanks for responding! I’m attaching images below of my GrovePi+ and the Accelerometers. I should point out that I went ahead and purchased a second GrovePi+ so I do have a second one if necessary.

Grove ADXL345 Top: [Link]

Grove ADXL345 Bottom: [Link]

I appreciate you taking the time to help!

P.S. I’m a new user, so I’m limited in links. I have two other accelerometers from an Arduino kit that I will post right below this one.

These are the other two Accelerometers I have:

Top: [Link]

Bottom: [Link]

My GrovePi+ At Address 4 (Bottom): [Link]

My GrovePi+ At Address 4 (Top): [Link]

I plan to assign the 2nd GrovePi+ to address 3 when it arrives.

Hi @VanDroid,

Sorry for the delayed reply.
It looks like the Grove ADXL345 module that you have posted does not support address change.

However, the other accelerometer that you have posted looks like it can support address change.So you can use the grove accelerometer as one of the sensors which will have the address 0x53 and for the other one connect SDO to VCC (3.3v) and it’ll come on address 0x1D .

Note: You can only use two ADXL345 together as it can only support a maximum of two different addresses.

You can refer to this link for the wiring of other pins of the accelerometer that you have posted.

In order to connect the other accelerometer to GrovePi, you will have to customize your own 4-Pin connector, for which you can refer to the Pin-out diagram of GrovePi here.

Please let us know if this helps,

Hi @Shoban,

No problem! Thank you for the great breakdown! using the info you’ve provided I’ve got both Accelerometers working and bringing their data in!


This topic was automatically closed after 24 hours. New replies are no longer allowed.