Thursday, 14 November 2013

How do smartphones work out what direction they are pointing? by Ciaran Beggan

Dr Ciaran Beggan is a BGS Geophysicist studying the exciting field (excuse the pun) of Geomagnetism. In this blog post he explains how sophisticated smart phone applications such as maps or augmented reality use measurements of the Earth’s magnetic and gravity fields to work out the orientation of the phone. A typical smart phone has three magnetic field sensors, fixed perpendicular to each other, which are used to work out the local direction of Magnetic North.  In addition, they have three accelerometers which sense gravity to give tilt information and to help work out which way is down.
Three steps to your true path
1. Magnetic and gravity field sensors located within your phone measure the direction of Magnetic North and the downward direction at the phone’s location.

2. Using the GPS coordinates of the phone location and a global map of declination angle (the angle between true north and magnetic north) the application software computes the required correction angle for True North. The declination map typically used in these apps is called the World Magnetic Model (WMM) and is produced by the BGS in association with the US National Oceanic and Atmospheric Administration (NOAA).
If you look closely at the declination map below, you can see several lines (contours) with a zero (‘0’) label. This means there is no angular difference between magnetic north and true north along this line. If the contour is marked with a (‘5’), then the difference is five degrees and so on. The map is fairly complicated which reflects the fact that the magnetic field at the surface is not really a simple bar-magnet, as you might have seen at school, for example.
The magnetic field also slowly changes over time, so the declination map is updated every five years to make sure the angles are correct.
3. Using the declination correction, the application’s map or image as shown to the user on their phone screen can now be correctly orientated to True North, which is what most people expect.

Thus the application software uses the location of the phone from the mobile phone’s nearest base-station or from a GPS reading along with a map of the magnetic declination to work out the orientation of the phone and the direction of True North at the user’s location.
If you look at the declination map again, you can see that correction angle is small in the UK (< 2°) but can be much larger in California (~15°) or in Brazil (> 20°). Users in these areas would quickly become lost if the application software didn’t correct for declination.
BGS produce a number of magnetic map products – you can see them here on our Data and Services pages ( )

No comments: