Search code examples
androidsensorsandroid-sensors

Android magnetic sensors gives different values of different devices


I am trying to do an analysis which involves interpreting the results from the various sensors of the Android device. Right now I'm analyzing the magnetic field sensor which should tell me (according to this documentation page) the values of the ambient magnetic field in uT (micro Tesla). Everything is clear so far but on the 2 devices that I tested on (Galaxy S, Galaxy Gio) the results are different. And by different I mean very different.

For example having the same orientation on a table here's what those devices show (just one example):

S2:  -2,12, 60 (approximate values on x,y,z accordingly)
Gio: -2,12,-36 (approximate values on x,y,z accordingly)

Even if I switch positions the results are the same. I also read on this page about the intensity of the magnetic field and I believe that I should have around 50uT given my geographical latitude.

Can someone explain what those sensors mean?

Does someone know how to explain this behavior?

Thank you,

Iulian


Solution

  • I just can confirm the problem.

    As the author of the steady compass application, I have done many tests of magnetic field sensors with different devices. I have found that one of the devices reported an absolute value of mf about 2x the amount reported by other different device under the same conditions.

    I have done a lot of test after phone calibration, and I even put the devices in "airplane mode" trying to minimize electromagnetic interferences coming from the own device. Another comment is that plugging the USB cable on some devices can create important magnetic field variations.

    The worst results that I have seen on a given device (after calibration, airplane mode and USB disconnected) is this: Using a compass application with the device on horizontal plane, I take a reading, rotate phone 90 deg in the horizontal plane and take a new compass reading. Both readings differ in more than 15 degrees!

    Fortunately, not all devices include such a bad sensors. Best devices have errors of about 2-3 degrees after a 90 degrees rotation.

    The conclusion: Unless you are very confident on your magnetic field sensor because you have tested and certified a good behavior, you should give a limited reliability to the readings reported by such sensor.