Timekeeping For Distributed Computers

Ask any programmer who has ever had to deal with timekeeping on a computer, and they’re likely to go on at length about how it can be a surprisingly difficult thing to keep track of. Time zones, leap years, leap seconds, various timekeeping standards, clock drift, and even relativity are all problems that can creep in to projects. Issues with timekeeping are exacerbated in distributed systems as well, adding another layer of complexity when we need to reliably determine the order that a series of actions occurred across a number of different computers with a high precision. One solution to this problem is the implementation of a vector clock.

When using other systems such as logical clocks to attempt to keep track of the order of events on different computers, a problem that may arise is that these systems don’t always track these changes with perfect reliability due to many issues such as varying temperature, race conditions, or clock skew. The vector clock instead tracks causal relationships between events. Each separate process maintains its own vector clock, represented by a list of integers. When one of these processes performs an event, it increments its own clock and sends it out to the rest of the system. By keeping track of this clock as it is updated by various processes across the computer the distributed system can be much more confident about the order in which events took place.

Of course, there are always downsides with elegant solutions like this. In the case of vector clocks the downside is largely increased overhead for keeping track of all of the sets of integers. But in systems where the ordering of processes is of the upmost importance, this is worth the trade-off to ensure reliability. And unless we hook all of our computers up to atomic clocks like they do for some computers at CERN we will have to take the increased overhead instead.

Mechanical Timekeeping Hack Chat With Clickspring

Join us on Wednesday, February 3 at noon Pacific for the Mechanical Timekeeping Hack Chat with Clickspring!

The reckoning of the passage of time has been of vital importance to humans pretty much for all our history, but for most of that time we were stuck looking at the movements of heavenly bodies or noting the changing of the seasons to answer questions of time. The search for mechanical aids to mark the passage of time began surprisingly early, though, pretty much from the time our ancestors first learned to work with metals.

Timekeeping devices were often created to please a potentate or to satisfy a religious imperative, but whatever the reason for their invention, these early clocks and calendars were key to a ton of discoveries. Timekeeping devices were among the first precision mechanisms, and as such formed the basis of much of our mechanical world. A mechanical representation of the passage of time also gave us some of the first precise observations of the physical world, which led to an enormous number of discoveries about the nature of the universe, not to mention practical skills such as navigation, which allowed us to explore the world with greater confidence.

In our era, precision timekeeping has moved beyond the mechanical realm into the subatomic world, and mechanisms built to please a prince are relegated to museums and collectors. That’s not to say there isn’t plenty to learn from the building of mechanical timepieces, as anyone who has watched any of the videos on Clickspring’s YouTube channel can attest. Clickspring not only makes some magnificent modern timepieces, like his famous open-frame clock, but recently he’s also branched out into the timekeeping mechanisms of the ancients. He built a reproduction Byzantine sundial-calendar, and tackled a reproduction of the famous Antikythera mechanism. The latter was undertaken using only the tools and materials that would have been available to the original maker. That led to an unexpected discovery and a detour into the world of scholarly publishing.

Clickspring has been busy lately, but he made some time to stop by the Hack Chat and talk about mechanical timepieces. We’ll talk about his modern builds, his forays into the mechanisms of antiquity, and his serendipitous discovery. On the way we’re likely to talk about what it takes to build precision mechanisms in a small shop, and whatever else that crops up.

join-hack-chatOur Hack Chats are live community events in the Hackaday.io Hack Chat group messaging. This week we’ll be sitting down on Wednesday, February 3 at 12:00 PM Pacific time. If time zones have you tied up, we have a handy time zone converter.

Click that speech bubble to the right, and you’ll be taken directly to the Hack Chat group on Hackaday.io. You don’t have to wait until Wednesday; join whenever you want and you can see what the community is talking about.

Continue reading “Mechanical Timekeeping Hack Chat With Clickspring”

Antique Pocket Watch Project Updates Antique Pocket Watch

Here at Hackaday we have a bit of a preoccupation with timepieces. Maybe it’s the deeply personal connection to an object you wear on your body, or the need for ultimate reliability. Perhaps it’s just a fascination with the notion of time itself. Whatever the case, we don’t seem to be alone as there is a constant stream of time-related projects coming through our virtual doors. For this article we’ve unearthed the LED Pocketwatch 1.0 by [Dr. Pauline Pounds] from way back in 2009 (ironically via a post about a wristwatch from last year!). Fortunately for us the Internet Archive has saved this heirloom nouveau from the internet dustbin so we can appreciate the craftsmanship involved in [Dr. Pounds]’ work.

Check out the wonderful, spiral routing!

My how far we’ve come; a decade after this project was posted a hacker might choose to 3d print a case for a new wearable, but in 2009 that would have been an entire project by itself! [Dr. Pounds] chose to use the casing from an antique Elgin pocket watch. Even through the mists of a grainy demo video we can imagine how soft the well-worn casing must be from heavy use. This particular unit was chosen because it was a hefty 50mm in diameter, leaving plenty of room inside for a 44mm double sided PCBA with 133 0603 LEDs (60 seconds, 60 minutes, 12 hours), a PIC 16F946, an ERM, and a 110mAh LiPo. But what really sets the LED Pocketwatch 1.0 apart is the user interface.

The ERM is attached directly to the rear of the case in order to best conduct vibration to the outside world. For maximum authenticity it blips on the second, to give a sense that the digital watch is mechanically ticking like the original. The original pocket watch was designed with a closing lid which is released when the stem is pressed. [Dr. Pounds] integrated a button and encoder with the end of the stem (on the PCBA) so the device can be aware of this interaction; on lid open it wakes the device to display the time on the LEDs. The real pièce de résistance is that he also integrated a minuscule rotary encoder, so when the stem is pressed you can rotate it to set the time. It’s all quite elegantly integrated and imminently usable.

At this point we’d love to link to sources, detailed drawings, or CAD files, but unfortunately we haven’t found any. If this has you inspired check out some of the other pocket watches we’ve posted about in the past. If you’re interested in a live demo of the LED Pocketwatch 1.0, check out the original video after the break.

Continue reading “Antique Pocket Watch Project Updates Antique Pocket Watch”

Waking Up To Classic Soundgarden Screaming

In a project that was really only slighly less creepy before the singer’s untimely death in 2017, this alarm clock built by [Rafael Mizrahi] awakens its user to a random selection of Chris Cornell’s signature screams. Not content to be limited to just the audio component of the experience, he contained all of the hardware within a styrofoam head complete with a printed out facsimile of the singer’s face.

An Arduino Uno coupled with a seven segment LED display provides the clock itself, which is located in the base. There’s no RTC module, so the Arduino is doing its best to keep time by counting milliseconds. This means the clock will drift around quite a bit, but given that there’s also no provision for setting the time or changing when the alarm goes off short of editing the source code, it seems like accurate timekeeping was not hugely important for this project.

Audio is provided by an Adafruit VS1053, which contains a microSD card full of MP3 samples of Cornell’s singing. This is connected to an X-Mini portable capsule speaker which has been installed in a hollowed out section of the foam.

Unconventional alarm clocks are something of a staple here at Hackaday. From ones which physically assault you to mimicking sunrise with OLEDs, we thought we had seen it all. We were wrong.

Continue reading “Waking Up To Classic Soundgarden Screaming”

Strobe Light Slows Down Time

Until the 1960s, watches and clocks of all kinds kept track of time with mechanical devices. Springs, pendulums, gears, oils, and a whole host of other components had to work together to keep accurate time. The invention of the crystal oscillator changed all of that, making watches and clocks not only cheaper, but (in general) far more accurate. It’s not quite as easy to see them in action, however, unless you’re [noq2] and you have a set of strobe lights.

[noq2] used a Rigol DG4062 function generator and a Cree power LED as a high-frequency strobe light to “slow down” the crystal oscillators from two watches. The first one he filmed was an Accutron “tuning fork” movement and the second one is a generic 32,768 Hz quartz resonator which is used in a large amount of watches. After removing the casings and powering the resonators up, [noq2] tuned in his strobe light setup to be able to film the vibrations of the oscillators.

It’s pretty interesting to see this in action. Usually a timekeeping element like this, whether in a watch or a RTC, is a “black box” of sorts that is easily taken for granted. Especially since these devices revolutionized the watchmaking industry (and a few other industries as well), it’s well worthwhile to take a look inside and see how they work. They’re used in more than just watches, too. Want to go down the rabbit hole on this topic? Check out the History of Oscillators. Continue reading “Strobe Light Slows Down Time”