This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Measuring Magnetic Field Strength
#1
Hello,

I'm currently doing a high school experiment on how temperature affects the magnetic field strength of a neodymium magnet and my teacher recommended Phyphox.

I'm planning to simply record the magnetic field strength before and after the magnet is subjected to an extreme temperature change but was hoping for some advice. I understand that the magnetometer has a calibrated and uncalibrated mode but I don't really understand what this means. I cannot tell the difference between it being calibrated and uncalibrated.

Also, it seems like there's a bit of interference regardless of whether or not the magnets are placed nearby so I assume I have to subtract a value for every result I get. And I'm assuming for this type of test, the absolute magnetometer test might be best? I'm not sure how I could use the x, y, and z separately. 

Any advice would be appreciated.

I'm currently testing this using the Samsung Galaxy S9, by the way.

Kind regards,
Eddy
Reply
#2
Your assumption, that you should subtract a reference value and that you should use the uncalibrated magnetometer is quite correct.

In fact, the magnetometer is a rather tricky sensor if you want to get absolute values. The first thing you should do, is to make sure that you know exactly where in your phone the magnetometer is, because the the dipole field of small magnets (not so relevant for "big" ones like the earth) drops rapidly with the distance. To find the magnetometer, you can use an iron nail or something similar, magnetize the nail and move its tip across the surface of your phone until you get a strong reading as you reach the magnetometer. I am emphasizing this, because the magnetometer is never in the center of the device but usually somewhere at the edge of the phone, most often in the top-right or top-left corner.

Now for the really annoying part, the calibration:
The magnetometer in your phone is extremely sensitive as it is designed to be used as a compass. Therefore it can easily resolve 50µT, but it also saturates at few mT. These are very small fields, so any kind of unwanted magnetization will influence your readings. Unfortunately, you phone is full of things that create magnetic fields and that can be easily magnetized (which is why the magnetometer is usually at the edge - far away from those things). If your phone is exposed to a strong magnetic field (like the magnets used to remove theft-protection while shopping for clothes), something might get magnetized and your compass would point in the wrong direction as it sees the permanent magnetization of some components in your phone.

That is why every phone has some strategy to recalibrate. Sometimes you can trigger this. When you are doing a magnetometer measurement and your absolute field is 100µT or more, then you can rotate the phone about every axis (still while measuring) and at some point it will suddenly drop to 50µT as the phone very likely will use the data from the rotation to subtract the constant contribution from the magnetized component. The field from this component is still there, but it is just subtracted in the calibrated data. This is nice as it means that your compass will start working again, but for measurements this can be quite annoying as you try to measure a higher field on purpose.

Therefore, you should switch to the uncalibrated magnetometer, where this would not happen. On some phones, you might not see a big difference, while on others you might see a difference of several 100mT. The downside is that you have to subtract the background yourself. To do this, you should start a measurement without your magnet, note the values and then add the magnet you want to measure. Simply subtract the values that you had without the magnet. However, you need to be careful not to move or rotate your phone as this would change the contribution of earth's magnetic field (or even local contributions - some tables have strong fields from their iron parts) and the values you want to subtract are no longer correct. So, you need to be very diligent to get good results.

Also, since you mention a neodymium magnet: Those can have rather strong fields. I do not expect them to damage your phone, but they will easily saturate your sensor. So, make sure that the magnet is either weak enough (not sure if even the small neodymium magnets are that weak) or far enough from your phone to stay below 2mT. Just make sure that if you would get closer the measured field can still increase. Then, of course, you have to make sure that the magnet is in the same position for every measurement.

Hope, this helps Smile
Reply
#3
(11-25-2019, 12:52 PM)Sebastian Staacks Wrote: Your assumption, that you should subtract a reference value and that you should use the uncalibrated magnetometer is quite correct.

In fact, the magnetometer is a rather tricky sensor if you want to get absolute values. The first thing you should do, is to make sure that you know exactly where in your phone the magnetometer is, because the the dipole field of small magnets (not so relevant for "big" ones like the earth) drops rapidly with the distance. To find the magnetometer, you can use an iron nail or something similar, magnetize the nail and move its tip across the surface of your phone until you get a strong reading as you reach the magnetometer. I am emphasizing this, because the magnetometer is never in the center of the device but usually somewhere at the edge of the phone, most often in the top-right or top-left corner.

Now for the really annoying part, the calibration:
The magnetometer in your phone is extremely sensitive as it is designed to be used as a compass. Therefore it can easily resolve 50µT, but it also saturates at few mT. These are very small fields, so any kind of unwanted magnetization will influence your readings. Unfortunately, you phone is full of things that create magnetic fields and that can be easily magnetized (which is why the magnetometer is usually at the edge - far away from those things). If your phone is exposed to a strong magnetic field (like the magnets used to remove theft-protection while shopping for clothes), something might get magnetized and your compass would point in the wrong direction as it sees the permanent magnetization of some components in your phone.

That is why every phone has some strategy to recalibrate. Sometimes you can trigger this. When you are doing a magnetometer measurement and your absolute field is 100µT or more, then you can rotate the phone about every axis (still while measuring) and at some point it will suddenly drop to 50µT as the phone very likely will use the data from the rotation to subtract the constant contribution from the magnetized component. The field from this component is still there, but it is just subtracted in the calibrated data. This is nice as it means that your compass will start working again, but for measurements this can be quite annoying as you try to measure a higher field on purpose.

Therefore, you should switch to the uncalibrated magnetometer, where this would not happen. On some phones, you might not see a big difference, while on others you might see a difference of several 100mT. The downside is that you have to subtract the background yourself. To do this, you should start a measurement without your magnet, note the values and then add the magnet you want to measure. Simply subtract the values that you had without the magnet. However, you need to be careful not to move or rotate your phone as this would change the contribution of earth's magnetic field (or even local contributions - some tables have strong fields from their iron parts) and the values you want to subtract are no longer correct. So, you need to be very diligent to get good results.

Also, since you mention a neodymium magnet: Those can have rather strong fields. I do not expect them to damage your phone, but they will easily saturate your sensor. So, make sure that the magnet is either weak enough (not sure if even the small neodymium magnets are that weak) or far enough from your phone to stay below 2mT. Just make sure that if you would get closer the measured field can still increase. Then, of course, you have to make sure that the magnet is in the same position for every measurement.

Hope, this helps Smile
Wow, thank you so much for the detailed response!
Reply
#4
To this end, I wonder if it would be possible to add into the software a "zero" function to subtract the current value. Then the phone is left in place and subsequent measurements taken.
Reply
#5
(11-25-2019, 12:52 PM)Sebastian Staacks Wrote: Your assumption, that you should subtract a reference value and that you should use the uncalibrated magnetometer is quite correct.

In fact, the magnetometer is a rather tricky sensor if you want to get absolute values. The first thing you should do, is to make sure that you know exactly where in your phone the magnetometer is, because the the dipole field of small magnets (not so relevant for "big" ones like the earth) drops rapidly with the distance. To find the magnetometer, you can use an iron nail or something similar, magnetize the nail and move its tip across the surface of your phone until you get a strong reading as you reach the magnetometer. I am emphasizing this, because the magnetometer is never in the center of the device but usually somewhere at the edge of the phone, most often in the top-right or top-left corner.

Now for the really annoying part, the calibration:
The magnetometer in your phone is extremely sensitive as it is designed to be used as a compass. Therefore it can easily resolve 50µT, but it also saturates at few mT. These are very small fields, so any kind of unwanted magnetization will influence your readings. Unfortunately, you phone is full of things that create magnetic fields and that can be easily magnetized (which is why the magnetometer is usually at the edge - far away from those things). If your phone is exposed to a strong magnetic field (like the magnets used to remove theft-protection while shopping for clothes), something might get magnetized and your compass would point in the wrong direction as it sees the permanent magnetization of some components in your phone.

That is why every phone has some strategy to recalibrate. Sometimes you can trigger this. When you are doing a magnetometer measurement and your absolute field is 100µT or more, then you can rotate the phone about every axis (still while measuring) and at some point it will suddenly drop to 50µT as the phone very likely will use the data from the rotation to subtract the constant contribution from the magnetized component. The field from this component is still there, but it is just subtracted in the calibrated data. This is nice as it means that your compass will start working again, but for measurements this can be quite annoying as you try to measure a higher field on purpose.

Therefore, you should switch to the uncalibrated magnetometer, where this would not happen. On some phones, you might not see a big difference, while on others you might see a difference of several 100mT. The downside is that you have to subtract the background yourself. To do this, you should start a measurement without your magnet, note the values and then add the magnet you want to measure. Simply subtract the values that you had without the magnet. However, you need to be careful not to move or rotate your phone as this would change the contribution of earth's magnetic field (or even local contributions - some tables have strong fields from their iron parts) and the values you want to subtract are no longer correct. So, you need to be very diligent to get good results.

Also, since you mention a neodymium magnet: Those can have rather strong fields. I do not expect them to damage your phone, but they will easily saturate your sensor. So, make sure that the magnet is either weak enough (not sure if even the small neodymium magnets are that weak) or far enough from your phone to stay below 2mT. Just make sure that if you would get closer the measured field can still increase. Then, of course, you have to make sure that the magnet is in the same position for every measurement.

Hope, this helps Smile


Hi, I am currently trying to determine temperature using my phone as well.

Thank you so much for the detailed response as written above. I still have some questions regarding this problem, though. How do I interpret the X, Y and Z component responses correctly? After doing some quick experiments, it was found that the magnetic field of a cold magnet changes a lot in the Z direction (it went form a large negative value to a slightly smaller positive value, but the results of having a decrease in the absolute magnitude of the field value. 

How do interpret the different components? And would it make sense to only look at one component?

Further, how do I know where the specific X, Y and Z components orientation on my phone are?
Reply
#6
(I have answered in the thread you opened, https://phyphox.org/forums/showthread.php?tid=1829)
Reply


Forum Jump: