Introduction: RetroPie Inside an NES Controller
The tiny form factor of the Pi Zero makes it perfect size to hide in any number of retro objects. I have a lot of old video game accessories in my workshop and was inspired to create an emulation station when I saw a design for a RetroPie NES controller on Thingiverse. RetroPie is an open source script optimized for Raspbian and includes many popular emulators all running through EmulationStation.
Step 1: Gather the Materials
You won't need much for this build, the main trick is getting your hands on an elusive Raspberry Pi Zero. I used an original NES controller in working condition with a bad cable.
- Raspberry Pi Zero Budget Pack $29.95 from Adafruit
- An Old School Nintendo NES Controller $10 on Ebay.
- A 3d Printed Base to hold the Pi Zero with the ports cut in the right place. My 3d plan on Thingiverse.
If you don't have access to a 3d Printer, I have uploaded the model to Shapeways. ~$20.
Step 2: Disassemble the NES Controller
- Remove the screws from the back of the Controller. Be very cautious not to strip these screws, you will need them later and they are hard to replace.
- Trim the 3 pins holding the PCB in place above the board, you need the pins to keep holding the board, just not this long. Also Cut down the 4 holders of the cord, they are no longer necessary and the more room you can get for the Pi Zero the better.
- Cut the cord to about 4 inches and remove the black outer cable casing.
Step 3: Solder the NES Wires on the Pi Zero GPIO
- Strip the wires on the NES Pad, about a 1/4 inch of bare wire will do.
- Solder the Wires on the GPIO board as follows:
White - Pin 1 (+3.3V)
Brown - Pin 6 (GND)
Yellow - Pin 7 (DATA)
Red - Pin 19 (CLK)
Orange - Pin 23 (LATCH/PULSE/STROBE/ETC)
Step 4: Burn RetroPie Onto SD Card
Step 5: Software Setup
As with the last step, there are many tutorials on getting RetroPie working, PetRockBlock is a great resource. For my installation I used an HDMI compliant TV, a USB Hub, a Keyboard, and a USB Wifi Stick.
- Put the SD card into the Pi Zero
- Plug in the HDMI Monitor
- Plug in the USB Hub with USB Keyword and WIFI Stick
- Plug in the Power.
The Pi Zero should boot right into EmulationStation. There are ways to do everything from EmulationStation, I chose to use the linux command line. F4 will get you out of EmulationStation to do the rest of the config.
- Expand the filessystem: Run `sudo raspi-config` Run option 1.
- Exit raspi-config
- Reboot `sudo reboot`
After reboot, exit out of EmulationStation again.
- Enter the RetroPie Setup Utility: `sudo RetroPie-Setup/retropie_setup.sh`
- Setup WIFI: Option 3 then Option 326. Find your WIFI and configure.
- Back to previous menu .
Now we install the utility that will pick up the NES pad through the Pi Zero GPIO, It is important that we do not let the script install the SNES configs.
- Run the Gamecon Script: Option 308 Gamecon and db9 drivers
- Say OK to the Firmware warning.
- Wait for everything to install.
- Say No to installing SNES configs.
Lastly we need to make sure that the GPIO kernel module gets run at boot.
- `sudo nano /etc/modules`
- Add a line at the bottom: "gamecon_gpio_rpi map=0,0,2,0,0,0"
Reboot `sudo reboot`
When the EmulationStation comes up this time you should be prompted to configure your controller (this could be hard with the controller only attached to the board and not closed up .. proceed to next step.
- Fit the Pi Zero into the base.
- Screw the Pi Zero into the base. I re-purposed some 7mm machine screws I found. I think some very small computer case screws will work as well.
- Carefully reassemble the gamepad making sure all the buttons are working.
- Use 5 of the 6 screws we originally took out of the NES pad to reattach it to it's new 3d printed base.
Reattach the completed NES RetroPie Controller into your monitor .. give it power .. and upon boot it will let you configure your joypad and now you are ready to install your ROMs
reppard made it!