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
Why the first fix can take a while
A common misconception is that GPS satellites track you. They cannot, because the system is one way: the satellites broadcast and your receiver only listens, so the satellites have no idea how many people are using them or where they are. When an app records your location, it is the phone that knows where it is and the app or network that passes that on. Another misconception is that GPS needs the internet. A dedicated receiver works in the middle of an ocean with no signal at all, though it may take longer to get going.
The delay comes from the satellites' data rate. Each one sends its navigation message at only 50 bits per second, and the precise orbit details a receiver needs, called the ephemeris, take around half a minute to arrive in full. The coarser almanac describing the whole constellation takes about twelve and a half minutes. A receiver starting from nothing therefore needs patience, which is what older handheld units were known for. Phones avoid this with assisted GPS, downloading the same orbit information quickly over the mobile network so the receiver knows which satellites to look for straight away.
From Sputnik's signal to a free service
The idea behind satellite navigation began by accident. When the Soviet Union launched Sputnik in October 1957, two physicists at the Johns Hopkins Applied Physics Laboratory, William Guier and George Weiffenbach, listened to its radio signal and noticed the Doppler shift as it passed overhead: the frequency was higher as it approached and lower as it moved away. From the exact shape of that shift they could work out the satellite's orbit. A colleague then pointed out that the problem could be run backwards: if the orbit were known, the same Doppler measurements would reveal where the listener was.
That insight became Transit, a US Navy system in service from the 1960s that let ships and submarines fix their position from the Doppler shift of a single passing satellite, though fixes could be an hour or more apart. GPS was designed to do far better, and its opening to civilians followed a tragedy. In September 1983 Korean Air Lines Flight 007 strayed into Soviet airspace and was shot down, killing all 269 people aboard. Soon afterwards President Reagan announced that GPS, then still being built, would be made available for civilian use once complete, to help prevent such navigational errors.
A signal weaker than the noise
By the time a GPS signal reaches the ground it is extraordinarily faint. Each satellite transmits with a few tens of watts, about as much as a household light bulb, from 20,000 kilometres away, and the signal arriving at your phone is weaker than the random radio noise produced by the receiver's own electronics. Yet the receiver hears it. The trick is that every satellite's message is combined with its own pseudorandom code, a sequence of 1,023 on-off pulses that repeats a thousand times a second on the civilian signal. All the satellites broadcast on the same frequency at once, and the codes keep them apart.
The receiver generates a copy of each satellite's code and slides it in time against the incoming signal until the two line up. When they match, the faint signal adds up over many repetitions while the random noise averages away, and the satellite emerges, much as a familiar voice can be picked out in a noisy room. The amount of sliding needed to get the match is the timing measurement. The weakness has a cost. A cheap jammer broadcasting noise on the same frequency can blot out GPS nearby, and faked signals, called spoofing, can mislead a receiver, problems that ships and aircraft in some regions now report regularly.
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.