Game – Entertainment Projects

DIY Game Controller

Hey everyone what’s up…

so this is my DIY Game controller.

It uses an Arduino Pro Micro which runs with HID Function, this is actually the second version of my previous game controller which had buttons but this one has two joysticks.

unlike the previous version, this one runs on the Joystick library which converts this pro micro into a proper gamepad controller…

fun fact, this controller can also run Retro games, like doom and donkey kong, by hooking it up with a retro pi/ or Recal pi setup…

more about that later.

In this Instructables, I’m gonna show you guys how you can build your own game controller in few easy steps so without any further ado, let’s get started!

Supplies:

these are the things that I used for this project-

  • Custom PCB
  • Switches
  • Verticle switches
  • Analog joystick
  • Pro micro
  • Female Header Pin

Step 1: Project Preparation and PCB Planning

The Previous Joystick that I made was completely DIY, I designed its PCB layout and printed the TOP layer on glossy paper, and then etched that board by tone transfer method.

That controller did work but it had many flaws like the responding time was not good and its code was not based on the joystick library. also, it didn’t have joysticks.

So to improve the Previous setup, I prepared a PCB that was similar to the old design, I added joysticks and made this cool looking silkscreen on the board resembles Pac man and then gave them to JLCPCB for samples,

You can check them out if you need great PCB service for Less cost!

after receiving the PCBs, I started the assembly process.

Step 2: PCB Assembly

The assembly process of this board is pretty easy, we just need to add switches and joysticks to it as

this PCB doesn’t have any SMD components which makes this project easy to make.

Here’s the first mistake of this PCB!

  1. I forgot to add mounting holes for the joystick in the PCB so I just drilled the holes manually with a 1.5mm drill bit.
  2. Also, here’s another mistake I did, I placed this verticle switch in an inverted position but the actual position was supposed to be this, so I drilled holes in the PCB and added the switch in the right order.

after adding the components, I soldered each of their pads and the project was pretty much completed!*

*only the hardware part, this controller needs a little software tweak.

Step 3: CODE

Open the Attached Sketch file.

  • Download and install the library from here- https://github.com/gamelaster/ArduinoGamepad/tree/master/examples
  • plug the controller into your computer
  • select the right board which is Arduino pro micro
  • select the right com port, and hit upload.
  • after this, open device and printer. you will see your Arduino micro with a gamepad icon.
  • Click on it and open its properties,
  • you will see the gamepad buttons layout.

Step 4: Testing

Now, just press any button or move the joystick, you will see the button number which we have declared in the sketch.

There are two joysticks in this setup, one for movement and the other for X and Y. you can move the joystick and see whether the setup is working or not.

After checking each button, we can now plug this game controller into our gaming rig and start our gaming spree.

Step 5: Game

Now, this setup does work without any tweaks with most of the stuff like for example, I plugged this onto my Recal pi setup to play some retro games,

I configure each key in the Recal pi settings and the controller worked without any issue.

Now, I wanted to play GTA5 with this controller, but unfortunately, it only supports the Xbox360 controller so this controller didn’t work by default in GTA5…

BUT, I found this awesome x box360 emulator, because of this, I was able to connect my DIY controller with GTA5 without any hassle, I first downloaded the software and then extracted it in the GTA5 folder in C drive. after this, I opened the software and map the controller keys according to the X box 360 layout and hit save button after button mapping.

I closed this software and then open GTA5, and guess what, the controller worked without any issue.

Step 6: Improvement

For improving this project, I will prepare a third PCB that will have more buttons and possibly an ESP32 board.

why esp32?

well, I found this library which uses the BLE of ESP32 to connect it to any computer as an HID gamepad…

Leave a comment if you encounter any trouble!

Source: DIY Game Controller

Tags

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
Close
Close