For this year’s Bring a Hack dinner after Maker Faire, I built a mini Ms. Pacman machine.
My goal was to have a playable game in an enclosure that resembled the full size cabinet.
Since I already had a Beaglebone Black sitting on the shelf, I decided to use it for the project.
- 1 - $3.95 - COM-09032 - Thumb Joystick
- 1 - $1.95 - BOB-09110 - Breakout Board for Thumb Joystick
- 1 - $59.95 - DEV-12085 - Beaglebone Black Cape - LCD (4.3”)
- 1 - $4.95 - COM-10302 - Tactile Button Assortment
- 1 - $4.95 - ID:706 - Stacking Header Set for Beagle Bone Capes (2x23)
- 1 - $9.95 - ID:572 - Adafruit Proto Cape Kit for Beagle Bone & Beagle Bone Black
- A sheet of 1/8” plywood underlayment from Home Depot
- A sheet of 12”x12” lexan
- 3M 77 Spray Adhesive
- Rustoleum enamel gloss black paint
- Wood glue
- Various resistors and LEDs
- Scroll Saw
- Hot Glue Gun
- Drill Press w/1” forstner bit
- Soldering Iron
- Wire Cutters
- Inkjet Printer
- X-acto Knife
I began by finding dimensional EPS drawings of the full size Ms. Pacman arcade cabinet online and bringing them into Gimp. I placed the left, right, and front elevations in a single layer, and then created a second layer for the artwork. I found the highest resolution images that I could via Google Image Search and lined them up with the cabinet outlines. I had to do some image work to put a Bally coin door on the front panel. I pieced together the bezel and control panel art on a different image, and overlayed that with the dimensional drawings of the Beaglebone Black Cape from 4D Systems. In order to center the screen, I had to offset the panel by a certain amount. Since I knew the width of the panel, this drawing gave me a measurement for the width of the cabinet (exclusive of the side panels) - 98.3mm.
I exported PNGs from Gimp - one with the dimensional layer, and one with the art layer. I opened these files in a program called BigPrint. BigPrint lets you scale a drawing accurately from a known feature length. You can then crop and print successive portions of the image. I scaled the dimensional drawing by the 98.3mm width and printed the two sides on plain paper. I then did the same with the artwork, but printed it on photo paper.
I roughly cut around the outlines for the dimensional printouts and used 3M spray adhesive to attach them to 1/8” plywood. I used a scroll saw to cut the pieces out. I used a jigsaw to cut a single length of 98.3mm wide plywood for all the central cabinet parts. I was able to slice these up as I went on the scroll saw. I generally did not use the dimensional drawings to try to precut the central parts to length. Rather, I just used my dial calipers against the dimensional side drawings as a reference.
I also cut two pieces of lexan on the scroll saw for the marquee and the bezel/control panel.
I began building the case by gluing up the front and bottom of the cabinet against the left hand side. I just eyeballed this and let the surface tension of the glue hold everything together since the parts were small. I did the same for the top, marquee, the parts above and behind the screen, and the supports at the back of the case. My original intent was to have a back door on the cabinet which would be velcroed on. Since I based my measurements solely on the width of the Beaglebone display cape, however, the boards ended up sticking well out of the back of the cabinet, especially taking into account the clearance from the USB cables.
I wired up three white LEDs to resistors and hot glued them to the inside of the marquee box and ran the wires out the back. I tore apart the Logitech USB speakers and desoldered the right side speaker from the board. I ended up with a USB cable, the circuit board, and a small speaker with a mounting bracket. I hotglued the board to the front inside of the cabinet and screwed the speaker down to the bottom. I then attached the right side of the cabinet and clamped it down to eliminate any gaps.
I eyeballed supports for the Beaglebone stack and the joystick breakout board. Getting the positioning right on this part before drilling and gluing down the Lexan was the most mechanically difficult part of the project.
I made it so the boards slide in from the back of the cabinet. The display cape’s circuit board sits on top of two wooden supports and the proto cape and Beaglebone hang underneath.
I mounted the joystick with screws and hot glued down the bottom of the one-player start button to the supports under the control panel. I drilled holes in the Lexan and hot glued that down at the front and the back.
Finally I painted the blue and black parts of the cabinet and then used 3M spray adhesive to attach the artwork. I used clear Avery label material for inkjet printers for the marquee. I’m not 100% happy with how this turned out, and would probably experiment with different approaches were I to do this again.
The electronics are pretty straightforward. It’s a Beaglebone Black with an Adafruit Proto Cape and the 4D Systems Display Cape. I consulted the wiring diagrams for the display cape to see what pins were not in use. I wired up the LEDs for the marquee to a digital pin (via the proto cape) and did the same with the one-player start button. I initially had planned to hook the analog stick up to some unused analog pins, but found that I couldn’t read their values. After some research, I discovered that the touchscreen driver basically monopolizes the ADC on the Beaglebone, so unless I was willing to mess with the driver, I’d have to come up with some physical solution. I thought about slapping in an external ADC, but I ended up just physically modifying the joystick. I cracked open the pots and scraped away the center electrical contact for both left-right and up-down. Then I wired the joystick up as a set of four digital switches to digital input pins. This worked fine.
I was happy to discover I could power the whole contraption (USB audio included) off of the USB input on the Beaglebone. I wanted to make sure it would run all night at Bring a Hack, so I hooked it up to a 15 amp hour battery (for recharging cell phones) and did a test. I let it run for 8 hours, and it only used about a quarter of the capacity of the battery. Nice.
It’s running the standard Debian Wheezy image for the Beaglebone Black. I compiled AdvanceMame on the BBB itself (took ages). I wrote a little python script which turns the marquee lights on during boot with the Adafruit BBB GPIO library – super easy. I then wrote a joystick ‘driver’ in python using the same GPIO library and the wonderful uinput library which creates a kernel uinput device and emits events. I was able to read the digital joystick pins and then emit uinput joystick events. Luckily, AdvanceMame was able to see these as jstick+ and jstick- events and map them correctly within the game. There was a fair amount of fiddling about getting the display positioned and rotated correctly on the screen, and getting the sound stable with AdvanceMame and Linux. I was getting a number of Linux USB stack crashes, which seemed to quiet down once I switched the sound driver to alsa in the AdvanceMame config.
That’s about it. I didn’t take any photos during the build, unfortunately. I’ll upload some more finished pictures here soon.