GPS Talking Clock

Accurate time without a display

Similar projects worth following
Starting from
nsayer has 1335 orders / 120 reviews
Ships from Santa Clara, US
I was inspired to start this project by listening to the USNO Master Clock telephone feed on New Year's Eve 2017/2018. My wife complained that it was the wrong timezone, but there are no time-talkers left in Pacific time. I glanced over at one of my GPS clocks at midnight and it struck me that there was no reason I couldn't make my own talking clock for either live use with a speaker or perhaps even as a dialup service.

The timekeeping aspect of this project is going to be very simple. While the GPS clock project had granularity down to the 10th-of-a-second, which required some interpolation, this clock will only require one second granularity. There will be a need to keep a sub-second timer, but we'll get to that later. Getting time from a GPS receiver requires handling the serial I/O as well as the PPS output from the receiver. We can use the PPS as an interrupt to create the leading edge of the tick and beep sounds (so that they're as accurate as possible) as well as marking the second-start for synchronizing the software activities.

Like all of the time-talkers that have come before, we want to use sampled audio rather than attempting to use voice synthesis. The limited vocabulary of the clock makes that the path of least resistance. 8 kHz 12 bit PCM audio provides "telephone" quality level for the audio. The bad news is that the 32 kB of flash available is obviously insufficient for the number of samples required. Storing the audio on an SD card not only gives us a nearly infinite (for our purposes) amount of storage, but by using FAT storage, we can configure the card quite easily. This also potentially allows field replacement of the samples, so that people could customize the voice (even the language) however they like.

We use the same XMega32E5 controller we used in the v5 variant of the GPS clock. The XMega32E5 has a 2 channel DAC that we can use to play back the audio samples from the SD card. We can use one of the timers configured for 8 kHz as a clock for the DMA controller to trigger updating the current DAC value so that playback can be done largely in the background (we have to double-buffer SD card reads to insure the playback remains seamless, but that's only 1k of RAM out of the 4k available).

The actual audio format is 10 second blocks. Every second is marked by a 10 ms "tick" and every 10 seconds there will be a 3/4 second beep. The leading edges of these are synchronized to the PPS of the GPS receiver using the PPS ISR. We configure one of the timers to output a 1 kHz square wave on one of the pins of the controller, and we simply turn that output on early in the PPS ISR and in the outer loop turn it off either 10 ms or 750 ms after the second.

The audio circuitry takes the 1 kHz square wave output and runs it through an RC low-pass filter. Then it is mixed with the output of the DAC and the sum fed into an audio amplifier and speaker.

The SD card slot is simply connected to the SPI interface. The directory layout is top level directories "ZONE" "HOUR" "MINUTE" "SECOND". Inside of each of the hour, minute and second directory are files named 0-60 (0-24 for hours, and only every 10 for seconds), each of which are an audio snippet. Inside of "ZONE" are files with two letter names, the first of which is a timezone (Pacific, Mountain, Central, Eastern, Alaskan, Hawaiian), the second of which is either S for standard or D for daylight. There will also be a "U" for UTC. Every 10 seconds, the playback consists of the appropriate ZONE file, then hour, minute and second. The intended scripting is "At the tone, Coordinated Universal time will be 23 hours, 59 minutes, 50 seconds." The first second of each 10 second block is reserved for the previous block's mark tone. Seconds 2 through 6 are for the "ZONE" file, then one second for each of the time files, which means the whole thing should end just before the 9th second.

There is a simple set of DIP switches on the board to configure the desired timezone. The system simply continuously generates the audio stream, and the speaker is turned on with a momentary push-button. The push-button will be an input to the controller and the firmware will toggle an enable pin on the audio amplifier. This design allows for autonomous audio output in the future for hourly chimes.

Adobe Portable Document Format - 76.54 kB - 01/25/2019 at 05:13


sch - 493.27 kB - 01/25/2019 at 05:13


brd - 151.79 kB - 01/25/2019 at 05:13


  • 1 × Assembled board
  • 1 × Laser cut wood case part set
  • 2 × feet of 22 gauge hookup wire
  • 1 × PR144C1900 Big Red Button
  • 1 × CSS-66668N Speaker

View all 11 components

  • More volume control tweaks

    Nick Sayer01/25/2019 at 05:19 0 comments

    The latest design moves the volume control to after the preamp, which cuts down on the low-volume noise. I also changed the balance control to a through-hole trimmer so it'll be easier to adjust. I also found a .1" SIP trimmer that can be used for a board-mount volume control, or replaced with wires to a panel mounted volume control.

  • Volume control tweaks

    Nick Sayer12/17/2018 at 00:10 0 comments

    I did some experiments on the volume control system. Two volume controls for separate control over the speech and beeps is a bit unsatisfying, so I've changed it to instead be a balance control followed by an overall system volume.

    While I was at it, I discovered that cutting the preamp gain in half made for better volume control range and less noise. I'm pretty happy with the result.

    The only question left really is whether to make the volume control external or not. It's definitely more convenient to have a knob, but that adds to the cost compared to a board mounted trimmer.

  • More firmware options

    Nick Sayer09/06/2018 at 21:31 0 comments

    One customer recently asked for a mode of operation more like WWV than the USNO. That is, 59 ticks and one beep per minute, with a single time announcement in the last ten seconds. 

    To accommodate that, there is now a WWV macro in the firmware, so this mode is a compile-time choice.

    I’ve also been asked to make a 12 hour AM/PM clock.

    You can actually do that by just re-recording the hour audio samples. You can do that by just copying the 12 sample over the 0 and copying 1 through 11 over 13 through 23. That would give you a purely 12 hour clock. If you want AM/PM as well, then you have to either re-record all the hour files to add AM or PM... which would result in a script like “At the tone, Pacific Daylight Time will be 4 PM, 23 minutes, 10 seconds.” If you’d prefer “4 hours, 23 minutes, 10 seconds PM,” then firmware work would need to be done to support it.

    Frankly, I like the easy way, and not just because I’m lazy. It just seems a more natural way of reading it. 

  • Laser cut wood case

    Nick Sayer02/20/2018 at 06:59 1 comment

    My friends at Steamy Tech helped me finalize the design for the laser cut and engraved wood case that's coming soon to the store. It's 4" x 4" x 2", and by housing the speaker in a cavity that size, the bass is really accentuated and the whole thing just sounds a whole lot better.

    The DIP Switches are accessible through a cutout on the back panel (you mount the DIP switches on the opposite side as the components for using the case), and the big red button on the top has the obvious function.

    They've got a few pressing items on their schedule, so it'll be a week or so before the inventory of cases is available, but I think it'll be worth the wait.

    EDIT: The case doesn’t have any viewports for the LEDs, but it turns out you can see the FIX LED through the speaker cone. If it’s not blinking, then GPS isn’t working. That’s the number two reason (after the speaker being turned off) that the clock would be silent. 

  • Chimes and configuration

    Nick Sayer02/06/2018 at 17:27 0 comments

    I've added support to for optional chimes and hour-strokes at the top of the hour.

    That sort of begs the question as to how to enable/disable the chimes temporarily when you don't want them.

    The DIP switches would seem the natural mechanism, but there are only four of them, and I don't want to just keep piling them on.

    It occurred to me this morning that I could simply add a config file to the top level of the SD card. That would allow configuration of, say, 8 different timezone/DST settings with the DIP switches and set one switch aside to turn the chimes on and off.

    EDIT: The chimes now can actually be on any minute you like, with optional per-hour STROKES at the top of the hour. The SD card now comes programmed to perform full-on Westminster Quarters.

  • Second build report

    Nick Sayer02/06/2018 at 01:45 0 comments

    The second prototype boards came today and they're almost ideal.

    As I mentioned in the last log, I do think I'll back down from a buck converter to an LDO to make the 3.3v power for the controller and GPS, but the addition of the preamp improved the range of output loudnesses available - making more of the range of the adjustment pots usable.

    I am going to change a pair of component values, however. The preamp only needs to have 5x gain instead of 10, so that means dropping the feedback resistor from 200kΩ to 100kΩ. The audio (to my ears anyway) sounds a bit less tinny changing the LPF feedback cap on the final amp from 2200pF to 0.01µF.

    But that's about it. With the larger speaker, I wouldn't call the volume "room filling" in the same sense as a stereo, but it's certainly loud enough to serve the purpose. If I did a better job recording the audio samples, that would probably help quite a bit too.

  • Buck -> LDO

    Nick Sayer01/31/2018 at 15:52 0 comments

    It occurred to me today that the combined draw of the Xmega and the GPS chip isn't likely more than 75 mA or so, so the buck converter is a bit of a waste. The final version will have a simple LDO instead. There should still be plenty of capacity left over to power a 3.3v antenna if it's jumper that way (the default, however, is 5v antenna power).

    The only other question for that version is whether the preamp will be kept or not. We'll get the answer to that when the 2nd prototype boards arrive, probably early next week.

  • Accuracy

    Nick Sayer01/28/2018 at 19:58 0 comments

    The old saw is, "measure with a micrometer, mark with chalk, cut with an axe."

    Using GPS to provide a source of time signaling directly through human senses is always going to be swatting a fly with a hydrogen bomb. Humans just aren't very accurate preceptors without lots of technological assistance. The visual GPS clock that presaged this project wound up with an accuracy of ~180 µs, but the granularity is only 100 ms. The speed of light has essentially no bearing on the accuracy.

    Unfortunately, I don't have any information about the latency of human perception.

    The talking clock has a granularity of only 1 second. But how accurate is it?

    Because the tick/beeps of the talking clock are 1 kHz and the oscillator for them is free-running, the accuracy spec starts at ±1 ms, but there's also the PPS ISR's latency to consider, which is probably a few microseconds (that ISR has little to do other than enable the tone output). Depending on where you are in the room relative to the clock will also have an impact because of the speed of sound - probably adding another 2-3 ms of latency if you're ~1 meter away.

  • Mystery solved

    Nick Sayer01/27/2018 at 16:53 0 comments

    Thanks to Ted Yapo for responding in the comments to a previous log. He solved the mystery.

    He said that the LM4871 LPF feedback cap (C20) was the problem. That got me to recalculate LPF rolloff and it was 24 Hz. Way, way too low. I had wanted something more like 2.4 kHz.

    First I removed the cap entirely and it really did jump right up.

    I had replaced the 20kΩ feedback resistor (R9) with 56kΩ, so the LM4871 gain is now officially 7 dB instead of 3 dB. I added back in 1000pF just to give it some pro-forma rolloff, but I can't really hear a difference.

    When the next boards come, I can experiment a bit. I can replace the pre-amp's feedback resistor with 0Ω and leave off the rest of the preamp components and it will be as if nothing is there. Or I can populate the pre-amp and see which way is better.

    As for the speakers, the little tiny ones I originally bought won't cut it. Trying to get enough gain for the voice output to sound decent makes it clip badly. The larger speakers, unsurprisingly, sound a lot better. If there's a downside, it's that the case will wind up having to be much larger (still not at all sure what I'm going to do there).

    It turns out that a new board rev was going to be necessary anyway because of the previously noted errors. In addition, I swapped the poles of the two gain trimmers so that the directionality correctly matches ordinary expectations (CW for higher gain).

  • Next prototype ordered

    Nick Sayer01/27/2018 at 06:17 0 comments

    I've added an op amp preamp configured for 10 dB of gain and ordered a set of boards. 10 dB is ostensibly too much gain, but the way things are now, the two gain pots are all the way up. With 10 dB of intermediate gain, the hope is that the "sweet spot" for the output will have those pots further down in their ranges. The most likely explanation I can come up with is that the maximum amplitude of the output from the controller is 1.65Vpeak. Doubling this yields 3.3Vpeak. If you calculate the average power (P = Vpeak^2 / 2R) into 8Ω, you get a little more than 0.5W. If instead you look at the power from 5Vpeak, it's over 1.5W.

    Configuring an OP Amp for a single supply voltage to amplify an audio signal isn't too hard. You use an inverting configuration (because audio doesn't care if it's inverse - that just means the speaker pulls instead of pushes, but it sounds the same) with a Vcc/2 virtual ground (classically the non-inverting input is grounded) made with a two resistor divider (and a decoupling cap). The input and output are both AC coupled. The LM4871 generates differential output power with 3 dB of gain, so if the output of the pre-amp is maxed out, it will max out the output of the power amp.

    I've now got two choices for speakers. One is smaller, but it's low frequency performance is much poorer (as you might expect). It's also a couple of dB less efficient overall.

    If the result still isn't loud enough, then the audio amp will need to be ramped up, probably to something running on a higher voltage supply.

View all 15 project logs

  • 1
    Usage instructions

    Install a CR1220 battery in the backup battery bail. This battery is optional, but if present will help the GPS receiver by preserving the satellite almanac across power cycling.

    Insure a properly formatted and loaded µSD card is installed in the slot.

    Adjust the two trimpots on the board to the center of their range to start with. The pot closest to the button controls the gain of the ticks and beeps, the other controls the gain of the sampled audio (chimes and speaking).

    Connect a GPS antenna to the SMA jack and plug a 2.1mm barrel connector with 5 VDC center positive to the power jack. The FIX LED (LED3) near the corner of the board and the GPS diagnostic light (LED1) should come on. As soon as the GPS receiver gets a fix, the FIX LED should start blinking at 1/2 Hz and the GPS diagnostic LED should go out. At some time a few seconds later, the clock should begin playing the audible timecode.

    You can push the button any time (except during chiming) to turn the audible timecode on or off.

    At any time, you can change the DIP switches to select the desired timezone. You can also turn switch 3 on or off to enable or disable the chimes. The chimes will only sound when the audible timecode is muted.

    The default time zones available:

    • 0 - UTC
    • 1 - Pacific Time
    • 2 - Mountain Standard Time (no DST - Arizona)
    • 3 - Mountain Time
    • 4 - Central Time
    • 5 - Eastern Time
    • 6 - Hawaii Standard Time (no DST)
    • 7 - Alaska Time

    If at any time LED2 lights, that indicates an error accessing the µSD card. Remove power and try reseating the card. If the error is persistent, it indicates an error in the content of the card. The best suggestion is to reformat and reload the correct sample files into the card.

  • 2
    Assembly instructions

    The board comes as a "quick kit" with the DIP switches unattached. If you're installing the clock in the laser-cut case, then install the DIP switches on the bottom of the board (opposite the components). Otherwise, it's up to you which side. If you prefer, you can connect some other switching mechanism up. The top 4 holes (nearest the center) are the switched pins. Shorting any of these to ground turns the switch "on."

    For mounting in a case, you can connect a remote switch up to the 2 pin terminal near the on-board switch.

    The speaker jack should be connected directly to a 4Ω or 8Ω speaker. The speaker terminals are a bridge output configuration - do not connect one to ground. The bottom terminal is positive (but it doesn't really matter in practice).

    For faster restarts after power outages, install a CR1220 battery under the battery bail on the board. This battery will likely last many years, as it is not used except when the board is unpowered (and even then the draw is very, very small).

  • 3
    Laser-cut wood case assembly

    Attach the speaker loosely to the front panel with 4 3/8" screws, lock washers and nuts. Once all 4 screws are loosely attached, tighten them using a figure X pattern.

    Solder 4 wires to the speaker and button terminals. Use 22 gauge wire 6 inches long (to facilitate easier case assembly).

    Attach the board to the back panel with 4 5/8" screws, 1/4" spacers, lock washers and nuts. Orient the board so that the DIP switches are visible through the cut-out with the switch numbers immediately above. The components should be facing upwards.

    Insert the button firmly through the hole in the top panel (the top panel doesn't have a front or back side).

    Solder the speaker wires to the speaker terminals.

    Solder the two switch wires to the switch terminals, then bend those terminals down to about a 60 degree angle against the switch body.

    Now is a good time to test the circuitry. Connect an antenna and apply power. Wait until the FIX LED (bottom left corner) begins to blink and the GPS LED (bottom of the two paired near the top middle of the board) goes out. Within a few seconds of that, the voice announcements should commence. Push the button to silence them and again to resume. Change the DIP switches to verify they function. Disconnect power and antenna for remaining assembly steps.

View all 4 instructions

Enjoy this project?



Mike Yurick wrote 02/26/2019 at 00:35 point

I like your idea, especially the old-school style speaker grill.

  Are you sure? yes | no

NobodyYouKnow wrote 01/21/2018 at 19:00 point

Ah. Thanks. That explains why I was not finding it from the usual sources. Of course, it is a BGA device. I haven't tried to push my SMT skills that far yet. :-)

  Are you sure? yes | no

Nick Sayer wrote 01/21/2018 at 19:49 point

it’s actually an LGA - there are no balls. So you just paste and place it the same as if it were a QFN - there are just more pads underneath. 

  Are you sure? yes | no

NobodyYouKnow wrote 01/22/2018 at 13:25 point

Thanks for the correction. That might not be so bad, then. An LGA I can handle. Are you aware of a commercial source that sells in the onesie-twosie range?

  Are you sure? yes | no

Nick Sayer wrote 01/22/2018 at 16:11 point

SkyTraq will sell in small quantities. I just buy large ones for the quantity pricing and to better amortize shipping cost.

  Are you sure? yes | no

NobodyYouKnow wrote 01/21/2018 at 18:49 point

What is your source for the Skytraq / Venus 838LPx-T? I'm having a bit of trouble finding it as a bare chip. Thanks!

  Are you sure? yes | no

Nick Sayer wrote 01/21/2018 at 18:51 point

I buy them a tray at a time from SkyTraq in Taiwan. 

  Are you sure? yes | no

Dan Maloney wrote 01/19/2018 at 19:37 point

Hey, this looks pretty cool. I'd like to write it up for the blog -- do you think you'll get the audio problem sorted out soon? A video of the clock in action would be a big bonus, too. 

  Are you sure? yes | no

Nick Sayer wrote 01/21/2018 at 19:28 point


I will say that in this case the video looks almost identical to the picture. 😁 (but the video can carry the audio - I get that).

The audio problem at the moment is a quandary. There shouldn’t be any reason it’s so low, which suggests I’ve just made some other dumb error.

I’m fairly sure I’ll be ordering a second prototype board run this week and I’m confident that one will be correct. 

  Are you sure? yes | no

Nick Sayer wrote 01/28/2018 at 06:12 point

I've added a YouTube video with the improved audio (now that that mystery has been solved).

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates