06 November, 2016

Yet another Arduino clock

Does the world need more Arduino clocks? Maybe not.

But I needed another Arduino project as I had made a K3NG morse keyer. I love this keyer because it is unique in supporting a display where you can see what you send. But I wasn't using the morse keyer all the time, so I wanted the hardware to serve two purposes. That's the excuse for also making a clock.

Its main features are:
  • Controlled by a GPS module outputting data over a serial interface, and handled with the TinyGPS++ library
  • Shows raw GPS data such as UTC time and date, position, altitude, and number of satellites
  • Shows derived GPS data such as 6-digit locator
  • Finds local time and handles daylight saving automatically using the Timezone library
  • Finds local sunset and sunrise, either actual value, or civil, nautical, or astronomical. The library is Sunrise.
  • The clock also gives local solar height based on the Sunpos library from the K3NG rotator controller
  • Finally, the clock also provides the lunar phase based on ideas found here.
The hardware for the K3NG keyer includes a speed pot and a memory bank selector (to the right) as well as four push buttons on top for selecting memories. The pot now controls the intensity of the display, but the bank selector switch is not used. Of the four push buttons, only button 1 is used (later two are used). With it one can toggle the clock through various displays as shown below.

Local time, solar and lunar state
Line 1: Local day, date, time
Line 2: Sunrise, maximum solar elevation (actual solar angle during the day), sunset
Line 3: Civil dawn, local time at maximum solar elevation, civil dusk
Line 4: Lunar phase, arrow showing that it is rising, days since new moon

UTC and position display
Line 1: UTC time, locator
Line 3: latitude, longitude
Line 4: Altitude, number of GPS satellites
Dual time display with local time, UTC time, and locator

What I would like to have as well is an indication of lunar visibility at the actual location with azimuth and elevation for the moon. So far I haven't had success in finding a suitable Arduino library for that, but I'm hoping that a reader of this blog may help me.

The post "Yet another Arduino clock" first appeared on the LA3ZA Radio & Electronics Blog.


  1. Thanks for posting the information on the modifications you made to the K3NG Keyer. Have you posted the software for your clock to GitHub or some other location.


    Fred, KC9QQ

  2. Please do share. I’m hoping to do a similar thing with my K3NG Keyer.

    1. I'd like to share it and put it on Github eventually. My problem is that I don't really understand the update system of Github, so at the moment Github is a hindrance rather than a help in controlling versions and updates.

  3. The code is now public, see https://la3za.blogspot.com/2021/09/gps-clock.html