GPS clock prototyping, part I


Kevin Rye has been working on his GPS clock project and wrote a detailed explanation on his blog describing the build:

The great thing about setting the time and date via GPS is that I won’t have to put any buttons on the clock. It’ll set itself, and appear to be completely autonomous. By removing the buttons needed for entering menus and setting the time and date, I can hopefully make the clock that much smaller. Ideally, I don’t want it to be any bigger than the display itself. In addition, shaving a half inch or so off the PCB should save a few bucks when it comes to getting the PCB made.

Join the Conversation


  1. Wow, that was fast! I just posted that last night! Thanks.

    Hopefully I can finish the alarm and time zone compensation code this weekend. Stay tuned, there’s always something in the works!

  2. It’s a shame that setting TZ by GPS is such a PITA. There appear to be commercial products for it, and some free-but-awful products, but no good free downloadable database of TZ geo boundaries.

    That being said, if you wanted to show local solar time, that’s a simple longitude calculation and might be really cute. :) Also sunrise/sunset calculations are pretty straightforward if you know your location, and that math is all over the place.

    Have you considered comparing your local RTC’s drift against the GPS when its signal is solid, to compensate for that drift when your reference is unlocked? This is a practice known as “disciplining a clock” and there’s a silly amount of literature on the topic, most of which is probably far too serious for a little clock project. But it might get you down from seconds per week to seconds per year in an unlocked condition. (Particularly if you plot drift against temperature, interpolate to a curve, and correct based on that curve.)

    Regardless of future features, it looks gorgeous now, and I appreciate the detailed writeup! Sharing your experiences where they’re searchable helps us all avoid the DenverCoder9 problem. ;)

    1. Nate,

      Sheeesh, I’ve never been able to get straight on this GPS vs. UTC thing. Maybe you can help…

      So does $GPZDA output UTC or not? If it does, how long after the GPS is first locked after never being used before (no stored data) before $GPZDA outputs true UTC? Before $GPZDA outputs true UTC is the time shown off by the number of leap seconds plus-minus since the GPS epoch somtime in 1980? If yes, what is that offset in seconds today (somthing like 20 sec.)?

      If when locked properly, is $GPZDA UTC still off from “standard” UTC by several seconds? I don’t think so. I think at the PPS rising edge it should be within some tens of microseconds?

      Finally, (this one has never been properly defined in my opinion), does the $GPZDA sentence time & date UTC value apply to the previous PPS or the next PPS output?

      Thanks, David

    2. You made a lot of good points. Thanks. I didn’t even consider sunrise/sunset. That’s a cool idea. I also didn’t know about that TZ stuff. I was going to just subtract the hours off the GPS time, but having it do it automatically based on L/L sounds like a cool idea.

  3. Definitely looks like a neat project. I am curious though how you plan to set the alarm, or at least turn it off without any buttons?

    1. I was wondering about using optical sensors, since I’ve seen some pretty tiny ones. His blog was blocked from work so I wasn’t sure if he explained that.

      1. It’s blocked at work? Weird. It’s not blocked at my job and we have the usual office-filtering scheme set up. Does your browser say what it’s being blocked for?. I don’t have anything on my site that’s NSFW so I’m curious as to what it keyed off.

    2. Hi, Jac ! I guess wih an in-display-menu you also don’t need buttons on the device, or perhaps some led’s to indicate the “mode” ?

  4. Hey Kevin –
    This is just about precisely the project I was about to embark on. I don’t want an Alarm clock, I want a high-update GPS interfaced to an LCD as a speedometer on my boat. And this would be perfect, especially since I have zero time to to the development at the moment (and three other projects scattered across the desktop).
    Are you willing to buy an extra PCB when you have them built and sell it to me?

      1. I see you use a graphical display in your design ? it’s a KS0108 type ? I have such a display, like to make also your project, but i understand it’s “work in progress” ? could you update your progress from time to time ? Great project !

    1. Frank,

      Have you considered using a smartphone? GPS speed solutions are typically more accurate than position, as [I’ve been told] they’re computed using phase shifts from the received signals. Unless you need crazy high-dynamics (in which case you’re looking at fancy receivers anyway), I bet an app like Mictale GPS Essentials configured with the dashboard widgets to “huge” would fit the bill. It’s what I use. :)

      1. We have no joke secton here :) this here is for people who like to make things by them selves, it’s more fun that way.

  5. I know that the use of GPS as an accurate timebase is total overkill. The GPS signal sets the time on a DS3231 RTC. I have several other clocks I’ve made using the D3231 and after a year, they are still to-the-minute. As accurate as the DS3231 is, there’s really no need to sync with GPS daily. The reason I’m doing it is because I can, and it’s fun!

Leave a comment

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.