1
\$\begingroup\$

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?

\$\endgroup\$
  • \$\begingroup\$ You are off by one bit. That is pretty normal. \$\endgroup\$ – venny Sep 2 '14 at 10:18
  • \$\begingroup\$ how can it be normal ? I am giving these values to HAL layer and then I am getting x = 0, y = -2.43. z = 12.32 in idle state.Also can you confirm that if I want to detect shocks greater than 8g, i have to put the sensor in 8g mode? \$\endgroup\$ – mrigendra Sep 2 '14 at 10:47
  • 1
    \$\begingroup\$ 6-bit resolution is quite crusty, it gives you quantisation error of \$2.45\, \mathrm{m\cdot s^{-2}}\$. With better resolution, you would get better results. Most accelerometers today are at least 10-bit. For detecting shocks above 8g (but below 16g), use 16g mode. \$\endgroup\$ – venny Sep 2 '14 at 10:57
  • \$\begingroup\$ yes maybe you are right. In 2g mode I am getting an error of 0.6. \$\endgroup\$ – mrigendra Sep 2 '14 at 11:02
  • 1
    \$\begingroup\$ Nexus 4 uses MPU-6050 which has 16-bit resolution and typical, not maximal, zero-g offset of \$\pm 50/\pm 80\, \mathrm{mg}\$. \$\endgroup\$ – venny Sep 2 '14 at 11:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.