DIY Game Controller

by Arnov Sharma in Circuits > Remote Control

40569 Views, 59 Favorites, 0 Comments

DIY Game Controller

Image1.jpg
Arduino Gamepad 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

Project Preparation and PCB Planning

02 (10).gif
Image8.jpg

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 that resembles Pac man and then gave them to Seeed Studio for samples.

Getting PCBs From Seeed Studio

IMG_20220412_225933.jpg
IMG_20220412_225941.jpg

For Getting PCBs, I used Seeed Studio's Service for both PCBs that are being used in this project.

Seeed Fusion PCB Service offers one-stop prototyping for PCB manufacture and PCB assembly and as a result, they produce superior quality PCBs and Fast Turnkey PCBA within 7 working days. 

PCB Quality of this joystick PCB WAS SUPER!

When you prototype with Seeed Fusion, they can definitely provide Free DFA and Free functional tests for you!

Check out their website to know about their manufacturing capabilities and service. 

https://www.seeedstudio.com/prototype-pcb-assembly.html

PCB Assembly

07 (8).gif
08 (8).gif
01 (12).gif
IMG_20210327_154601.jpg
09 (8).gif

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.

CODE

Image2.jpg

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.

Testing

03 (11).gif

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.

Game

Capture3.PNG
Image3.jpg
05 (9).gif
06 (9).gif
04 (10).gif

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.


Improvement

ESP32-S Wi-Fi+BT SoC Module-1000x750.JPG
00001.png

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!