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 Runs Computer In Slow-Motion

At the heart of all computers is a clock, a dedicated timepiece ensuring that all of the parts of the computer are synchronized and can work together to execute the instructions that the computer receives. Clock speeds for most modern off-the-shelf computers and smartphones operate around a billion cycles per second, and even clocks that tick at a human-dizzying speed of a million times per second have been around since at least the 1970s. But there’s no reason a computer can’t run at a much slower speed, as [Greg] demonstrates in this video where he slows down a 6502 processor to a single clock cycle per second.

To reduce the clock speed from the megahertz range down to a single hertz or single clock cycle per second, [Greg] is using the pendulum from an actual clock. He attaches a small magnet to the bottom of the pendulum which is counted by a sensor as it swings past. Feeding that pulse into a monostable conditioner yields a clock signal which is usable for one of his 6502-based computers, and at this extremely slow rate, it’s possible to see the operation of a lot of the computers’ inner workings a step at a time. In fact, he optimized the computer’s operation as this slow speed let him see some inefficiencies in the program he was running.

It helps if your processor is static, of course. Older CPUs with dynamic storage for registers and some with limited-range PLLs would not work with this technique. The 8080A, for example, required a clock of at least 500 kHz.

Not only can this computer use a pendulum clock as the basis for its internal clock, but [Greg] also rigged up a mechanism to use a heartbeat. Getting in a little bit of exercise to increase his heart rate first will noticeably increase the computer’s speed. And, if you’re looking to get a deeper glimpse into the inner workings of a computer, we’d recommend looking at one which forgoes transistors in favor of relays.

Continue reading “Clock Runs Computer In Slow-Motion”

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”

A clock made with LED displays and reflective film

Clever Optics Make Clock’s Digits Float In Space

If you’ve never heard of Aerial Imaging by Retro-Reflection, or AIRR for short, you’re probably not the only one. It’s a technique developed by researchers at Utsunomiya University that uses beam splitters and retroreflective foil to create the illusion of an image floating freely in the air. Hackaday alum [Moritz v. Sivers] has been experimenting with the technique to make — what else — a clock, appropriately called the Floating Display Clock.

The most commonly available retroreflective films are typically used for things like street signs and high-visibility clothing, but also work perfectly fine for homebrew AIRR setups. [Moritz] tried several types and found that one called Oralite Superlens 3000 resulted in the best image quality. He combined it with a sheet of teleprompter glass and mounted both in their appropriate orientation in a black 3D printed enclosure.

An inside view of a clock based on the AIRR projection techniqueThe projected image is generated by a set of 8×8 RGB LED displays, which are driven by a PCA9685 sixteen-channel servo driver board. A Wemos D1 Mini fetches the time from an NTP server and operates the display system, which includes not only the LED panels but also a set of servos that tilt each digit when it changes, giving the clock an added 3D effect that matches nicely with the odd illusion of digits floating in space.

We can imagine it’s pretty hard to capture the end result on video, and the demonstration embedded below probably doesn’t do it justice. But thanks to [Moritz]’s clear step-by-step instructions on his Instructables page, it shouldn’t be too hard to replicate his project and see for yourself what it looks like in real life.

Although this isn’t a hologram, it does look similar to the many display types that are commonly called “holographic”. If you want to make actual holograms, that’s entirely possible, too.

Continue reading “Clever Optics Make Clock’s Digits Float In Space”

Holograms Display Time With ESP32

Holograms and holographic imagery are typically viewed within the frame of science fiction, with perhaps the most iconic examples being Princess Leia’s message to Obi-Wan in Star Wars, or the holodecks from Star Trek. In reality, holograms have been around for a surprising amount of time, with early holographic images being produced in the late 1940s. There are plenty of uses outside of imagery for modern holographic systems as well, and it’s a common enough technology that it’s possible to construct one using an ESP32 as well.

In this build, [Fiberpunk] demonstrates the construction and operation of a holographic clock. The image is three-dimensional and somewhat transparent and is driven by an ESP32 microcontroller. The display is based around a beamsplitter prism which, when viewed from the front, is almost completely invisible to the viewer. The ESP32 is housed in a casing beneath this prism, and [Fiberpunk] has two firmware versions available for the device. The first is the clock which displays an image as well as the time, and the second is more of a demonstration which can show more in-depth 3D videos using gcode models and also has motion sensing controls.

For anyone interested in holography, a platform like this is might make an excellent entry point to explore, and with the source for this build available becomes even easier. It’s almost certainly less expensive than these 3D printers that can turn out custom holographic images, and has the added benefit of being customizable and programmable as well.

Continue reading “Holograms Display Time With ESP32”

A white, house-shaped clock with the words "TEMPUS NECTIT" written in faux Roman script in black on a strip of silver at the base of the "roof." a white power cord extends from the left of the enclosure, and the center of the clock is a 22 pin knitting machine wheel with one pin covered in silver metalic. A white plastic peg extends from the bottom right of the enclosure to hold the feedstock yarn.

Tempus Nectit, A DIY Knitting Clock With Instructions

We’re no strangers to unusual clocks here at Hackaday, and some of our favorites make time a little more tangible like [Kyle Rankin]’s knitting clock.

Inspired by our coverage of [Siren Elise Wilhelmsen]’s knitting clock, [Rankin] decided to build one of his own. Since details on the build from the original artist were sparse, he had to reverse engineer how the device worked. He identified that a knitting clock is essentially a knitting machine with a stepper motor replacing the hand crank.

Using a Raspberry Pi with an Adafruit motor hat connected to a stepper motor and a 3D printed motor adapter, [Rankin] was able to drive the knitting machine to do a complete round of knitting every twelve hours. By marking one of the knitting pegs as an hour hand, the clock works as a traditional clock in addition to its year-long knitting task. [Rankin] says he still has some fine tuning to work on, but that he’s happy to have had the chance to combine so many of his interests into a single project.

If you’re looking for more knitting hacks, check out this knitted keyboard instrument or a knitted circuit board.

Continue reading “Tempus Nectit, A DIY Knitting Clock With Instructions”