# Install packages needed
sudo apt install gpsd gpsd-clients pps-tools

###########################
## Add the following lines to /boot/config.txt to set the port used for the PPS h/w input (in this case GPIO pin 18)
# The next lines are for GPS PPS signals
dtoverlay=pps-gpio,gpiopin=18
###########################


###########################
## Add the following to /etc/default/gpsd. Note that in this case we are just using the PPS output and not using the GPS time from the GPS's USB tty device
USBAUTO="false"

# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
# DEVICES="/dev/ttyACM0 /dev/pps0"
DEVICES="/dev/pps0"

# Other options you want to pass to gpsd
GPSD_OPTIONS="-n"
###########################


###########################
## Add the following to /etc/chrony/chrony.conf

# Added for GPS/PPS
refclock SHM 0 delay 0.325 refid NMEA
refclock PPS /dev/pps0 refid PPS

allow 192.168.1.0/24 # my home network
###########################


# Reboot and check everything is working:
sudo ppstest /dev/pps0
gpsmon -n /dev/ttyACM0
chronyc sources && chronyc tracking

See https://austinsnerdythings.com/2021/04/19/microsecond-accurate-ntp-with-a-raspberry-pi-and-pps-gps/ for more details

