Skip to content

Synchronize most radio-controlled ("atomic") clocks and watches using almost any phone or tablet

License

Notifications You must be signed in to change notification settings

kangtastic/timestation

Repository files navigation

Time Station Emulator

Logo

License: MIT GitHub Actions Workflow Status Codecov
C Lit TypeScript WebAssembly

Overview

Time Station Emulator turns almost any phone or tablet into a low-frequency radio transmitter broadcasting a time signal that can synchronize most radio-controlled (“atomic”) clocks and watches.

Real time signal broadcasts are limited in geographic range and notoriously prone to interference in urban areas, so many such clocks end up never actually using their self-setting functionality. Time Signal Emulator may allow setting such clocks when/where a suitable signal is not otherwise available.

Features

  • Compatible with most radio-controlled clocks: Emulates the five operational radio time signal stations (🇨🇳 BPC, 🇩🇪 DCF77, 🇯🇵 JJY, 🇬🇧 MSF, and 🇺🇸 WWVB).
  • Network time: Derives the current time from the network using an NTP-like algorithm.
  • Location-agnostic: Supports applying an offset to the transmitted time of ±24 hours from the present.
  • BST/CEST/DST-aware: Transmits daylight saving time information for DCF77, MSF, and WWVB.
  • Leap second-aware: Transmits a DUT1 offset for MSF and WWVB.
  • Client-side, browser-based: Runs entirely in the browser; no installation, no signup, no data collection.

Requirements

The hard requirements of note are browser WebAssembly support and DAC support for ≥44.1 KHz PCM. Almost any device running a browser from ≥2019 should work.

However, as of early 2024, Safari on iOS and Firefox on Android have multiple breaking issues and will not work.

For other devices, Time Station Emulator works best with a built-in speaker of a phone or tablet. See Technical Details for an explanation.

Usage

Time Station Emulator is hosted at https://timestation.pages.dev/.

click to expand/hide
  1. Choose emulator settings.

    The most important setting is which time station to emulate. Certain settings are only available for certain stations.

    Clocks (or watches) that support more than one station may prefer one of them over the others.

  2. Choose any clock settings and place the clock into sync mode.

    If your clock has them, try to choose station and/or time zone settings that make sense for your location.

    Most clocks provide a way to force a synchronization attempt. You will probably have to navigate menus and/or press physical buttons.

  3. Position the speaker as close as possible to the clock’s antenna.

    The transmission range is quite short, so positioning is crucial. Some experimentation will probably be required, especially if you’re unsure where the antenna is.

    The volume should be set so that the clock picks up the cleanest signal. Usually, this occurs at or near the maximum possible volume.

    WARNING
    DO NOT PLACE YOUR EARS NEAR THE SPEAKER TO DETERMINE VOLUME.

    Use a visual volume indicator instead.

    The generated waveform has full dynamic range, but is pitched high enough to be difficult to perceive.

    Even if you “can’t hear anything”, many common devices are capable of playing it back loud enough to potentially cause permanent hearing damage!
  4. Start transmitting and hold the speaker in position.

    If all goes well, the clock will set itself within three minutes.

Technical Details

click to expand/hide

Time Station Emulator generates an audio waveform intentionally crafted to create, when played back through consumer-grade audio hardware, the right kind of RF noise to be mistaken for a time station broadcast.

Specifically, given a fundamental carrier frequency used by a real time station, it generates and modulates the highest odd-numbered subharmonic that also falls below the Nyquist frequencies of common playback sample rates.

One of the higher-frequency harmonics inevitably created by any real-world DAC during playback will then be the original fundamental, which should leak to the environment as a short-range radio transmission via the ad-hoc antenna formed by the physical wires and circuit traces in the audio output path.

NOTE
Because it relies upon this leakage, Time Station Emulator works best with a built-in speaker of a phone or tablet.

In some cases, wired headphones or earbuds may also be suitable.

Higher-frequency harmonics are considered artifacts beyond the range of human hearing, so they are routinely suppressed by audio compression algorithms and better equipment.

Bluetooth devices and audiophile-grade equipment are therefore less likely to work.

License

src/shared/casefoldingmap.ts derives from a data file published by the Unicode Consortium, and is Unicode licensed.

src/shared/icons.ts derives from SVG icons originally part of ionicons v5.0.0 and Flagpack, and is MIT licensed by way of those projects.

All other files are also MIT licensed.

About

Synchronize most radio-controlled ("atomic") clocks and watches using almost any phone or tablet

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published