measuring earth’s magnetic field using a smartphone

5
Measuring Earth’s Magnetic Field Using a Smartphone Magnetometer Simen Hellesund University of Oslo Abstract I use the magnetometers of a smartphone to measure the magnitude of the earth’s mag- netic field. A method for eliminating bias due to internal magnetic fields in the phone is proposed. Keywords : Earth’s magnetic field, magnetometer, Hall-effect. Introduction In recent years, modern smartphones have become packed with sensors: Accelerom- eters, gyroscopes, microphones, cameras, proximity sensors, and more. Most people are walking around with a potential lab- oratory in their pocket, the like of which would have been the envy of any experi- menter in times gone by. In recent years, numerous papers have been published de- scribing smartphone-based experiments for educational purposes, utilising the various sensors of the smartphone [1–7]. Magnetometers, sensors for measuring magnetic fields, have become ubiquitous in smartphones. These magnetometers are what enables the phone’s compass to func- tion. Several papers have also been pub- lished describing how such sensors could be used in education [8–11]. The magnetometers used in smartphones utilise the so-called Hall-effect to operate. This effect was first demonstrated by Ed- win Hall in 1879. When a current is flowing through a thin foil of semiconductor mate- rial, a voltage difference will arise perpen- dicular to the direction of the current in the presence of a magnetic field perpendicular to the semiconductor foil [12]. This voltage is linearly dependent on the strength of the magnetic field. Today, the material needed to make a Hall-sensor sensitive enough to measure the strength of the earth’s mag- netic field is small enough to fit inside a mobile phone. Most phones will, in fact, contain three magnetometers, one for each spatial direction. There are a plethora of apps available for accessing the instantaneous readings of a phone’s magnetometer. For this experi- ment, the app named Physics Toolbox Mag- netometer [13], available in the Google Play store, is used. The simplest way of measur- ing the field strength of the earth’s mag- netic field would be to simply take the vec- 1 arXiv:1901.00857v1 [physics.ed-ph] 13 Dec 2018

Upload: others

Post on 19-Apr-2022

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Measuring Earth’s Magnetic Field Using a Smartphone

Measuring Earth’s Magnetic Field Usinga Smartphone Magnetometer

Simen HellesundUniversity of Oslo

Abstract

I use the magnetometers of a smartphone to measure the magnitude of the earth’s mag-netic field. A method for eliminating bias due to internal magnetic fields in the phone isproposed.Keywords: Earth’s magnetic field, magnetometer, Hall-effect.

Introduction

In recent years, modern smartphones havebecome packed with sensors: Accelerom-eters, gyroscopes, microphones, cameras,proximity sensors, and more. Most peopleare walking around with a potential lab-oratory in their pocket, the like of whichwould have been the envy of any experi-menter in times gone by. In recent years,numerous papers have been published de-scribing smartphone-based experiments foreducational purposes, utilising the varioussensors of the smartphone [1–7].Magnetometers, sensors for measuring

magnetic fields, have become ubiquitousin smartphones. These magnetometers arewhat enables the phone’s compass to func-tion. Several papers have also been pub-lished describing how such sensors could beused in education [8–11].The magnetometers used in smartphones

utilise the so-called Hall-effect to operate.

This effect was first demonstrated by Ed-win Hall in 1879. When a current is flowingthrough a thin foil of semiconductor mate-rial, a voltage difference will arise perpen-dicular to the direction of the current in thepresence of a magnetic field perpendicularto the semiconductor foil [12]. This voltageis linearly dependent on the strength of themagnetic field. Today, the material neededto make a Hall-sensor sensitive enough tomeasure the strength of the earth’s mag-netic field is small enough to fit inside amobile phone. Most phones will, in fact,contain three magnetometers, one for eachspatial direction.There are a plethora of apps available

for accessing the instantaneous readings ofa phone’s magnetometer. For this experi-ment, the app named Physics Toolbox Mag-netometer [13], available in the Google Playstore, is used. The simplest way of measur-ing the field strength of the earth’s mag-netic field would be to simply take the vec-

1

arX

iv:1

901.

0085

7v1

[ph

ysic

s.ed

-ph]

13

Dec

201

8

Page 2: Measuring Earth’s Magnetic Field Using a Smartphone

tor sum of the field strength contributionsin each spatial direction. This is done au-tomatically in the Physics Toolbox Magne-tometer app. However, when testing theapp with the smartphone used in this exper-iment, I observe that the physical orienta-tion of the phone has a noticeable effect onthe field strength readings. This indicatesthe presence of systematic offsets in themagnetometer sensors, or constant mag-netisation of the phone. I suggest a methodto eliminate these effects, thus achieving amore accurate measurement.

Experimental Setup

The only equipment needed to perform theexperiment is a smartphone with a mag-netometer app installed. The phone usedhere is a Motorola Moto g6 Plus, shown inFigure 1. The approximate location of themagnetometer sensors in the phone is de-termined by moving a test magnet acrossthe surface of the phone. The magnetome-ter reading spikes at the closest approachof the test magnet to the magnetometer.The approximate location of the sensors ismarked in blue in the Figure. This locationis not critical to the experiment.The coordinate system of the magne-

tometer app is as follows: The positive x-direction is defined as pointing directly leftto right in the plane of the phone screen.The y-direction also lies in this plane and ispointing directly upwards along the screen.The z-direction is perpendicular to the x-y-plane and is pointing directly out of thescreen. This coordinate system is drawn inFigure 1.

Figure 1: Experimental setup. The tripodseen in the picture was not usedin the experiment.

Procedure

As mentioned in the previous section, themagnetic field strength reading of the mag-netometer app is found to be quite stronglydependent on the orientation of the smart-phone. This means that the magnetic fieldmeasured by the magnetometer will be thesum of the earth’s magnetic field Bearth andthe constant magnetic offset Boffs in thephone:

Bmeas = Bearth +Boffs . (1)

If the phone is flipped such that the mag-netic field is measured in the opposite di-rection, the offset term will be the same,but the sign on the contribution from theearth’s magnetic field will change:

Bπmeas = −Bearth +Boffs . (2)

The constant offset Boffs can be eliminatedby adding Equations 1 and 2. The magnetic

2

Page 3: Measuring Earth’s Magnetic Field Using a Smartphone

field of the earth is then taken as the meanof the two measurements:

Bearth =Bmeas +Bπ

meas

2. (3)

The smartphone contains three magne-tometers, one for each spatial direction. Tominimise the effect of potential miscalibra-tion of any one of the sensors, the mea-surement is performed individually for eachsensor. This is done by orienting the smart-phone such that only the magnetometer inquestion has a reading.I was not able to find any information

on the resolution of the analog to digitalconverter of the magnetometers. This un-certainty is assumed to be lower than thereadout uncertainty of the measurement;as I am not able to hold the phone com-pletely still during the measurement, thefield strength reading fluctuates somewhat.The field strength is thus determined to thenearest µT.The experiment was first performed in-

doors. This yielded inconsistent results,possibly due to a permanent magnetisationof the building in which the experiment wasdone. Iron rebars in the concrete of thebuilding, for example, may have obtained apermanent magnetisation. The experimentwas therefore moved outside.The experiment was also first performed

by attaching the phone to a camera tripod,using a clamp. The tripod allows for ac-curate orientation of the phone in all di-rections. The tripod used can be seen inFigure 1. However, the metal legs of thetripod were found to be magnetised. Thismagnetisation interfered with the measure-ments. The tripod was therefore aban-doned in favour of simply orientating thephone by hand.

Results

The results of the measurements can befound in Table 1. Two measurements areperformed for each magnetometer accord-ing to the procedure described in the pre-vious section. Taking the average of eachsuch pair of measurement removes the con-stant offset due to internal magnetic fieldsin the phone. This gives one value forthe magnetic field strength of the earthfor each magnetometer. These values arestored in Table 2. Taking the average ofthese three measurements gives the finalmeasurement of the earth’s magnetic field:Bearth = 50.5± 0.4 µT. The uncertainty onthe measurement is found by adding the un-certainties on the individual measurementsin quadrature. The field strength obtainedis reasonable for Oslo, Norway, where theexperiment is performed.

Direction Bmeas [µT]x 47±1xπ −53±1y 51±1yπ −52±1z 51±1zπ −49±1

Table 1: Magnetic field strengthmeasurements.

Measurement (dir.) Bearth [µT]1 (x) 50.0±0.72 (y) 51.5±0.73 (z) 50.0±0.7

Table 2: Magnetic field strength measure-ment. Averaging out constantoffsets.

3

Page 4: Measuring Earth’s Magnetic Field Using a Smartphone

Conclusion

In this article, I demonstrate an economicexperiment for measuring the earth’s mag-netic field. The only equipment needed is asmartphone with magnetometer sensors. Amethod is shown to eliminate the effect ofinternal magnetic fields in the phone.Students taking an experimental course

on electromagnetism can, for example, usethis method along with other methods formeasuring the earth’s magnetic field, tocheck their results. The experiment alsoprovides an opportunity for students topractice estimating uncertainties and sys-tematic errors.Steps should be taken to perform the ex-

periment away from any potential sourcesof magnetic contamination.

References

[1] K. Hockberg et al. The spinning disc:studying radial acceleration and itsdamping process with smartphone ac-celeration sensors. Phys. Educ., 49,2014. 137.

[2] T. Pierratos and H. M. polatoglou.Study of the conservation of mechani-cal energy in the motion of a pendulumusing a smartphone. Phys. Educ., 53,2018. 015021.

[3] J. Kuhn et al. iRadioactivity - possi-bilities and limitations for using smart-phones and tablet pcs as radioac-tive counters. The Physics Teacher,52(6):351–356, 2014.

[4] J. Kuhn and P. Vogt. Analyzing acous-tic phenomena with a smartphonemicrophone. The Physics Teacher,51(2):118–119, 2013.

[5] J. Kuhn and P. Vogt. Analyzing springpendulum phenomena with a smart-phone acceleration sensor. The PhysicsTeacher, 50(8):504–505, 2012.

[6] J. A. Sans et al. Oscillations stud-ied with the smartphone ambient lightsensor. Eur. J. Phys., 34. 1349.

[7] J. C. Castro-Palacio et al. Usinga mobile phone acceleration sensorin physics experiments on free anddamped harmonic oscillations. Ameri-can Journal of Physics, 81(6):472–475,2013.

[8] E. Arribas et al. Measurement ofthe magnetic field of small magnetswith a smartphone: a very econom-ical laboratory practice for introduc-tory physics courses. Eur. J. Phys.,36, 2015. 065002.

[9] S. Arabasi and H. Al-Taani. Measur-ing the earth’s magnetic field dip an-gle using a smartphone-aided setup:a simple experiment for introductoryphysics laboratories. Eur. J. Phys., 38,2017. 025201.

[10] B. Setiawan et al. Measurement of 3-axis magnetic fields induced by currentwires using a smartphone in magneto-statics experiments. Phys.Educ., 52,2017. 065011.

[11] R. D. Septianto et al. Utilisation ofthe magnetic sensor in a smartphonefor facile magnetostatics experiment:magnetic field due to electrical cur-rent in straight and loop wires. Phys.Educ., 52, 2017. 2017.

[12] E. H. Hall. On a new action of themagnet on electric currents. AmericanJournal of Mathematics, 2(3):287–292,1879.

4