-6
\$\begingroup\$

I'm using a cheap BLE accelerometer MPU 6050 that notifies X, Y, Z values as a single attribute. It seems that this type of value hasn't been standardized and I don't know how to read data correctly.

Here are some samples:

  • 0xFF52FFBC36AC
  • 0xFF5CFFD83656
  • 0xFF50FFB83620
  • 0xFF4EFFE43648
  • 0xFF6AFFEC3676
  • 0xFF4EFFEC365A

It is quite obvious, even moving the device that X, Y, Z can be split for example in 0xFF52, 0xFFBC, 0x36AC.

How I should convert it to something usable (signed [g] maybe?)?

I started by putting the device on the plane and rotating only around X axis, and I get these values (quickly collected as draft) for Y and Z (decimal):

|  Rotation Around X |      Y     |         Z           |
|:------------------:|:----------:|:-------------------:|
| 0°                 | 65535 or 0 | 13900 (only g here) |
| 45°                | 56000      | 11100               |
| 90°                | 49000      | 62000               |
| 135°               | 54000      | 52000               |
| 180° (upside down) | 65535 or 0 | 46300               |
| 225                | 8300       | 49000               |
| 270                | 1600       | 63000               |
| 315                | 9400       | 11100               |
| 360                | 65535 or 0 | 13900               |
\$\endgroup\$
3
  • 6
    \$\begingroup\$ Read the data sheet. \$\endgroup\$ – Andy aka Jun 23 '17 at 15:22
  • \$\begingroup\$ I can't find useful information beyond the fact that, with the +-2G scale, 2 bytes for each axis are used. I think this is more a problem of how the manufactured designed the data array sent via bluetooth or a trigonometric problem. \$\endgroup\$ – mattewre Jun 23 '17 at 15:46
  • 1
    \$\begingroup\$ Then look harder at the tables (specifically 6.2). \$\endgroup\$ – Andy aka Jun 23 '17 at 15:52
1
\$\begingroup\$

From the MPU-6000/MPU-6050 Register Map and Descriptions datasheet:

enter image description here

\$\endgroup\$

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