Instructables

USB Game Pad With Tilt-accelerometer Mouse

Featured
Picture of USB Game Pad With Tilt-accelerometer Mouse
 
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!

Credits

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



 
Remove these adsRemove these ads by Signing Up

Step 1: What You'll Need...

Picture of 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!

Usablerain9 months ago
Would this work with the Portable Raspberry Pi Emulation Machine (http://www.instructables.com/id/Portable-Raspberry-Pi-Emulation-Machine/#intro)?
yolivas2 years ago
I want to do this to a GameCube remote, so how do I connect the analog sticks?
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?
snehal09093 years ago
why do all this when you can buy a really good quality NEW usb gamepad for $20.
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?
 Its more fun to build than to buy! :)
it is done, because it can be done.  It is recycling something  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? It's lonely and it needs love.
Good easy project for people like me that's learning about electronic modification, too.   :3
tp1l3 years ago
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.

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.

Whether or not this is worthwhile is probably a factor of your budget. It'll add some hassle but save $20 for the Teensy.
Icalasari3 years ago
...This will make playing gameboy games a LOT easier
Foaly73 years ago
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.
mcrjig3 years ago
could you do this with a N64 controller?
Undead mcrjig3 years ago
Thats what I wanna know too!
Check out http://raphnet.net/electronique/gc_n64_usb/index_en.php
andreq3 years ago
Nice instructable !

I've done the same thing some time ago with a "full" DIY version :

You have 2 possibilities :

1 - raphnet.net/electronique/snes_nes_usb/index_en.php
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.

2 - translate.google.ca/translate
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 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!  I'll try to post my modified files for you to enjoy.

I might even post an instructable if I have some spare time.

andreq andreq3 years ago
Here's the second link :

http://translate.google.ca/translate?hl=fr&langpair=de|en&u=http://hobbyelektronik.org/w/index.php/SNES-Joypad

ai3sixers3 years ago
Hi, cheers for an excellent Instructable. Was wondering, can this be easily applied to a Sega Mega Drive 6 button gamepad?
epizeuxis3 years ago
Looks great! I'll have to try this some time.
samirsky3 years ago
 Thanks!  Always enjoy your tutorials.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!