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



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;
    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


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

  • 1
    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

1 Answer 1


Accelerometer static errors are usually not anywhere near that large, so I suspect your scaling code is not behaving correctly. You could verify this by turning the accelerometer on its side and see if the Z axis retains a +7G value, or if the X/Y axis instead becomes too large.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.