# phyphox Forums

Full Version: magnetometer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi,
i'd like to use phyphox to verify Biot-Savart law and magnitude of the magnetic field inside a coil with my kids (last year of high school, 19 years old).
I run into some issues:
-i try to set my phone in a certain position in order to have no component of the earth field along a certain direction, for example x axe, so I put it with y axe along a compass needle but i can never see it measuring 0μT. The direction assumed by the phone when the x component of B is 0 is about 25 degrees different from the compass needle one. Is it because of the phone magnetic field?
-when a DC current  (0,45/1,4A) flows, an extra B is visible: it changes up to 34, 35 μT, visible enough on the x window, but it's oscillating and not constant. I really don't know why.

[attachment=17]
in this screenshot I tried with 3V, 6V and 9V and a resistor of 2,5 ohm

any hint?
thank you
I don't have a good explanation for the oscillation, but the fact that you cannot get the axis down to zero looks like you are dealing with a bad calibration.

Absolute measurements with the phone's magnetometer can be tricky because you usually measure fields in the order of the earth's magnetic field, which is rather weak compared to unwanted influences. In fact, there are plenty magnetic fields from within the phone, which can also change from environmental influences (imagine when shopping for clothes you accidentally place your phone on one of those strong magnets that remove anti-theft devices). Therefore the phones try to remove the "permanent" field in the phone from the measurement and they use some kind of calibration algorithm to figure out what this "permanent" field is.

So, a typical behavior you can find on pretty much every device is that when using the magnetometer the first time after not using it for a while (or on some devices after a fresh boot), that there is an offset in one direction (which, if large enough, would prevent reaching zero). If you rotate the phone about all axes while running a measurement, there suddenly is a jump in the curve as the phone notices the incorrect calibration and corrects it.

But there are also some phone-specific behaviors. For example, some phones tend to recalibrate when the field becomes too strong (i.e. 100µT), which prevents measuring stronger fields while others only do not show this behavior.

In the end, the most robust method is to disable the calibration altogether and manually subtract the field measured before applying the field that you want to measure. You can do so in the menu in the top right corner. In any experiment that uses the magnetometer you will find an item "use calibrated magnetometer" or "switch to the raw magnetometer" (or maybe similar). With this setting the calibration from the phone should be disabled - you will quite likely not be able to rotate the field to zero, but also the phone should not mess up your measurement by recalibrating while measuring.

(This option is not present on some older Android phones which do not exhibit the raw magnetometer, but it should work on most phones.)
thank you so much.
I'll try without calibrating.
I'll try also to understand if the right value is the average B (during the oscillation) or the maximum one by comparing row data to theoretical ones.
I hope that someone else will deal with this experience and will share their opinion
Before doing the experiment with the current in the coil you can put your smartphone on a table directed to the south.
I got 41 microT. That's the local strenght of the magnetic field of the earth.
You have to substract it from the mesurements of the magnetic field in the coil.
I got a fairly good value for the magnetic permeability of air using a coil of 10 turns of wire on a plastic bottle.