ADXL345 returns 0,0,0


Im trying to connect an accelerometer ADXL345 by SparkFun on my Arduino UNO, and it always returns 0,0,0 for the axis x,y,z. Ive tried a lot of codes and none worked. Please somebody help me!

The quickstart code:

And the code that I`m using:

If any of the SPI wires is not making good contact you will likely get 0 or 255 for your inputs.

Double check all your wires, making sure they are wired according to the example. Use a meter to make sure the connections are solid end-to-end.

Now, I`ve reconnected the wires, and the axis x,y,z only returns the same values: -57,15390,-3720 Is there any chance the sensor is damaged? Thanks for helping

You got a different answer when you re-connected your wires which tends to show that you had a bad connection the first time. Try re-connecting the wire again. :slight_smile:

I concluded that the sensor is faulty. All connections were soldered and are good, I've eliminated this hypothesis. The readings are always unstable and no data seems trusted.