Skip to content

Inconsistent (?) Magnetometer readouts

I've noticed that the from the magnetometer for the two PinePhones (BH & CE) I have at hand seem to differ.

This is a call for sensor values to try and find out where the difference in the values comes from (f.e. changes in the revision v1.1 vs v1.2).

I have used this script to gather data while rotating the phone. Make sure the sampling_frequency is set to a high value (f.e. 80)

To measure: Start the script and turn your phone around for a bit to get a number of samples for different directions. Ctrl-C when you want to stop the measurement.

BH edition:

mobian@mobian:/sys/bus/iio/devices/iio:device3$ python3 ~/magnetometer.py 
Starting measurements. Press Ctrl-C to quit
x 2921.62 y -627.21 z -1474.23      ^C
Offsets: x -4780.0 y -3541.0 z -177.0
Weights: x 0.9623243933588761 y 1.0003318951211417 z 1.0403866068346566
Finished
Global minima/maxima:
xmin -7912.00 xmax -1648.00 ymin -6554.00 ymax -528.00 zmin -3074.00 zmax 2720.00

CE edition:

mobian@mobian$ python3 ~/git/magnetometer_test/magnetometer.py
Starting measurements. Press Ctrl-C to quit
x 1162.38 y -579.34 z -2576.73      ^C
Offsets: x -2726.0 y -2791.0 z 1434.5
Weights: x 0.9718856292517007 y 1.0075482093663912 z 1.02190556021235
Finished
Global minima/maxima:
xmin -5862.00 xmax 410.00 ymin -5816.00 ymax 234.00 zmin -1548.00 zmax 4417.00

Summary

Name xmin xmax ymin ymax zmin zmax
devrtz BH -7912 -1648 -6554 -528 -3074 2720
devrtz CE -5862 410 -5816 234 -1548 4417
newton BH -8170 538 -7762 1168 -5455 5372
migmatite -5254 1696 1104 7516 9517 15907
federico -4064 2214 -564 5462 -3568 2728
Edited by Evangelos Ribeiro Tzaras