This is a wired game pad for PC. It can be used to play emulator and PC games. Also the joystick can serve as a mouse for your PC. The Game pad is controlled using an Arduino Pro Micro.
Step 1: Gather the Necessary Components
1. Old retro game controller
You can use a retro game controller like the one I used. If you have access to a 3d printer, you can print your own casing(This option will give you more room for adding more buttons).
2. Arduino Pro Micro
For this project you need to use an Arduino Pro Micro or Arduino Leonardo mini. In short you need a micro controller with HID (Human Interface Device) capability. Arduino Pro micro has an ATmega 32U4 micro controller.
This is a normal slider switch which I used for emergency purpose. The problem with working with mouse and keyboard library is that if you fail to upload a correct code you could loose the control of your keyboard or mouse. So it is very essential to have a switch which could help you to regain the control of your PC mouse/keyboard.
4. Joystick module
To control the mouse movement we need to use a joystick module. If you want to see a basic example of how to interface this module you can check the below link.
5. Limit switches
I used limit switches as triggers for my controller. These are optional if you want to make a game pad with just push buttons.
6. Push buttons
Push buttons can be interfaced in either pull up or pull down configuration. Here I used pull down configuration for all the buttons and switches. I used 10 K ohm resistors for this.
7. General purpose PCB
Get a general purpose PCB to solder all the components.
Step 2: Circuit Diagram and Coding
Connect all the components according to the circuit diagram given above. I have also attached a quick guide to interface push buttons with Arduino.
I would recommend to first check all the connections and working on a breadboard.
The layout of my actual button placement is also shown above to give you a clear idea which button is positioned where, what label it is programmed with and what character it sends to the computer.
Now download the code and install the mouse.h and keyboard.h libraries. Upload the code to your Arduino.
CLICK BELOW TO DOWNLOAD THE CODE
Step 3: Cutting, Painting and Soldering
First cut the PCB according to the size of the Game pad and align the push buttons and the joystick module.
Then paint the game pad with the color of your choice.
Now solder the push buttons and joystick on general purpose pcb.
Step 4: Fixing the Limit Switches and Final Testing
Now fix the limit switches in their positions with the help of some super glue.
Solder the remaining components and do a final test.
Step 5: Putting It All Together
Now close the enclosure with the help of some screws.
I have attached some pictures above to show you how the final product looks like.
That's it you are done. Now try playing some games. You can play emulator as well as PC games (which do not require more number of keys).
With this ends my first instructable. I hope you liked it :)