Close

Time synchronization

A project log for GPS Nixie Alarm Clock

GPS controlled nixie alarm clock with IR-receiver

tobias-rathjeTobias Rathje 02/01/2016 at 15:540 Comments

When I started the project, it seemed natural to just use DCF77 for time syncronization as this has more or less been the de-facto method for radio controlled clocks here in Europe.

So I just ordered a DCF77 receiver module with included ferrite antenna. I assumed it would be pretty simple to get a signal and decode it, but I never managed to get a stable signal from the receiver.

To be honest, I didn't try that hard... I suddenly remembered having a DCF77 controlled alarm clock many years ago, and why that particular clock is no more. It took forever to sync the time when turned on, and it could suddenly be off by several hours.

Apparently the DCF77 signal is quite susceptible to radio interference and the one bit pr. second protocol feels pretty antiquated today.

So, enter the Ublox NEO6-M GPS module:

These modules are dirt cheap, small, come with antenna, and have a simple RS232 interface and use a standard protocol (NMEA). What's not to like?

Luckily, I used an AVR with an extra UART.

One module ordered, took forever to arrive, but now hooked up in a test setup:

Much easier, faster and stable than DCF77.

However, it does impose a couple of challenges: The GPS time information is UTC only. The ZDA message should be able to provide local time information, but I have not been able to get my module to provide any information in those fields. So time zone and DST must be handled in software, more on that later...

Hardware-wise there are two issues:

The Ublox chip is 3.3V and the board has a 3.3V regulator, but there are no level converters on the board for the RX/TX lines. Since my main board is 5V, I can't just connect the lines directly to the ATmega162. I solved the issue the quick'n'dirty way with two 10k resistors, it works fine.

Another issue is that the board has an obnoxious blue LED which flashes at 1 Hz when the module has GPS fix. I have managed to turn it on permanently with a certain UBX command string, but I have not managed to turn it off. If anyone knows how to to this with the UBX protocol, I would like to hear about it. Yeah, I could just desolder the LED from the board, but it is so damn small, so for now I have just covered it with a patch of duct tape :-)

Discussions