What is a GPS Clock - put simply, it's just an electronic device that "talks" to the GPS satellite network orbiting the Earth and in effect, asks the satellites what time it is.
Why bother??
Well mainly - just because I can - or perhaps more accurately, because I can't - I don't really know how this all works, but I thought it might be a lot of fun to find out, and what better way to find out than to build a GPS Clock.
Also - because they are accurate - VERY accurate! Each individual GPS satellite has multiple atomic clocks that contribute very precise time data to the GPS signals. When a GPS receiver receives a signal from one or more satellites all of their clocks contribute times signals to the final time displayed on the GPS Receiver. This enables users to determine the time to within 100 billionth of a second, without the cost of owning and operating atomic clocks. Pretty flash huh??
But having said all that - I doubt my clock will be doing all the hard core number crunching to get accuracy to that level. I won't be taking into account the time it takes for the time signal to travel from the satellite to my clock, nor the time it takes for my clock to interpret the time signal and then display the result. OF course these are trivial in the real world, but when you are talking about time signals accurate to one billionth of a second - they are enormous.
So.....how does one with not a great deal of electronics knowledge or experience go about building something that sounds quite elaborate?
The Answer - Arduino.
So put the thinking cap on - what do I want the clock to do?
I initially just wanted the Time - but the Day and Date would be pretty useful too
As I thought about it more - I realised that seeing as I would need to be talking to the GPS satellites to get the time - I may as well also grab the Latitude and Longitude and display that as well - just for the hell of it.
I will need some way to display all that info - the logical (ie: easiest) way seems to be the ubiquitous Hitachi 44780 type display
They come in multilines and ther are Arduino libraries to interface with them easily. I will probably need three of them - a four line version to display Time - Day - Date, and a couple of two line versions to display Lat/Log on one and Temperature/Humidity on the other - and this Temp/Humidity one will probably double as an "abuse" display should Paul decide to come too near.
Connecting all these things (ie: 3 x LCD Screens, Humidity/Temp Sensor, Proximity Sensor, will take a lot of pins on the Arduino - I have the Uno, which is the smaller version of the Arduino - I may end of having to upsize to the Arduino Mega to get more pins - either that or forget about the stupid Proximity Sensor idea - I'll probably just upsize - there's only a couple of dollars difference.
And as I thought more about controlling it all with an Arduino Microcontroller - I realised it wouldn't be all that difficult to include a Temperature sensor and display the temp as well. IThe Temperature sensor I bought was a DHT21 - it also had an onboard Humidity Sensor - and hence that got added as well.
And that's how it stands at the moment - but who knows what might change as time goes on.
New thought.....
Just for the hell of it, I think I might add a little proximity sensor - I plan to send one of these to my mate Paul as a present - and I'd like to display some sort of abuse on the clock if he comes too close: ie: I can only assume if he comes too close, he intends to in some way interfere with my brilliant creation - and that of course cannot be tolerated!
A quick bit of research reveals the bit of kit I need is an SR-04 Ultrasonic proximity sensor - they can be had a literally a dollar or two on eBay, so they wont break the bank. And if they are anything like the other bits of kit for the Arduino, it shouldn't be too hard to interface with the Arduino board.
Another thing I have just thought about......
Connecting all these things (ie: 3 x LCD Screens, Humidity/Temp Sensor, Proximity Sensor, will take a lot of pins on the Arduino - I have the Uno, which is the smaller version of the Arduino - I may end of having to upsize to the Arduino Mega to get more pins - either that or forget about the stupid Proximity Sensor idea - I'll probably just upsize - there's only a couple of dollars difference.
But of course the elephant in the room is - how am I going to talk to the satellites???
This is one of the main reasons I chose the Arduino - to be honest, the chances of me designing something electronic that communicates with orbiting satellites from scratch is zero, so I knew from the start I'd have to employ somekind of technology that basically does it for me, but leaving me enough to do to make it interesting.
Enter the Arduino GPS Breakout Board!!
There is a great little board that interfaces with the Arduino made by adafruit, called a GPS Breakout Board. They are reasonably pricey, but I couldn't do the job otherwise. Freetronics also make one, which is a little bit cheaper, but from I understand, does pretty much the same thing, so take your pick.
Adafruit Version - and - the Freetronics one.
Obviously I'm only in the thinking about it stage - but it *seems* pretty straightforward to hook up these little fellas. They plug straight into your Arduino board and as soon as you apply power and an antenna - they started automagically looking for satellites. Once they have acquired the satellites, they automagically start communicating with them - tproviding you with a series of packets containing info like Latitude/Longtitude/Alitude and importantly time (not sure yet if time is localised to your location based on Lat/Long, but I doubt it), so then we just need to pull out the info we want, maybe do some calculations, format it and display - and hey presto - super accurate, constantly updated GPS clock :)
Sounds easy ...... :)
Now let's build this thing before I get any more silly ideas.
STOP THE PRESSES....
24 Mar 2020.
I've had another silly idea - while I have been thnking about how I am going to get all this working - I began to consider Real Time Clocks -v- GPS Signals and that lead me to the internal Arduino Clock. I began to wonder how accurate the ticker in the Arduino itself was. Then I came up with an interesting idea - I would display two separate clocks. One would be the time as maintained by a battery powered Real Time Clock (RTC) inside my clock, and the other would be the GPS Clock, displaying the time according to the GPS Satellite Network. This would enable the user to see the difference in time between the two - and I could provide a small reset button which would reset the onboard RTC clock to align with the GPS Clock....I'm still thinking about this, is it a good idea or not?