How does GPS know where you are?
TUREFF• •0
Your phone can pinpoint you on a map in the middle of a field with no signal bars at all. It does not send anything to a satellite to do this. It simply listens. Here is how a set of satellites high above the Earth, a few very accurate clocks and some clever geometry let your phone work out where it is.
The satellites
GPS, the Global Positioning System, is run by the United States.
- The satellites orbit about 20,200 km up, each circling the Earth twice a day.
- They are arranged in six orbital planes so that, from almost anywhere on the planet, at least four are in view at once. The baseline design needs 24, and more than that are normally in service.
- Each satellite carries atomic clocks and continuously broadcasts a radio signal saying, in effect, who it is, where it is, and exactly what time it was when the message left.
Other countries run similar systems, including Europe's Galileo, Russia's GLONASS and China's BeiDou. Most modern phones can use several of them, which makes positions faster and more reliable.
Measuring distance with time
Radio signals travel at the speed of light. If your phone knows when a message was sent and when it arrived, it can work out how far it travelled.
- Light covers roughly 300 metres in a millionth of a second, so timing has to be extraordinarily precise. An error of one millionth of a second would put you hundreds of metres out.
- One satellite tells your phone it is somewhere on a giant imaginary sphere centred on that satellite.
Why it needs four satellites
- Two spheres overlap in a circle.
- Three spheres narrow it down to two points, one of which is usually absurd, far out in space or deep underground.
- A fourth satellite fixes a remaining problem: the clock in your phone is cheap and nowhere near as accurate as the satellites' clocks. By using four signals, the phone can solve for its clock error as well as its position, effectively borrowing the satellites' precision.
This process is called trilateration, and your phone does it continuously as you move.
Einstein in your pocket
The satellite clocks need correcting for relativity.
- Because they are moving fast, special relativity makes them tick slightly slower than clocks on the ground.
- Because they are farther from the Earth's gravity, general relativity makes them tick slightly faster.
- The net effect is that they would gain roughly 38 millionths of a second per day. Uncorrected, that would quickly build into errors of kilometres, so the system is designed to allow for it.
Why your phone is sometimes wrong
- Tall buildings block satellites and bounce signals, so a city street can throw your position off.
- Indoors and underground, satellite signals are weak or absent.
- The atmosphere slows the signals slightly, adding small errors that receivers try to correct.
How phones fill the gaps
Your phone does not rely on satellites alone.
- Assisted GPS downloads information about where the satellites are, through the mobile network, so the first fix comes much faster.
- Wi-Fi networks and phone masts nearby give a rough location, which is why your blue dot often appears before satellites have locked on, and why it still works in many buildings.
- Motion sensors help estimate where you have moved between fixes.
A note on privacy
Receiving GPS signals does not reveal your location to anyone. Apps and services that use your location can share it, though, so review location permissions in your phone's settings and switch them off for apps that do not need them.
Have a question about satellites, maps or location settings? Ask in the comments.