• [LA3ZA] GPS Clock published

    From LA3ZA via rec.radio.amateur.moderat@21:1/5 to All on Wed Sep 29 07:13:04 2021
    XPost: rec.radio.amateur.moderated

    LA3ZA Radio & Electronics

    GPS Clock published

    Posted: 28 Sep 2021 03:07 PM PDT https://la3za.blogspot.com/2021/09/gps-clock.html

    Version 1 of my GPS Clock is here. It has some 19 different display screens showing time, location, solar and lunar positions and rise/set times. It
    shows UTC time as received from the GPS satellites and local time where it automatically adjust for summer time. The initial screen, no. 0, is this:
    The display changes by pushing the right-hand pushbutton on the top,
    increasing the screen number by one. Similarly the number can be decreased
    by pushing the left-hand push-button. The potentiometer on the right side adjust the backlight. The clock is built on the same hardware as used for
    the K3NG Arduino CW keyer.

    The date and time formats may be changed, and with US settings it looks
    like this:
    This format is closer to the ISO standard:
    When local time is shown, day names may be in another language than
    English. Here is my Norwegian day name display. The local short name for Tuesday (Tir) will be shown in some of the following displays also, because
    the native option is set:
    The circuit diagram is rather simple and is based on an Arduino Mega and
    I2C or parallel connection to a 20x4 LCD display. It was drawn online on www.circuit-diagram.org and is a public circuit.
    The GPS input is for serial data on a TTL-like interface. I use a QRPLabs
    QLG1 GPS. It is now discontinued and replaced by the QLG2.
    The code is public on github.com/LA3ZA/GPSClock. It uses 57714 bytes (22%)
    of program storage space of an Arduino Mega. This is too much to fit an
    Arduino Uno. Global variables use 2446 bytes (29%) of dynamic memory,
    leaving 5746 bytes for local variables.
    Here are the other screens. Screen 1 shows UTC time and date, Maidenhead locator and number of satellites:
    Screen 2 shows local time, and actual, civil, and nautical rise and set
    times for the sun, i.e. when the sun touches the horizon, and is 6 and 12 degrees below the horizon. To the right is shown solar elevation (-22
    degrees), local time at solar noon (13.09), and solar elevation at local
    noon (27 degrees).
    Screen 3 is similar to screen 2 except for the last line which shows the
    next lunar event, set, at 17:29, the lunar phase and illumination of, in
    this case, the decreasing moon, and lunar elevation.
    Screen 4 is a lunar display showing actual elevation and azimuth, next
    set/rise time and azimuth. The last line shows lunar distance as a
    percentage of its maximum value and distance in km, and lunar phase (51% illumination).
    Screen 5 shows lunar rise/set times for the present 24 hours and the next
    and the corresponding azimuth angles:
    Screen 6 is a display of time in various user configurable time zones, here showing central Europan Summer Time, Indian time, Eastern Daylight Time,
    and Pacific Daylight Time:
    The following screens show several fancy, barely useable screens of various alternative displays. Screen 7 is binary:
    Screen 8 is binary coded decimal:
    Screen 9 is also binary coded decimal, but to be read vertically:
    Screen 10 is based on groups of three bars which are each 1/4 of a round
    Screen 11 emulates the set theory clock in Berlin:
    Screen 12 emulates the linear clock of Kassel:
    Screens 13 and 14 are diagnostic displays which are not shown here. Screen
    15 shows UTC time, position, altitude and number of satellites:
    Screen 16 shows the NCDXF beacons in the 15, 12, and 10 m bands at the
    present time. It changes every 10 seconds as transmitters change frequency. Screen 17 shows the NCDXF beacons in the 20, 17, and 15 m bands:
    Screen 18 shows the WSPR frequency used at the indicated time according to coordinated band hopping. All 10 bands between 160 m and 10 m are covered
    in a 20 minute cycle:
    After the last screen, the screen counter goes to 0 and the sequence is repeated as the right-hand button is pressed. Pressing the left-hand button will take you directly from the initial display to the WSPR screen.
    The startup screen shows GPS baud rate (user settable) as it is waiting for
    a GPS signal:

    The code is on github and has several options. The way to choose and set options has been inspired by the way it is done in the The K3NG Arduino CW Keyer.
    An important feature is that it is possible to customize which screens to
    show and in which order. Thus only screens 0-5 with time, solar and lunar positions and screens 16-18 with the NCDXF and WSPR sequences may be made available for instance.
    Other options and features are:FEATURE_LCD_I2C - I2C interface to LCDFEATURE_LCD_4BIT - parallel interface to 20x4 LCD
    FEATURE_DAY_NAME_NATIVE - to use local language day names for local timeFEATURE_CLOCK_SOME_SECONDS - to show time in digits for 10 seconds
    every minute in the Binary, BCD, etc displaysDate and time formats allow
    most of the formats found on the Date format page of Wikipedia:DATEORDER
    = 'L': Little-endian: 22.04.2016 or 22.04 - EUDATEORDER = 'M':
    Middle-endian: 04/22/2016 or 04/22 - USDATEORDER = 'B': Big-endian:
    2016-04-22 or 04-22 - ISODATE_SEP = '.'; //
    Alternatives: '.', '/', '–', ' ', ...HOUR_SEP = ':'; //
    Alternatives: ':', '.', 'h', ...MIN_SEP = ':'; //
    Alternatives: ':', '.', 'm', ...
    The GPS clock uses these libraries:TimeLib.h - timekeepng functionalityTimezone_Generic.h - for time zones and automatic handling of daylight savingTinyGPS++.h - for GPS data interpretation Sunrise.h - for predicting sun rise/set timessunpos.h - solar position, taken from the K3NG rotator controllermoon2.h - lunar position from K3NG rotator controller lunarcycle.c - has been adapted for Arduino and is included in the codeThe lunar phase calculation is based on ideas discussed here. It is accurate to 2-3% or so compared to timedate.com.
    Details on how to set up the options and adaptations for the code published
    on github.com/LA3ZA/GPSClock will follow.

    This blog post first appeared on the LA3ZA Radio & Electronics blog.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)