Wirebook › Lesson 9 of 18
How does a map know where you are?
Open a map on a phone and a blue dot appears right where you're standing, even in the middle of a field. Nobody told the phone where you are. So how does it know? It listens to satellites shouting the time, and does some very clever maths with circles. Let's find a hidden phone the same way.
Satellites that shout the time
About 31 GPS satellites circle the Earth, roughly 20,200 km up, each going round twice a day. Every one of them carries atomic clocks, and all day and night it sends out the same kind of message: "I'm satellite number 12, here's exactly where I am, and the time right now is…"
Your phone just listens. When a message arrives, the phone checks its own clock. The message was sent a tiny moment ago, and radio waves travel at the speed of light, about 300,000 km every second. So the delay tells the phone how far away that satellite is. You're somewhere on a giant ball around it. Hear a few satellites, and there's only one spot where all their balls meet. That's you. Working out a position from distances like this is called trilateration.
A millionth of a second is 300 metres
Here's the tricky bit. Radio covers about 300 metres in one millionth of a second. If a clock is wrong by even that much, every distance is 300 m out. The satellites' atomic clocks are fine, but your phone has a cheap clock that drifts. The answer is beautiful: listen to one more satellite than you'd need. On a flat map, three rings can only meet at one spot if the clock is right, so the phone tries clock corrections until they do, exactly like the Fix the clock button above. In the real, three-dimensional world you need four satellites: three for where you are, and one to fix the clock. Your phone usually hears many more.
Are the satellites spying on me?
No. GPS only goes one way, like a lighthouse: the satellites send, and your phone listens. They have no idea who is listening, how many phones there are or where any of them are. Your phone works out its own position, quietly, by itself.
The other clues your phone uses
- Nearby Wi-Fi. Your phone can see the Wi-Fi networks around it without joining them. Phone makers keep huge maps of where networks are, so "I can see these five networks" is enough to place you within a few tens of metres, even indoors where satellites can't reach.
- Phone masts. Your phone always knows which masts it's talking to. That's a rough clue, from a few hundred metres in a city to a kilometre or more in the countryside, but it works almost everywhere.
- Other satellite systems. GPS is American. Europe has Galileo, Russia has GLONASS and China has BeiDou, and most phones listen to several, so they often hear 20 or more satellites at once.
- A head start from the internet. Satellites send their own position very slowly. A phone with mobile data can download where the satellites are instead, which is why it finds you in seconds rather than half a minute.
- Motion sensors. In a tunnel, the phone guesses from your last known spot, plus its sensors that feel you moving and turning, until a signal comes back.
The blue dot comes with a pale circle around it. That circle isn't decoration: it's the phone being honest about how sure it is. Small circle, good clues. Big circle, best guess.