Intro: Retro-Gaming Machine With Raspberry PI, RetroPie and Homemade Case
Some time ago I found a Linux distribution for Raspberry Pi named RetroPie. I found out immediately that it is a great idea with a great implementation. One-purpose retro-gaming system without unnecessary features. Brilliant.
Soon after, I decided to buy a new Raspberry Pi, on which I wanted to run the RetroPie with some good old games.
I also began to look around for a case. Unfortunately I didn't like almost any commercial case. They was ugly, overpriced and sometimes even overengineered, in my opinion. On the other hand, I liked some DIY cases which didn't try to copy the look of old consoles. So, I decided to make my own case too. For many reasons I used an universal project enclosure case as a basis...
Take this Instructable as inspiration and also try to make a retro-gaming machine with a custom case. It isn't too hard and you will be happy about the result. And moreover it could be a great gift. Think about it...
Step 1: Components
- Raspberry Pi
- 5V Power Supply with barrel jack 5.5/2.1. I used Vigan 5V/2A.
- 8 GB micro SD card class 10 or better
- universal project enclosure box with good dimensions. Search for good box on eBay or in your local electronic component store. I used KP17 from GMe.cz. (It has dimension: 143x119x33mm)
- USB B micro male connector. I used this one from GMe.cz.
- Power supply female barrel jack 5.5/2.1.
- USB A female connectrors. I took them from broken USB HUB.
- USB A male connectrors. I took them from old USB cables.
- Straight HDMI coupler. I used this one from eBay.
- LEDs. I used 5mm green and 8mm red
- small push button. I used this one from GMe.cz.
- piece of universal PCB
- small piece of plywood or something usebale as spacer
- srews and nuts M3, some spacers
- female pin header
- red and black wire. I used AWG 24.
- four-core cable. I took it from an old USB cable.
- power switch (optional)
- and USB game controllers. I like USB SNES-like controllers.
Step 2: Tools
- PC connected to the Internet
- micro SD card reader for PC
- masking tape
- black markers
- drill and drill bits. I highly recommend a stepped drill bit (in the picture above) for drilling to a plastic.
- sand paper
- small files
- utility knive and/or small chisels.
- hot glue gun
- soldering iron
- good quality ("artistic") color markers. I used markers from Winsor & Newton. I chose colors: Mulberry, Cool Gray 1, Cool Gray 2, Cool Gray 3. But you can use whatever you want, of course.
- white permanent marker
- contact glue. I used common Pattex Contact Glue.
- heat shrink tubes
Step 3: RetroPie Installation
What is Retropie? By the author's words:
RetroPie allows you to turn your Raspberry Pi, ODroid C1/C2, or PC into a retro-gaming machine. It builds upon Raspbian, EmulationStation, RetroArch and many other projects to enable you to play your favourite Arcade, home-console, and classic PC games with the minimum set-up.
See Retropie homepage: retropie.org.uk.
Download latest version of the RetroPie for your version of Raspberry Pi.
Download and install the Etcher. It is a user-friendly multiplatform tool for safe flashing OS image to a SD card. (If you used Raspberry Pi before, you probably know it well.)
Run Etcher, choose RetroPie image, choose correct microSD card drive and hit the flash button (see image above).
After flashing is finished, put the card to your Raspberry Pi, connect a monitor and a controller and a power supply. At the first run, the RetroPie system should extend the filesystem to the entire SD card and then RetroPie ask you for configuring the conroller.
See original guide.
Step 4: Basic RetroPie Configuration
Select RASPI-CONFIG in menu, and:
- Change User Password. Default password is: raspberry (default user is: pi)
- Localisation Options
- Set your Locale
- Set your WiFi country code
- Set your Keyboard layout
- Set your Time zone
- Enable SSH
- Enable Serial
- Disable Overscan. (It removes black margins)
Step 5: Emulators
Most of the emulators are installed and configured correctly by default. I only had to install DOSBox (a famous MS-DOS emulator) and configure Fuse (a ZX Spectrum emulator).
For more information about the emulators see original guide.
Select RETROPIE SETUP → Manage packages → Manage optional packages → dosbox → install from binaries
1) map controller as Kempston Joystick.
input_libretro_device_p1 = "513"
2) set emulator to ZX Spectrum 48k mode.
fuse_machine = "Spectrum 128K"
fuse_machine = "Spectrum 48K"
You can do it for example using SSH.
EmulationStation (ES) essential shortcut
Select+Start = exit currently running game and return to ES menu (not working for DOSBox, see below...)
Step 6: ROMs and MS-DOS Games
First of all, I have to say that even very old games are still copyrighted, so be aware...
However, many old games are considered as abandonware, because they are technically obsolete and practically unsaleable (or unprofitable). A good instance are games for old computer ZX Spectrum, which you can download for free from sites like spectrumcomputing.co.uk or www.worldofspectrum.org.
Some games for MS-DOS you can purchase from www.gog.com.
How to copy ROM files to RetroPie
There are several ways how to do it. See original manual. If you are running Linux on your PC, then you can also copy ROM files directly to the microSD card.
Tip: Less games is more! Don't install entire archives, but only a several best games for each system. A large number of games is somewhat depressing.
DOSBox games (for advanced users)
MS-DOS games in RetroPie/Emulationstation are tricky. It is necessary map contoller buttons to keyboard, create and tune a dosbox configuration file and create a run script for every single game.
Here are steps for game Prehistorik 2:
0) install DOSBox
See step "Emulators".
1) buy Prehistorik 2 from www.gog.com/. Install Prehistorik 2 on your PC first, because you will need unpacked game files.
2) copy game directory to the microSD card to
/home/pi/RetroPie/roms/pc_data ("pc_data", not "pc"...)
(name of the game directory should be Prehistorik_2).
3) create a run script
#!/bin/bash cd "/home/pi/RetroPie/roms/pc/" "/opt/retropie/emulators/dosbox/bin/dosbox" -conf "/home/pi/RetroPie/roms/pc/Prehistorik_2_dosbox.cf" -c exit
See Prehistorik_2.sh.txt in the attachment
Prehistorik_2.sh will be reconized as ROM file by the runcommand.
4) create a conf file
See Prehistorik_2_dosbox.cf in the attachment
Most interesting parts are:
[autoexec] @echo off mount C "../pc_data/Prehistorik_2" -t cdrom c: cls TITUS.BAT exit
and mapperfile definition:
5) create a map file
See Prehistorik_2_dosbox.map in the attachment
Search on the Internet about how to do it. Good start should be for example a DOSBox wiki.
6) try to run the game.
Step 7: Scripts and Configuration for LEDs and On/Off Button
Safe power On/Off button
Rasperry Pi has no "safe off" button (at least versions up to 3B+). Search the Intenet for more informations about it.
Users often solve this problem by writing their own script which runs a command "sudo shutdown -h now" on a interruption from a button connected to some pin.
I just used well-written scripts from tyler from howchoo.
I let pin for button setted to the GPIO 3 (=Physical pin 5) (see pinout.xyz).
External ACT LED
- for Raspberry Pi 3 add this:
# --- external LED as SD ACT LED (Raspberry Pi 3) dtoverlay=pi3-act-led,gpio=4 # ---
- for Raspberry Pi 2 add this:
# --- external LED as SD ACT LED (Raspberry Pi 2) dtparam=act_led_gpio=4 # ---
Now you can connect a LED with resistor to the GPIO 4 (=Physical pin 7) (see pinout.xyz). As ACT LED I used a 5mm green LED.
Power status LED
I adopted clever super-simple power status indicator from this tutorial from Zach from howchoo. Just enable the GPIO serial port, then you can connect a LED with resistor to the GPIO 14 = TX (=Physical pin 8) (see pinout.xyz). As power status LED I used a 8mm red LED.
Step 8: Start Planning a Case
As I wrote, I used an universal project enclosure case as a basis. I admit, it isn't as cool as case made from good quality wood, or well designed 3D printed case, but it can be still acceptable way how to quickly create a good-looking case, in my opinion.
Plan the position of all components. Where to place Raspberry Pi, where to place all connectors, which connectors omit and so on. Take the time, don't hurry.
Step 9: USB Extensions
Because I decided to have two USB connectors for two game controllers in the front and Raspberry Pi in the middle, I needed two short USB extenders. I made them from old USB cables and from a crappy USB hub. See pictures above.
Step 10: Power Adapter Exension
One thing that makes me nervous about Raspberry Pi is the micro USB B power connector. This connector seems to be a bit fragile to me. Therefore I decided to use a common barrel jack 5.5/2.1 and power my retro-gaming machine by 5V power supply with a barrel jack 5.5/2.1 mm.
Step 11: Marking Holes
Specify possition of all components and mark all necessary holes. In my case:
- holes for two USB (and holes for screws to mounting small PCB)
- hole for barrel jack 5.5/2.1 connector
- hole for HDMI coupler
- power button hole
- two holes for LEDs
- four holes for screws to mounting Raspberry Pi
- hole for micro SD card slot
- ventilation holes (don't forget about them)
Step 12: Making Holes
Make all holes using your trusty tools.
Small chisels were surprisingly useful for making non-circular holes in my case.
Step 13: Soldering LEDs and On/Off Button
Do wiring according the schematic in the picture above. It shouldn't be difficult.
You can secure all wires with hot glue after soldering.
You probably noticed that the power button (see in the picture above) is soldered to a piece of PCB with wooden spacers. I had to make this workaround, because I chose a button designed for PCB, not a button designed to be mounted to a panel.
Step 14: Placing All Components
Attach all components to the case. I attached every component using a hot glue except Raspberry Pi and USB extenders, which I attached with screws. See pictures above.
Step 15: Decoration
Decorate your case as you wish. Everything is allowed. For example: I drew a top mask on a paper using an artistic markers. Then I glued the mask to the case using a contact glue.
Step 16: Testing
Close the case and try to test everything. Work everything fine?
No? So, fix all issues, test it again, repeat until everything is fine. Keep cool.