Hi everyone. For this Physics 126 Lab, we'll be measuring the strength of an ordinary magnet as it gets closer and farther from a magnetometer. We're going to use the magnetometer that's in your smartphone and an app that allows us to read that data directly. For this lab, you will need a magnet, any refrigerator magnet or other magnet will do. For your phone, something to measure distance with, you only need a few centimeters. And if your clots like me, you need something to protect your phone from dropping a magnet on it. You've probably seen the magnetic field around a bar magnet as represented by iron filings placed down near the magnet and then the filings align with the magnetic field locally. We use magnetic field lines as a representation of both the direction and strength of the magnetic fields. Here is a stylized representation of a bar magnet with the field lines around it. The lines when they are closer together indicate a stronger magnetic field and the direction that they are pointing indicate the direction that the magnetic field is oriented. In this lab, we will be mapping out the magnetic field of an object very much like this. You'll notice that near the poles of the magnet, the field lines are closer together, so the field should be stronger and when you get far away, the field lines spread out, so the field should be weaker. This is the behavior we are expecting. To start collecting data, you will want to open up the Firefox app on your phone. When you do so, it shows you all the sensors that the app has access to on your phone. You'll want to go and find the magnetometer data, which is useful in navigation. To start collecting data, simply hit the play button. This begins collecting a time series of data from each of the magnetometer sensors in the three different directions, horizontal, vertical and out through the phone corresponding to x, y and z. The reading that we want to use is actually the simple setting. This will give us raw numerical values for each of the magnetometer directions, including units in micro Tesla. Okay, now that you're collecting data with your magnetometer, the first thing that you're going to want to do is rotate the phone around in three dimensions. This calibrates the magnetometer for the magnetic field inside the phone. Then place it on a flat non-magnetic surface and cover it. You'll want to take the magnet and hold it about 10 centimeters above the phone and move it around until you find the point where the magnetic field reading is the strongest. At that point, the magnet is directly above the magnetometer sensor in the phone. In my phone, it's in the upper right hand corner here. So then, what you need to do is measure distances from that point in your phone to the magnet at different vertical directions. You'll want to hold it at a single distance, record the magnetometer values off the phone, record the distance, and then repeat this measurement for five other distances, or a total of six. Then, go back and repeat the measurements for those same six distances. Once you're finished with that, take the magnet, place it far away from the phone without touching the phone, measure what the background magnetic field is. And that's just the measurement when the magnet is far away from the phone. To understand our measurements, we'll need to know what the coordinate system for our phone is. This diagram from the Firefox website shows the x, y, and z directions for a phone. Given each individual measurement, you will need to calculate the real magnetic field from the magnet by subtracting off the component of the magnetic field in that direction. So for the x direction here, we take our measured value and subtract off the background magnetic field in the x direction to get the value we want to use. Once you've calculated the corrected magnetic field in all three directions, you can calculate the total magnetic field by using the Pythagorean theorem and calculating the square root of the sum of the squares of the three directions. The theory that we'll use is the magnetic field of a dipole magnet. This is shown in a scaled relationship here where the magnetic field relative to a fundamental measurement drops off like the separation between the dipole magnet and the magnetometer raised to the negative three power or an inverse cubic relationship. In the lower left hand corner, you see a graph of this relationship where small values of r over r0 represent when the phone is near the magnet and large values of r over r0 is when the phone is far from the magnet. The magnetic field should be dropping off. In our lab, we will be analyzing the linearized form of this relationship where we calculate the natural log of both axes. Log r over r0 on the horizontal axis and log b over b0 on the vertical axis. The important thing here is what is the value of b0? In our case, all we are going to do is to assume that b0 and r0 are the measurements when your magnet is closest to your phone. So for the smallest values of r, that's the value of r0. Once you've completed your study of the vertical displacement of the magnetic field, go ahead and measure horizontally from the sensor. In this case, measure flat along the table using the ruler to indicate the distance between the magnet and the magnet'someter in the phone. Try it again for six different distances and each distance you should measure twice separated by some other distances. When you're done with that, again, remove the magnet and the ruler and go ahead and measure the background magnetic field again.