AXDL345 Notes

SparkFun MEMS SPI/I2C Triple Axis Accelerometer Breakout – ADXL345 $18.95

ADXL345 Hookup Guide

ADXL345 3 Axis, +-2g / +-4g / +-8g /+-16g Digital Accelerometer Datasheet – Analog Devices

ADXL345 Python Module – PyPi

ADXL345 I2C Rpi CircuitPython Module – Adafruit

ADXL345 I2C Rpi Python Module – Adafruit (Depreciated, replaced by circuit python library)

ADXL345 Python Module – Pimoroni (Old and absolute)

3-axis +-16g 13 bit accelerometer up to +-16 g.

Digital output data 16-bit twos complement

Measures the static acceleration of gravity in tilt-sensing applications, as well as

Dynamic acceleration resulting from motion or shock.

High resolution (4 mg/LSB) enables measurement of inclination changes less than 1.0 degrees.

Several special sensing functions are provided:

Activity and inactivity sensing detect the presence or lack of motion and

If the acceleration on any axis exceeds a user-set level.

Tap sensing detects single and double taps.

Free-fall sensing detects if the device is falling.

These functions can be mapped to one of two interrupt output pins.

Integrated, 32-level FIFO buffer can be used to store data to minimize host processor intervention.

GY-291 / ADXL345 weird sensor reading for x, y, z

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?


Say for sensor A:

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
x-axis vertically, static

x-axis = -15 m/s^2
y-axis = -11 m/s^2
z-axis = -20 m/s^2
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.

sensor python-3
edited 51 mins ago
asked 10 hours ago


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 1 hour ago

@joan I’ve added readings for 3 different orientations and the units. – participant 50 mins ago


Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s