Issues with accelero and gyro sensitivity
Posted: Mon Feb 20, 2017 10:43 am
Hi,
I am working on a project to record acceleration and rotation values of a moving object around a vertical axis.
The Sense HAT is equipped with an LSM9DS1 inertial module, and its datasheet states that it has various measurement ranges, each range having its own sensitivity.
For the moment, I'm only working with the accelerometer, and I have this issue : the X, Y, and Z values don't seem to be correct.
For example, with the RPi + SenseHat being still, the following Python 3 code :
returns values like :
Using I2C instead of SenseHat functions returns values like :
I'm aware that sensors can't have 100 % accuracy, but I assume that the z value should be closer to 1, which leads me to my questions :
I am working on a project to record acceleration and rotation values of a moving object around a vertical axis.
The Sense HAT is equipped with an LSM9DS1 inertial module, and its datasheet states that it has various measurement ranges, each range having its own sensitivity.
For the moment, I'm only working with the accelerometer, and I have this issue : the X, Y, and Z values don't seem to be correct.
For example, with the RPi + SenseHat being still, the following Python 3 code :
Code: Select all
from sense_hat import SenseHat
SH = SenseHat()
while True:
acceleration = sense.get_accelerometer_raw()
print("x: " + str(acceleration['x']))
print("y: " + str(acceleration['y']))
print("z: " + str(acceleration['z']))
Code: Select all
x: 0.030790632590651512
y: 0.03836122900247574
z: 0.9808798432350159Code: Select all
x: 35980
y: 23644
z: 45746- Am I doing something wrong ?
- Do I need to use the sensitivity values provided by the datasheet ? And if I have to, how ?
- How to use the sensitivity on the I2C-obtained values to have the "real" ones ?