Many Android phones (maybe even most?) come with a built-in magnetometer that lets them measure the Earth’s magnetic field strength and direction, and determine both magnetic and true directions for the phone. I thought I’d take a look at some of the basic issues associated with its use.
First off, the magnetometer needs to be re-calibrated on a regular basis:
- The magnetometer readings can “drift” with time
- Exposure to a strong magnetic field can alter its characteristics
- Every battery has a unique magnetic signature, so replacing the battery can require re-calibration
Figure 1: The compass calibration procedure can be accessed from the Settings menu, Location & Security => Calibration Compass. It’s kind of an annoying process requiring you to rotate the Android unit back and forth along the three possible axes of rotation until you get a message indicating that calibration is complete. On my unit, there’s a demo animation that shows you how to do this; one frame of this is the picture at left. Some apps (like Snaptic’s Compass) offer a simplified calibration procedure that involves a simple figure-8 movement of the unit; I’ve found that this procedure often doesn’t fully calibrate my Droid X compass, so I always do the standard full calibration.
I’ve found one quick and easy way to check my unit’s compass calibration. It requires that you have a regular old-fashioned magnetic compass available; doesn’t have to be an expensive one, just good enough to tell you clearly which direction is magnetic north. Next, start up the Snaptic Compass, and set it to display magnetic north. In a location away from any large hunks of iron-containing metal, which can shift magnetic fields, orient both the Android phone and the magnetic compass so that they point towards magnetic north (Figure 2):
Even a cheap compass will give you an accurate heading towards magnetic north, so if the phone and compass disagree, as they do above, it’s the phone that’s wrong. BTW, I deliberately miscalibrated the phone’s compass by doing the calibration procedure next to a large hunk of magnetic metal, my car; when you do a calibration, you should do it as far away from any magnets or magnetic metals as possible (e.g. iron, steel, nickel).
You need to be careful to leave some distance between the phone and the compass when you do this test; otherwise, the magnetic compass needle can affect the phone’s reading: (Figure 3)
After re-calibrating the phone, and repeating the test above (Figure 4):
Unfortunately, the screen contrast on the phone sucks in this photo, so you barely see the Snaptic Compass dial. But hopefully you can see that, unlike the first pic above, both compass and phone are oriented in the same direction when both indicate north.
When I use a compass app on my Android, I choose one that lets me set either true or magnetic north, and always stick with true north. True north is always the direction towards the North Pole, while magnetic north points towards the magnetic north pole, a direction offset from true north by the magnetic declination (see yesterday’s post for more on this). But some apps have no setting for true or magnetic north, and won’t necessarily tell you which kind of direction they’re using for north. For example, Smart Measure has a built-in heading meter, and it displays the magnetic direction instead of the true direction; you’d have to add the “magnetic declination” to that heading to get the true direction. And at least one app I’ve run across has a setting that lets you choose between true and magnetic north, but always displays magnetic north. The difference between the two direction angles varies depending on where you are, but is often greater than 10 degrees.
I’d like to see all app writers either use only true north, or give the option between true and magnetic north,. But until that happens, here’s a simple way to check which kind of direction an app is using:
Figure 5: Install the Snaptic Compass app on your Android unit, set it to show true north in the Settings menu, then rotate the unit until it’s pointed directly at true north. Don’t move it once it’s oriented in the true north directio
Figure 6: Start up the app in question. If the app uses true north, then the direction indicator should show north, the same as the Snaptic Compass. In this case, though, the needle deviates slightly to the east of true north, indicating that it’s displaying magnetic north. The amount of the deviation should be the magnetic declination for your current location, about 11 degrees in this case.