A quick exercise in understanding and applying GPS data
- Time Required: 2 Hours
- Cost: $75–$150
For makers, it has become quite cheap to incorporate high-quality geospatial data into electronics projects. And in the last few years, GPS (Global Positioning System) receiver modules have grown much more diverse, powerful, and easy to integrate with development boards like Arduino, PIC, Teensy, and Raspberry Pi. If you’ve been thinking of building around GPS, you’ve picked a good time to get started.
HOW IT WORKS
A GPS module is a tiny radio receiver that processes signals broadcast on known frequencies by a fleet of satellites. These satellites whirl around the Earth in roughly circular orbits, transmitting extremely precise position and clock data to the ground below. If the earthbound receiver can “see” enough of these satellites, it can use them to calculate its own location and altitude.
FUN FACT: GPS could not work without Einstein’s theory of relativity, as compensation must be made for the 38 microseconds the orbiting atomic clocks gain each day from time dilation in Earth’s gravitational field.
When a GPS message arrives, the receiver first inspects its broadcast timestamp to see when it was sent. Because the speed of a radio wave in space is a known constant (c), the receiver can compare broadcast and receive times to determine the distance the signal has traveled. Once it has established its distance from four or more known satellites, calculating its own position is a fairly simple problem of 3D triangulation. But to do this quickly and accurately, the receiver must be able to nimbly crunch numbers from up to 20 data streams at once.
Since the GPS system has a published goal of being usable everywhere on Earth, the system must ensure that at least four satellites — preferably more — are visible at all times from every point on the globe. There are currently 32 GPS satellites performing a meticulously choreographed dance in a sparse cloud 20,000 kilometers high.
COUNTING STARS
One evening I built a little Arduino/GPS test gizmo to spy on the GPS satellite constellation. I was able to count all 32 distinct satellites over a 24-hour period, with as many as 13 visible at once. You can grab the sketch from my Github repo and try it yourself with the setup described below.
Share it: #makegps
This article appeared in MAKE Volume 37, page 58.