Magnetic sensor app has wrong unit-of-measure?

Hi @Taifun,

Regarding your magnetic sensor app:

https://puravidaapps.com/magnetic.php

Your documentation lists the unit-of-measure as “nanoteslas”, which would be 10^-9 teslas. Shouldn’t it be in “microteslas”, which would be 10^-6 teslas? Wikipedia says that the earth’s magnetic field is about 25 to 65 microteslas, your app is reading approximately that value, if it were in microteslas, instead of nanoteslas. Also, @Sander0542’s “Phone Sense” app has uT (microteslas) as the unit-of-measure.

Thanks!
BillG

2 Likes

sorry for answering late…

I copied that unit from the Android documentation here
https://developer.android.com/reference/android/hardware/GeomagneticField.html, which might be incorrect then?

Taifun

Hi @Taifun,

No prob regarding your lateness, hope you had a great vacation!

Yeah, I’m thinking that the documentation is wrong. Plus they didn’t proof-read it very well. (Have you heard of a “nonotesla”).

getHorizontalStrength

added in API level 3
float getHorizontalStrength ()
Returns
float Horizontal component of the field strength in nonoteslas.

Also, there are some inconsistencies in the documentation. The SensorEvent documentation seems to indicate microteslas (10^-6):

https://developer.android.com/reference/android/hardware/SensorEvent.html

Sensor.TYPE_MAGNETIC_FIELD:
All values are in micro-Tesla (uT) and measure the ambient magnetic field in the X, Y and Z axis.

Thanks!
BillG

1 Like

thank you @BillG for catching this, I now updated my documentation here https://puravidaapps.com/magnetic.php

The tooltips inside the extension still show the wrong unit… I will have to create a new version of the extension later (this will take some time)…

Taifun