Project tutorial

Arduino Game Controller © MIT

DIY game controller project with a Pro Micro which uses an ATmega32U4 microcontroller for emulating a game controller.

  • 9,962 views
  • 4 comments
  • 17 respects

Components and supplies

Necessary tools and machines

Ferrous chloride powder
3drag
3D Printer (generic)
70y8518 40
Drill / Driver, Cordless

Apps and online services

About this project

VIDEO

Version1
Version2

INTRO

SO this post is gonna be about a "DIY Gaming USB Controller" which we have been working on recently at ElectroPunkz Labs.

the idea here is to make a cheap Atmega32U based USB controller with buttons and analog joysticks that can be used to play games

like NFS, GTA, half-life, LITTLE FIGHTER 2!etc

We've made our controller in two form factors, the first one is based on PS1 or SNES config and other is a straight-up Xbox USB controller with analog sticks and buttons (not yet finalized)

We gonna Make V1 in this post which is the PS1 layout Controller!

It's better if you watch the project's Video First-

MATERIALS

the hardware is pretty simple and easy to get (except for the PCB, you can make your own with the attached PDF file of PCB)

  • Arduino Leonardo/ Pro Micro/ Atmega32U
  • Buttons (tick tack switches)
  • Custom etched PCB (button matrix PDF is attached)
  • 10K Resistors
  • Jumper wires

Thanks UTSOURCE.net to offer electronic components for this project! you can check UTSOURCE.net, they deal in all kinds of electronics components like for example all the Components used in this project!

BUILT PROCESS(Wiring, assembly, etc)

The first thing that we need to do is prepare the Basic Setup which is basically 12 Pushbuttons connected in pull-down Config with a Pro Micro, basically this-

we tested this on a breadboard and then prepared a PCB according to the above schematic.

After making the PCB (in OrCad cadence) we printed its TOP Layer's PDF on a Glossy paper.

I cut the Glossy paper according to PCB shape and place it on a copper clad board and apply heat to it for Transferring the Ink from glossy paper to the Copper clad board. (Basic Tone Transfer Method, watch my video about this topic)

After getting the PCB ready, we Dropped it in an Etching Solution and etch the PCB, after that, we just drilled holes for components, and our DIY GAME CONTROLLER PCB was Ready!

Then we just put everything on it according to the schematic and the circuit was ready.

After getting the Circuit Ready, we Designed and 3D printed the PCB Housing/Case for the controller in Fusion360.

Now we just need to upload the code and play some games with it.

CODE

Upload the Code provided on your Pro Micro.

word of advice, first test your board/setup thoroughly, check the resistance and connectivity of PCB traces because if something is missing this would cause a lot of keyboard error because missing ground lines will send irregular signals to the pins and your pro micro will keep on pressing random keys which will make reprogramming the Pro micro very difficult.

TESTING

The first thing that you need to do is Open Notepad, and start pressing the keys of your Controller and check whether the keys on the press are displaying the right words that are assigned

or just use any Keyboard testing app or web app.

If everything is working according to the code, then open any game start playing it with this DIY GAMING CONSOLE!

watch the video-

FURTHER IMPROVEMENTS

Well, the first thing that I'm gonna add to this setup is Analog Joysticks for playing proper games which uses a mouse for navigating the player, kinda like XBOX ONE CONSOLE.

V2 will have a proper PCB with XBOX One Controller Layout so stay tuned for that.

Leave a comment if you guys have any problem!

Code

CODEC/C++
#include <Keyboard.h>

int WPin = 2;  // UP   
int SPin = 3;  // DOWN
int APin = 4; //LEFT 
int DPin = 5; //RIGHT
int UPLpin = 7; //upper left Q
int UPRpin = 9; //upper right
int Xpin = 14;//x
int Apin = 10; //i
int Ypin = 15;//y
int Bpin = 16;//b




void setup()
{
  pinMode(WPin, INPUT); 
  pinMode(SPin, INPUT);
  pinMode(APin, INPUT);
  pinMode(DPin, INPUT);
  pinMode(UPLpin, INPUT);
  pinMode(UPRpin, INPUT);
  pinMode(Xpin, INPUT);
  pinMode(Apin, INPUT);
  pinMode(Ypin, INPUT);
  pinMode(Bpin, INPUT);
  
  digitalWrite(WPin, HIGH);  
  digitalWrite(SPin, HIGH);
  digitalWrite(APin, HIGH);
  digitalWrite(DPin, HIGH);
  digitalWrite(UPLpin, HIGH);
  digitalWrite(UPRpin, HIGH);
  digitalWrite(Xpin, HIGH);
  digitalWrite(Apin, HIGH);
  digitalWrite(Ypin, HIGH);
  digitalWrite(Bpin, HIGH);

  Keyboard.begin();
  
}

void loop()
{
  if (digitalRead(WPin) == 0) 
  {
    Keyboard.write('W');  
    delayMicroseconds(1); 
  }
  if (digitalRead(SPin) == 0) 
  {
    Keyboard.write('S'); 
    delayMicroseconds(1);  
  }
  if (digitalRead(APin) == 0)  
  {
    Keyboard.write('A'); 
    delayMicroseconds(1);  
  }
  if (digitalRead(DPin) == 0)  
  {
    Keyboard.write('D'); 
    delayMicroseconds(1);  
  }
  if (digitalRead(UPLpin) == 0)  
  {
    Keyboard.write('q'); 
    delayMicroseconds(1); 
  }
  if (digitalRead(UPRpin) == 0)  
  {
    Keyboard.write('e'); 
    delayMicroseconds(1);  
  }
    if (digitalRead(Xpin) == 0)  
  {
    Keyboard.write('x'); 
    delayMicroseconds(1);  
  }
  if (digitalRead(Apin) == 0)  
  {
    Keyboard.write('i'); 
    delayMicroseconds(1);  
  }
  if (digitalRead(Ypin) == 0)  
  {
    Keyboard.write('y'); 
    delayMicroseconds(1);  
  }
  if (digitalRead(Bpin) == 0)  
  {
    Keyboard.write('b'); 
    delayMicroseconds(1);  
  }
}  
  

Custom parts and enclosures

PCB Encloser

Schematics

PCB Layout PDF

Comments

Similar projects you might like

Arduino Pocket Game Console + A-Maze - Maze Game

Project tutorial by Alojz Jakob

  • 18,454 views
  • 9 comments
  • 45 respects

Arduino Video Game Controller for any Computer

Project showcase by GadhaGod

  • 5,814 views
  • 1 comment
  • 3 respects

Gesture Based Media Player Controller Using Arduino

Project tutorial by Jithin Sanal

  • 4,193 views
  • 0 comments
  • 10 respects

Bubble Cannon Interactive Game Controller

Project tutorial by Jimmy Huang

  • 1,957 views
  • 0 comments
  • 2 respects

LCD Hill Run v2 Runner Game

Project tutorial by PunkyMunky64

  • 17,984 views
  • 60 comments
  • 75 respects

Space Trash Game using Arduino and OLED Display

Project tutorial by Pi BOTS MakerHub

  • 6,512 views
  • 3 comments
  • 15 respects
Add projectSign up / Login