Smartphones Magnetic Sensors within Physics Lab

Current smartphones incorporate different types of sensors that allow us to know our spatial position, they give us information about pressure, speed, acceleration, time, acoustic level, and other different physical magnitudes. These smartphones measure each component of the magnetic field, bearing in mind that any current perpendicular to a magnetic field produces a small potential difference, transversal to the said current, being this voltage easily measurable by Hall sensors. With the implementation of three Hall sensors, and an appropriate app, we can measure the three components of the magnetic field vector, and with this we can obtain information and deduce properties of the physical systems considered. In this paper we are exploring the use of smartphones in a physics laboratory for freshman students. To do this, we have measured, using Hall sensors, the magnetic field created by a linear quadrature, and we have obtained, first of all, its dependence on the distance between the quadrupole and the magnetic sensor. The second purpose of this work is to show that the laboratory is a powerful tool that increases the significant learning of freshman students through advanced technological tools.


Introduction
A transformation is required in the practice of teaching, learning and assessment of sciences in general, and Physics in particular, to ensure that students acquire cognitive skills needed for the construction of scientific concepts.Designing teaching strategies that allow students to solve complex problems means that the teacher must develop didactic situations where the students play a more active role in class, as an alternative to the simple memorization of procedural activities, considering the specific needs of university students and taking into account the characteristics of the environment in which they live as antecedents for instructional design [1].To be able to learn adequately, students must feel motivated and willing to actively participate in the learning process.
Hence the crucial point is to promote learning that is meaningful for the student, and preferably using resources of easy access to students, both economically and in the domain of technology.Over the past several decades, educators and researchers have sought many new pedagogical methods to promote interactive learning [2][3][4][5][6][7][8][9][10] and demonstrated their effectiveness through a variety of tools [11][12][13][14][15][16][17].The active participation helps students understand the basic concepts of Physics or any other science.
The carrying out of experiments and data analysis are effective ways to have an interactive and collaborative environment, the application of their own resources and the measurement of the simple phenomena of daily life can increase the students´ interest, while allowing a precise analysis of the data, which can contribute to the generation of scientific thinking and provide a good opportunity for inquiry learning [18].A great variety of responses have emerged for improving laboratory experiences within the physics curriculum [19][20][21][22][23][24][25][26][27][28][29].
With the emergence of technology, we can bring laboratory experiments closer to our students.Mobile devices can provide meaningful assistance to users in their work, study and entertainment.They have been widely used in recent years within the process of instruction in different disciplinary fields [30][31][32], although the effects on learning [33][34][35][36][37][38] and the use given to them in the classroom are still being studied.In education mobile devices are widely used to access, import, organize, edit, simulate, design and share information extracted from the web; in addition to didactic applications designed by the teacher for their use in the classroom they contribute to the reinforcement of the teaching-learning-evaluation process.They allow to manage data collection tools, games/simulation, learning management systems and productivity tools [39].Due to the reasonable cost, size and diverse functions of smartphones, and to the fact that the experimental configuration is simpler compared to traditional measurement techniques, smartphones are becoming the data recorders of portable physics laboratories for a variety of measurements in astronomy, mechanics, thermodynamics, electromagnetism and optics among others, either using the internal sensors of cell phones or diverse applications [40][41][42][43][44][45][46][47][48][49][50].
We are mainly interested in how the smartphones used for performing a physics laboratory practice influenced the traditional learning of electromagnetism.Bearing this in mind, in this work we are going to focus on the design of a laboratory experience to measure the dependence of the magnetic field of a quadrupole on distance employing a smartphone.

Basic Theory
A linear electric quadrupole is a neutral charge system, formed by three charges: one with a value -2q located at the origin of coordinates and two charges of value +q located symmetrically on he x-axis, one at the point (-d, 0) and the other at (+d, 0) as shown in Fig. 1.The total width of the system is 2d.The electric field of this quadrupole at an arbitrary point of the plane P has two components, one radial and the other transversal.For greater simplicity, we will consider the point P on the x-axis at a distance x from the origin of coordinates and then only the radial component that becomes the component x survives.The electric field of this neutral charge system can be obtained using the electric field of two opposite dipoles, one centered on (-d/2, 0) and the other one on (+d/2, 0) [41].In the Appendix, we obtain, in two different ways, the electric and magnetic field of a linear quadrupole of width 2d.The x component of the electric field is To obtain this expression it has been assumed that  ≫ .Being  the electric dipole moment of each of the two dipoles,  = , and k the Coulomb's constant.In fact, we want to study a magnetic quadrupole, for which two magnetic dipoles will be used with the two south poles together, at the origin of coordinates, and with their north poles placed at the points (-d, 0) and (+ d, 0), obtaining a system with zero magnetic dipole moment.A similar expression to Equation (1) can be written for the x-component of the magnetic field vector, replacing the variables appropriately: k for  0 , and  for m  0 being the magnetic permeability of vacuum and m the magnitude of the magnetic dipole moment vector of both magnets, which have previously had to be carefully selected so that they are equal and the magnetic dipole moment is cancelled and the quadrupole moment survives.It is very important that both magnets have the same geometrical and magnetic characteristics.With this information we will proceed to design a Physics practice for first year students of all Engineering and Science Degrees (STEM: Science, Technology, Engineering and Mathematics).The practice is expected to be technologically simple, far from those types of practices in which almost everything is monitored by a computer.Why is this done?Because learning is expected to be as meaningful as possible, and therefore the student must manipulate the elements that form the practice, and must understand the procedures that are being used.The student is not expected to operate mechanically but to learn.

Magnetic sensor
Over the last decade, due to the accelerated proliferation in the smartphone market users demand different functionalities that meet their needs, and they use smartphones not only to make phone calls and send messages, but also for multiple activities [51][52][53].
Smartphones have several internal and external Hall sensors that allow to detect movements, orientation, proximity, luminosity, gravity, environmental conditions and to gather information to facilitate their use [54,55].
The sensors of magnetic field based on the Hall effect are the most used magnetic sensors and allow us to know the linear position, angular position, speed, rotation, current [56][57][58][59] and the three components of the field magnetic [60][61][62][63][64].
It should be noted that the future trends of magnetic sensors should be discussed from these two perspectives: physics and applications, since many of the phenomena exploited by sensors were found in the 1800s and early 1900s, i.e., the Faraday effect , the Hall effect, superconductivity, etc. and the possible routes to improve the performance of magnetic sensors are: new phenomena, new applications of the existing phenomenon, improved materials, higher speed of processing and manufacturing, and, fundamentally, cost [55].

Experimental procedure
Firstly, the magnetic quadrupole must be constructed, this is a system composed of two identical dipoles of equal but oppositely directed moment, so that the magnetic moment of the system is zero, see Figures 1 and 2. It is important to take into account that two identical magnets must be chosen as possible in order to obtain results in line with the theoretical prediction.On the other hand, to carry out this laboratory experience we must prepare the measuring instrument, this is, the smartphone following the steps described in [41].We need to install an application that measures the three spatial components of the magnetic field on the smartphone.Out of all the apps that allow to make these measurements on the internet, we recommend the Magnetometer app, and Physics Toolbox Sensor Suite by Vieyra Software app for smartphone with Android and iOS operating system, respectively [59,65] Since the goal of the laboratory practice is to determine the dependency of the magnetic field on distance, we will consider only a component of the magnetic field, for example, the x-component.In Figure 3 the orientation of the spatial axes on a smartphone is shown.They can be determined through a small discovery process which consists on bringing a small magnet near our phone from different directions and observing the component that varies in the app which measures the magnetic field.Finally, the acquisition of data is completed as follows.The smartphone is placed on a sheet of paper and we draw the corresponding x-and y-axis of the phone passing through the magnetic sensor, Figure 4.Then, the y-axis should be oriented towards the geographic North in order to avoid the magnetic field background coming from the terrestrial magnetic field.If it is impossible to exactly cancel this background, it should be subtracted from our measurements.And lastly, the magnetic quadrupole is placed at different distances and we can write down the value of the x-component of the magnetic field provided by the application.

Results
In this section, we will analyze the results obtained with an iPhone 5 smartphone with the Magnetometer application for two magnetic quadrupoles, that is, they are composed of magnets of different forms and magnetic moments (see Figure 2) Figure 5 shows the graphical representation of the data taken with the magnetic sensor of the smartphone for the x-component of the magnetic field B, in function of the x-distance.This figure also shows the setting of the experimental data with EXCEL, using the option 'potential adjustment', the equation that adjusts the experimental data (B as a function of x), and the correlation coefficient, R, square.In the case of Figure 5a we have used a magnetic quadrupole composed of two neodymium rings (Figure 2a).We have placed the quadrupole 2 cm to 20 cm away from the smartphone.In Figure 5b the results have been obtained with a magnetic quadrupole composed of two ceramic magnets (Figure 2b).In this case, we have placed the quadrupole 2 cm to 10 cm away from the smartphone because the magnetic sensor of the smartphone didn´t detect the magnetic field of this quadrupole for bigger distances.According to the theoretical model (Eq.( 2)), the x-component of the magnetic field of the quadrupole is given by The value of n from the experimental data is approximately -4, this is -4.02 (ring quadrupole) and -4.10 (ceramic quadrupole), which is in total agreement with the theoretical prediction if we consider error calculation, see Table 1.Besides, it is possible to observe that both measurements with different quadrupoles have a very squared correlation close to unit, 0.9976 (ring quadrupole) and 0.9966 (ceramic quadrupole), much higher than the minimum that we require in our student laboratory practices, 0.95.
On the one hand, an objective which is considered sufficient is to be aware that the exponent n is very close to -4.On the other hand, error calculation is an important task in experimental works.For that reason, the students must carry out (calculate) an error analysis of the measurements and results and they must fit the data using the least squared method.Consequently, we must linearize the results obtained in Figure 5, taking decimal logarithms in Eq. ( 3), the following linear expression is obtained log   = log (6 0 ) +   .
If we represent log   versus log , we can obtain information on the exponent of x and its absolute error, through the slope of the linear fitting.In Table 1, we show the results for the corresponding adjustment by least squares to the two quadrupoles used in this practice.As we can see from the results shown in Table 1, the experimental values of the dependency of the magnetic field with the distance are compatible with the expected theoretical value.
The argument of the logarithm (neperian or decimal) should be a dimensionless magnitude, although that fact is discarded here, because it is not relevant.It is recommended to work in the International System of units so as not to have problems with the interpretation of the results.
The students do not know Eq. ( 3), they are told that B is a function of a negative power of the variable x, which they themselves observe, because when decreasing x, B increases.Therefore, students do not know that the exponent of x is -4, and they must obtain this result.Therefore, we have learning by discovery.Students learn it in a highly significant way through their own experience in the laboratory.The Physics laboratory allows meaningful learning as long as the practices are well designed out and not overly sophisticated.

Conclusions
We have used the smartphone as a tool in the Physics laboratory for freshman students, and we have been able to achieve this due to the three Hall sensors that are incorporated these phones.Students are motivated with the use of new technologies, introducing the smartphone to measure the magnetic field through the sensor that these phones usually have, along with a suitable and free app.In fact, the most sophisticated device used is the smartphone, and since most students have one, the practice is also very cheap.
The proliferation of smartphones, almost ubiquitous, and the new sensors that incorporate them make them almost essential in a modern physics laboratory, therefore a laboratory practice has been designed that allows freshman science and engineering (STEM) students to obtain results which are quite accurate and compatible with the underlying electromagnetic theory [41].
Acknowledgments: AB thanks the "Generalitat Valenciana" of Spain (project PROMETEOII/2015/015). IE is grateful to the Ministry of Economy and Competitiveness the help provided through the project DPI2015-66458-C2-1-R. EA thanks the Associated Center UNED Albacete the facilities given for the use of its laboratory.

Appendix A
First, the electric field created by a linear quadrupole will be obtained.Afterwards, using the analogy, the magnetic field of a linear quadrupole will be calculated.Taking into account Fig. 1  Another equivalent way of obtaining this result is through the use of the Legendre polynomials [66,67].The electric potential of the quadrupole of Fig. 1 at any point in space is given by

Figure 1 .
Figure 1.An electric quadrupole is formed by two opposite electric dipoles, being d the separation between the charges and P (x, 0) the point where the electric field is wanted to be calculated.

Figure 2 .
Figure 2. Magnetic quadrupoles used: a) Neodymium rings of 3.5 cm of diameter; b) ceramic magnets of 1.5 cm of diameter

Figure 3 .
Figure 3. Orientation of the spatial axes on a smartphone

Figure 4 .
Figure 4. Experimental assembly: a smartphone, a sheet of paper and two identical magnets pasted by their two north poles.

Figure 5 .
Figure 5. (•) Experimental measures of the magnetic field and (--) potential adjustment of the experimental measures for: a) magnetic quadrupole composed of two neodymium rings; b) magnetic quadrupole composed of two ceramic magnets

Author
Contributions: I.E., E.A. and A.B. conceived and designed the experiments; I.E., R.R-V and J.G-R.performed the experiment; I.E., E.A. and A.B. analyzed the data; I.E., E.A. and R.R-V.wrote the paper Conflicts of Interest: The authors declare no conflict of interest , we can write the x component of the electric field at the point P located on the x-axis x much greater than the parameter d, it can be written discarded, being  ≫ , and electric dipole moment p = qd has been used.If we use the electric quadrupole moment (which is measured in C•m 2 ,  = (2) 2  = 4 2 .The above expression could be written as

Table 1 .
Experimental results of the value of the exponent of x after the corresponding adjustment by least squares