Jump to content
I2Cdevlib Forums

Using two ADXL345s in a project

Recommended Posts

has anyone been able to run two adxl345s at the same time?



I've setup two instances:

ADXL345 accel(0x53);  
ADXL345 accelB(0x1D);

and each runs the initialize function:

  Serial.println(accel.testConnection() ? "ADXL345 connection successful" : "ADXL345 connection failed");
    Serial.println(accelB.testConnection() ? "ADXL345B connection successful" : "ADXL345B connection failed");    




When both are connected, the arduio outputs on the serial:


and that's it. just "Init".


When only one is connected, data is retrieved for the working one, but only one can work at a time. I can read data from either one, but not both at the same time. One is wired with SDO high, to allow it to run on 0x1D, the other is wired to SDO low and runs on 0x53. 



Both are given grd, 3.3v,  Both SCL's are connected in parallel to A5, SDA to A4.



Does the wiring need to be different? Can you run both at the same time?



Link to comment
Share on other sites

Please forgive me... but I would imagine that because of the serial nature of the 12c bus... that it would be somewhat contentious to wire two separate busses in parallel...

I would think it should be in series. The one I am working with has a daisy chain output to pass along uncaptured signals to the next potential device.


Link to comment
Share on other sites

I've never tried to run two at the same time, but one thing that comes to mind (since the wiring seems correct to me) is that perhaps the power requirements for both are higher than the source can provide. They don't take much power and this isn't likely to be an issue unless you're actually providing power from a GPIO instead of a supply pin.


A logic analyzer on the SDA/SCL lines would definitely be helpful.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...