Video summary

I built a new clock, and now I'm not sure what time it is

Main summary

Key takeaways

Technology

Project Goal

Build a DIY Precision Time Protocol (PTP) clock that shows time with nanosecond resolution, using an LED matrix display (instead of the seconds-only behavior of a typical watch).

PTP vs. NTP (Concept and Motivation)

The video describes PTP as similar to NTP, but designed for local area networks and capable of higher precision. It also cites advanced real-world uses, including:

  • Stadium-scale synchronization for coordinated audio/video across a venue
  • “White Rabbit”, an even more extreme timing standard used for large scientific instruments (e.g., Earth-scale neutrino detectors)

Inspiration and Open-Source Basis

  • The builder was inspired after seeing the clock in Oliver Atlin’s 39C3 talk: “Excuse Me, What Precise Time Is It?”

  • Oliver reportedly provided open-sourced code and a parts list, which the builder used.

  • The clock is built around a Raspberry Pi 4.

Why Raspberry Pi 4

Key engineering/product reasons given:

  • Convenient GPIO access for driving LED matrix displays
  • Network adapter support that can enable PTP hardware timestamping, which is positioned as important for precision

Hardware, Cost, and Practical Notes

  • Estimated parts cost: ~$120–$150 (with a joke about timing during the “AI bubble”)
  • Pi requirement: “Any Pi 4 will do.”
    • Mentions potential issues with Pi 5 + RGB matrix (RGB matrix not working on Pi 5)
  • Named components:
    • Adafruit RGB matrix hat
    • Waveshare daisy-chainable 64×32 LED matrix panels
    • Power: at least 4A through a barrel jack; recommends 5V 4A
    • microSD card to boot the Pi
  • Build difficulty notes:
    • Requires some soldering (three headers)
    • Mentions concern about flux residue and whether IPA can fully clean it

Power and Display Behavior (Observations)

Practical behavior when power is insufficient:

  • Using roughly ~3A supply current can cause the display to dim and flicker, especially when driving both sides.
  • He tested with a Pi adapter that might supply ~3A depending on the USB-C PD circuit, and advises using a true 5V/4A supply.
  • Reports minor wiring “jank” (crimp/screw terminals) and plans to switch to a more permanent connector.

Software Workflow / Build Steps

  • Uses the rpi-rgb-led-matrix library (maintained by Henner Zeller)
  • Workflow described:
    1. Run demo scripts from the library
    2. Customize to display a single color PTP clock
    3. Update Pi config
    4. Reboot
    5. Install the RGB matrix library
    6. Compile the PTP clock app
  • Important required step:
    • Disable audio on the Pi for matrix correctness
  • Integration:
    • Wraps the clock app as a systemd service so it auto-starts on boot
  • Collaboration/debugging:
    • He encountered issues and pushed code changes for Oliver to review

Mechanical / UX Finishing

  • Builds a custom CAD brace/standoff assembly to make two matrix panels appear as one long display.
  • Uses magnet screws for magnetic mounting.
  • Leaves room to avoid stressing the LED panel overhang (~0.1 mm).
  • Adds cable management and considers a future angled stand for the Pi.

Time Synchronization Testing and Root-Cause Diagnosis

After the clock was working, he tested synchronization against other clocks:

  • A “most accurate” studio clock is timed via GPS, then time is fed through a Time Pi to the network interface.
  • His PTP clock initially was off by milliseconds, then later drifted ~3 seconds.

Root Cause

  • Identified issue: Intel i226 Linux network driver bug affecting timing pulses.
  • Driver behavior: triggers “a new second” using both edges (rising and falling) instead of the correct edge.
  • Result: the system can sample the wrong GPS second sometimes (off by ~100 ms).

He also mentions:

  • A potential patch that might fix the i226 behavior.

Alternatives Considered

  • Switch to another time server using the Pi’s built-in Broadcom network path (to avoid the i226 edge bug)
  • Possibly run multiple Time Pis and select the best one

Overall Conclusion

The open-source clock project is useful not only as a visual PTP indicator, but also as a debugging tool to expose network time issues. The builder credits:

  • Oliver’s code
  • His own blog for full build commands

Main Speakers / Sources

  • Jeff Geerling — video author / build log
  • Oliver Eklund / Oliver Atlin — originator of the open-sourced PTP clock code and parts list (referenced via the 39C3 talk)
  • Henner Zeller — maintainer of the rpi-rgb-led-matrix library

Original video