Introduction: ARDUINO CONTROLLED GAMEPAD FOR PC
Hello guys, I'm Sarvesh. A couple of days ago I wanted to play some retro games. So I installed them on my Pc. But I could only play with my Pc's keyboard and that did not give the feel of my childhood days. So I decided to build a gamepad for my Pc that can play old as well as new games(Not all). I used a old gaming controller and modified it to create this awesome Gamepad. 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
Getting all the supplies is the first and most important step in building projects. And to make sure you get them correctly is by ordering them from a single place. This helps in receiving all the components at the same time.
I strongly suggest you guys to buy the components from UTSource because they are quite reliable and the quality of the products is also good. They deliver the products on time and that too in proper condition.
Now lets take a look at the 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 room for adding more buttons).
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.
To control the mouse movement we need to use a joystick module. Each module controls the X and Y direction.
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 Button
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. You can avoid this hectic task of soldering by ordering a PCB. UTSource.net provide quality PCB's at affordable rates.
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 :)