HDDJ: Turning an old hard disk drive into a rotary input device

 by nvillar
Featured
P1010792.JPG
A couple of years ago we built a fun system that would allow DJs to mix music tracks in interesting ways. Our design called for an input device that would allow the DJ to quickly seek through a track and find a specific playback position, and we wanted to be able to do this by spinning a rotary control with a flick of the wrist - much like turntable DJs can spin the record back and forth to do the same.

We found that we had only limited choices for building our device: we first tried to use rotary encoders, but it is not easy to find a cheap encoder that spins smoothly and freely. Another alternative was to buy some audio equipment (like turntables) that spin well and feel good to use - but this seemed both expensive and wasteful for our purposes. Then, while looking for inspiration amongst assorted junk in the lab, we came upon a broken hard disk drive with its case open. We admired the quality of the bearings in the motor that drives the disk plates, enjoyed the fact that even a soft flick would get it spinning for a long time, and wondered whether we could sample an output from it when it was spun by hand, in much the same way that an electric motor, when turned, acts as a dynamo and outputs a voltage.

The answer is yes - and it's a very simple process to turn a hard disk into a rotary input device that has some unique properties. All you'll need is an old hard disk drive, a few op amps, resistors and a programmable microcontroller of some kind.

In this Instructable we'll show the basic principles behind this hack, then provide the schematics and firmware for the HDDJ device (shown below) that we used in our project, and which includes a few extra buttons, lights and a motorized slider for good measure.

 
Remove these adsRemove these ads by Signing Up

Step 1: Crack open a hard disk drive

P1040041.JPG
HardDiskAnatomy.jpg

Old, unwanted or broken hard disk drives (HDDs) are usually free and easy to get hold of. They come in all shapes and sizes, but the most common are the 3.5" HDDs that are used inside desktop PCs. We experimented with a number of different 3.5" HDD models, and found that most are suitable for our purposes (and would guess that smaller, laptop-sized disks would work just as well). The largest variation lies in how easy it is to open the case of some compared to others. Seagate HDDs, which often use plain Phillips screws in the casing, are our favorite.

The first step is to open the drive by removing all the screws that hold the case closed. Often these are torx screws, and you'll need an appropriate screw driver. Sometimes a screw will be hidden behind a label - so if you have trouble opening the case after all the screws seemed to have been removed, poke at the labels to find the culprit. If there is a label saying "Warranty Void if Removed," then, for sure, remove it.

Open the case, and reveal the disk platters in all their untouched glory. Never again will they be so free of fingerprints.

Remove the actuator that holds the read-write head, which stops the platters from spinning around freely. It's up to you how much more you want/need to remove (rule of thumb: anything sharp should go). The only thing that you need to keep attached are the frame, platters and spindle motor.

Thanks to Wikipedia for the "Anatomy of a Hard Disk Drive" image.
1-40 of 122Next »
FurtherThanTesla says: Nov 16, 2010. 4:47 PM
Just tested it, and it outputs the Grey Code as expected and behaves just like I imagined. Tesla would be proud :D
nerd7473 in reply to FurtherThanTeslaAug 30, 2012. 12:38 PM
yes tesla would be proud
ejay1 says: Feb 8, 2012. 2:44 AM
sorry to ask such a basic question, but the zigzag lines on the schematic are capacitors, right?
project_builder in reply to ejay1Feb 14, 2012. 4:18 PM
no the zigzag lines are resistors
Rhamkota says: Nov 30, 2011. 7:00 PM
What if my hard drive only has 3 connections to the motor
vadipp in reply to RhamkotaFeb 5, 2012. 10:45 AM
Then you should find the "center" one using an Ohmmeter and _not_ use that one. See the right image in http://en.wikipedia.org/wiki/File:Wye-delta.svg
vadipp in reply to vadippFeb 5, 2012. 10:57 AM
Hmmm, I just realized that this project relies on all four wires. Sorry, I don't know how to fix it :)
charlyv says: Feb 4, 2012. 12:11 AM
Wow, what a way to steer a boat.
Like flipping the disk, each few revolutions being a degree of turn and then when you stop the disk, the processor nulls the rudder. Would make it so easy to navigate with a GPS in a narrow area. Some ideas on how to implement hydraulic or heavy servo mechanics using the control output of your design.... gonna look that kind of scenario up...
Thanks!
skeetshooter11 says: Dec 28, 2011. 7:11 PM
awsome idea
isantos says: Dec 5, 2011. 6:01 AM
Instead of a LM324D, Can I use a LM386?
project dude says: May 11, 2010. 12:50 PM
 Solder what kind of cables, standard electrical cables or audio or video cables?
Data643 in reply to project dudeJun 28, 2011. 7:18 PM
There isn't much of a difference between the two...
recordmasta001 in reply to project dudeFeb 23, 2011. 1:43 PM
22 gauge wire will do fine :)
SaNjA2659 says: Apr 11, 2009. 6:41 AM
WANT A PARTS LIST, And can somebody tell me, how can I put files into microcontroller, or can I ask to write files there in a radio shack?
blackbeardlion in reply to SaNjA2659May 16, 2011. 1:37 PM
no you can't bring it to radio shack but you can make your own software using an avr microcontroller and the usb keyboard and mouse library. it's a bit of a task but you could learn allot if your new to microcontrolers
offnot in reply to SaNjA2659Feb 6, 2011. 5:48 PM
You have to read some books about PIC.
If you are a beginner of PIC, I'll recommand you an easy book.

Add me up as a MSN friend, "staybesideyou@hotmail.com"
natman3400 in reply to SaNjA2659Jul 6, 2010. 9:16 AM
You need a microcontroller programmer.
MECHOL says: May 1, 2011. 6:55 AM
incomprehensible
MECHOL says: May 1, 2011. 6:55 AM
incomprehensible
rlapse says: Apr 12, 2011. 1:03 AM
could this be done with the old spinny drums from VCR's, i think that that would look boss.
Lowkill says: Mar 3, 2011. 5:05 AM
Does the hard drive needs to be powered or I'm missing something here?
mman1506 in reply to LowkillApr 9, 2011. 6:34 AM
no. It does not, When you spin the platter it creates about 500 mv thats why you need a amplifier
CBMalloch says: Feb 27, 2011. 4:06 PM
I'm somewhat confused. The sine waves show three phases spaced at 120deg apart, and this implies that the fourth wire is some kind of common. This conflicts with the idea of "pick any three", because one is special.

Then, the outputs of the comparators show two signals in quadrature (90 deg apart) and one signal that is the inverse of one of the first two. Doesn't seem like the same device is being shown.

With four wires all alike, I'd expect them to be 90 deg apart, so there would be two pairs of inverse signals, with one pair leading the other by 90 deg. With three wires and a common (wye) I'd expect the three wires to be at 120 deg apart.

Do your pictures represent two different disk drives, wired differently?

Thanks for the instructable -- I'm going to try it myself.
efiscp says: Dec 25, 2010. 8:47 AM
I'm gonna implement this as a scrollwheel. A very fast scrollwheel. ;)
the_prototype says: Dec 6, 2010. 1:33 PM
hehe just realised I'm using exactly the same HDD as you are in the instructable :D
It's an IBM Desktstar, isn't it?^^
Really cool idea, my friends are gonna be like "wtf?" :D
tomtortoise says: Nov 17, 2010. 3:36 PM
can you make a schematic for JUST the rotary part no buttons or fader or lights and stuff because im thinking of using one of these for the most legit steering wheel ever for pc gaming
FurtherThanTesla says: Nov 16, 2010. 4:50 PM
one prob though. Once the platter stops rotating it gets a little upity. the lights blink with the slightest vibration of the whole thing, but once the platter is rotated again, its running smoothly. I Imagine this oversensitivity could be corrected with a high value resistor, or low value capacitor
FurtherThanTesla says: Nov 16, 2010. 4:12 PM
It should also give you some error detection. like, it is impossible for it to go from 11 to 00, or vise-versa, so you can tell it is misreading either by going too slow or too fast and ignore the reading
FurtherThanTesla says: Nov 16, 2010. 4:09 PM
Hey, my HDD only had three wires (im guessing a motor in a "whye" config) but it gave me an idea. use the green wave as the reference for the other two (save urself an opamp) and it will output a grey code like a rotary encoder! this will also improve your resoloution since a 2-bit grey code has four states per revoloution, while your three-phase setup gives three per rev. it goes like this- Green wave is higher than other two= 00, green goes below red=10, yellow goes up above green allong with red= 11, red starts to fall below green while yellow stays = 01 - This pattern will repeat and give you four steps per rev while saving an exta op amp! ill try it out and let you know :D
AriderM says: Oct 3, 2010. 8:21 PM
A couple months back I got this working. I used a Parallax basic stamp 2sx. Used an oscilliscope to find the correct pins. From there I connected them to the comparator (quad comparator in my case) and fed those to the stamp. It took me a few hours, maybe even a full day, but I got it working. I then took the serial out of the stamp and had that spit out to my desktop running virtualdj. Using midiYoke and some other stuff I changed the serial data to virtualdj midi commands. After that I could spin the disk and have the track play. The next step I have planned is to rebuild this setup and introduce a speed controller. This will allow me to set the speed of the disk by hand, press a button and have the speed controller maintain the disk spinning speed.
Ashiro says: Aug 22, 2010. 8:31 AM
Minor correction: "a very simple process". Change to: "a very simple process for an electronics engineering graduate with access to a lab for etching their own PCB."
jhakker says: Jul 14, 2010. 4:40 PM
I'd pay for one of these !
swathisanthu says: Jun 14, 2010. 11:58 PM
can u pleas send the HDDJ zip which is working pleazzzzzz
teinai says: Jun 14, 2010. 6:14 AM
Very very cool. I love the cubic fader tool in your paper too. It makes me very happy to be alive at this time when people are sharing brilliant ideas incorporating fun, music and technology. Makes me wish I was more focussed at university! Great work!!!
T-Hawke says: Jun 11, 2010. 7:37 AM
Very Cool. Adding this one to my to do list. I want to adapt or use in windows movie maker for a shuttle knob. Maybe size the platters and the case down to something more convenient that does not take as much space. Good instructable. Great idea.
mattgilbert says: Aug 30, 2009. 11:26 AM
Thanks for the instructable! I got one working with an Arduino:
http://www.youtube.com/watch?v=qaL5syVlae0

I posted the Arduino code here:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1251656637/0

Not quite how you did it, but I wouldn't have figured it out without this instructable. I used an old 1st gen iPod HD, and I only needed 2 pulse signals, amplified with LM386 op amps (would have used a LM358 dual opamp if I had one handy.)

It sends usb MIDI commands, routed by this program:
http://www.spikenzielabs.com/SpikenzieLabs/Serial_MIDI.html

to a shoddy Max/MSP patch that I threw together.
SinAmos in reply to mattgilbertJun 11, 2010. 1:21 AM
Sweet. What about with different inputs? Like actual tracks?
kbishop in reply to mattgilbertSep 10, 2009. 3:17 PM
i got a question though, how do you connect the usb cable to the op-amps, or where does it play it's role on the schematics? i ask this because i'm really temped to try but never done usb stuff like this before
mattgilbert in reply to kbishopSep 10, 2009. 5:41 PM
kbishop, if you mean my Arduino version, the Arduino communicates with the computer over USB, and it also powers and senses the output of the opamps.

http://arduino.cc/
SinAmos says: Jun 11, 2010. 1:17 AM
My kind of fun-zeyz.
1-40 of 122Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!