Build 18!
Nolan | January 17, 2010Hello again from Pittsburgh!
I spent some time over the last few months continuing my electronics tinkering, and I’ve successfully completed two new gadgets along with a friend from school, Billy Keyes, as part of a week-long extravaganza at CMU called Build 18. It’s for ECE majors exclusively, and turned out to be a lot fun!
WARNING: Technical information follows. Skip down to the end for the pictures
Hard Drive Speed Game
When I got home from break, I was really anxious to try out a project that I ran across that made a “Spin The Hard Drive” game out of old 1-5 GB hard drives that weren’t being used anymore. So, getting the permission of my Dad, I ripped apart his old Western Digital and started playing with it. Since I didn’t have a scope back home, I had to guess a little bit on the values of the resistors for my voltage comparator. After a while, the green LED on my Arduino shield started blinking when I moved the hard drive, so I knew I hit the right spot. After adding a little hysteresis with a feedback resistor, it was working consistently enough to check it with an Arduino interrupt.
Switching over to the Arduino, it was pretty easy to set up an interrupt routine and convert over to RPM. See below for the code I used:
/*Hard Drive RPM Monitor*/ int interruptPin = 2; long oldtime, difference = 0; volatile int clicks = 0; volatile long oldclick = 0; int rps, rpm; void setup() { Serial.begin(9600); Serial.println("Serial works..."); pinMode(interruptPin, INPUT); attachInterrupt(0,click,RISING); } void loop() { if (clicks >= 4) { //Every 4 "clicks" is one rotation difference = micros() - oldtime; oldtime = micros(); clicks = 0; //Rotations per minute Serial.println((int)(60000000.0/difference)); } } void click() { //One "click" is 1/4 of a rotation //Delay should get rid of most false signals if (micros() - oldclick > 100) { clicks++; oldclick = micros(); } }
After making a little GUI in Processing to receive the Serial data from the Arduino and display it on the screen, I was ready to go! In the picture below, I show someone getting a high score, and the fastest I’ve seen people spin it is around 1350 RPM, which is pretty ridiculous! At Build_18, someone suggested using the hard drive as a DJ mixer, which sounded really cool and will probably be where I will go with this hard drive next!
Keepon Tracking
Our second project involved an old security camera with a built-in internet connection that I got for free last year. When I got around to buying the power cable for it, I plugged it in only to discover that the camera was broken (hence why I got it for free). So, Billy and I came up with the idea for using it as a dancing robot ala Keepon. After hooking up the camera, a USB webcam for facial recognition, and a microphone, we realized two things very quickly. First,the security camera only took commands every .6 seconds or else it would time out (bad for complex motion, but still ok). Second, sound data (particularly claps) are not very good for interrupts, as our interrupt would trigger multiple times during the sound wave and our various attempts to solve the problem weren’t working. To fix our sound problem, we ended up just checking thresholds on the analog values from the microphone and put in a small time delay to ignore the rest of the wave. Once we found the beats, we just moved the robot left and right in sync with the beat and in half- or quarter-time as necessary.
- New Camera
- New High Score!
- Partner Billy and Ross, a fast spinner!
- Air Guitar Hero
- Half of Build_18
Overall, it was a great way to come back from break and hack around with some electronics. I’m looking forward to the next one!











