Uncategorized

AXDL345 Notes

SparkFun MEMS SPI/I2C Triple Axis Accelerometer Breakout – ADXL345 $18.95
https://www.sparkfun.com/products/9836

ADXL345 Hookup Guide
https://learn.sparkfun.com/tutorials/adxl345-hookup-guide?_ga=2.48434913.676536663.1556760594-851658892.1545628477

ADXL345 3 Axis, +-2g / +-4g / +-8g /+-16g Digital Accelerometer Datasheet – Analog Devices
https://www.sparkfun.com/datasheets/Sensors/Accelerometer/ADXL345.pdf?_ga=2.123987277.676536663.1556760594-851658892.1545628477

ADXL345 Python Module – PyPi
https://pypi.org/project/adxl345/

ADXL345 I2C Rpi CircuitPython Module – Adafruit
https://github.com/adafruit/Adafruit_CircuitPython_ADXL34x

ADXL345 I2C Rpi Python Module – Adafruit (Depreciated, replaced by circuit python library)
https://github.com/adafruit/Adafruit_Python_ADXL345

ADXL345 Python Module – Pimoroni (Old and absolute)
https://github.com/pimoroni/adxl345-python
Features

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
https://raspberrypi.stackexchange.com/questions/98160/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?

Edit

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
shareeditflag
edited 51 mins ago
asked 10 hours ago

Comments

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

.END

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