This project is my personal rendition of the popular persistence of vision (POV) hard drive clock design. I had seen a few of these online before, and decided that it would be a fun project to try to build one myself. If you haven’t encountered one of these before, the basic idea is that you take an old hard drive, and use some LEDs and some eye trickery to create the illusion of illuminated clock hands on the spinning hard drive platter.
How it Works
The operation of a hard drive clock is fairly straightforward, though difficult to describe in words. One of the important underlying concepts is that of “persistence of vision”. In a very oversimplified explanation, POV simply means that the human eye retains an image for a short amount of time (tens of milliseconds) after it has been observed. As a result of this limited temporal acuity, visual events that happen in very quick succession may be perceived to be happening at the same time. For example, fluorescent light sources powered from a mains ballast actually flicker at 120 Hz (it cycles on and off for each half-wave of the supply), but we perceive it as a steady source because the flickering is too rapid to discern the individual cycles.
In the hard drive clock, there is a a ring of LEDs that provide backlighting behind the hard drive platter. In general, the LEDs do not need to be independently controlled. They are on the same circuit so that, at any given instant, they are all the same color (the only reason that there are multiple LEDs is just to better distribute the light). The hard drive platter itself has a small radial slit cut into it that allows a sliver of light from the LEDs to pass through. When the clock is operating, the hard drive platter spins at a rate much faster than our eyes are capable of perceiving, creating a sort of “time-average” image of the platter. In general, we cannot discern the position of the slit at any given time because it is blurred into the rest of the platter. However, if the backlighting is applied for a fraction of a second while the slit sweeps over a partial rotation, our eyes will see the light that was emitted over that sector and it will persist momentarily to create the illusion of the entire sector being illuminated. This illusion can be maintained in the long term by actuating the backlight at the same location during each rotation of the platter. Thus, by precisely monitoring the position of the platter and controlling the timing of the backlighting, it is possible to create any number of radial patterns on the platter.
Technical Details
At a high level, there are four major aspects to this project: physical hardware, motor control and position sensing, backlighting driving and timing, and timekeeping and user interface logic.
The physical hardware includes the actual hard drive case, motor, platter, PCB, etc. For this project, I used an old 30GB Quantum Fireball hard disk drive. I gutted the existing PCB and the electronics that were on the inside of the drive. However, I kept the read/write head in tact for aesthetics. The hard drive platter was removed and, using a Dremel, a slit was cut from the outside toward the center of the platter. A prefab RGB LED light ring that I scrounged up online was taped around the spindle using double-sided foam tape. The original cover was replaced with a plexiglass sheet. Unfortunately, the original cover was extruded to accommodate the motor spindle, as it sticks out slightly from the rest of the enclosure. I used some rubber grommets as spacers to bring the plexiglass away from the spindle. The LED wires were brought out to the back of the hard drive, where they are attached, along with wires from the motor, to the controller PCB. Actually, this was the first surface mount board that I had designed, and my first time soldering surface mount components. It was kind of a pain, but I’m sure it will get better with practice. The PCB was secured to the back of the enclosure using more double-sided foam tape.
The motor control aspect is a task that could potentially be very difficult. A sensorless motor such as the hard drive spindle motor can take a considerable amount of effort to implement. There are both hardware considerations, like how to drive the motor windings and measure the back EMF, as well as software logic design and processing overhead. Manually driving a sensorless, brushless DC motor can be a project in and of itself. To avoid this unnecessary complexity, I have enlisted the help of a Microchip 6502C motor control IC to do the heavy lifting for me. This frees up considerable microcontroller resources. Another major benefit is that speed feedback is provided as an output from the chip. Essentially, this output pin pulses each time the three-phase motor cycle completes. This information can be used to determine the relative position of the platter and thereby alleviates the need for any external sensors (many other hard drive clock projects use photonic or hall-effect sensors to determine the position of the slit in the platter as it rotates).
The backlighting also uses a more-or-less prefab solution. I was able to find some RGB LED light rings online. I simply mounted one of these behind the platter using some double-sided foam tape. The LED’s are the only component of the system that needs a 12V supply. As I chose to run the motor and the microcontroller at 5V (I’m using a 12V supply in conjunction with a 5V voltage regulator), I needed a way to interface the 5V output pins of the microcontroller with the 12V, high-power LED’s. For this task, I used a 74LS05 with open collector outputs at 12V to drive BJT’s controlling each of the three LED color channels.
The timing logic is responsible for taking the platter speed information and the realtime clock information and using them to draw a clock face on the platter. The microcontroller used in this project is a PIC18F2550 (selected simply because I had several of them laying around). The input capture functionality is used to measure the time between rising edges of the motor speed feedback output. As it happens, the spindle motor used in this hard drive actually uses four 3-phase motor cycles per rotation. Fortunately, the PIC offers a 4:1 hardware prescaler on the input capture edge detection, allowing the PIC to measure the precise timing of one platter rotation entirely in hardware. This rotation time is then divided by 60 to get the time of each “1 second” sector on the clock face. An output compare peripheral is then used to precisely trigger interrupts at each sector time and update the LED state. One of the timer peripherals is used solely to keep track of realtime clock data. Three pushbuttons are used to toggle between modes (set hours, set minutes, and set seconds), and increment or decrement the value in the corresponding mode.
Project Status
This project is currently on hold. Even though I have the main functionality working quite well, there is a fair amount of jitter in the display as a result of jitter from the feedback output of the motor control chip. Recall that the motor control chip only provides a speed output. By using this information to determine the position of the platter, we are implicitly integrating (as speed is the derivative of position). As a result, there is some unknown term that represents the rotational offset. The motor control chip is therefore good at providing information that we can use to determine the relative position of the platter, but not the absolute position. For this reason, we unfortunately cannot use averaging or other smoothing techniques to reduce the jitter because these may cause the rotational offset to drift (what good is a clock where the 12 o’clock position is not fixed?). Perhaps a software PLL (phase locked loop) could provide the steady pulse cycles that are required while removing the jitter. However, as I have only very limited familiarity with PLL’s, I’m not sure whether this is an appropriate solution or whether it’s feasible.
Another limitation of the project is that it currently makes use of a division operation every platter rotation, and numerous divisions each time the position of the hands needs to be updated (currently once per second). As the PIC does not have hardware division support, this division arithmetic is performed under-the-hood iteratively in software. Combined with the fact that the operands are larger than the native 8-bit word size of the microcontroller architecture, these operations are actually very expensive in therms of instruction cycles. I would very much like to rework the code to somehow reduce the use of division operations.
Also, this project is of limited practical application. Although it does, indeed, function as a clock, it is to noisy to go in most rooms. Actually, the motor itself is pretty quiet, with the platter only generating a soft whirring sound. The problem is that when you put the unit on a table or against the wall, the noise from the vibrations can be somewhat bothersome. As I’m not mechanically inclined, I’m not about to attempt to fix this issue. I think this project will most likely remain on hold indefinitely.