Skip to main content

Project 1: GPS-based NTP server

Source: Microsecond accurate NTP with a Raspberry Pi and PPS GPS

Info

This page describes setting up a GPS module with a Pi. The GPS module needs to have a 3-5V input, with serial AND PPS outputs (5 pins minimum). Example: Adafruit Ultimate GPS Breakout.

Setup:

  1. Install packages:
    sudo apt install pps-tools gpsd gpsd-clients gpsd-tools chrony
    
  2. Add these lines to the end of /boot/config.txt
    # the next 3 lines are for GPS PPS signals
    dtoverlay=pps-gpio,gpiopin=18
    enable_uart=1
    init_uart_baud=9600
    
  3. Add this text to the end of /etc/modules:
    pps-gpio
    

These programs and config changes enable PPS time sync inputs on GPIO pin 18 (real Pin 12), and initializes the serial COM port with a baud rate of 9600.

Wire up the GPS module:

Pinout:

  1. GPS PPS to RPi pin 12 (GPIO 18)
  2. GPS VIN to RPi pin 2 or 4
  3. GPS GND to RPi pin 6
  4. GPS RX to RPi pin 8
  5. GPS TX to RPi pin 10

Picture reference (note that all the Pi pins are seqential): raspberry-pi-zero-5-1536x768.png

Check GPS functionality

TBD