1

I am using the inbuilt magnetometer in my mobile phone for magnetic field readings. I noticed that if I keep my phone stationary at some place even then the values being shown keep on fluctuating. I want to know the reason why this is happening and what can I do to get a constant reading at one place. Graph for change along x-axis Graph for change along y-axis

matrix_017
  • 13
  • 6

1 Answers1

0

The Magnetic Field is affected by Device Orientation. So, if you rotate device in one place, the Magnetic field fluctuates. Below are some links, which can be useful to get constant reading.

How do I get the correct bearing (magnetic orientation) regardless of screen orientation?

https://android-developers.googleblog.com/2010/09/one-screen-turn-deserves-another.html

Convert magnetic field X, Y, Z values from device into global reference frame

Thank you.

  • Let me make it clear that even with no change in orientation the readings keep fluctuating. I repeat a part of the question, "I noticed that if I keep my phone stationary at some place even then the values being shown keep on fluctuating." – matrix_017 May 29 '17 at 11:47
  • Then in that case your phone's magnetic sensor might not be working properly. You should try to test with another phone. – Bimal Bhattarai May 30 '17 at 02:53
  • So, I took your advice and used different phones and different apps for recording the values. But still, the values keep fluctuating. Some apps asked to move the phone in infinity motion for high accuracy, but even after that, they couldn't give an exact value. – matrix_017 May 31 '17 at 11:44
  • How much difference are you getting while reading fluctuates? Also, are you getting fluctuation in all 3 axis? – Bimal Bhattarai Jun 01 '17 at 05:15
  • I have added the graphs for fluctuations in x-axis and y-axis in the question itself. There is a fluctuation in z-axis too. But there is a limit on the number of photos that I can attach. – matrix_017 Jun 02 '17 at 13:05
  • Even if my magnetometer is not working properly, is there a mathematical method to get a single reading? – matrix_017 Jun 06 '17 at 06:16