Instructables
Picture of Convert a NES gamepad to USB with Arduino
PDR_0064.JPG
Hello!

In this instructable, I will show you how to hook up a Nintendo Entertainment System control pad to an arduino, the arduino is in turn running a special sketch that allows it to show up to a PC as a USB HID joystick!

And if that is not cool enough, I will show you how to shove it all inside the NES controller shell for a simple controller + wire, "plug n play" device!


Notice!!
If you hook this up wrong you can fry your arduino, and or your usb ports, if you choose to biuld this project you assume responsibility for its proper construction

Sofar I have tested this on ... Windows XP pro, Windows 7 64 bit, and Ubuntu 9 32 bit

So far its not tested on Mac, I don't see why it should not work on Mac, but its untested, the only Mac I have in the house is a SE from 1986, I will test it as soon as possible, just gotta sweet talk a co worker into bringing his macbook pro into work :)

Step 1: Parts n Tools

Picture of Parts n Tools
Tools: your usual electronics tools... on this project I used

Soldering Iron

Solder wick

Solder

Small phillips (+ shape) screwdriver

razor knife

small needle nose pliers

electrical tape (or proper sized heat shrink, I just happen to be out)

multimeter

Tweezers

Parts:
Arduino (with atmega 168 or 328, other chips not tested)

and a EXTRA atmega chip, you dont HAVE to but I installed this inside the controller, so you may want to have an extra chip on hand with a boot loader installed on it to replace the one we will be using (especially for me since I use my arduino AS a avr programmer, I would be kinda stuck)

16mhz crystal (ceramic resonator works fine, but I had the crystal and caps already)

2 * 22pf for the crystal (if your using a resonator then its packaged in for you)

0.1uf cap (code 104)

2 * 68ohm 1/8 watt resistors (or smaller if you want, just not larger, its tight in there)

1k5 ohm resistor

2 * 3.6v zeiner diodes 500mw or smaller

USB cable you dont mind cutting one end off of

NES game pad

thin insulated jumper wire
 
Remove these adsRemove these ads by Signing Up
1-40 of 41Next »
dajobe9 months ago
The first link on the software page doesn't seem to work any more. :(
kilofeenix1 year ago
Building an nes multi platform emulator using the nes shell, Need to know if i can drop the Arduino in the nes and plug multiple controllers into the Arduino. I.E. Arduino plugs into mini itx via usb, two nes controllers plug into Arduino via nes controller port. Will this be possible?
Marneus681 year ago
Hi ! I've been trying to get this to work for a few days now. I managed to get the code to compile using Arduino 0016, but as some people already pointed out, the schematics doesn't look like the wiring diagram... and none of these are actually working for me. The computer sees an "Unknown USB device" under Windows, and lsusb doesn't return anything on Linux.

I've been trying to go back and use the wiring of the UsbKeyboard project, but using the UsbJoystick library with it doesn't work at all. The documentation of the UsbJoystick library doesn't mention the wiring explicitelly, and the originl website seems to be down.

I'd love to have some additionnal informations, at least for the wiring.
Tried on windows 8 64 bit. so far only gotten it to show up as an unknown VMWare usb device and on a friends vista 32 bit an unknown usb device. no HID usb joystick yet :(
Awesome tutorial!
1.5k resistor ... 1/8 watt, 1/4 watt, 1/2 watt? 1 watt???
osgeld (author)  hysteriamk21 year ago
whatever you have, I used 1/8th watt 5% tolerance
Hi! I'm having some trouble understanding the schematics here, it seems to me that they are showing quite different setups? And I can't find an arduino pin 14 either?
osgeld (author)  kirreböna3 years ago
I double checked, they are showing the same thing, but the breadboard layout makes it look harder than it is

also digital pin 14 is analog pin zero (d15 is a1 etc to 19)
shaggs31 osgeld3 years ago
I've looked at this as well and agree with kirrebona. In the two schematics arduino pins 2 and 4 are not going to the same place. In the bread board you have pin 2 going to D+ and pin 4 going to D-. In the other pic you have them reversed. I might be wrong but I do not want to follow the wrong one. Some imput would be great thanks.
Yep, the breadoard image and the schematic image apparently have pin 2 and pin 4 reversed. I'm not sure which is correct (or where in the code/library those pins are chosen in the first place). Also, the diode on pin 4 in the breadboard image is connected to power, rather than ground. Please clarify the pin4/pin2 connections.
nc5203 years ago
This is great, but a little out of my comort zone for electronics. Any chance you would be willing to sell one? Thanks!
heare this is beter for you http://www.retrousb.com heare is a you thbe video of it http://www.youtube.com/watch?v=vG_OOV2bBaY
Check E-Bay. They should have some good ones for a low price :)
Hallmar3 years ago
How much is the cost of this Usb NES controller?
Hey nice Instructable! :)
I'm wondering if it's possible to get 2 NES controllers with one Atmega328 via one usb hub?
osgeld (author)  the_prototype3 years ago
yea it would be pretty easy if you left the original chip in the nes controller, and chained them together, as the original puts out a easy serial stream
so all I need is a serial to usb converter? :D
I though about putting the Atmega chip and the circuit "behind" the original plugs so you can plug in or out the controller, but didn't want to have 2 USB connection :p
Thx didn't knew it gives serial signals ^^
osgeld (author)  the_prototype3 years ago
its not RS232 like computers use, its (a simplified) SPI protocol at 5 volt levels, which is real easy to read with a microcontroller to read

it requires 3 lines, a latch line a clock line and a data line

you toggle the latch and that signals the controller to read the current button state and store that in the shift register, then you send it 8 clock pulses to read each button state one at a time serially

cool thx a LOT! :)
I thing this would be really helpfull to others to, maybe I'm gonna do a instructable about it ^^
I mean, it would be easy to just add some lines of codes to give the Atmega328 the pins where the second controller is connected to, but to be honest, I'm new into arduino programming and don't get it xP
Would be REALLY cool if someone could help me with that! :)
ajmckay3 years ago
Awesome instructable! Now I wonder if we can figure out how to "theoretically" store an accessible library of games (roms) so that it will be accessible through the controller....
osgeld (author)  ajmckay3 years ago
you can get a usb 1, 2-3 port hub chip from TI at most resellers that does not take a bunch to hook up, and strip down a flash drive

loading it would be slow as crap but running from it once loaded would be fine
lothoth3 years ago
Can I use an atmega16 instead?
osgeld (author)  lothoth3 years ago
I dont think you can with the arduino lib that I used, but its made out of VUSB which pretty much runs on any avr with 128bytes of ram and a 1b of storage
gabrielsan3 years ago
Can it be done for the SNES to work?
osgeld (author)  gabrielsan3 years ago
yes as they are pretty much the same, though the SNES uses 16 bits of data for the 12 buttons instead of 8
hey it looks like you are using V-USB, I've developed a MCU kit that is designed specifically to build stuff like this

http://www.seeedstudio.com/depot/usnoobie-kit-p-708.html?cPath=104_128
osgeld (author)  frank260801153 years ago
not directly, yes it uses VUSB but I am c-tarded and never really got far with the plain lib

thanks for the link I will check it out!
Would it be possible to modify this project to make a USB joystick using potentiometers and buttons, but not use an NES gamepad at all? Awesome job BTW!
osgeld (author)  computurwizard3 years ago
yes you can pretty much use anything you want, though since I am using a lib for arduino and not directly VUSB, and suck at USB descriptors you will have to do some legwork
Hi you might be interested in my tutorials here
http://frank.circleofcurrent.com/index.php?page=hid_tutorial_1

and this will also help
http://frank.circleofcurrent.com/index.php?page=usnoobie_rfid_keyboard
mojo-chan3 years ago
May I humbly suggest: http://denki.world3.net/retro_v2.html

Cheaper than an Arduino (although you do need an AVR programmer, or you can order programmed chips from me or anyone as it is open source) and designed not to alter the original pad. Well, you can reduce cost a bit by splicing in to the pad or do what I do and add a DB9 near the NES connector so it can be used on USB and a real NES.
T_T_4 years ago
this is pretty cool check out this website http://www.retrousb.com/index.php?cPath=25
klarkg4 years ago
IVe got some 5v zeners any chance those will work?
osgeld (author)  klarkg4 years ago
no the D lines need to be around 3v, some usb systems are 5v tolerant on those lines but its out of spec and could cause damage to your port
FrozenFire4 years ago
I think it would be a lot less invasive to just tap into the shift register. You could even leave it functional for the NES too that way.
osgeld (author)  FrozenFire4 years ago
also! I have mangled this NES pad so many times with various fun things I thought its time to place something in it and get a new one before pads start ripping off, or screws strip out
osgeld (author)  FrozenFire4 years ago
I wanted to use a smaller chip, and I may in the future, with the atmega328 in there it seemed like extra hardware right where it would be "sorta" convenient to place that big chip
FrozenFire4 years ago
(nice instructable by the way)
1-40 of 41Next »