Stratum 1 Grandmaster Time Server On A Budget

[Jeff Geerling] has been following the various open source time projects for some time now, and is finally able to demonstrate a working and affordable solution for nanoseconds-accurate timekeeping in your local lab. The possibility of a low-cost time server came about with the introduction of the Raspberry Pi CM4 compute module back in Oct 2020, whose Broadcom network chip (BCM54210PE) supports PTP (Precision Time Protocol, IEEE-1588) 1PPS output and hardware-based time stamping. Despite the CM4 data sheet specifying PTP support, it wasn’t available in the kernel. An issue was raised in Feb last year, and Raspberry Pi kernel support was finally released this month.

[Jeff] demonstrates how easy it is to get two CM4 modules to synchronize to within a few tens of nanoseconds in the video below the break. That alone can be very useful on many projects. But if you want really stable and absolute time, you need a stratum 1 external source. These time servers, called grandmasters in PTP nomenclature, have traditionally been specialized pieces of kit costing tens of thousands of dollars, using precision oscillators for stability and RF signals from stratum 0 devices like navigation satellites or terrestrial broadcast stations to get absolute time. But as Lasse Johnsen, who worked on the kernel updates remarks in the video:

In 2022 these purpose-built grandmaster clocks from the traditional vendors are about as relevant as the appliance web servers like the Raq and Qube were back in 1998.

It is now possible to build your own low-cost stratum 1 time server in your lab from open source projects. Two examples shown in the video. The Open Time Server project’s Timecard uses a GNSS satellite receiver and a Microchip MAC-SA5X Rubidium oscillator. If that’s overkill for your projects or budget, the Time4Pi CM4 hat is about to be release for under $200. If accurate time keeping is your thing, the technology is now within reach of the average home lab. You can also add PTP to a non-CM4 Raspberry Pi — check out the Real-Time HAT that we covered last year.

Continue reading “Stratum 1 Grandmaster Time Server On A Budget”

Network Time Protocol On The ESP32

Network Time Protocol (NTP) is one of the best ways to keep networked computers synchronized to the same time. It’s simple, lightweight, and not only allows computers to maintain a time standard together, but it also allows some computer manufacturers to save some money on hardware costs. The Raspberry Pi is perhaps the most well-known example of a low-cost computer without the extra expense of a real-time clock (RTC). While the Pi sets up NTP essentially automatically, other microcontrollers like the ESP32 don’t, but it is possible to configure them to use this time standard with some work.

For this project the MicroPython implementation for the ESP32 is required. MicroPython is a way of running Python code on microcontrollers or other embedded systems without all of the overhead that Python would normally require. Luckily enough, the NTP libraries are built right in so once MicroPython is running on the ESP32 it’s nearly as easy as calling the library. Of course you will have to make sure there is an internet connection, and then grab the time, sync it to the machine, and then set the timezone.

For a bonus exercise, the project’s creator [Bhavesh] suggests attempting to configure Daylight Savings Time, although this can be a surprisingly difficult problem to solve. In the meantime, there are a few other ways of installing a clock on a microcontroller like this one. An RTC module is an obvious choice, but you can also get incredibly accurate time by using a GPS module as well.

NTP server heated with Bitcoin mining dongles

Bitcoin Mining ASICs Repurposed To Keep NTP Server On Track

They say time is money, but if that’s true, money must also be time. It’s all figurative, of course, but in the case of this NTP server heater powered by Bitcoin mining dongles, money actually does become time.

This is an example of the lengths to which Network Time Protocol aficionados will go in search of slightly better performance from their NTP servers. [Folkert van Heusden], having heard that thermal stability keeps NTP servers happy, used a picnic cooler as an environmental chamber for his  Pi- and GPS-based NTP rig. Heat is added to the chamber thanks to seven Block Erupter ASIC miner dongles, which are turned on by a Python script when a microcontroller sends an MQTT message that the temperature has dropped below the setpoint.

Each dongle produces about 2.5 Watts of heat when it’s working, making them pretty effective heaters. Alas, heat is all they produce at the moment — [Folkert] just has them working on the same hash over and over. He does say that he has plans to let the miners do useful work at some point, not so much for profit but to at least help out the network a bit.

This seems like a bit of a long way around to solve this problem, but since the mining dongles are basically obsolete now — we talked about them way back in 2013 — it has a nice hacky feeling to it that we appreciate.

NTP, Rust, And Arduino Make A Phenomenal Frequency Counter

Making a microcontroller perform as a frequency counter is a relatively straightforward task involving the measurement of the time period during which a number of pulses are counted. The maximum frequency is however limited to a fraction of the microcontroller’s clock speed and the accuracy of the resulting instrument depends on that of the clock crystal so it will hardly result in the best of frequency counters. It’s something [FrankBuss] has approached with an Arduino-based counter that offloads the timing question to a host PC, and thus claims atomic accuracy due to its clock being tied to a master source via NTP. The Rust code PC-side provides continuous readings whose accuracy increases the longer it is left counting the source. The example shown reaches 20 parts per billion after several hours reading a 1 MHz source.

It’s clear that this is hardly the most convenient of frequency counters, however we can see that it could find a use for anyone intent on monitoring the long-term stability of a source, and could even be used with some kind of feedback to discipline an RF source against the NTP clock with the use of an appropriate prescaler. Its true calling might come though not in measurement but in calibration of another instrument which can be adjusted to match its reading once it has settled down. There’s surely no cheaper way to satisfy your inner frequency standard nut.

Portable GPS Time Server Powered By The ESP8266

Most Hackaday readers will be familiar with the idea of a network time server; a magical box nestled away in some distant data center that runs the Network Time Protocol (NTP) and allows us to conveniently synchronize the clocks in our computers and gadgets. Particularly eager clock watchers can actually rig up their own NTP server for their personal use, and if you’re a true time aficionado like [Cristiano Monteiro], you might be interested in the portable GPS-controlled time server he recently put together.

The heart of the build is a NEO-6M GPS module which features a dedicated pulse per second (PPS) pin. The ESP8266 combines the timestamp from the GPS messages and the PPS signal to synchronize itself with the atomic clock aboard the orbiting satellite. To prevent the system from drifting too far out of sync when it doesn’t have a lock on the GPS signal, [Cristiano] is using a DS3231 I2C real-time clock module that features a high accuracy temperature-compensated crystal oscillator (TCXO).

Continue reading “Portable GPS Time Server Powered By The ESP8266”

A Custom Clock With LED Filament Hands

LEDs have become so ubiquitous in our projects that just hearing that term probably conjures images of tiny illuminated domes in an array of single-spectrum colors. It’s easy to forget that these efficient sources of light come in a variety of form factors, including the retro-tacular filaments that [bitborked] used to make his beautiful analog LED wall clock.

Aside from its aesthetics, this timepiece features some great design. A custom PCB acts as a hub for all the LED filament spokes. The onboard brains come in the form of an ESP32, which means it can keep extremely accurate time via NTP. WS2811 LED controllers, which we’re so accustomed to seeing alongside RGB LEDs that they almost feel strange to see here, provide the 12 volts required for each filament and make individual addressing a breeze.

[bitborked] takes advantage of that addressability to display other animations in addition to the standard clock face. They also plan to implement MQTT for eventual alerts from other home automation devices. When it comes to just telling time, you can discern the individual “hands” by differences in their brightness, which sadly does not show up as well in video as it does in real life.

We would certainly be happy to have this clock on our walls, and we hope to eventually see more of its PCB designs. In the meantime, though, we can drool over a more digital take on the LED filament clock. Although, filaments are certainly not required to make a beautiful LED timekeeper.

Using Heaters To Display Time

We’re always fans of interesting clock builds around here, whether it’s a word clock, marble clock, or in this case a clock using a unique display method. Of course, since this is a build by Hackaday’s own [Moritz v. Sivers] the display that was chosen for this build was a custom thermochromic display. These displays use heat-sensitive material to change color, and his latest build leverages that into one of the more colorful clock builds we’ve seen.

The clock’s display is built around a piece of thermochromic film encased in clear acrylic. The way the film operates is based on an LCD display, but using heat to display the segments. For this build, as opposed to his previous builds using larger displays, he needed to refine the method he used for generating the heat required for the color change. For that he swapped out the Peltier devices for surface mount resistors and completely redesigned the drivers and the PCBs around this new method.

Of course, the actual clock mechanism is worth a mention as well. The device uses an ESP8266 board to handle the operation of the clock, and it is able to use its wireless capabilities to get the current time via NTP. All of the files needed to recreate this are available on the project page as well, including code, CAD files, and PCB layouts. It’s always good to have an interesting clock around your home, but if you’re not a fan of electronic clocks like this we can recommend any number of mechanical clocks as well.

Continue reading “Using Heaters To Display Time”