My original idea was to try to drop steel balls from a height in order to simulate a drum beat. I looked quite a bit into stepper motors, which are motors that don't feely spin, but spin at a fixed increment every time you pulse them with a signal. They're a little complicated, but not too bad.
In order to interface a stepper motor with the PC, you need some sort of hardware in the middle to translate the PC parallel port signals into something the stepper motor can use. The easy way to do this requires 4 data pins (out of 8) from the parallel port, which means I could only drive two stepper motors. The hard way required only a single signal line, but some more intricate bridgeware.
I decided to revert back to my ORIGINAL original idea, which was to use a solenoid (which also only requires one signal line). In case you didn’t know, a solenoid is an electromagnet with a metal rod in the middle of it. Turn on the current, and the rod shoots one way. Turn off the current, and a spring pushes the rod back. So it's pretty easy to see how that directly translates into drum beats... just hold the solenoid over the drum, and turn on the current for about 50ms, and it rod strikes down and then released. At a local junk shop (Industrial Liquidators off Convoy), I was able to find little anonymous solenoids for $1.50 for two. What a bargain.
So, I've got software that creates signals, and I've got solenoids. What next? I need a power supply for the solenoids, and then I need a way to turn on and off the circuit using the PC.
I begged an old PC power supply from a workboy, and learned how to get those to run on their own (they need some internal wires connected, one with a resistor to simulate load). The PC power supply outputs 5v and 12v (red and yellow wires), and also has black ground wires.
After lots of research, I learned about a particular integrated circuit that would do exactly what I wanted. It's called a ULN2803a Darlington Transistor array. A transistor is basically a switch. It has an input, an output, and a signal input. You attach voltage to the input, and ground to the output, and current will only pass through it while the signal input is on. And this little integrated circuit is basically 8 of those stacked together.
So, I did a little test using an LED. I hooked up one leg of the LED to power. I hooked up the other LED to this IC, and I attached the signal portion of the IC to my parallel port. (I had to buy a separate parallel port card for my PC... my motherboard didn't have one, and even if it did, I probably wouldn't want to use it. $10 on eBay!). I wrote a little application to output signals to the parallel port. So, just like a lightswitch, when the parallel port pin has a signal, it will allow current to flow through. When the parallel port is off, no current flows, and the light turns off.
Electronics Test - Click here for more blooper videos
It worked!
So I tried hooking up the solenoid in a similar manner. I had no data on the solenoid (I even did a "live online chat" on the manufacturer's support website, and they didn’t know anything about it!), so I tried it with the 5v power supply output. I carefully hooked everything all up, and tried my little test application.
Nothing.
I checked my wiring, and found a mess-up (oops!). I tried again. Still nothing.
I triple-checked everything again, and decided to try the 12v line from the power supply. I started up my application, and clicked the mouse, and the solenoid fired with a satisfying *click!*. It worked!
Shortly after that, I modified my code to send signals on and off to the parallel port with a variable delay time that I could adjust on the fly. I started off at one second, and the solenoid clicked on and off just like it should. Then I bumped it down to half a second, and down to a tenth of a second, and it clicked on and off that fast. Certainly fast enough to keep up with the fast drum rolls in Rock Band.
So that's about where I'm at. One open question is if the solenoid fires with enough force to register a hit on the drums. I'm estimating that it does, but I haven't actually tested that.
So, I need to find a way to mount a solenoid on each drum. Then I need to find a way to actually get video input into my PC (beg, borrow, or steal a video capture device). I think those are the only open questions, and they shouldn't be that hard. All the hard stuff is basically done!
4 comments:
Wow.
Gwen
I know. It's embarrassing to be such a geek sometimes, but what can I do?
I only know how to be one kind of Adman.
Sounds cool Adman, now if you could rewrite the previous post in a language that I could understand (maybe English?) that would be great.
this is very cool
Post a Comment