Raspberry Pi GPS NTP Server

Made with stuff from the junk box

Raspberry Pi on window sill

I had a cheap GPS module (GP-20U7) sitting around when I ran into this page about using a Raspberry Pi as an NTP server with the GPS as a reference.

The GP-20U7 is cheap, but syncs up fast even when it is sitting on a desk pointing in the general direction of the window. The main problem is that it doesn't come with a PPS signal which is needed to use it as a time reference.

I noticed that there was a spot for a resistor and LED on the back labelled PPS. I happended to have some 0603 LEDs and resistors so I soldered them on and the LED blinks once a second when it is synced. Adding a wire connects the PPS to the Rasperry Pi. The right terminal of the resistor (next to PPS) is 3.3V and the right side of the LED (where the wire connects) is PPS. PPS is open-drain so a pull-up is required. If the LED is installed it is the pull-up.

GPS Module LED and wire soldered

The ugly soldering is because I didn't have a microscope when I built this and 0603 LEDs are hard to hand solder.

The power and serial connections are just the terminals from the original JST connector with the shell removed and heatshrink added. The PPS wire uses a female D-Sub pin and heatshrink.

GPIO connections

The GPS module was then held in place with two sided tape on top of the earphone jack. The cover helps hold it in place too.

GPS taped in place

Note that the GPS current draw is near the maximum recommended for the 3.3V rail of the Raspberry Pi 1 I used. If I was doing a better job I would add a regulator to run it off the 5V rail.

Add a WiFi adapter or Ethernet cable and you are done.

Final product

The software setup is pretty much as described on the website mentioned in the first paragraph. It seems to work fine using the GPS for PPS and seconds. I also left one of the default Debian pool.ntp.org servers to get the rest of the time and to have a reference if the GPS signal fails.

gpsmon output ntp status

Windows time diaglog