I've two identical GY-291 / ADXL345 sensors. To read the data I use the python-module (https://pypi.org/project/adxl345/). `i2cdetect` detects the sensors at address x53 correctly.

Unfortunately, data for all axis are way off. z stays always constant at 20 m/s^2 and x and y are measuring pitch and roll correspondingly but are way off. For example, if I place the sensor horizontally on the table the x = -5, y = -11, and z = -20 for one sensor and x = -10, y = -11, and z = -20 for the other one.

I've tried the libraries from Pimoroni and Adafruit but to no avail.

I've checked the code on the chips and it reads 345B **** **** PHIL. So, I guess it should be an Analog Devices ADXL345.

Q Any ideas to get the sensors on track?

Edit

Say for sensor A:

1. z-axis aligned vertically, static

• x-axis = -5 m/s^2 (offset by 5 m/s^2)
• y-axis = -11 m/s^2 (offset by 11 m/s^2)
• z-axis = -20 m/s^2
2. x-axis vertically, static

• x-axis = -15 m/s^2
• y-axis = -11 m/s^2
• z-axis = -20 m/s^2
3. y-axis aligned vertically, static

• x-axis = -5 m/s^2
• y-axis = -20 m/s^2
• z-axis = -20 m/s^2

Even when accelerating or decelerating, the sensor's z-axis reads constantly 20 m/s^2.

Edit 1

• black is connected to rPi's ground
• red is connected to rPi's 3V3 pin
• SCL and SDA are connected to the rPi accordingly
• the chip reads 345B #029 4218 PHIL

Edit 2

``````           x    y    z
z-up:    -127 -282 1299
z-down:  -110 -264  762
y-up:    -125   43 1017
y-down:  -128 -594 1043
x-up:     201 -277 1029
x-down:  -448 -278 1034
``````
• You have provided no evidence that anything is wrong. As a minimum you will have to provide readings for different orthogonal orientations so we can determine the units.
– joan
Commented May 3, 2019 at 8:02
• @joan I've added readings for 3 different orientations and the units. Commented May 3, 2019 at 8:23
• I would try different software and also confirm you only have one wired to the I2C bus at any one time. I think the time has come for clear photos of the connections.
– joan
Commented May 3, 2019 at 10:05
• @joan I'm using only one sensor at address x53 at the time and both of the sensors show the weird behavior at the time. Also, employing alternative libs e.g. Pimoroni's and Adafruit's lib for ADXL345 show similar results. There is only a difference in scaling. Commented May 3, 2019 at 10:15
• Need clear photos.
– joan
Commented May 3, 2019 at 10:28

Needs `sudo pigpiod` to start the pigpio daemon before you run it.