Got a new GPS module! It's always amazing how consistent Digikey is when it comes to shipping orders, I ordered the new module on Sunday night and it came in today (Wednesday). With the new module the project is back on track. It only took about 15 minutes to swap out the modules, before doing that I verified the module worked just by hijacking the serial pins of an Arduino Mega:
And it spits out the correct data which is what the project uses to tell time. For those who are interested the GPS module itself just communicates over UART at 9600 baud. The data it transmits is formatted in NMEA sentences, it transmits the GGA, GSA, RMC, and VTG formatted sentences. Different sentences have different data contained in them and in different formats (if you want to know more a great reference can be found here https://www.gpsinformation.org/dale/nmea.htm). In the case of time keeping the most useful sentence is the GPRMC sentence just because it contains both current time (UTC) and date. Here's an example of the raw output from the module:
There's not a lot of work involved interfacing this module with a micro-controller, it doesn't require any configuration commands to operate, the above screenshot is just it's default output. If I wanted to the module could be configured to output different sentences with different information (such as the ZDA sentence which is exclusively time and date) but ultimately there's no additional benefit to doing so.
Getting time out of the RMC string is simple, all we need to do is store the UART data that's received and parse the time out. All the values in the NMEA sentence are comma separated so finding the data we want is just a matter of splitting the string up. Once the time is parsed out it's just a matter of converting to whatever time zone and switching over to a 12-hour format if preferred.
Once the data's parsed out it's just a matter of updating the seven-segment display.
And that's all it really takes to get a functioning GPS clock. I'll release the code in one of next few logs, there's still a few things to add, but the core functionality is there.
Thanks for reading, see you in the next log!