I am trying to make a device which can give x, y, z data and also can detect freefall and shock. For that I am using bma220 sensor. I am programming the sensor in 8g as I need shock values < 8g. Now as I put the sensor on a flat surface I expect x and Y to be near to zero while z should be near to 1. But I am getting changes in Y axis continuously. And those changes are almost 1/4 of 1 g so I can not neglect them.
Data directly from the sensor is
x = 0 y = -4 z = 20 x = 0 y = -4 z = 20 x = 0 y = 0 z = 20 x = 0 y = 0 z = 20 x = 4 y = -4 z = 20
The sensor's useful data is invfirst 6 bits in 1 byte, so I am dividing these values by 4 and multiplying with the resolution that is 250 in this case and those values becomes
x = 0 y = -250 z = 1250 //y value is very big x = 0 y = -250 z = 1250 x = 0 y = -250 z = 1250
I need to know what value I should be getting at idle state? Am I wrong somewhere in interpreting something?