How GPS Works: Satellites, Clocks and a Little Relativity
By the BrainSnail editorial team. How these articles are written and checked, and how to tell us when one is wrong.
The map on a phone knows where you are to within a few metres, and it does it without sending anything out. It listens. Around thirty satellites orbiting 20,000 kilometres above the Earth broadcast the time and their own position, continuously, to anyone who can hear, and a receiver turns those time stamps into a location by doing geometry with the speed of light.
Distance from time
Every GPS satellite carries an atomic clock and transmits, many times a second, a message that says in effect: it is exactly this time, and I am exactly here. Radio waves travel at the speed of light, so when the message arrives, the receiver compares the time it was sent with the time it was received. A delay of 70 thousandths of a second means the satellite is about 21,000 kilometres away.
One distance places you somewhere on a sphere around that satellite. Two satellites narrow it to a circle where their spheres cross. Three narrow it to two points, one of which is usually out in space and can be discarded. This is trilateration, and it would be the whole story if the receiver had a perfect clock.
Why it takes four satellites
A phone's clock is nowhere near good enough. An error of one millionth of a second in timing becomes 300 metres of error in distance, and cheap quartz clocks drift by far more than that. Rather than put an atomic clock in every phone, the system treats the receiver's clock error as a fourth unknown alongside latitude, longitude and altitude, and solves for all four using a fourth satellite.
That is why a receiver needs a clear view of at least four satellites, and why it works better outdoors than under trees or between tall buildings. The constellation is arranged in six orbital planes so that from almost anywhere on the surface at least six are above the horizon at any moment. As a side effect, every GPS receiver ends up with the time to within a few billionths of a second, which is why the system also synchronises mobile networks, power grids and financial exchanges.
The clocks that run fast on purpose
The satellites' clocks would be useless if Einstein were ignored. According to special relativity, a clock moving at the satellites' speed of about 14,000 kilometres an hour runs slow relative to one on the ground, by about seven millionths of a second a day. According to general relativity, a clock further from the Earth's mass, where gravity is weaker, runs fast, by about 45 millionths of a second a day. The net effect is that satellite clocks gain about 38 microseconds a day.
That sounds negligible until it is multiplied by the speed of light: 38 microseconds is more than 11 kilometres of position error, accumulating every day. So the satellite clocks are built to tick slightly slowly before launch, at a rate chosen so that in orbit they keep pace with clocks on Earth. GPS is one of the few everyday technologies that would fail within hours if relativity were wrong.
What limits accuracy
A plain receiver in the open is usually accurate to about five metres, and several things account for the rest. The signal slows slightly passing through the charged upper atmosphere and the wet lower one, and the amount varies. In cities the signal can bounce off buildings and arrive by a longer path, an error called multipath. The satellites' positions are known very precisely but not perfectly.
Phones improve on this by combining GPS with the other systems now in orbit, Russia's GLONASS, Europe's Galileo and China's BeiDou, giving them many more satellites to choose from, and by adding corrections from ground stations, wifi and cell towers. Surveyors and farm machinery use a second receiver at a known fixed point to cancel the shared errors and reach accuracy of a centimetre or two.
Where it came from
GPS was built by the United States military from the 1970s, and its full accuracy was deliberately degraded for civilian users until May 2000, when the scrambling was switched off overnight and consumer receivers became ten times more precise. The satellites remain a military system offered free to the world, which is one reason other powers built their own. What a receiver actually does, in order:
- •Picks up time-stamped signals from at least four satellites
- •Converts each delay into a distance using the speed of light
- •Solves for latitude, longitude, altitude and its own clock error
- •Corrects for the atmosphere and, if it can, for reflections
- •Blends the result with other satellite systems and local signals
The takeaway
GPS works by timing radio signals from satellites whose positions and atomic clocks are known, turning delays into distances and distances into a position. It needs four satellites because the receiver's own clock is an unknown, and it needs relativity because without the correction the fix would drift by kilometres a day.