Comments: Alphanumeric GPS Wall Clock

Pages

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • That "day of the week" algorithm was not devised by Tomohiko Sakamoto in 1993, it was "devised" by a German mathematician Christian Zeller in 1883 see Zeller on Wiki

    Here's a generic piece of code in C that implements Zeller's Congruence:

    if (month < 3) { month += 12; year -= 1; }
    dow=(((day+(((month+1)*26)/10)+year+(year/4)+(6*(year/100))+(year/400))-1)%7);
    if (month > 12) { month -= 12; year += 1; }
    

    All variables are ints, and the names should be self-explanatory.

    • Interesting point. I had originally found the code on the determination of the day of the week page on wikipedia. Tomohiko posted the code I used but it does seem it is based off of Zeller's formula. Thanks for the correction! I've update the code bit of the tutorial.

  • -------------------- Tech Support Tips/Troubleshooting/Common Issues --------------------

    Other GPS Lock Problems

    Other lock problems besides being in a building can be from other RF devices. There was someone that had lock problems using one of the Venus GPS receivers because there was interference from their 900MHz XBee transceiver.

    Checking to See How Many Satellites are in View

    You can also test the GPS receiver by using this serial passthrough code [ https://learn.sparkfun.com/tutorials/xbee-shield-hookup-guide#example-communication-test ]. Just make sure to modify the software serial baud rate to your GPS receiver's baud. While it was written for the XBee, it just takes the serial data and sends it to the hardware UART so that you can view on a serial terminal/monitor. Try looking at the GPGGA sentence [ http://aprs.gids.nl/nmea/#gga ] to see if any satellites are in view by streaming the serial data through an Arduino's serial UART onto a serial terminal. The 6th data field will tell you if you have a satellite lock and the 7th data field will show how many satellites are in use.

  • Nice tutorial. Yeah, I also been having GPS locking issues as well further in the new building. I can get a lock outside but I start loosing satellites the further in I go toward the center. =(

  • Member #136296 / about 10 years ago / 1

    You think DST is fun, just wait until you tackle leap seconds!

    http://www.leapsecond.com/java/gpsclock.htm

    But I think my receiver takes leap seconds into account since it matches WWV and I'm sure my clock isn't smart enough to know about leap seconds.

    • Yea - I'm relying on the receiver and the GPS system to handle leap seconds. But I'll have to set some time aside for June 30th 2015 to see what exactly it does.

      • dead-eye / about 10 years ago / 1

        I may be wrong, but I believe the GPS system flat out ignores leap seconds. I remember having a conversation about this with one of the broadcast engineers that I've worked with at one of the various television stations that I've worked at over the years. It's not uncommon now for your local stations to get their "house time signal" from a GPS antenna on the roof somewhere. He told me that our time was off by several seconds now. This was a few years ago, so this may have changed since then.

        • Member #62982 / about 10 years ago * / 1

          You're correct. In order to position accurately, all time received from GPS satelites must be real seconds, not adjusted seconds. Just means that in 50-100 years time, the clock may be a minute out. Although, as leap seconds happen in both directions, it may never get to be a minute out... EDIT: time received. The time broadcast are slightly shorter seconds, as the satellites are travelling at relativistic speeds, and being further away from the massive earth. The signal we receive on the ground is in real seconds.


If you've found an issue with this tutorial content, please send us your feedback!