Building a GPS System


Thanks to the efforts of brilliant engineers and scientists, GPS (Global Positioning System) is a cornerstone technology in our world today. Whether it's from our vehicle's navigation system or a handheld device while hiking through the woods, we are now able to pinpoint our exact latitude and longitude from satellites orbiting the earth. Pretty crazy, right? Come along with us and learn what it is, how it works and how you can make your own GPS system.

Learn about the history of GPS, how it works and how it came to be an integral technology in today's world.

How does GPS work?

Satellite Distance from EarthAt Medium Earth Orbit (12,550 miles), there are approximately 31 satellites in operation at any given time. This is a relatively large system, run with careful planning and calibration. The principle idea is math. Wait! Let me finish. Your receiver pinpoints location by calculating the distance between you and that satellite. This is done by multiplying the rate of signal (speed of light) by the atomic clock time on the satellite. You can get your location from three satellites, but it will not be as accurate – four satellites are needed to determine your location in three dimensions. Three satellites are needed for x, y and z coordinates, and one satellite to determine the time it took the signal to travel from the satellites to the receiver (see images below).

Four satellites are needed to find an accurate location: X, Y and Z axes, and a clock reading.

Satellite Technology

Ok, cool. So satellites are zipping around spitting out location data, and if I’m in the line of sight then my receiver will tell me my location. Is that it? No, not exactly. We’ve just taken a small step into GPS technology as a whole. We’ve established there are two key parts, satellites and receivers, so now let’s look closer. A receiver is usually a chip that can receive an electromagnetic wave and translate it into readable data. These systems can range from a standalone chip, to a breakout board, to a fancy complete user system, like in a car. If you’re making a project around these types of technologies, you’ll have to understand the three main features they all need to work. For a GPS module you’ll need an antenna, an integrated system to perform math and data communication, and a communication protocol output that feeds to the user or end system.

Satellite Constellations for Major Powers

Antenna

Any wireless communication system will feature the almighty antenna. In short, we’re looking for a conductive metal that, when hit with electromagnetic waves, an electric current inside the conductor will flow. Think of slapping a pool and watching waves ripple on the water. This current flows in a specific way, controlled by the electromagnetic wave. There is an entire engineering discipline dedicated to making antennas, so we won’t go too deep. But, this is an important component for the next part of the system.

Integrated System

There is no exact standard for this portion, but we need electronics to filter out unwanted wave frequencies and read the ones we’re interested in. These systems can be complex, as with GPS-RTK, or simple for regular GPS. A basic recipe would be a filter, signal decoder and some communication output. We use a variety of chips, and each has their own advantages and disadvantages. So how do we communicate with these chips?

Communication Protocols

Let's assume you’ve heard of or have some experience with common communication methods between electronics, like Serial, I2C, SPI, etc. These are hardware-level, computer-to-computer communication methods, but GPS has an extra layer on top. How do we account for many satellites zipping around spitting out their own languages? We introduce GPS communication protocols, which is just a fancy way of saying standardizing. Meet the NMEA-0183 standard: this basically breaks down signals into sentences.

When the signal is decoded into this standard, the once-electromagnetic wave becomes readable to humans. Throw it on communication method lines, and our computer can show us our location.

If you would like to learn even more about GPS, check out our GPS Basics page below.

GPS Basics

December 14, 2012

The Global Positioning System (GPS) is an engineering marvel that we all have access to for a relatively low cost and no subscription fee. With the correct hardware and minimal effort, you can determine your position and time almost anywhere on the globe.
GPS Constellation

Finding your first location


Now that we've covered the basics with GPS, it's time to dive right in. We've put together a simple, effective tutorial to introduce you to the hardware and coding needed to build your first global positioning system.

Displaying Your Coordinates with a GPS Module

April 30, 2019

This Arduino tutorial will teach you how to pinpoint and display your GPS coordinates with a press of a button using hardware from our Qwiic Connect System (I2C).

GPS Geo-Mapping at the Push of a Button

September 27, 2019

Let's ramp up our GPS tracking skills with KML files and Google Earth. We'll make a tracker that logs location and allows us to visualize our steps with Google Earth.

Make sure to look at our hookup guides!

When learning how to use GPS hardware, one of the best ways to learn is to view the hookup guides. For each product SparkFun carries we have an associated hookup guide on the product pages located under the description. We do our best to walkthrough all the connections needed, associated libraries and a working demonstration or two to get your project off the ground.


Step up in accuracy and precision


With technological advances in GPS receivers, we are able to achieve positional accuracy to one centimeter. This is possible through what is called real-time kinematics (RTK). RTK-capable GPS receivers used to be thousands of dollars and were limited to professional surveyors and government groups, but now they can be used by anyone, for a fraction of the cost.

What is GPS RTK?

September 14, 2018

Learn about the latest generation of GPS and GNSS receivers to get 2.5cm positional accuracy!

GPS-RTK2 Hookup Guide

January 14, 2019

Get precision down to the diameter of a dime with the new ZED-F9P from Ublox.

GPS-RTK Hookup Guide

September 13, 2018

Find out where you are! Use this easy hook-up guide to get up and running with the SparkFun high precision GPS-RTK board.

Products


As with any technology, GPS hardware comes in many shapes and sizes to fit the specific needs of your project. Below we have listed a few of our favorite breakout boards, antennas and modules.

Our Creative Technologist Rob takes us through the different types of GPS hardware
and information to help you build the system right for you.

See our GPS Buying Guide

GPS Breakout Boards:

GPS breakout boards are equipped with a receiver, and have the ability to interface with your favorite development boards, such as a SparkFun RedBoard Qwiic.

SparkFun GPS Breakout - ZOE-M8Q (Qwiic)

SparkFun GPS Breakout - ZOE-M8Q (Qwiic)

GPS-15193
$44.95
2
SparkFun GPS-RTK2 Board - ZED-F9P (Qwiic)

SparkFun GPS-RTK2 Board - ZED-F9P (Qwiic)

GPS-15136
$219.95
11
SparkFun GPS Breakout - XA1110 (Qwiic)

SparkFun GPS Breakout - XA1110 (Qwiic)

GPS-14414
$49.95
5
SparkFun GPS Module - Copernicus II DIP (12 Channel)

SparkFun GPS Module - Copernicus II DIP (12 Channel)

GPS-11858
$75.95
3
SparkFun GPS-RTK Board - NEO-M8P-2 (Qwiic)

SparkFun GPS-RTK Board - NEO-M8P-2 (Qwiic)

GPS-15005
$199.95
5
SparkFun GPS Breakout - Chip Antenna, SAM-M8Q (Qwiic)

SparkFun GPS Breakout - Chip Antenna, SAM-M8Q (Qwiic)

GPS-15210
$39.95
2
SparkFun GPS Logger Shield

SparkFun GPS Logger Shield

GPS-13750
$49.95
3
SparkFun Mini GPS Shield

SparkFun Mini GPS Shield

GPS-14030
$6.95

See all GPS Breakout Boards

Antennas:

Some projects require an antenna to better recieve signals from the satellites. Below are some of our favorites.

GPS/GNSS Magnetic Mount Antenna - 3m (SMA)

GPS/GNSS Magnetic Mount Antenna - 3m (SMA)

GPS-14986
$12.95
1
Interface Cable SMA to U.FL

Interface Cable SMA to U.FL

WRL-09145
$4.95
3
SparkFun GNSS Chip Antenna Evaluation Board

SparkFun GNSS Chip Antenna Evaluation Board

GPS-15247
$24.95
1
Molex Flexible GNSS Antenna - U.FL (Adhesive)

Molex Flexible GNSS Antenna - U.FL (Adhesive)

GPS-15246
$3.95

See all GPS Antennas

Modules:

GPS modules are the signal receivers. These modules come without a breakout board, so interfacing with these modules may increase difficulty of a project.

GPS Module - Copernicus II (12 Channel)

GPS Module - Copernicus II (12 Channel)

GPS-10922
$44.95
1
GPS Receiver - GP-20U7 (56 Channel)

GPS Receiver - GP-20U7 (56 Channel)

GPS-13740
$17.95
35
GPS Receiver - GP-735 (56 Channel)

GPS Receiver - GP-735 (56 Channel)

GPS-13670
$45.95
15
GPS Receiver - EM-506 (48 Channel)

GPS Receiver - EM-506 (48 Channel)

GPS-12751
$39.95
12

See all GPS Modules


Additional Projects


Here are a few other projects that use GPS. We are always trying to expand our library of projects and tutorials, so check back often or fill out the form above to be notified of new content.

Getting Started with U-Center for u-blox

September 13, 2018

Learn the tips and tricks to use the u-blox software tool to configure your GPS receiver.

Alphanumeric GPS Wall Clock

January 26, 2015

This is a GPS controlled clock - a clock you truly never have to set! Using GPS and some formulas, we figure out what day of the week and if we are in or out of daylight savings time.

GPS Differential Vector Pointer

May 31, 2016

Use GPS to have two objects, a base and a target, point towards one another. This can be used to aim a directional antenna (or in the case of this project, a laser) from one object to the other object at a distance that is only limited by your ability to provide the base station with the target's GPS location.