Lightgun-Compatible DIY Arcade Machine

by TTMirror in Circuits > Raspberry Pi

34 Views, 0 Favorites, 0 Comments

Lightgun-Compatible DIY Arcade Machine

photo_2026-10-03_13-38-42.jpg
arcade 2.JPG
playing 3 (2).jpg
playing 2.jpg
playing 1.jpg
arcade 3.JPG

This is a DIY Machine that lets you play retro Arcade games. You can play with a console or connect a compatible Light gun that lets you play shooting games like Duck Hunt!

Supplies

The list of supplies completely depends on how much you want out of the arcade machine.

Components:

  1. Raspberry Pi;
  2. A screen;
  3. Joystick and buttons (I recommend getting a USB Encoder Kit);
  4. A power Supply (preferably 12V/5A);
  5. Plywood, plastic corner brackets and a lot of screws;
  6. Optional: Some speakers and amplifiers (if you want audio);
  7. Optional: Two Relays and a switch;

Technology & Tools:

  1. Access to a 3D Printer to print to mount some components in the Cabinet;
  2. Access to a CNC machine (or a really high-end laser cutter) to cut out the Cabinet;

Designing the Cabinet

screen mount plank.JPG

The cabinet is a fully functioning arcade machine that does not require a light gun to operate! You can use a commerical light gun or build your own (I'll explain how to make one in another instructable).

I designed the cabinet in SolidWorks, but you can use any 3D modeling tool you're comfortable with. I've attached my final design below, but it might not be compatible with your parts if they're different from mine.

Before you even begin to work in CAD, sit down and think about the design: How thick is the plywood you're going to use? How is it going to be shaped? How large is your screen? Are you going to use speakers? After you are clear about what parts you are going to use, draw your design with a pen and paper, it really helps!

After you have a clear image of what you want your cabinet to look like, begins the tedious part of perspective drawing. I recommend drawing each flat part of the cabinet as a separate part file (.SLDPRT in SolidWorks) and then assembling them in an assembly file (.SLDASM in SolidWorks)

Things to look out for:

  1. Don't choose thin plywood. The cabinet will be put under a lot of stress: holding its own weight, screen, other parts and the force applied by the user. I recommend using 8mm or 10mm plywood. Less than that is too risky and might collapse under load and more than that is unnecessary and will only add weight.
  2. Account for plywood thickness. If your cabinet is 40cm by 80cm, it does not mean that your bottom and side parts part will be exactly 40 and 80 centimeters accordingly. One of them has to be shorter by the thickness of your plywood, otherwise the parts won't join well. I advise you to use a global variable for plywood thickness so you can easily change it if you suddenly decide to use wood of other thickness (something that has happened to me).
  3. Account for components. The biggest thing your cabinet has to hold is a screen, so it has to be at least as wide as the screen's widest part. I recommend clearance of about 10mm on both sides. Besides that, the cabinet has to house a Power Supply, Raspberry Pi other smaller components and a lot of wires, so make sure to leave enough room for all that. I recommend elevating the console by 20cm. This not only leaves enough room for comfortably placing and wiring all the components, but also puts the buttons at a pretty comfortable height when the cabinet is put on a table.
  4. Focus on the outline first. The cabinet needs a bunch of holes for various components sticking out: buttons, joystick, speakers, power connector, switch, etc. You will have to decide where to put each one of these, but I recommend doing the outlines first and focus on the holes after you assemble the full design. This way you don't waste time repositioning the components if you decide to change a dimension.

I've attached my design below, feel free to use it for your inspiration.

Downloads

Component Placement

6b553679-43a4-4940-bd76-a0d904eb3794.png
plug.JPG
wago.JPG
console back.JPG

In this step I will give advices on how to position components inside the Cabinet. You will not be physically placing any components until after step 4 of this instructable, but the reason I put this step so early is that you will have to account for component placement in your CAD design so that you get all the holes and measurments right.

I assume you have already settled on your components list based on your local options. If not, feel free to refer to mine! Once you are settled with that, I recommend spending time to find 3D models of your components online (i.e. on GrabCAD) to add into your CAD design. This not only makes it much easier to get a rough image of how the parts fit together, but also premits you to easily extrude-cut a hole for some component after you've placed it somewhere (you can do that in the Assembly file by clicking "Edit Part" of the part you wish to make a hole in, drawing a new sketch on its surface, then projecting the component from the assembly for which the hole is intended using the "Convert entities" tool).

Some advices:

  1. Strip the display. If you like me are planning to use an old PC display, you can almost certaily remove its plastic enclosure and use its more compact metal frame. While you could go further and remove the metal casing as well, I do not recommend doing that as it isolates the electronics inside (there's usually some high voltages in there) and taking it away doesn't actually make it much more compact. Most displays also feature mounting screws on the back that you can utilise to fix the monitor in place. I did that by screwing the monitor into a strip of wood which I in turn connected to the opposite sides of the cabinet from the inside.
  2. Use a USB Encoder Kit. I really recommend getting a USB Encoder Kit for buttons and joystick. If you were to connect each button individually to the Pi, the wiring would get really messy. Besides, Raspberry Pi's GPIO pins are quite sensitive and connecting them to buttons might damage them in the long run. A USB encoder does all the necessary signal processing on its own and features a USB port that can be connected to Raspberry and is natively recognised as a game controller. I recommend putting it on the back side of the console, right in the middle. That way the buttons can easily reach it, console is easily removable, and the USB cable that comes with the kit is usually long enough to reach the Pi no matter where you put it.
  3. Use a plug for power. It is not strictly necessary and one could just poke a cable out of the cabinet that can go straight into the wall socket, but a plug like C14 is much more elegant, secure (won't break connections if the cable is pulled) and costs almost nothing at the scale of the project.
  4. Utilise amplifiers' potentiometers. If you are going to use PAM8610 Audio amplifiers just like me, use their potentiometers up to their full potential (pun intended). You can make them stick out of the walls of the cabinet, allowing the player to adjust the volume of the speakers. In my case, they were too short to poke out from the other side of the wall, so I designed a 3D printable extender (feel free to use it!)
  5. Direct speakers at the user. This one is pretty straightforward. The best audio quality is achieved when the sound waves go right into the user's ears. An important note here is that audio will most likely have some background noise no matter what you do. This is because a Raspberry Pi does not have a proper DAC (Digital-Analog converter) and Pi 5 doesn't even have 3.5mm jack (use a USB adapter instead). You could use a DAC HAT or a high quality adapter to avoid this issue, but I personally think that a little white noise adds to the retro arcade machine vibes.
  6. Use switch and relays. While not strictly necessary, it's nice to have the ability to turn your machine on and off without having to unplug it from the socket. I put two relays - one on the 12V output line and one for the 220V line for the display. The switch sits on a 5V line (derived from a buck converter connected directly to the power supply's 12V line before it goes into the relay). Note that I used 5V buck because my relays use 5V logic. Yours might be 3.3V, so check that before anything.
  7. Use WAGO connectors. I cannot express enough how much I love these. They are extremely convenient, hold onto cables very well, provide reliable connection even on high-power lines and require no soldering, making them ideal for splitting lines for different components. I put one on my 12V line, splitting it for Raspberry Pi (through a buck), two audio amplifiers, and IR LEDs.

I've mentioned IR LEDs several times already and it's time to talk about them for a little. They are required if you want to use a Lightgun with your arcade machine. If not, you can skip them. The technical details of setting up a light gun (or even building your own) is a topic for another instructable, for now is it enough to know that you need them for the light gun to be able to aim on the screen. There should be four points emitting infrared light on the screen - one in the middle of each of its edges. These points can be a single very powerful LED, or a cluster of multple weaker ones.

Cutting the Cabinet

hinges + connection.JPG

If you don't have a CNC machine/laser cutter, there might be vendors/companies out there offering their services. This step is for choosing the right option and preparing your design for it. Skip this step if you have a machine and know its capabilities and limits.

There are two main ways you can cut plywood with machinery: a CNC machine and a Laser Cutter. Laser cutters are very precise, but their laser power limits the thickness of the plywood they can cut. Most common laser cutters can cut through 3-6mm plywood and you can get a bit more by doing multiple passes if you really want to. CNC machines, on the other hand, can easily cut through thicker plywood (through still requiring multiple passes). The disadvantage of using a CNC machine is that it is not able to do sharp inner corners. This is due to the way they work: The spindle can make cuts only as thin as its radius, so there will always be some rounding to the inner corners.

If you are using a Laser Cutter:

  1. Check what thickness it can cut. If the cap thickness is too thin, you can stack thin plates on top of each other to make them thicker. CA glue with activator (the transparent glue with a spray) works really good for this: apply the glue to one side of one plate and spray the opposite side of another plate, then stack them on top of each other and apply some pressure evenly for a minute or two. Be quick and precise when stacking, the glue freezes pretty fast upon coming in contact with activator.

If you are using a CNC machine:

  1. Avoid sharp inner corners in design. As mentioned above, a CNC machine can't do them very well. You can sharpen them with a knife later, but that might be quite tedious.
  2. Beware of the errors. CNC machines are way rougher than laser cutters. The wood usually has to be mounted onto the pannel with screws before the cutting begins so it doesn't move during the cutting, but even then it might vibrate and wobble around a little bit, resulting the final cut to be off by a couple millimeters. When this happened to me, I had to scrape the wood with a knife and use sandpaper to remove the error.
  3. Avoid mortise and tenon joints. Mortise and tenon joint is a fancy name for a joint where you have a hole in one component and a tongue on another component shaped to fit into the hole. The machine's inability to cut sharp corners combined with errors caused by its roughness mean that these joins will almost never be perfect. I spent hours manually fitting these joints with a knife and sandpaper and would definitely not recommend using them unless absolutely necessary.

In both cases:

  1. What you'll need: If you are using a vendor's services for your design, they will probably ask you for a .DXF file. To export a DXF from SolidWorks, open your assembly, go to File -> Save As, then select .DXF in the "Save as Type" dropdown. Choose where to save and write a name, i.e. "Part 1" or "Bottom". A menu will appear on the left after you hit "Save", select "Faces / Loops / edges" there and click on one part's surface you want to export. Click the green check in the top left of that menu and hit "Save". Do this for every part separately.
  2. Check limits on width and height. Every machine has a cap on the dimensions it can cut (lasers usually have tighter limits). Try your best to fit your design into these limits. If this makes your cabinet smaller than you want it to be, you can cut the part that's over the limit into two pieces and later connect them with another piece of wood from the inside.

Below I've attached the .dxf files that I used for my Cabinet as well as a 3D model of the assembled cabinet which should help you assemble all the pieces if you decide to use my design

Assembling the Cabinet

braces.JPG
L corner in action 2.JPG
L corner in action 3.JPG
braces in action 1.JPG

After you have all the components for your cabinet, it's time to put them together, but I don't recommend starting assembling straight after cutting. The wood out of CNC machines is rough on the cuts (smoothen it with sandpaper) and laser-cut pieces usually have burns (clean them with a paper towel). You would also probably want your cabinet to be painted. You can paint it either before or after the assembly, but doing it before is easier.

First, you need to smoothen the surface of the pieces with some thin sandpaper (use a sanding machine if available) then wipe off the dust with a paper towel. Feel free to use any type of paint compatible with wood. I painted my cabinet with spray paint - apply the paint slowly from about 20-30cm distance to the frontal face of each piece, then apply some around the edges as well. You might want to apply a second layer after the first one dries or even add some varnish for a smoother finish. Make sure to do all the painting and drying outside or open windows to let as much fresh air in as possible.

Now let's talk about the assembling. If you were assembling furniture, you could simply put the parts against each other in a 90° angle and secure them with some screws. This approach will not work well with plywood, especially thin one. This is due to its layered structure. When a screw is driven into the edge of the plywood, it pushes the layers apart weakening its structure. Even if you don't see the layers coming apart, the screw is still likely to weaken their structure under load. For this reason, I recommend using 90° plastic corner braces instead. This way, the screws are driven normal to the layers, making the hold much more rigid. Make sure to use the right screw size so it doesn't come out on the other side. I used screws with 8mm total length for my 8mm plywood.

If, like me, you are not highly proficient in furniture assembly and are afraid you won't be able to hold a perfect right angle, you can 3D print a corner clamp to help with it.

Start with the biggest parts and do the small ones at last. If you have some really small parts in your design, you can use glue to hold them in place instead of screws, just make sure they aren't put under any load.

Features and Details

cabinet connection diagram.png
cabinet inside.jpg
cable management.JPG
pi holder 2.JPG

This project is relatively complex and hard to maintain unless you think about it in advance. In this step, I will share my experience on how to make connections, debugging and maintainance easier.

A cool feature I added to my design is hinges for the back of the cabinet. If I ever want to debug a component, change the wiring, access some part inside or just look at the beutiful wiring, I can open the back of the arcade with one simple motion without needed to unscrew anything. To keep the door shut, I used magnets with 3D printed holders.

I've also found it useful not to screw the console (the part with the buttons and joystick). I've put braces so that it fits tightly between the walls but comes off if you pull it upward. It does not interfere with gameplay in any way but makes maintainance much easier, providing easier access to the front part of the cabinet. As a bonus, this lets you easily change layout (buttons on the left, joystick on the right vs the other way around).

Another important note is that you do not want to use glue or any other permanent means of holding components in place. I recommend using screws for everything. If you ever need to reposition or replace a component, screws will do you much better than glue. Some parts (Such as Raspberry Pi and speakers) don't feature screw holes, so I 3D printed holders to keep them in place. This also allowed me to put my raspberry closer to the display, because my HDMI cable was rather short.

The wiring can get really messy, so I advise you to use color codes (i.e. red for 12V, black for GND, etc.) and is you really want your design to shine, attach your cables to walls so they don't wobble around needlessly. You can do it with duct tape or very simple 3D print - a rectangle with half-circles with diameter that of the wires.

The LED clusters are another thing that can get really messy. To avoid this, I advice using a small piece of perfboard for each of the clusters. Get an old/broken perfboard, break in apart into small (15x15mm) pieces and solder three IR LEDs onto it in series with a 150 ohm resistor (use at least 1/2W resistors) as shown on the image. Connect positive and negative sides of the clusters to each other in parallel (positive to positive, negative to negative). With that done, you can glue the cluster to the edges of your screen or, but I recommend printing a small enclosure for them instead - it's way more elegant and pleasant to look at.

If you are using speakers, you will need to connect your amplifier to your Raspberry. Raspberry Pi 3 and Pi 4 have a dedicated 3.5mm jack for audio output, so simply connect it with a 3.5mm audio cable and you're good to go. If you have Raspberry Pi 5, it does not feature a 3.5mm jack onboard, so you will have to get a USB-3.5mm adapter and plug your amplifier into a USB port.

I've attached a bunch of .stl and .step files that I designed below. Feel free to use my models directly or modify them to match your needs. (P.S. I modified this design from Printables to use as a holder for Raspberry Pi)

The Software

console layout.jpg
about-batocera.png
IMG_2225.JPG
IMG_2226.JPG
IMG_2224.JPG

This is the last step of the Cabinet's design. After this, you will have a fully functioning arcade machine!

First, get an empty SD card with at least 16GB of storage capacity. Download Batocera OS for your Pi model and install Raspberry Pi Imager from the official websites. Connect your SD card to your laptop/pc and open the imager. There, select your Pi model and hit next. In OS tab, scroll all the way down and click "Use Custom". Choose the Batocera image file you downloaded earlier and click next. In Storage tab, select the SD card you are going to be using and click next. Wait for the imaging process to finish (this might take 10-20 minutes), then take out the SD card and put it into Raspberry. You now have the operating system to simulate retro arcade games!

Connect Raspberry Pi to the display via HDMI, plug it into to 5V for power, connect the USB Encoder into Raspberry's USB port and audio amplifiers into either 3.5mm port or USB via an adapter. Plug the power supply into the wall socket and turn on the machine. Upon first boot, you will have to configure your console by mapping buttons and joystick. For this, temporarily connect a USB keyboard to Raspberry Pi, hit space, use arrows to navigate to "Controller and Bluetooth Settings", then "Controller Mapping" and click "OK". Hold any button on your console to start mapping. If you have played arcade games before, you know what to do. If not, you can refer to the image I've attached to map your buttons. Select a button function with arrows on your keyboard, then click a button on your console to map that function onto that button. Map the Joystick to D-Pad and buttons onto their functions based on their position. Map one button specifically to "Hotkey" (in the very bottom of the menu). After all buttons are mapped, navigate with arrows on the keyboard to hit "OK".

Batocera comes with a set of pre-installed games. In order to install more games, connect your Raspberry Pi to the internet: Hit space on a keyboard, go to Network Settings. Choose your local WiFi name in from a dropdown list in "WiFi SSID" and enter its password in the field below (WiFi Key) or leave it empty if you don't have one. Click "BACK" to connect and exit to the main menu using Esc button on your keyboard.

When your machine is connected to the WiFi, open main menu using space on your keyboard, navigate to "Updates & Downloads" -> "Content Downloader". This lets you access batocera's library of over 100 games to install.

If that amount of games is still not enough for you and you want even more, you can get more! If you have purchased an Arcade game from an authorised retailer and have its ROM file, you can add it to your cabinet's games list. To do this, connect a laptop/PC to the same WiFi as your cabinet and open "\\BATOCERA" in File Explorer. There, navigate to ./userdata/roms and put your ROM file in a folder specified by the manufacturer of your game.

Enjoy all the games!