Make a game pad with an accelerometer inside!

This project tutorial will show you how you can convert a console game pad into a USB keyboard mouse for playing games on your PC. The USB game pad can be used with nearly any software, such as a MAME emulator, game, simulation software, or for custom user interfaces.

We'll start by turning the buttons of the game pad into keyboard buttons, so that pressing 'up' is converted into the 'U' key, for example. The firmware is easily adaptable, so you can adjust it for whatever software it will be used with.

Then we'll make the project more interesting by adding an accelerometer. This will allow the game pad to be used as a mouse by tilting it!


This tutorial including the original code and Portal video is by Devlin Thyne! Rock!

Step 1: What You'll Need...

You'll need the following in order to build the project:

  • Game pad - We'll be using an SNES controller
  • Teensy - This is a very small microcontroller board that can act as a keyboard/mouse
  • Triple-axis accellerometer - We'll be using the nice ADXL335 on a breakout board. You can skip this if you're not planning to add in the mouse capability
  • USB cable with mini-b connector - to attach to the Teensy for plugging into a computer!
  • Ribbon cable - for all the soldering connections. Rainbow cable is the easiest to work with as its color coded

If you want to build the entire project, we have a project pack in the shop with all the parts listed above!

You'll also need some basic hand tools such as screwdrivers, wire strippers, soldering iron, solder, diagonal cutters, vise or third hand tool, etc.

All the code is on GitHub, including some extra sketches we've written so be sure to look there!

<p>Does the actual version of arduino 1.6.5-r5 works with this hardwere or were i can find the Arduino v18?</p>
I want to do this to a GameCube remote, so how do I connect the analog sticks?
<p>You solder VCC to the VCC pin and the UP,Down left and right to the digital pins, then you open the Arduino IDE and program it using the code that adafruit has on github as something to start with.</p>
Would this work with the Portable Raspberry Pi Emulation Machine (<a href="https://www.instructables.com/id/Portable-Raspberry-Pi-Emulation-Machine/#intro" rel="nofollow">https://www.instructables.com/id/Portable-Raspberry-Pi-Emulation-Machine/#intro</a>)?
OK. I figured this one out. This menu option is no longer there as pictured, but what you should do is to select your teensy board, usually a teensy 2.0 and the go to another sub-menu, also on the Tools menu called, USB Type ... Select Keyboard + Mouse from this menu, and then you can proceed with the rest of these steps.
I have tried to follow these instructions carefully, but I don't see an option for the Teensy (USBKeyboard/Mouse) on my board menu. I do see teensy 2.0 and teensy++(2.0). What is the most likely the cause of that?
why do all this when you can buy a really good quality NEW usb gamepad for $20.<br />
you shut your mouth!!!
Can you actually? I haven't seen a single USB gamepad with a decent D-pad. They all have the horrible design (where it's hard to deliver a 'pure' up/down/right/left because they wobble back and forth between two switches at once) because the good designs are still under nintendo or sony patents.
What would you learn from just buying one?
&nbsp;Its more fun to build than to buy! :)
it is done, because it can be done.&nbsp; It is recycling something&nbsp; that some of us have sitting around in a closet without any use anymore because we dont play Super Nintendo anymore.
=( why aren't you playing your Super Nintendo anymore?&nbsp;It's lonely and it needs love.<br />
Good easy project for people like me that's learning about electronic modification, too. &nbsp; :3<br />
One option if you wanted to do this one the cheap would be to hack the buttons into the inputs of a USB keyboard. Just break open a keyboard and trace out eh leads on the membrane from all of the keys you need, and wire them up directly to the gamepad buttons.<br><br>The big downside is that it would likely involve a care mod to fit the keyboard PCB in with the rest, or I suppose you could run all of the switch leads in a thicker cable to the keybaord PCB in a separate housing.<br><br>Whether or not this is worthwhile is probably a factor of your budget. It'll add some hassle but save $20 for the Teensy.
...This will make playing gameboy games a LOT easier
I think that this would be even better wireless, maybe bluetooth that plugs into the computer on one end, for people who have XBMC computers attached to their TVs.
could you do this with a N64 controller?<br />
Thats what I wanna know too!<br />
Check out http://raphnet.net/electronique/gc_n64_usb/index_en.php
Nice instructable !<br /> <br /> I've done the same thing some time ago with a &quot;full&quot;&nbsp;DIY&nbsp;version :<br /> <br /> You have 2 possibilities&nbsp;:<br /> <br /> 1 -<a href="http://raphnet.net/electronique/snes_nes_usb/index_en.php" rel="nofollow"> raphnet.net/electronique/snes_nes_usb/index_en.php</a><br /> he use an atmega 8 with a xtal for the pad-usb conversion. It's a nice idea, but the overall size of the project (if you do it without a PCB) is a tad big to fit inside the pad.<br /> <br /> 2 - <a rel="nofollow">translate.google.ca/translate</a><br /> He use a small Attiny 45 with internal osc for the pad-usb conversion. I've used this method for my own pad. It fit quite easily in a SNES&nbsp;gamepad. I didn't have any Attiny45 on hand, but I had some Attiny25... I've managed to make the code smaller and include the auto usb calibration. It was quite a tight fit in the 2k memory!&nbsp; I'll try to post my modified files for you to enjoy.<br /> <br /> I might even post an instructable if I have some spare time.<br /> <br />
Here's the second link :<br /> <br /> http://translate.google.ca/translate?hl=fr&amp;langpair=de|en&amp;u=http://hobbyelektronik.org/w/index.php/SNES-Joypad<br /> <br />
Hi, cheers for an excellent Instructable. Was wondering, can this be easily applied to a Sega Mega Drive 6 button gamepad?<br />
Looks great! I'll have to try this some time.<br />
&nbsp;Thanks! &nbsp;Always enjoy your tutorials.

About This Instructable




Bio: All-original DIY electronics kits - Adafruit Industries is a New York City based company that sells kits and parts for original, open source hardware electronics projects ... More »
More by adafruit:Adaruit Resistor Helper Adafruit Photo Tutorial Logger Shield: Datalogging for Arduino 
Add instructable to: