GPS as an accurate time source
GPS is fundamentally a very accurate time-dissemination system. With an appropriate GPS receiver, the clock on a computer can be maintained to within a few milliseconds of UTC. However, consumer GPS units do not provide the “PPS” super-accurate time signal to the computer, because the USB (or serial) connection has no way of transferring it. The OEM version and a little work with a soldering iron is all that’s required.
The OEM GPS unit is the Garmin GPS 18 LVC, about $60. The “LVC” version comes with bare wires, and I wanted to add a couple of LEDs to show some basic status: power, and the super-precise PPS (pulse-per-second) signal. Since the GPS unit will be in an inaccessible place (the roof) I wanted to make sure that I could debug problems without climbing back up to the thing. A good start is to have the “power” LED light only if the thing is actually drawing power (current), not just because the computer happens to be on.
To detect the current, the simplest way would be to put a small resistor (3.6Ω) in line with the GPS power wire, and measure the voltage drop across it. The easiest way to detect this accurately is by using a “Wheatstone bridge” with an op-amp as a comparator (with hysteresis — anti- “bounce” — thrown in).

The machine the GPS will be connected to is the Soekris Net 4801, a low power Geode (x86-compatible) system running on a compact flash card as its disk, and no fans — i.e. no moving parts. The first serial line (COM1) is used as the console, so I need to use the second serial inerface (COM2), which is a 10-pin header on the motherboard. A serial line requires 9 pins, and instead of leaving the 10th pin unused, the engineer who designed the motherboard decided to put +5V on it. Genius! (I want to buy him or her a drink.)
I decided to use 6-pin mini-DIN to connect the GPS to the system. I drilled a 14mm hole in the chassis for the female jack, and soldered the male plug on the GPS. By using 6-pin mini-DIN, any PS/2 keyboard/mouse extension cable will work if it turns out I need a longer cable.

View from solder-side of plug
The yellow wire from the GPS is the PPS signal, and it’s connected to DCD on the serial interface. The NTP daemon (OpenNTPD, with OpenBSD’s nmea(4) driver) is configured to listen on DCD.
Since I don’t know how much current the GPS18’s PPS output can deliver, a buffer is a good idea if driving an LED. In any case, dual op-amp packages cost about as much as single op-amps, so why not?

Buffered PPS LED driver
Here’s the complete circuit on a PCB. The 10 dots (5 rows of 2) are the header pins; a ribbon cable connects them to the 10-pin serial2 header on the motherboard.

Layout on small PCB

Completed interface
Category: hardware