If you're into playing classic video games, there's just no substitute
for an arcade joystick and buttons. The clicky feel, the ball top stick,
it's all part of the experience. Not only that, but these games were
originally tuned for these types of controllers. So if you're going for
high scores, you may find you actually perform better with the right
equipment in your hands.
Adafruit has some great products to make
one of these for yourself. We can even leverage a little bit of the
21st century to make our 20th century experience wireless with the creation of Bluefruit EZ-Key.
Before we start with the rest of this project, check out the Bluefruit tutorial as you'll need to refer to it for information on how to pair the module and remap the keys
(this tutorial does not require remapping the keys but if you want to customize your joystick)
The first order of business is to figure out the connections on the joystick. Luckily, these work exactly as you'd expect. The black wire is common, and the other four are the direction switches. I used the meter to determine which was which when the joystick is sitting in my desired orientation, then labeled them for later.
Next, I attached the headers that come with the bluetooth module. I like to solder in a cross-pattern, the way you would tighten bolts on a sealing surface. This keeps the header from getting crooked, and spreads out the heat load as you go. Note that I'm holding the headers in place with blue tape, easily one of my favorite "tools".
Now on to the breadboard! I connected the four joystick directions to inputs 0-3 on the bluetooth module. These correspond to Up, Down, Left, Right, respectively. Then I pushed the pair button, and my laptop saw the device and immediately connected to it. Then, I fired up a text editor and created a grid of characters. If everything is working, I should be able to move the cursor around in this grid with the joystick. Success!
Now we know things are going to work as we expect, we can get serious and build an enclosure for these nifty bits.
Since the Adafruit joystick is the classic Japanese ball-top four-way style (like you'd find on Pac-Man or Frogger), I thought a clean zen style would be appropriate for this stick. A blonde wood enclosure felt right, and should also result in something you won't be ashamed to leave on the coffee table when guests come over.
There's a company called Walnut Hollow that sells through Amazon. They make all sorts of raw wood boxes that you can modify and finish yourself. They're a terrific source of cheap, nice looking project enclosures. Here's what I've chosen for the arcade stick:
going to mount all the bits in the lid. That will make wiring and
future maintenance much easier. So, I started by laying out my holes on
the lid. Once again, I'm using my beloved blue tape to assist.
For the Adafruit buttons, drill a 1-1/8" hole. I drilled pilot holes first, then drilled the final holes using a sharp paddle bit. Paddle bits tend to tear out the bottom of the hole, so drill from the top. Alternatively, use the more expensive Forstner bits if you have them. They make nicer holes, and are a bit easier to control.
The resulting hole will be a tiny bit too small for the buttons, but that's good. We want them to be just large enough for a tight press fit, so we'll go the rest of the way with a round file. I don't have a round file, but 80-grit sandpaper wrapped around a screwdriver works well.
Next, I drilled the hole for the joystick, and marked where the mounting screws needed to be. I'm mounting the joystick using wood screws from underneath. This will be strong enough for casual play.
We need pilot holes for the screws to avoid splitting the wood. The trick here is that the wood isn't tremendously thick, so we need to be very careful not to drill our pilot holes too deep. Here's a trick for that- choke up the bit so that the drill chuck will prevent it from going too deep. Then drill carefully. If your bit is sharp (and it should be!!), you'll have good control.
With all the holes drilled, this would be a good time to apply a finish to the box if desired. You could do a varnish or tung oil, for example. I'm opting to leave it raw, since I like how it looks and feels as-is. Your mileage may vary! Note that if you leave it unfinished, it will be a bit susceptible to moisture.
I mounted the power button in the side of the lid. This will become the back when the joystick is being used.
With all the components installed, it's time to start wiring!
I found a convenient spot for the bluetooth module, then tacked it down with blue tape.
Next, I cut all the wires to length, and stripped the ends. The bluetooth module will actually be held in place by the wiring. It's very light, and there are 9 solid core wires soldered to it, so that's really plenty of support.
The joystick is wired up the same as in the mockup. One side of each button is daisy-chained to ground. The other side of each button is wired to inputs 4, 5, and 6 on the bluetooth module. These correspond to the "Return", "Space", and "1" keys on a keyboard. These already map to commonly used fire, jump, and start buttons in many games, but you can remap whatever game or emulator you're using, if needed. Three buttons is plenty to play pretty much every classic game that you'll ever encounter. Two buttons would probably be enough, honestly, but since we have all the tools out anyway, why not overdo it a bit?
Once all the wires were cut and stripped, they were soldered in place.
The last order of business is the battery pack. This needs to be accessible so that we can change the batteries. To that end, I screwed a small piece of scrap wood to the side of the lid, then screwed the battery pack to that.
When the lid is on, the pack is "suspended" in the bottom of the enclosure. When the lid is removed as shown in these photos, the pack is held "above" the joystick, so the batteries can be easily changed.
Also note there's a washer behind the pack. This serves two purposes- it consumes some extra length on the screw, and makes clearance for the on/off switch on the battery pack. We don't need that switch, since we have our own, and it sticks out enough to interfere with insertion of the lid in the base.
That does it for our little joystick controller. Now all that's left to do is set some high scores!
Look mom, no wires!