Asteroids Controller with Raspberry Pi

The 1979 arcade version of Atari Asteroids is a beautiful thing.

A white triangle battles lethal polygons on the glowing phosphors of a vector display. The two-note pulse of the music is syncopated by the “pew pew pew” of your effort to stay alive. The controls are as minimal as the graphics, and yet the game itself is complex, never the same twice.

I am a fan.

Years ago, I wired up parts from a scrapped Asteroids machine to control a computer via USB. It’s a beast. So when I had access to the resources at NYU’s ITP Camp, I decided to learn some new tools and make a refined desktop version. This one is designed for a tiny Raspberry Pi computer running an arcade machine emulator (MAME), so all you need to provide is power in and audio/video out.

Asteroids Pi

I’ve included links to design files throughout this page — be sure to open the PDFs in a program that can handle layers. Or, here’s a zipped folder with all the files in one place:

The Design

First up, I made vector artwork of the Atari Asteroids control panel by tracing a photo in Illustrator. (I’d actually done this a few years ago for a different project).


Asteroids Control Art

asteroids_controls.pdf (editable PDF) (Illustrator file)

I decided how small the face could be and still have a comfortable layout, and how tall the controller needed to be to house all the components. From there I sketched up the basic design, and started fabrication with the frame.

The Frame

The acrylic faceplate wraps around 3/4″ plywood end caps, which are connected with two 1.5″ x .5″ plywood rails.

The end pieces have 3/8″ grooves for the acrylic and rails. The CNC machine (robot miller) carved these first, before making a deeper pass to cut the outer shape.



That done, it needed some good old cabinet art. I made a black and white vector image from the original arcade marquee, and etched that with the laser cutter in raster mode.


Image link: marquee art
Image link: screen bezel art

sides etched

Finally, I carved out the rails with a table-mounted router. Nothing computer-driven here, but I did make a diagram. The slots are for removable acrylic shelves.


The Faceplate

I used 1/4″ clear acrylic for the faceplate to show off the components. The control panel file has layers for raster etching (the artwork) and vector cutting (edges and button holes) with a laser cutter. The plans are flopped so the art is etched on the inside.

There are also 3 shelves that slide into the grooves in the wood. The smaller ones have mounting holes for a breakout board and terminal.



cut acrylic

ITP has a large strip heater for bending acrylic. I heated up the laser-cut piece along one seam, holding it just above the heater. I flipped it over every minute or so to heat it evenly and prevent warping or blistering.

bending acrylic

Eventually it was soft enough to flex slowly. I put the shorter edge on the table, and holding the sheet evenly, pressed it forward. Holding a piece of wood along the seam helped start the crease straight. I had to re-heat the fold throughout the process, using the heater on the outside and a heat gun along the inside.

I matched the folds to the curve of the plywood end pieces. There was eyeballing involved. It’s not perfect but it’s secure, shiny, and strong.

bent acrylic

Assembly and Wiring

I finished the wood with Briwax and glued it all together. The faceplate’s curved shape is enough to hold it in place, but it’s still easy to remove by lifting up on the front edge.

I wired up the buttons with quick disconnects and it looked like this:


The buttons are from an original Asteroids arcade machine, so they’re the old leaf switch type. You can’t get much simpler: a spring-loaded plunger presses two pieces of metal together. This was standard in arcade games until the mid-1980s, when they were replaced with micro-switches. The leaf switch is easier for rapid-fire and finesse. The micro-switch is more compact and goes “click.”


I scrounged my old buttons at Vintage Arcade Superstore in Glendale, California. The leaf switch buttons were meant for a thin metal plate, and just barely fit around the 1/4″ acrylic. A major supplier of new parts is Suzo-Happ.

I also got two original cone-shaped Atari start buttons. They’re supposed to blink when you insert a coin, but the old parts box I went through didn’t have any with working lights.

A micro-switch inside a hole on the front signals that a coin’s been inserted.


I wired the buttons to a small Perma-Proto Raspberry Pi Breadboard from Adafruit (details below), which was mounted to the acrylic shelf with 1/4″ standoffs. I also ran wires to a terminal on the other end, in case I ever want to attach the buttons to something other than a Raspberry Pi.


When it’s all put together, the Raspberry Pi computer sits on the large center shelf, with access for video, audio, and power cables running out the back.


Raspberry Pi

The Raspberry Pi is a tiny, inexpensive ($30 or $40, depending on the model), project-friendly Linux computer that came out in early 2013.

Adafruit has an excellent tutorial on setting up a Raspberry Pi to play classic arcade games, written by Phillip Burgess. It leads you through setting up a RasPi from scratch, installing a MAME (Multi Arcade Machine Emulator), and getting arcade buttons to work.

I modified the button wiring plan to suit the Asteroids controls. The buttons are wired to the RasPi like this:

Raspberry Pi pin, Asteroids function
#17, Hyper-Space
MOSI (GPIO 10), Thrust
MISO (GPIO 9), Right
#23, Fire
#24, insert coin
#25 (GPIO 25), Left
#4 (GPIO 4), Two Players
CE1 (GPIO 7), One Player
GND, ground rail

And I changed the appropriate lines of the “retrogame” utility code to this:

struct {
        int pin;
        int key;
} io[] = {
//        Input    Output (from /usr/include/linux/input.h)

        {  17,      KEY_SPACE     },
        {  10,      KEY_LEFTALT     },
        {  9,      KEY_RIGHT     },
        {  23,      KEY_LEFTCTRL     },
        {  24,      KEY_5     },
        {  25,      KEY_LEFT     },
        {  4,      KEY_2     },
        {  7,      KEY_1     }

Instructions for doing this are in the tutorial.

At some point I might add two more internal switches to trigger KEY_ESC and KEY_ENTER, to quit and shutdown (using an alias/shortcut) with just the controller.

I had a bit of trouble getting the MAME ROM (game file) to work. In the end, I had to unzip the Asteroids Rev. 2 folder, change the file extensions so the names matched the missing file names that the MAME asked for, re-compress the folder, and put that zipped file into the roms folder on the RasPi. The MAME complains that two of the files are funky, but it seems to run fine.

Finally, once everything was working, I set the RasPi to boot directly into Mame4All when it’s turned on. Instructions are here. Since everything is stored on a cheap SD card, I have one dedicated to Asteroids.

Hello World, Goodbye Asteroid

It works!

I mainly built this to learn some new tools. Maybe next I’ll learn Python and write a new game for five buttons, or maybe I’ll use it to run live visuals.

As for now, it’s time to break out a projector and throw a rooftop Asteroids party.

For more Asteroids love, check out (I run the site. Like I said, I’m a fan).


comment comment

  1. Evan says:

    This is really nice looking, thanks for sharing.

  2. Mark Wita says:

    This is very cool. I’m 53 years old and played many of the older arcade games when the first came out in the USA back in the late ’70’s and 80’s. Of all the games which I mastered, the original Atari Asteroids was my favorite and it is THE arcade game I mastered the most. I have been into emulation for 20 years or so off and on. I’m back on and was thinking about getting serious. As an Asteroids player you obviously know how important it is to have the proper button layout and it looks like you nailed it. I’m currently setting up a PC to run everything up to and including the Wii, but I will never be happy until I have a controlled such as your for Asteroids MAME. If I wanted to connect something like this to a PC over USB skipping the Pi is that reasonably possible? BTW the longest I ever played on one quarter was 7.5 hours from player one. I quit with extra ships lined up completely off the screen on the right hand side.

    • Tim says: (Author)

      Mark – thanks for checking this project out! It’s not that hard at all to wire arcade buttons to control a PC MAME via USB. You just need to attach them to some sort of encoder instead of the Raspberry Pi. I did this with my first Asteroids controller project, ripping open an old keyboard and attaching the buttons to that — which I don’t recommend since the connections are difficult and programmable electronics have come along since then.

      The easiest approach would be to use something like this: (I notice they have Asteroids in their page header, so that’s a good sign). I haven’t used this, but it looks like it’s pre-programmed, and you can attach wires from the buttons with the screw terminals, no soldering required. A cheaper option is to buy a more general-purpose microcontroller like an Arduino, and program it to act like a keyboard or joystick. But that requires programming (the internet will provide code for you to tweak) and soldering to connect the buttons. I’m working on a project right now that will light up colored LEDs when arcade buttons are pressed, using Adafruit’s Pro Trinket ($10). It can do what you need, and here’s info on how:

      I hope that helps.

      For an inspirational MAME cabinet, check out the “Popcade” by Joshua Axelrod. It’s got a PC inside, and is set to run a number of games.

  3. Rick says:

    I’m the same age as Mark and have a deep connection to the Asteroids arcade game. When I was a teenager it was my favorite and I had it mastered. I remember one session that could have lasted forever but they turned it off – I was playing at a Sears store in the entranceway, they shut if off at 9:30, 1/2 hour after they closed.

    Anyway, I bought an Asteroids machine from a local guy about 5 years ago. Unfortunately it’s very unreliable. I paid a local repair guy $100 to fix the board, it lasted about a day. Plus I actually bought a spare board and it had different issues. So for most of my time with it it has sat unused in my basement.

    Looked into getting it fully rebuilt, would run about $350 from a guy I found on one of the big arcade forums. There were a few of them but many of them were not that motivated to turn things around quickly, you had to catch them at the right time of year and when they were in the mood I guess.

    So, I’ve always wondered if I could just replace the guts of my machine. That way I could play the real standup machine with the real buttons, etc., but have the reliability of modern electronics (and easy cheap repairs I could do myself if needed).

    I’m picturing keeping the buttons, wiring them up to a computer or controller and using a 19″ 4:3 LCD panel in place of the vector display.

    Would a Raspberry Pi be a good be a good base for this kind of project?

  4. Lance says:

    You are a real craftsman!

    I don’t think the quality of the original arcade machine is at the level of your controller.
    Normally I would be satisfied to create wood bottoms to the original arcade control panels and connect USB interfaces. But you have created a unique product.

    I recommend that you add custom multi-color LED lights inside that tie into the Raspberry Pi to create special effects like normal glow, attract mode, explosion flickers, etc.

    The next thing to do is to work on converting the huge collection junk US CRT TV sets found in everyone’s houses and scrap heaps into Atari Vector Displays. You have to rewire the yoke to reduce the windings and then create a new circuit board controller. Big money to the person who can do that!

    And thank you for the excellent plans and pictures. Very useful for those that recreate arcade consoles and machines.

    Thank you again.

Trackbacks for this post

  1. Atari Asteroids Controller: Backstory | Tim Bartlett
  2. Asteroids Controller with Raspberry Pi @Raspberry_Pi #piday #raspberrypi « adafruit industries blog
  3. Community Corner: This Week in Adafruit’s Community 8/9 – 8/16 « adafruit industries blog
  4. An Atari Asteroids controller for the #RaspberryPi | Raspberry PiPod

Leave a Comment