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
There are lots of tutorials on this so I will be brief.
- Get the right RetroPie Image. Currently RetroPie is stable on Wheezy. I used the Standard Image.
- I used ApplePi-Baker to burn the image.
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.
Step 6:
- 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
1 Person Made This Project!
- reppard made it!
40 Comments
Question 3 years ago
will this work with a third party manufactured controller?
Question 3 years ago on Step 6
How did you give it power? Is there a little battery I can buy somewhere, or do you just need to plug in an external power cord? I'd like to have a mounted power supply if possible.
4 years ago
Hi, I'm a writer in South Korea.
Now I'm writing a book about Raspberry Pi.
I want to introduce this project in my book.
Can I introduce this project in my book?
6 years ago
Hey Gang, the software portion of this has RADICALLY CHANGED. I have it working up till emulation station with these instructions but I think that the controller config is not making it to retroarch and therefore the rest of the emulators. I have worked on this for a few days (off and on) and have come up with these install instructions to get it this far:
I preferred to SSH into the pie but you can do all this from the keyboard as as well:
sudo raspi-config
Select resize filesystem
Reboot
sudo RetroPie-Setup/retropie_setup.sh
update retropie-setup script
reboot
sudo RetroPie-Setup/retropie_setup.sh
Manager Packages -> manager driver packages --> 809 gamecon -> install update from binary
TAKE A NAP (unpacking raspberrypi-kernel-headers takes a hour or so)
select configuration/options --> do you want to configure gamecone for 2 snes controllers? NO
exit
sudo nano /etc/modprobe.d/gamecon.conf
put in:
options gamecon_gpio_rpi map=0,0,2,0,0,0
sudo nano /etc/modules
put in:
gamecon_gpio_rpi
sudo reboot
Reply 5 years ago
I got it to work with the latest retropie version using your steps but there are now some more changes:
gamcon is not at 810 (there was no 809 in the driver package manager). also it didn't take that long to install so I couldn't have a proper nap :(
the more important change is in the configuration after installation where I had to say yes to the configuration of two SNES controllers otherwise no gamecon.conf file would appear in /etc/modprobe.d/!
I got this info, on this page: http://blug00.blogspot.ro/2016/03/how-i-got-the-gamecon-driver-to-work-on-retropie.html
Have fun and thanks for the suggestions!
Reply 6 years ago
HOLY COW I GOT IT TO WORK!
Run the controller config in emulator station a second time and it worked!
So this tutorial worked as of 6-24-2016
Reply 5 years ago
Oh, also. I used the RetroPie 4.0.2 image they made, should I add RetroPie to Raspian instead or it makes no difference?
Reply 5 years ago
You have used the GPIO pins specified here in this guide and it worked?
What controller config did you run a second time for it to work?
I hold the A key, but nothing happens. I wonder if the key presses make it to the software.
Any help apprciated.
Reply 6 years ago
Have you seen any issues, such as the controller not being unresponsive, using the 3.3V? I only ask because I am working on a similar project only mine will have a battery, charger, and on/off switch. The project I am folloewing says that with 3.3V the controller was unresponsive so he powered it with 5V.
Reply 6 years ago
Hi. I was following your instructions until it started unbacking the raspberry pi kernel headers. Half way through that I got an error saying "gamecondriver install failed". Any idea on how to fix this at all?
Reply 6 years ago
I would try it again, perhaps the download got corrupted or something. be sure you have enough power to it, i have had them work underpowered and get strange errors.
5 years ago
I'm a little curious if that is possible to make same as for SNES controller.
6 years ago
I cannot get this thing working :( used the pin out instructions but only the 'A' button works. Tested with jstest and all bits light up to 1 when the 'A' button is pressed. Any thoughts on how to fix this??
Reply 5 years ago
For anyone having the same issue. I noticed that the instructions say to put the red wire on pin 19, but the correct pin is pin 21. Looking at the images for the project you can see where the wire should be.
Reply 5 years ago
Ive resoldered to have the red wire on pin 21 but im still only getting the A button registered... any other ideas?
5 years ago
When I try and update firmware it says failed. SO I tried moving on anyways when I add the info at bottom of command line and save then reboot it says no gamepad detected any ideas
5 years ago
Hello there.
I *really* tried to get this working. The software part is too buggy for now. The instructions given in the instructable seems to be outdated so I followed the ones given by queekus two posts bottom. It seems that the gamecon driver will fail to install until we fully update RetroPie, but after a reboot, I've got a message appearing after the ES splash screen saying this:
terminated called after throwing an instance of 'boost::filesystem::filesystem_error'
what(): boost::filesystem::status: Too many levels of symbolic links: "/home/pi/RetroPie/roms/arcade/advmame/hi/hi/hi/hi/hi/hi/hi/hi/hi/hi/hi/hi/hi/hi/hi/hi"
Aborted
The physical keyboard is not responding anymore, however I can SSH. I tried to disable Advanced Mame in the RetroPie Config assistant, but no luck.
I'm on it for two weeks now, I got too many problems with RetroPie. It's the first time I use it, I hope it's more reliable the rest of the time.
Reply 5 years ago
Your error message is stating that you have too many subdirectories under your advmame roms folder. Not sure why you have so many /hi/ folders, but removing those folders will stop the error message.
Reply 5 years ago
Hi Michael, thank you for your reply.
The problem is that the "hi" folder does not exist. I did nothing except update the system after the first boot.
Regards,
Chris.
6 years ago
I too am having same problem its saying kernel firmware fail