Navigation & Positioning

GPS

GPS is a satellite-based positioning system that allows electronic devices to determine their location, speed and precise time. GPS receivers are widely used in vehicles, smartphones, navigation systems, tracking devices, drones, robotics, surveying equipment and microcontroller projects.

What Is GPS?

GPS stands for Global Positioning System. It is a satellite navigation system that allows a receiver to determine its position on Earth by receiving signals from satellites.

A GPS receiver does not normally transmit a signal to the satellites. It listens to signals transmitted by the satellites and calculates its position from the information contained in those signals.

GPS Satellites
   │
   │ Radio signals
   ▼
GPS Receiver
   │
   ▼
Position Calculation
   │
   ├── Latitude
   ├── Longitude
   ├── Altitude
   ├── Speed
   └── Time

GPS vs GNSS

GPS is the name of the United States satellite navigation system.

GNSS, or Global Navigation Satellite System, is the broader term for satellite positioning systems.

Other satellite navigation systems include:

  • GPS — United States
  • Galileo — European Union
  • GLONASS — Russia
  • BeiDou — China

A modern GNSS receiver may be capable of receiving signals from several of these systems.

How GPS Works

GPS satellites continuously transmit precisely timed radio signals. A receiver measures the timing information and uses signals from multiple satellites to calculate its position.

Satellite 1 ───────┐
                   │
Satellite 2 ───────┼──► GPS Receiver
                   │
Satellite 3 ───────┤
                   │
Satellite 4 ───────┘
                         │
                         ▼
                  Position Solution

GPS Satellites

GPS satellites orbit Earth and continuously transmit navigation signals.

The receiver uses information from the satellites to determine the distance to each satellite and calculate its position.

The receiver normally needs signals from multiple satellites for a three-dimensional position solution.

GPS Trilateration

GPS positioning is based on measuring distances to satellites and determining the point where the distance constraints intersect. This process is commonly described as trilateration.

             Satellite
                 ●
                / \
               /   \
              /     \
             /       \
            /    ●    \
           / Receiver  \
          /             \
         ●---------------●
      Satellite        Satellite

The receiver combines measurements from multiple satellites to obtain a position solution.

Why GPS Needs Multiple Satellites

A single satellite cannot uniquely determine the receiver's position. Additional satellite measurements provide additional distance constraints.

A practical receiver uses multiple satellite signals to determine latitude, longitude, altitude and receiver clock error.

GPS Position

A GPS receiver can provide geographical coordinates such as:

  • Latitude
  • Longitude
  • Altitude

It can also provide navigation information such as speed, course and time depending on the receiver and its configuration.

Latitude and Longitude

Latitude describes the position north or south of the equator. Longitude describes the position east or west of the reference meridian.

             North
               ↑
               │
West ◄─────────┼─────────► East
               │
               ↓
             South

GPS receivers normally output latitude and longitude in a standard coordinate format defined by their data protocol.

GPS Altitude

A GNSS receiver can calculate an altitude-related position value. However, the reference used by the receiver may differ from the elevation shown by a map or surveying instrument.

Applications requiring accurate elevation should therefore understand the receiver's altitude reference and accuracy specifications.

GPS Speed

A GPS receiver can calculate movement speed from changes in position and from information contained in the satellite navigation solution.

GPS-derived speed can be useful for:

  • Vehicle tracking
  • Navigation
  • Robotics
  • Sports equipment
  • Fleet monitoring

GPS Time

Satellite navigation systems provide extremely accurate timing information.

GPS receivers can therefore provide accurate time to an electronic system even when the system has no Internet connection.

This can be useful for:

  • Data logging
  • Network synchronization
  • Time stamping
  • Measurement equipment
  • Embedded systems

GPS Receiver

A GPS receiver contains the radio-frequency and digital circuitry required to receive satellite signals and calculate a navigation solution.

GPS Antenna
     │
     ▼
RF Front End
     │
     ▼
GNSS Receiver IC
     │
     ▼
Navigation Processor
     │
     ▼
Position Data

GPS Module

A GPS module is a compact board containing a GNSS receiver and supporting electronics.

Many modules provide a serial interface that allows a microcontroller, computer or other host to read position information.

GPS Antenna
     │
     ▼
GPS Module
     │
     │ UART
     ▼
Microcontroller
     │
     ├── Display
     ├── Storage
     ├── Map
     └── Internet

GPS Module UART

Many GPS modules communicate with the host controller using UART.

Typical connections include:

GPS TX ─────────► MCU RX

GPS RX ◄───────── MCU TX

GPS GND ───────── MCU GND

Some applications only require the GPS TX line if the host only needs to receive navigation data.

GPS Baud Rate

The GPS module's UART operates at a configured baud rate.

The microcontroller UART must use compatible serial settings to correctly receive the data.

If the baud rate is incorrect, the received characters will generally appear corrupted.

NMEA GPS Data

Many GPS receivers output navigation information using the NMEA protocol.

NMEA messages are ASCII text sentences containing navigation data.

$GPRMC,...
$GPGGA,...
$GPGSA,...
$GPGSV,...

The exact message types available depend on the receiver and its configuration.

NMEA GGA Sentence

The GGA message contains information related to the GPS fix. It can include parameters such as:

  • Time
  • Latitude
  • Longitude
  • Fix quality
  • Number of satellites
  • Altitude

NMEA RMC Sentence

The RMC message commonly contains recommended minimum navigation data. It can provide information such as:

  • Time
  • Position
  • Navigation status
  • Speed
  • Course
  • Date

GPS Fix

A GPS receiver needs usable satellite measurements before it can produce a reliable position solution.

Common terms include:

  • No fix
  • 2D fix
  • 3D fix

The exact status indicators depend on the receiver and its output protocol.

Cold Start

A cold start occurs when a receiver has little or no useful recent information about its satellite environment.

The receiver may need more time to acquire satellites and obtain the necessary navigation information.

Warm Start

A warm start occurs when the receiver retains some useful information from a previous operation.

This can allow it to obtain a position solution more quickly than a full cold start.

Hot Start

A hot start occurs when the receiver has recent satellite and time information and can quickly reacquire the required signals.

Actual startup performance depends on the receiver, antenna, satellite visibility and stored information.

GPS Time to First Fix

Time to First Fix, or TTFF, is the time required for a receiver to obtain a usable position solution.

TTFF depends on:

  • Receiver design
  • Satellite visibility
  • Startup conditions
  • Antenna performance
  • Stored satellite information
  • Environmental conditions

GPS Antenna

The antenna is one of the most important components of a GPS system. It receives extremely weak satellite signals.

Common antenna types include:

  • Patch antennas
  • Active GPS antennas
  • Passive GPS antennas
  • Helical antennas

Active GPS Antenna

An active GPS antenna contains a low-noise amplifier powered through the antenna connection.

GPS Antenna
   │
   ▼
Low Noise Amplifier
   │
   ▼
GPS Receiver

The receiver or module must provide the appropriate antenna bias supply when an active antenna is used.

Passive GPS Antenna

A passive antenna does not contain an integrated low-noise amplifier.

The receiver's RF input therefore receives the antenna signal directly. Cable length, connector losses and receiver sensitivity can become important considerations.

GPS Antenna Placement

GPS antennas generally perform best when they have a clear view of the sky.

Avoid placing the antenna:

  • Under large metal structures
  • Inside heavily shielded enclosures
  • Immediately next to noisy electronics
  • Where the antenna is obstructed by the vehicle body

The exact installation requirements depend on the antenna and receiver.

GPS Signal Strength

GPS satellite signals arriving at Earth are extremely weak. A suitable antenna and low-noise RF design are therefore important for reliable reception.

Buildings, trees, vehicles and other structures can attenuate or block satellite signals.

GPS Accuracy

Position accuracy depends on many factors.

  • Satellite geometry
  • Atmospheric effects
  • Multipath reflections
  • Antenna quality
  • Receiver quality
  • Environmental obstruction
  • Correction services

A basic consumer GPS receiver should not automatically be expected to provide survey-grade accuracy.

GPS Multipath

Multipath occurs when satellite signals reflect from buildings, vehicles or other objects before reaching the antenna.

Satellite
    │
    │ Direct signal
    ▼
   Antenna

Building
   ▲
   │ Reflected signal
   └──────────────► Antenna

Reflected signals can reduce positioning accuracy.

GPS with a Microcontroller

A GPS module can be connected to a microcontroller through UART.

GPS Module
     │
     │ UART
     ▼
Microcontroller
     │
     ├── LCD
     ├── OLED
     ├── SD Card
     ├── Motor
     └── Wi-Fi

The microcontroller reads the navigation data and can use it in the application.

GPS with ESP32

An ESP32 can communicate with a GPS module through one of its available UART interfaces.

GPS Module
     │
     │ UART
     ▼
ESP32
     │
     ├── Wi-Fi
     ├── Bluetooth
     ├── Display
     └── Internet Server

This combination is useful for tracking and connected navigation projects.

GPS Tracker

A GPS tracker combines a GNSS receiver with a controller and usually some method of storing or transmitting the location.

GPS Receiver
     │
     ▼
Microcontroller
     │
     ├── SD Card
     │
     └── Cellular / Wi-Fi
             │
             ▼
           Server

GPS Data Logger

A GPS data logger stores position information over time.

A typical design can use a microcontroller and SD card.

GPS
 │
 ▼
Microcontroller
 │
 ▼
SD Card
 │
 ▼
GPS Log File

The recorded data can later be processed by a computer or mapping software.

GPS Navigation System

A navigation system can combine GPS position information with digital maps and route calculations.

GPS Receiver
     │
     ▼
Position
     │
     ├──────────────┐
     ▼              ▼
Digital Map     Route Engine
     │              │
     └──────┬───────┘
            ▼
          Display

GPS in Vehicles

GPS receivers are widely used in vehicles for:

  • Navigation
  • Fleet tracking
  • Vehicle location
  • Speed monitoring
  • Route recording

GPS in Drones

GPS/GNSS receivers can provide position information for drones and other autonomous vehicles.

The flight controller can use the position information for navigation, position holding and other supported functions.

GPS in Robotics

GPS can provide outdoor position information for robots.

A robot can combine GPS with other sensors such as:

  • IMU
  • Compass
  • Wheel encoders
  • Ultrasonic sensors
  • LiDAR
  • Camera systems

Combining multiple sensors can improve navigation reliability.

GPS and Compass

GPS position and heading are different measurements.

A GPS receiver can calculate movement direction when the device is moving, but this should not be confused with a magnetic compass measurement when stationary.

A magnetometer can be used when an electronic compass function is required.

GPS and IMU

An inertial measurement unit can provide motion information even when GPS signals temporarily become unavailable.

GPS ───────┐
           │
IMU ───────┼──► Navigation System
           │
Compass ───┘

Sensor fusion can combine these measurements for improved navigation.

GPS and Cellular Tracking

A GPS receiver determines the device's position while a cellular modem can transmit that position to a remote server.

GPS
 │
 ▼
Controller
 │
 ▼
Cellular Modem
 │
 ▼
Internet
 │
 ▼
Tracking Server

GPS itself does not provide the cellular or Internet connection.

GPS Testing

A GPS module can be tested systematically.

  1. Check the supply voltage.
  2. Check the ground connection.
  3. Check the antenna connection.
  4. Place the antenna where it has good sky visibility.
  5. Connect the UART output to a computer or microcontroller.
  6. Check whether NMEA messages are being received.
  7. Wait for a valid position fix.
  8. Verify latitude and longitude.

Testing GPS with a Computer

A UART GPS module can be connected to a computer through a suitable USB-to-serial interface.

GPS TX
  │
  ▼
USB-UART Adapter
  │
  ▼
Computer
  │
  ▼
Serial Terminal

A serial terminal can then be used to inspect the NMEA messages.

GPS Has No Fix

If a GPS receiver outputs data but never obtains a position fix, check:

  • Antenna connection
  • Antenna placement
  • Sky visibility
  • Power supply
  • Receiver configuration
  • Environmental obstruction
  • Startup time

GPS Cannot Receive Data

If no serial data is received, check:

  • GPS power supply
  • Ground connection
  • TX/RX wiring
  • UART baud rate
  • Logic-level compatibility
  • Serial port configuration
  • Module status
GPS TX → MCU RX
GPS RX ← MCU TX
GND    → GND

GPS Position Is Inaccurate

Possible causes include:

  • Poor antenna placement
  • Buildings and obstructions
  • Multipath reflections
  • Poor satellite geometry
  • Weak signal reception
  • Low-quality antenna
  • Receiver limitations

GPS Output Contains Corrupted Characters

Corrupted NMEA messages are commonly caused by incorrect serial configuration.

Check:

  • Baud rate
  • Data bits
  • Stop bits
  • Parity
  • TX/RX connections
  • Logic voltage

GPS Module Faults

Symptom Possible Cause
No power Supply, wiring or module fault
No serial output UART wiring or configuration problem
Corrupted NMEA data Incorrect baud rate or serial settings
No satellite fix Antenna, obstruction or receiver problem
Slow fix Poor sky visibility or startup conditions
Position unstable Weak signals, multipath or poor satellite geometry
Incorrect altitude Normal GNSS altitude limitations or receiver error

GPS Module Replacement

When replacing a GPS or GNSS module, check:

  • Supported satellite systems
  • Supply voltage
  • UART voltage level
  • UART baud rate
  • Antenna connector
  • Active or passive antenna support
  • Update rate
  • NMEA or other protocol support
  • Accuracy specifications
  • Physical dimensions
  • Pinout

How to Select a GPS Module

  1. Determine whether GPS-only or multi-GNSS operation is required.
  2. Determine the required positioning accuracy.
  3. Check startup and acquisition performance.
  4. Check the required update rate.
  5. Check UART or other communication interfaces.
  6. Check supply voltage.
  7. Check antenna requirements.
  8. Check active antenna support if required.
  9. Check supported navigation protocols.
  10. Check operating temperature.
  11. Check physical dimensions.
  12. Check power consumption.

GPS Module Update Rate

The update rate determines how frequently the receiver provides new navigation solutions.

A higher update rate can be useful for applications involving rapidly changing position, but it may increase processing or power requirements.

The maximum update rate depends on the receiver.

GPS Power Consumption

GPS receivers continuously process radio signals and navigation data, so power consumption should be considered in battery-powered products.

Power consumption depends on:

  • Receiver chipset
  • Update rate
  • Tracking mode
  • Satellite systems enabled
  • Antenna amplifier
  • Power-management features

GPS Applications

  • Vehicle navigation
  • Vehicle tracking
  • Fleet management
  • GPS data logging
  • Drones
  • Robotics
  • Marine navigation
  • Outdoor equipment
  • Asset tracking
  • Timing systems
  • Geolocation
  • IoT devices
  • Surveying

Advantages of GPS

  • Provides global positioning information
  • Works without a cellular connection
  • Can provide accurate time
  • Modules are widely available
  • Can interface easily with microcontrollers
  • Useful for tracking and navigation
  • Can be combined with other navigation sensors

Limitations of GPS

  • Satellite signals can be blocked by buildings and other structures.
  • Indoor reception can be poor.
  • Position accuracy varies with conditions.
  • Multipath can introduce errors.
  • Initial acquisition can take time.
  • Basic GPS receivers are not automatically survey-grade instruments.
  • A GPS receiver does not itself provide Internet connectivity.

Common GPS Design Mistakes

  • Installing the antenna where the sky is heavily obstructed
  • Using the wrong antenna type
  • Failing to provide active-antenna bias when required
  • Incorrect UART wiring
  • Incorrect baud rate
  • Ignoring logic-voltage compatibility
  • Expecting instant position acquisition
  • Placing the antenna next to noisy electronics
  • Assuming GPS provides Internet connectivity
  • Expecting consumer GPS to provide survey-grade accuracy

Key Points

  • GPS is a satellite-based positioning system.
  • GNSS is the broader term for global satellite navigation systems.
  • A GPS receiver calculates position from satellite signals.
  • Multiple satellite measurements are required for a useful position solution.
  • GPS modules commonly communicate with microcontrollers through UART.
  • NMEA is a common format for GPS navigation data.
  • GPS receivers can provide latitude, longitude, altitude, speed and time.
  • Antenna placement has a major effect on reception.
  • Buildings and reflected signals can reduce positioning accuracy.
  • GPS can be combined with Wi-Fi or cellular communication for remote tracking.
  • Always check antenna requirements, voltage, interface, update rate and supported GNSS systems when selecting a GPS module.

Continue Learning About GPS

The next pages can cover GPS modules, GNSS, antennas, NMEA, UART communication, GPS coordinates, positioning, tracking, applications, testing, troubleshooting, replacement and selection.