{"id":369,"date":"2017-02-18T13:50:22","date_gmt":"2017-02-18T13:50:22","guid":{"rendered":"http:\/\/www.inguardians.com\/?p=66"},"modified":"2018-11-30T21:05:54","modified_gmt":"2018-11-30T21:05:54","slug":"the-ultimate-arduino-gps-clock-uagc-part-1","status":"publish","type":"post","link":"https:\/\/zed.inguardians.com\/blog\/the-ultimate-arduino-gps-clock-uagc-part-1\/","title":{"rendered":"The Ultimate Arduino GPS Clock (UAGC) – Part 1"},"content":{"rendered":"
Original Post Author: Tom Liston [Twitter: @tliston<\/a>] Doing a Google search<\/a> for “arduino GPS clock” turns up more than a few other projects that use the time information found within the NMEA data<\/a>\u00a0provided by a GPS signal to display the current time and date. So… while this is Yet Another Arduino GPS Clock (YAAGC), I hope that some of the additional programming I\u2019ve done will serve to set it apart from the rest. Additionally, my goal in writing this multi-part blog post is to fully document both the process of building the electronics and the development of the software. I hope to give you \u2013 the reader \u2013 a step-by-step process explaining the development of the hardware and software for this project, So, what is it that sets my “Arduino GPS Clock” apart from the myriad of others on the ‘net? Well, I started off with the basics that any of these projects have:<\/p>\n If you look around, you\u2019ll find that “laundry list” describes pretty much all of the arduino\/GPS clock projects on the \u2018net. But once I got all of that basic stuff working, I took a hard look at what I considered to be the biggest shortcoming of the “standard” clock design: they don\u2019t display local time.<\/p>\n For the most part, these clocks simply act to monitor and display the information contained within the NMEA data output by the GPS module. Most of the time that means that the clock displays UTC time, rather than local time \u2013 so that was the first thing I fixed. Unfortunately, here in the U.S., transitioning the project to “local”; time also entails dealing with the problem of Daylight Saving Time<\/a> (DST).<\/p>\n <\/p>\n My initial fix involved hardcoding a UTC offset into my clock code, and monitoring one of the arduino\u2019s digital inputs as a mechanism for telling the clock that DST was in effect \u2013 i.e. by pulling one of the arduino\u2019s input pins high (don\u2019t worry if you don\u2019t know, exactly, what that means \u2013 just figure that it means connecting a wire between two points in the circuit to tell the arduino to use DST).<\/p>\n Getting that working wasn\u2019t too difficult, but the idea of changing around a jumper on the board to turn DST on and off seemed a little \u2013 well \u2013 wrong. So… that was the next place I turned my attention \u2013 and developed some code to automatically change between standard time and daylight saving time.<\/p>\n Despite the fact that accounting for Daylight Saving Time seems to trip up several<\/a> OS<\/a> manufacturers<\/a>, altering the clock code to correct itself for DST really wasn\u2019t incredibly hard. However, because the transitions to and from DST occur on non-fixed dates<\/a> (DST starts on the second Sunday in March and ends on the first Sunday in November) we need a means of figuring out when specific days occur. All things considered, adding DST-handling to the clock code doesn\u2019t turn out to be incredibly difficult.<\/p>\n Finally, I was terrifically bothered by the idea of hard-coding a UTC offset into the clock code to account for the local time zone. I could, of course, fall back to setting the local UTC offset using jumpers in the circuit \u2013 but once again, that just seems wrong. The local time zone is a function of your physical location… and the clock knows what your geographic coordinates are… Hmmm…<\/p>\n
\nOriginal Date Published: 11 June 2013<\/p>\n
\nbut I also hope to be able to teach you some interesting stuff along the way. For instance \u2013 if you don\u2019t know what NMEA data<\/a> is all about, you\u2019ll learn \u2013 I promise.<\/p>\n\n
\n
<\/center><\/p>\n
\nNote the timezone info…<\/i><\/div>\n