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.

Clock Escapement Uses Rolling Balls

The escapement mechanism has been widely used for centuries in mechanical clocks. It is the mechanism by which a clock controls the release of stored energy, allowing it to advance in small, precise intervals. Not all mechanical clocks contain escapements, but it is the most common method for performing this function, usually hidden away in the clock’s internals. To some clockmakers, this is a shame, as the escapement can be an elegant and mesmerizing piece of machinery, so [Brett] brought his rolling ball escapement to the exterior of this custom clock.

The clock functions as a kitchen timer, adjustable in 10-second increments and with several preset times available. The rolling ball takes about five seconds to traverse a slightly inclined, windy path near the base of the clock, and when it reaches one side, the clock inverts the path, and the ball rolls back to its starting place in another five seconds. The original designs for this type of escapement use a weight and string similar to a traditional escapement in a normal clock. However, [Brett] has replaced that with an Arduino-controlled stepper motor. A numerical display at the bottom of the clock and a sound module that plays an alert after the timer expires rounds out the build.

The creation of various types of escapements has fascinated clockmakers for centuries, and with modern technology such as 3D printers and microcontrollers, we get even more off-the-wall designs for this foundational piece of technology like [Brett]’s rolling ball escapement (which can also be seen at this Instructable) or even this traditional escapement that was built using all 3D-printed parts.

Continue reading “Clock Escapement Uses Rolling Balls”

Clock Project Doesn’t Require A Decision

You decide to build a clock. The first thing you have you determine if it is going to be digital or analog. Or is it? If you build [Ivanek240267]’s clock, you can have both.

The digital portion uses an OLED display. The analog portion contains two rings of smart LEDs. The WiFi configuration is always an issue in projects like this, and this clock also offers options. In addition, the Raspberry Pi Pico-based clock also sets itself via NTP.

You can, of course, compile the WiFi credentials into the code, and assuming you don’t plan on changing networks, that’s fine. But if you’re in a more dynamic situation, the clock can also read its configuration from a memory card.

The analog clock uses colors. The green LEDs represent quarter hours. The blue LEDs are for minutes, while the red ones are full hours. Of course, reading the OLED doesn’t require any special interpretation.

When debugging, the timing doesn’t drive the smart LEDs. That means if you need to work on that part of the code, you won’t be able to count on debugging support.

We’ve mentioned before that digital clocks are all analog, anyway. If you want to use fewer LEDs, you can get by with only five.

A wristwatch based on a red PCB with seven-segment LCD screens

The Time Machine Mk. 8 Is A Sleek Smartwatch With Retro Styling

The primary purpose of a wristwatch is to tell the time, which pretty much any watch does perfectly fine. It’s in the aesthetics, as well as features other than time-telling, where a watchmaker can really make their product stand out from the rest. Watchmaker and electronic artist [Eric Min] focused on those two areas when he designed the Time Machine Mk.8, which combines exquisite design with simple, offline smartwatch functionality.

The heart of the watch is a Microchip ATSAMD21G18 low-power 32-bit microcontroller. [Eric] chose it for its high performance, ease of use and large number of integrated peripherals, a real-time clock being one of them. With the basic clock function thus taken care of, he then decided to add several useful sensors: a battery fuel gauge to keep an eye on the 40 mAh rechargeable lithium cell, a three-axis accelerometer to enable motion sensing and an environmental sensor to track temperature, humidity and pressure.

A faux 1980s magazine ad for a red PCB wristwatchThe various functions are operated using four pushbuttons along with a 16-step rotary encoder set in the middle. The overall design of the watch is inspired by Formula 1 steering wheels, as well as various sports cars and media franchises like Neon Genesis Evangelion and Akira. [Eric] considered a few different options for the display but eventually settled on two four-digit seven-segment LCDs, which fit nicely into the retro-futuristic aesthetic of the Mk.8. It’s so retro, in fact, that it almost makes [Eric]’s faux 1980s magazine ad look genuine.

All components neatly fit together on a dual-layer PCB, which is a true work of art in itself. From the lightning bolt on the front to the hidden Frank Sinatra lyrics, it definitely stands out from the crowd of ordinary LCD wristwatches. It’s also quite a step up from [Eric]’s previous watch design, the Time Machine Mk.IV.

Over the years we’ve seen several other examples of how a bare PCB, or even a stack of them, can become a beautiful wristwatch.

Apple Invent The Mechanical Watch

The Apple Watch has been on the market for long enough that its earlier iterations are now unsupported. Where some see little more than e-waste others see an opportunity, as has [NanoRobotGeek] with this mechanical watch conversion on a first-generation model.

What makes this build so special is its attention to detail. Into the Apple Watchcase has gone a Seiko movement, but it hasn’t merely been dropped into place. It uses the original Apple watch stem which is offset, so he’s had to create a linkage and a tiny pulley system to transfer the forces from one to the other. The rotor is custom-machined with am Apple logo, and the new watch face is a piece of laser-cut and heat treated zirconium. Even the watch movement itself needed a small modification to weaken the stem spring and allow the linkage to operate it.

The build is a long one with many steps, and we’re being honest when we say it would put our meager tiny machining skills to an extreme test. Sit down and take your time reading it, it really is a treat. Apple Watches may head to the tip after five years, but not this one!

See more in the video below the break, and of course long-time readers may remember we’ve considered the Apple Watch versus mechanical watches before.

Continue reading “Apple Invent The Mechanical Watch”

Billion Year Clock Is LEGO Genius Or Madness

If you are a fan of LEGO bricks or Rube Goldberg, you should have a look at [Brick Technology’s] billion-year LEGO clock. Obviously, it hasn’t been tested for a billion years, and we wonder if ABS would last that long, but the video below is still worth watching.

Even if you aren’t a LEGO fan, the demonstration of a pendulum clock and escapement is worth something and really shows the practical side of things. Of course, making a pendulum clock that keeps time isn’t anything magic — people have been doing that for centuries. But then more and more elements join to keep track of more time.

You might wonder how the pendulum keeps going for a billion years. Well, honestly, it can’t. But a solar panel charges a battery that rewinds the clock when the drive weight reaches the bottom. We imagine the solar cell and battery would be maintenance items if you expected the billion-year life cycle.

Some will ask why, but we get it. If you must explain why you build everything you do with LEGO, you are doing it wrong. The clock even keeps track of the galaxy’s rotation which, apparently, completes every 230 million solar years.

We’d be impressed with this clock even if it weren’t made with LEGO. Sure, it isn’t as posh as the fancy clock in Denmark. But it does work longer — at least, in theory — than most other LEGO clocks we’ve seen.

Continue reading “Billion Year Clock Is LEGO Genius Or Madness”

Old Clock Transformed Into Mesmerizing Light Display

It’s easy to find a cheap clock at any dollar store that will manage to tell the time, but chances are that the plastic-fantastic construction won’t do you any aesthetic favors. Fear not, though, for [ROBO HUB]’s upcycled design turns a humble clock into a mesmerizing horological display of beauty.

The build starts by scavenging the movement out of a cheap plastic clock. A CD is then glued to the front of the movement to serve as a reflective backing plate. For numerals, the clock uses F3, F6, F9, and F12 keys nabbed from a keyboard.

The real party trick, though, is in the lighting. This build is elevated beyond hackneyed 90s desk clocks by the inclusion of a ring of LED strip lighting. When switched on, the LED light reflects and refracts on the surface of the CD, creating a mesmerizing shifting pattern featuring all the colors of the rainbow.

CDs are actually quite magical from an optical perspective and have all kinds of nifty uses.

Continue reading “Old Clock Transformed Into Mesmerizing Light Display”