# Accelerometer Z Value off a significant amount, all other values reasonable

I'm using the MPU9255 Accelerometer to measure acceleration in the X,Y, and Z directions. As per the datasheet, I've applied a scaling to the raw digital values based off of whether I specified +- 2G, +- 4G, +- 8G etc. This scaling works fantastically, but there is consistent noise on the Z axis, far greater than that of gravity's 1G of force. Here is a sample output

``````ACCELEROMETER-X
0.7226562500
ACCELEROMETER-Y
0.1523437500
ACCELEROMETER-Z
7.9707031250

ACCELEROMETER-X
0.7460937500
ACCELEROMETER-Y
0.1875000000
ACCELEROMETER-Z
8.0468750000
``````

As you can see, there is about 7G of noise on the Z axis. I calculated the scaling with this code:

``````//Get accelerometer scaling based off of how many G's per of variation the system was tuned to handle
int16_t getAccScalar(int16_t system_scale){
int16_t acc_scalar = 16384;
short scalar = 1;
if(system_scale == ACC_FULL_SCALE_4_G){
scalar = 2;
}
else if(system_scale == ACC_FULL_SCALE_8_G){
scalar = 4;
}
else{
scalar = 8;
}
acc_scalar /= scalar;
return acc_scalar;
}
``````

And then in configuration I use a register writing function with this header:

``````void I2CwriteByte(uint8_t Address, uint8_t Register, uint8_t Data)
``````

and call it with these values

``````I2CwriteByte(MPU9250_ADDRESS,28,ACC_FULL_SCALE_2_G);
``````

Anyone know why this is happening? Thanks and have a squanchy day.

• I suspect are just looking at the 1G from gravity and your scaling is off; What happens when you turn the accelerometer on its side? Jul 9, 2016 at 23:46
• When you turn the accelerometer on its side, all the force transfers to the other axis as expected. But here's the thing, the scaling I'm using is perfect scaling for X and Y, so why is Z so far off? It's the same scaling for all 3 axes. Jul 10, 2016 at 15:28
• The accelerometer scaling value was off from the one that I set as the actual scaling, so scaling was indeed the problem. Thanks. Jul 10, 2016 at 18:19