The system works by timing the slot in the platter. The Arduino uses an internal timer to clock each revolution. It achieves this using an infrared gate, which triggers a hardware interrupt on every full revolution of the platter. The Arduino uses the revolution time and phase to schedule a second internal timer. This second timer uses an interrupt to schedule the timing of the LEDs, firing tens of thousands times a second to build a stable, visible image.
This work is based on Ian Smith's version of the same. His work is excellent, and his website on this topic will help provide a complete picture for this instructable.
Step 1: Gather Materials
Arduino - If you don't have an Arduino board, this link will show you where you can buy one. I developed this with a Diecimila, but I would expect the code to work on a Duemilanove without changes.
ULN2803A - This is responsible for switching the high current 12V LEDs.
RGB LED Tape - The best source I've found for tricolor LED tape is from Super Bright LEDs. A single 19.5" strip costs $19.95.
Super Bright LEDs: NFLS-RGB15
270 Ohm Resistor - Limits current to your sensor source.
10K Resistor - Pull-up for your sensor output.
You can build the platter sensor from either an infrared gate or a Hall-effect sensor. The infrared gate uses the slot cut out of the platter to disrupt the beam. The Hall-effect sensor will require that you glue a small but strong magnet exactly 180 degrees from the slot in the platter.
If you decide to use an infrared gate, you can either build your own gate from scratch or you can buy a manufactured gate. If you choose to build your own, you can use any old pair of infrared emitter/phototransistors (mine are from Radio Shack), or you can purchase the following:
Infrared Emitter - Used to provide an infrared beam to time the platter.
Infrared Phototransistor - Provides a pulse on every platter revolution.
I did not build my rig with a Hall-effect sensor. I chose to use infrared because I had the parts lying around, but a Hall-effect sensor is less obtrusive. If you choose to go the Hall-effect route, you will need to adjust a few details in this tutorial. For example, you will need to glue a magnet directly opposite of the slot. This will require changing the code loaded onto the Arduino to account for the 180 degree change in phase.
I have not tested this Hall-effect sensor, but I would expect it to work fine:
Hall-Effect Sensor - Provides a pulse on every platter revolution.
Step 2: Deconstruct a Few Hard Drives
Not all hard drives are alike, but they are remarkably similar. From brand to brand, they often have mechanically interchangeable parts such as platters, spacers, retaining collars and screws. In order to build my version, I had to take apart five hard drives to achieve the right configuration of parts and hard drive chassis.
The motor that spins the platter is known as the spindle. Most hard drive spindles are three terminal brushless motors. Driving this kind of motor is beyond the scope of this tutorial. To our advantage, most logic boards for hard drives will spin their spindle indefinitely.
Select a hard drive, and open the top case. Opening a hard drive requires a set of Torx screwdrivers. If you don't have any, you can pick up a set at any well stocked hardware store. Once you remove the top case, remove the entire read/write assembly. Be careful not to damage the underlying logic board, as it is required to drive the spindle.
Remove the platter retaining collar, and remove the platter stack. Make sure you save the collar, its screws, any spacers and any platters.
Here are a few important issues to be aware of as you proceed to select your candidate drive:
- The clearing of the platter over the LEDs is critical, and there is a very small space to fit them in. Once the LEDs are glued to the wall of the platter chamber, the platter must be able to freely spin. This means no part of the LEDs or its ribbon backing can touch the platter. It's important to test this before gluing anything to anything.
- The LEDs are too tall to hide below the first platter. The solution is to use a combination of spacers from various hard drive manufacturers to shim a single platter above the LEDs. This can be very tricky to achieve, and may have you tearing apart working computers in sacrifice to the cause.
- Once you have all of the above figured out, make sure you test the spindle driver! Screw it together (without the LEDs) and plug it in. Make sure the drive spins continuously! I had the perfect drive that would only spin for about a minute before quitting. I suspect it found the lack of a read/write head unsettling, and decided rest was best. The point is you don't want to carry out the remainder of this instructable with a drive that won't continuously spin for you.
Step 3: Cut Out Paper Platter
Grab a piece of thick, white paper and trace the outline of a platter (both the inside and outside). Cut out your paper platter, and widen the central hole a few millimeters. Slip this over the spindle, and push it down to the floor of the platter chamber. You might need to trim the paper a little so it doesn't rip. This will serve as a white, reflective backing, making the color in your LEDs shine more vibrantly.
Once the backdrop is positioned, make sure the spindle can still spin freely. If it can't, trim the center hole of your backdrop.
Step 4: Build LED Bridges
If you are building the bridges out of wood, you will want to use a band saw. The pictures will help guide you.
Using a platter as a template, mark out a half-circle from your material. Make sure there is ample material around your half-circle. Cut out your half-circle, and toss it. Use the remaining outline to build the bridge from.
Line up your circle outline with the platter chamber. Mark off extra material, and trim it. This might take a few iterations to get right. You should be left with a roughly 1" thin, 3.5" wide U-shape. Once you have this shape, measure the center, and mark half an inch on either side. Remove this center.
You now should have two curved pieces. Test fit them on either side of the chamber gap. You might find that knobby features of the chassis require further refining of a certain bridge. Continue to cut away material until they you have a snug fit. The chamber wall should be flush with your bridges, or the LEDs will mount askew. Make sure the platter can spin freely with the bridges in position, shaving down any excess material.
Grab some strong, quick setting glue and glue each bridge to their position. Make sure to hold the bridge down until the glue sets.
Step 5: Cut the LED Tape
The LED tape can be separated into groups of three. Cut out one section of three groups. Do not separate the tape into three groups. You want one piece of tape with nine LEDs. This should leave a reasonable gap for the platter sensor, where the read/write assembly used to sit. Make sure you cut the tape on the line between copper tabs, or else you may severe internal traces rendering the affected section useless.
Step 6: Solder Wires to the LED Tape
Step 7: Glue the LED Tape in Place
Step 8: Cut Slot in Platter
Step 9: Build the Rotational Sensor Rig
My measurements are based on my hard drive chassis. Make sure to measure your platter height with respect to the floor of the chassis. Use a piece of paper, and mark the platter height with a pen. This way, you can accurately measure with a ruler.
The platter in my rig is 1/2" above the chassis. The design of my sensor rig is based on this height. Adjust as neccessary.
Grab a piece of 1/2" thick wood, and cut out a 1" by 1-1/2" rectangle. Cut out a notch from one side, 3/4" deep and 1/4" from the top and bottom. Mark a point on the top a 1/4" from the side and front. Use this point to drill a 3/16" diameter hole through the entire block. A drill press will keep the hole straight through both sections.
Once you have finished making the rig, test fit it within the chassis, making sure the platter can spin freely. Push the emitter and photo-transistor into either hole, and test fit the rig in the chassis again. Make sure the platter can spin freely. Once you are happy with your rig, proceed to glue the emitter and photo-transistor in place.
Step 10: Wire the Rotational Sensor
Cut four equal lengths of wire, roughly a foot and a half in length. Two of the wires should be black, while the other two should be two different colors other than black (like red and yellow).
Solder a black wire to the anode lead of the emitter. The anode is the shorter of the two leads, while the cathode is the longer. Using your second black wire, do the same for the photo-transistor. Solder the third wire (red in my picture) to the cathode of the emitter. Solder the fourth wire (yellow in my picture) to the cathode of the photo-transistor.
Once you have your wires soldered on, use heat shrink or electrical tape to shield and protect the exposed leads.
Cut your ground wires close to the body of the sensor, leaving a few inches of wire from either lead. Strip about an inch of insulation from each ground wire, and tie them together. Use a third piece of black wire, and tie it to the same junction. Solder the junction, and insulate.
You should be left with three wires, which you can wrap together for stability.
Step 11: Mount the Rotational Sensor
Step 12: Build Breakout Board
D3 - Wire to Digital Pin 3 on the Arduino
D4 - Wire to Digital Pin 4 on the Arduino
D5 - Wire to Digital Pin 5 on the Arduino
GND - Wire to GND Pin on the Arduino
5V - Wire to 5V Pin on the Arduino
SOUT - (Sensor Out) Wire to Digital Pin 2 on the Arduino
12V - Wire to 12V supply
GND - Wire to ground of 12V supply
RED - Wire to red wire of LED tape
GRN - Wire to green wire of LED tape
BLU - Wire to blue wire of LED tape
12V - Wire to common wire of LED tape
GND - Wire to ground wires of platter sensor
SPWR - Wire to supply of platter sensor
SOUT - Wire to output of platter sensor
Step 13: Upload Firmware to Arduino
Step 14: Serial Command and Python Extras
You can either communicate with the firmware using a terminal application such as hyperterminal or minicom, or you can use a programing language like Perl, Python or Java to orchestrate animations. The firmware sets the serial port's BAUD at 115200. Along with the code to the firmware, you will find a script called "clock.py". This python script will draw a clock face on the platter using the serial communication protocol.
The firmware sets up the display for 255 individual slices. It builds a double-buffered frame-buffer, allocating one byte to represent each slice. The double-buffer allows you to draw to the device without disturbing the current frame. Once you upload your frame, you must issue a page flip command (command f) to have it displayed.
r - Report on status
h - Write to the hidden page
v - Read the visible page
c - Clear the page
s - Set single slice number to a value
f - Flip page
1 - Setup test pattern 1
2 - Setup test pattern 2