The spatial dependence of magnetic fields in simple configurations is an usual topic in introductory electromagnetism lessons, both in high school and in university courses. In typical experiments, magnetic fields are obtained taking point-by-point values using a Hall sensor and distances are measured using a ruler.Here, we show how to take advantage of the smartphone capabilities to get simultaneous measures with the built-in accelerometer and magnetometer and to obtain the spatial dependence of magnetic fields. We consider a simple set up consisting of a smartphone mounted on a track whose direction coincides with the axis of a coil. While the smartphone is smoothly accelerated, both the magnetic field and the distance from the center of the coil (integrated numerically from the acceleration values) are simultaneously obtained. This methodology can be easily extended to more complicated setups.
Simultaneous use of several smartphone sensorsRecently, the increasing availability and capabilities, and the decreasing cost have contributed to the expansion of smartphone physics. Indeed, smartphone sensors, as accelerometer, gyroscope, magnetometer among others, have been successfully employed in diverse physics experiments ranging from mechanics to modern physics (see, for example, this column in past issues of this journal). One relevant aspect that has received little attention is the fact that smartphones allow to obtain simultaneous measures from several sensors. In previous works, the simultaneous use of the accelerometer and the gyroscope has been proposed [1][2][3][4][5]. More recently, the luminosity sensor has been employed together with the orientation sensor to experiment with polarized light [6]. In this work, a simple experience which combines the use of the smartphone magnetometer and the accelerometer is proposed. The magnetic field generated by a current in a coil is measured with a smartphone located over a cart on a rail whose orientation coincides with the axis of the coil. While the smartphone is moving on the track, its position is readily obtained integrating twice the acceleration values obtained from the accelerometer. In this way, with a simple data processing, the magnetic field as a function of the position is obtained and as a by-product also the permeability. These results can be compared with the predictions of the Biot-Savart law.