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.
Adjust the Address in the python script i.e def init(self, address = 0x52): vs def init(self, address = 0x54):
Purchase A Second GrovePi+ Shield and Run the Second Accelerometer off that.
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.
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.
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.
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.