Wednesday, January 22, 2014

Old-School Standing Arcade


This year for Christmas, I wanted to build something really cool for my son. He's really into Tron right now, so I figured that I would build a Tron themed standing arcade.

The Parts




Electronics
1 - 42" TV (you can adjust schematics for smaller sizes)

Everything else
1 - 4' x 8' x (3/4") sheet of plywood
1 - 8' x 3/4" quarter round moulding
3 - cans black spray paint (flat)
1 - can white spray paint (glossy)
1 - 2'x4' - 1/8" mdf
2 - 3' x 1/4" square wood dowel
2 - 3' x 3/4" square wood dowel
painters tape, wood glue, putty, sand paper


For those who don't know, a Raspberry Pi is a $35 credit card sized computer that runs a version of linux. It supports HDMI and RCA video. Audio can be supplied either with HDMI or a 3.5mm jack  I chose to use this simply because I had one sitting around that I had been using as a web server but no longer needed. If you aren't familiar with linux, it's ok. You don't really need to know anything to get this up and running. If you want to be able to run two 8 way joysticks plus ten buttons, you may want to find a friend that knows how to solder. For a non-solder version, just use two buttons per player, rather than four (plus two more for universal 'start' and 'select' buttons)  Lets get to building this thing!




The Build



The bulk of the arcade was built from a single 4'x8' sheet of 3/4" plywood. Pay the extra to get the nice smooth stuff, it's worth it when it comes time to paint. You can also use 3/4" mdf, but it require a lot more paint because mdf tends to really suck that stuff up.

Here are the general blueprints. Be careful not to mangle the pieces labeled 'extra' too much. You will need to cut pieces off of them in order to make backings for other pieces.


Marking off my cuts. If you don't have a big 6' carpenters level, I really suggest getting one! It made everything so much easier. I got mine at Harbor Freight for $10 bucks.


This is my sheet of plywood after having made my first round of cuts.


After the initial cuts, clamp the two sides together and cut out the 'inner arms'. Then sand the edges of the 'side' pieces until they line up with each other.


Clamp 'inner arm 1' to 'side 1'. Since the cuts on the inner arms are made at 45 degree angles, they should line up just right with the top of where they were cut out in the side pieces. Use a carpenter square to insure the arms go straight out, as they will become the control table. Do the same thing with 'inner arm2' and 'side 2'. Make sure that you flip side 2 over though, so that the inner arms will both be on the inside of the arcade.


I wasn't able to take a picture of the actual process (both hands in use), but line up the shorter 'outer arms' with the inner arms. NOTE: you will need to mark the angle of the hypotenuse of the 'side pieces' on the 'outer arms' and then cut them off at that point. The outer arms will sort of rest on the hypotenuse edge of the 'side' pieces.  


This is the 'inside' of the arcade. The horizontal piece is the
inner arm. I cut small scraps from the extra pieces to use
as backing mount points. Here, I have one piece sideways 
to use as a spacer, so that the front panel will line up with
the hypotenuse edge of the 'side' pieces.


This is after gluing the backer piece and removing the 
spacer (opposite side of course). 


I did the same thing in the middle and at the bottom of the 'side' pieces, but I used two (2) spacers, rather than just the one (1) that I used at the top. I did this mostly for aesthetics, but also because I'm lazy. The front of the cabinet is two pieces, so rather than cutting one of them down so that they can be flush with each other, I just layered them, so the bottom one goes behind the top one.


Here you can see the layering of the top and bottom front pieces. I have also, already laid the control table top across the arms. (you will notice that the control panel does not cover the outer arms, those will be covered with the 3/4" quarter round.)


I intentionally left about a 1 inch space between the top of the front panel and the control panel, this way I can easily feed any cables through to the back.


Here's a picture of the back. I used some scrap 2"x4" to keep the spacing correct while things were being glued.


I attached the 'outer arm bridge' and 'inner arm bridge' to the front of the two arms. Then I added the 3/4" quarter round to all of the exposed 'outer' pieces. A little putty and sanding and it all looks like one nicely rounded piece.



I wanted to add some chrome T-moulding to the edges (just like the real guys use), but I needed a channel cut in the center of the edges. You can buy a bit for your router (but it's like $30 bucks), so I just used a $3 rough cut reciprocating saw blade. I think that it is like 10 inches long or so. I just held it in my hand and slid it up and down along the edges and it made pretty short work of it. No need to make any of it pretty, it's all getting covered by the moulding. 
You can also see that to the right of the groove that I cut, I also attached some of the 1/4" square wooden dowel. This will be used to hold the 1/8" mdf board in place over the TV. I didn't want that board permanently attached, in case I needed to remove the TV at some point.





This is how I drew out the outlines for my buttons and joysticks. With the curved edge of the 3/4" quarter round, I quickly found that I need something a bit more exact to rest my carpenter squares on, so I clamped my 6' level to the edge and that worked wonderfully. This shows the outline for 1 joystick and 4 buttons.
Pro-tip: If you need to make lines parallel to your base line, use 2 carpenter squares. Place one against the base line, then place the other (hypotenuse to hypotenuse) against the first. The top edge of the second square is parallel to your base line. 


2 joysticks, 4 buttons, plus 1 player & 2 player buttons at the top. You may have noticed the large rectangular cutout at the back of the control panel (top of the picture). I had to add this to accommodate the back of my TV. It is an older LCD TV, so even though it's a 'flat screen', the base was still kind of beefy.


I used a 1" hole saw, then I used a wood hand chisel to cut out the square section. After doing the first 4 of 10, I was really regretting buying the square buttons. Circular buttons would have been so quick and easy.


Test fitting the buttons. They fit like a glove! I was getting way excited as I saw them actually in place.



Cutout for the joystick. Test fitting the joystick face plate. The joystick face plate was a really dull gray color, eventually, I sanded them clean with a high grit sand paper and really shined 'em up. The joysticks were tricky to fit just right. The electronics were actually a little bit bigger than the face plate, so I had to scoop away some of the underside of the control panel underneath to make room for the electronics. I could have just made a hole and mounted the whole thing on the underside (which is what I think that they had in mind); but then the joystick wouldn't have been much more than just a nub sticking through.


Originally I started painting with a glossy latex paint. I didn't like the way that It was turning out, so I switched to a flat black spray paint. The whole cabinet used about 4 cans of black and 1 can of glossy white.


This is the border that I cut out of 1/8" mdf with a box cutter. I didn't include the dimensions for this in the plans because it will vary depending on your TV. I just used it to cover the bezel and allowed for enough room to add a marquee sign at the top. (This is it after having been primed and with one coat of the flat black paint.) The TV was underneath that tarp. Apparently the tarp was not waterproof and the paint/primer seeped through and onto the TV. I was able to clean it off pretty easily with tea tree oil essential oil.





I used a white glossy lacquer spray paint for all of the white lines. At the end of each line, I painted a metal washer with the white paint and then glued it in place. It made it look very much like terminal points on a circuit board.

The Electronics

This, my dear friends, is the Raspberry Pi. This is the model B version with 512mb of ram. The pins that are near the bottom of the picture are the GPIO (general purpose input output) pins. They are what we are going to use to receive input from our buttons and joysticks. 


The picture isn't great, but if you look closely, you can see a shorter row of pins. These ones have to be soldered on by hand, they don't come with the board. It's fairly easy, but if you don't feel comfortable doing it, I suggest finding someone that is. Otherwise, you can just reduce the number of buttons to accommodate.


I picked up a cheap plastic case for the RPi for $9 on amazon. I used a rotary tool to cut a hole for the wires and the GPIO pins.


This is the Raspberry Pi (model B revision 2). Chances are, if you have or are buying an RPi, this is the model that you will be working with. Only early adopters have the other models (check for the mounting holes if you aren't sure, only the revision 2 has them.) The schematic to the left is a duplicate of the gpio pins. It shows what each pin is. All buttons need to be connected to a separate (green) gpio pin but the returns for the buttons can all go to the same ground (black) pin. If you bought the types of buttons or joysticks with LED's, you will connect them in parallel to both a 3.3v (gold) and ground (black) pin.


Now, you need to connect a pair of your quick connect wires to each side of each of your buttons. Next, connect the male ends of two of your jumper wires into the female ends of the quick connect wires. One of these jumper wires will run to your ground (black) pin, the other will run to one of the labeled (green) pins, depending on which button you want this to be. Repeat until all buttons are connected, you can wire all of the ground wires together before connecting to the ground pin. The joysticks connect similarly, but there are 4 wires that run to the corresponding labeled (green) pins and 1 wire that will run to the common ground pin.

The Software

First off, there is some software that you will need to download:
Win32 Disk Imager - Used for installing the software to the SD card
Adafruit Retrogame - Used for recognizing the buttons and joysticks
PiMAME - Used for running the game emulators

None of this software is written by me! All licenses belong to their respective parties. These instructions are as of PiMAME version 0.7.10

Setting up PiMAME
1. Unzip the PiMAME image
2. Run Win32 Disk Imager
3. Click the little blue folder button
4. Select the PiMAME image that you unzipped
5. Insert your SD card
6. Select your SD card in the 'device' dropdown
7. Click 'Write'
8. Eject SD card and put it into your Raspberry Pi
9. Plug in your RPi and let it boot up
10. After booting up, select 'Exit (return to command line)'
11. Type 'sudo raspi-config'
12. Choose option 1 - 'Expand Filesystem'
13. Go to 'Finish'
14. When asked if you would like to reboot now, select 'No'

Setting up Retrogame
If you have connected your RPi to your network (recommended)
1. Get your IP address by typing ifconfig eth0
2. write down your 'inet addr' (probably something like 192.168.1.whatever)
3. Go to any computer on your network
4. Unzip the retrogame.zip file that you downloaded earlier
5. Type your RPi IP address into a web browser
6. Click 'Rom Uploader' and log in (user: pi, password: raspberry)
7. At the bottom in the 'New Folder' textbox, type in retrogame and click 'Create New Directory'
8. Click on the newly created directory then click 'choose file' 
9. Upload 'Makefile', then 'retrogame.c'
10. Back on your RPi, type in cd retrogame
10. Then type in sudo nano retrogame.c
11. This will open an editor, scroll down a bit until you see something that looks similar to this:

  1. } io[] = {
  2. // Input Output (from /usr/include/linux/input.h)
  3. { 25, KEY_LEFT },
  4. { 9, KEY_RIGHT },
  5. { 10, KEY_UP },
  6. { 17, KEY_DOWN },
  7. { 23, KEY_LEFTCTRL },
  8. { 7, KEY_LEFTALT }
  9. };

Change that section to this:

} io[] = {
//  Input    Output (from /usr/include/linux/input.h)
{  2,       KEY_LEFT },
{  3,       KEY_RIGHT },
{  4,       KEY_UP },
{ 17,      KEY_DOWN },
{ 27,      KEY_ENTER },
{ 22,      KEY_SPACE },
{ 10,      KEY_1 },
{  9,       KEY_2 },
{ 11,      KEY_A },
{ 18,      KEY_D },
{ 23,      KEY_W },
{ 24,      KEY_S },
{ 25,      KEY_R },
{  8,       KEY_T },
{ 28, KEY_RIGHTCTRL },
{ 29,      KEY_RIGHTSHIFT },
{ 30,      KEY_Y },
{ 31,      KEY_U }
};

12. Press 'Ctrl+X', then 'Y', then 'enter'
13. Now type sudo make
14. Type sudo modprobe uinput
15. Next type sudo sh -c 'echo uinput >> /etc/modules'
16. Type sudo /etc/rc.local
17. After the last line, type /home/pi/retrogame/retrogame &
18. Press 'Ctrl+X', then 'Y', then 'enter'
19. Lastly, type sudo reboot

Assuming everything went correctly, you should now be able to control the pimame menu with the player 1 joystick! Hooray! If not, here are some references for you to troubleshoot.

The End Result




1 comment: