Introduction: Let's Make a Game Controller!

I love flying games, but it feels like there are never enough buttons on my joystick.

This instructable will show you how to build your own switch panel in no time.

It will work with any game and computer that supports a joystick. I also encourage people to adapt this guide to make foot pedals, joysticks, or other input devices.

What skill level is needed?
This is a great starter project, all the wiring and code is very simple, just repeated for each button.

Out of any project I've done this has had the best ratio of skills needed to reward, so with relatively little effort you will get a great reward.

Step 1: What Will I Need?

Tools

  • Wire snips + thin wire
  • Soldering iron + solder
  • Drill + drill bits
  • Dremel (optional) + safety glasses

Bits

  • A Teensy(or arduino that supports HID)
  • Buttons! Lots of buttons and switches
  • Potentiometers (optional, used for sliders or axis control)
  • LEDs (optional) + equal number 220ohm resistors
  • Perf board
  • Female pin headers (optional, but recommended)
  • Enclosure

Notes:

I used the dremel because I had some square buttons, using just round-base switches is way easier and faster!

The female pin headers are great so you can take the Teensy out and use it for the next project—highly recommended.

You can also use an Arduino instead of the Teensy, just be sure that it supports HID (Human Interface Device), this is a great standard that ensures it'll work easily with any computer.

I found all my buttons and the enclosure at a local hobby electronics shop.

Step 2: Start Laying Out

The quickest way to plan where the switches will go is just draw them on with pencil.

Bonus

I wanted an extra crisp look, so I redrew all my markings on the computer and printed it out.

Then I glued the paper to my case and pasted over it with clear tape, so the oils in my hands don't ruin the paper.

In the end I chose the standard Russian green colour, makes it a bit more fun, and apparently helps reduce eye fatigue for pilots.

Step 3: Manufacture

Next drill out the holes you marked with pencil, or on your printed decal.

(Optional) If some of your buttons are square, you'll have to use a cutting tool.

Test fit everything together, and become eager with anticipation.

Step 4: Electronics

Snip the pin headers to length for each side, then solder them to your board.

Test fit the board and trim if needed. Leave a few pins on each side of the teensy.

The first step of wiring is to attach the ground wire to one of all the button pins, if there are three pins on a button, attach it to the middle one. For the potentiometers attach ground to one of the outside pins, doesn't matter which.

Now is also a good time to glue in the LEDs, if you're using them, and solder the negative pin onto the same ground wire that we used for the buttons. (All round style LEDs have a flat spot that mark the negative side)

Step 5: Wire Buttons

I've included the diagram that comes with each Teensy, it shows each pin number and what they can do.

Button

One side of the button goes to Gnd, the other to a digital pin on the Teensy.

Each button will take up one pin (marked in grey on the diagram), and a few of my 3-position switches will take up two. Keep track of what pin numbers you are using, but it's not necessary to know exactly which button goes to each pin.

LEDs(optional)

With the flat side of the LED attached to ground, the other side will attach to one side of a 220ohm resistor, and the other side of the resistor will attach to a digital pin.

Notes

Some 2-position switches have three pins. With the middle pin attached to ground, choose what side you want to be "on" and attach that to a digital pin on the Teensy.

Step 6: Potentiometers (optional)

It doesn't matter which side gets wired to 3.3v and which to Gnd, but the middle pin must go to an analog input on the Teensy (marked in orange on the diagram from the last step).

Notes

A potentiometer is a variable voltage divider, basically one side gets the whole voltage, the other side gets no voltage, and the pin in the middle gives a reading somewhere between the two.

I used B10K potentiometers.

The B means linear, as in it increases in a straight line when plotted, these are used for digital things. Type A potentiometers are usually used for audio applications and increase exponentially.

10K means 10,000ohm max resistance. This is pretty standard, but because what we're measuring is a ratio most values work fine.

Step 7: Code

First step is to install Arduino if you don't have it and the Teensy plugin for Arduino. It's a quick install and comes with lots of great libraries to play around with.

Now either download and change my code to the number of buttons you have, or try to make your own using the included Teensy examples. If all you have to do is a few buttons, it's super easy.

When you want to upload the sketch, set the board to your Teensy version, and change "USB Type" to "Keyboard + Mouse + Joystick"

Step 8: Testing

Presto!

We now have a joystick input device, but does it work?

If you used some LEDs you can flick some of the switches to turn on the lights, but you might have to change some of the pin numbers in the code to match your controller.

Now either load up a game, or on Windows press "Win + R" to run a command and type in "joy.cpl"

This is Windows' built-in joystick utility, select the "Keyboard/Mouse/Joystick" and press "Properties" now we will see live input from our custom game controller! Exciting stuff.

Step 9: Package It Up

I used some double sided foam tape to hold my board in place, anything works, just be sure the circuit doesn't touch any metal inside your case.

Drill out a hole for your usb connection. Tilting the drill back and forth a bit will help make it wide enough without using a huge bit.

Step 10: Finishing Touches

Because I forgot to get proper LED carriages I quickly printed some little rings to make them look more proper.

I also had some knobs from an old stereo for the potentiometers, but I decided to print off some little knobs that match a cockpit a bit better. Any place that sells potentiometers will also sell the knobs, or make some, or download some from a 3D share hub to print yourself.

One last finishing touch was a carbon-fibre type decal on the side. Not very traditional, but looks cooler than the plain plastic.

Step 11: Rejoice!

It's done. Didn't take too long, did it?

Now load up your favourite video game, bind some keys and get to work flying, ejecting, or firing missiles! Heck even change radio stations or run macros.

Thanks for reading along, and hopefully giving it a go too!

Thoughts:

If I were to take this project a step further, I would probably make my own enclosure. You can use a laser cutter to cut the pieces, holes, and etch the design in painted acrylic, all in one go! That'd be the dream.

Comments

author
OJTheAviator made it! (author)2017-08-15

Hi, I made something similar to this, I found that a breadboard works well instead of the perf-board if you want to change or add stuff regularly. Great instructable!

Controller front.JPGController Wireing.JPGController.JPG
author
efe00 (author)2016-10-27

Hi!

Can I use Teensy 3.0 for this project? Will it work?

'Cause I think Teensy 3.0 is great and now it's just $9.50!

Please reply me!

Have a good day..

author
skitcher1101 (author)efe002017-04-02

will an arduino uno work?

author
travershenry (author)efe002016-11-02

Hey, yes I believe the 3.0 can also work as a HID device like a keyboard or joystick. Good deal!

author
efe00 (author)travershenry2016-11-11

Thanks for answer. After you said it can work with 3.0, I tried to buy but the shipping cost was $19 :D

I have an another question, can this code run on arduino mega?

author
travershenry (author)efe002017-01-23

Hey, didn't notice your second question.

It wont work on a mega, but it should work on a Leonardo or Micro

author
esteban941017 (author)2017-01-20

Sorry if the question is dumb, but i have no experience at all with teensy or aruino, do i have to buy one of them? both? is teensy an extension for arduino? can teensy work for this project by itself? can arduino work for this project by irtself? wich one do you recommend the most? Tahnk you very much, really nice project

author

No dumb question here.

A Teensy is just like an Arduino, but uses some different chips and is developed by another company. The Teensy boards also work with the Arduino programming language, so they are almost interchangeable. I personally like the Teensy boards very much, but an Arduino Micro or Leonardo cab also work as a game controller, just with a bit different library. Choose either a Teensy, Arduino Micro, or Arduino Leonardo for this project.

author
TheoM28 (author)2017-01-18

What teensy did you use?

author
travershenry (author)TheoM282017-01-23

Hey, I used the Teensy 3.1, but I believe they all support HID.

author
fyborg (author)2016-11-08

I have arrived late to read this proyect, please tell me where to find the PDF with schematics and so on, many thanks

author
AlexanderK49 (author)2016-11-02

Hi, nice project. Can i use this controller and a regular keyboard or another game controller like a steering wheel at the same time?
Thank you.

author

Sure can! I use it with mouse, keyboard, joystick, and foot pedals.

author
mfaust made it! (author)2016-09-04

Thanks for this instructable! Inspired by your article, I build a box on my own. It's based on an a regular Arduino UNO and communicates with a Java program. So it's not a flight controller, but a controller for a program I've written on my own. I'm gonna release an instructable about it the next days. I hope it's ok to put a reference to your article into it. As you can see I've copied the idea using carbon-fibre type decal - loved it!

IMG_20160904_113343.jpgIMG_20160903_134211.jpg
author
travershenry (author)mfaust2016-09-04

That looks amazing!

Absolutely you can link to this project, will check out your instructable when you post it.

author
jhunmar100 (author)2015-10-29

what editing software did you use to make a template??

author
travershenry (author)jhunmar1002015-10-29

Hey!
I used photoshop to measure out and make a template, it's just what I had available and know how to use. Gimp is a free alternative if you're interested.

author
rodlund (author)travershenry2016-08-30

This is an old post at this point, but I'm just discovering it, and it's fantastic! How did you get such clean lines to line up in PS? I've used it a lot for editing pictures but haven't designed something like this or found quite the right Google term. Such as can you define the holes to be 5mm exactly and such?

author
travershenry (author)rodlund2016-09-04

Hey no worries, thanks a bunch :)

Drawing lines in photoshop one can use the Shift key to make them straight. Also when drawing a shape, you can just click on the canvas and type in any dimension you want, that said it's probably not the best to do this sort of thing. Even illustrator is better because you can use the transform tool and move things by set amounts.

Cheers!

author
PatrickC154 (author)2016-05-25

Where did you buy the enclosure? Just wondering, thanks!

author
travershenry (author)PatrickC1542016-05-27

Hey, I bought it at my local electronics shop, but I find the right combination of words to find one online is "sloped project enclosure." The same model pops up on ebay and amazon. Cheers!

author
PatrickC154 (author)travershenry2016-05-27

Thanks

author
futzwith (author)2016-02-19

Nice, Could you link the decal file?

Thanks, in advance!

Later, FW

author
travershenry (author)futzwith2016-02-21

Hey futzwith, happy to hear you're interested in making one!
Unfortunately I'm having trouble finding the decal file, I think it might have gotten lost in a recent reformat. :C

author
chrisjlionel (author)2015-11-02

congratulations friend, very nice build.

author

Thanks so much. It's really exciting to have won!

author
bhavik zure (author)2015-10-28

Heartiest congratulations, hope you will keep posting some more.

author
travershenry (author)bhavik zure2015-10-29

Thanks so much!

I'm so excited to have won.

author
CosmiChild (author)2015-09-22

Just one more question appear in my head. :)

1.Does the PDF contains a scheme how to connect all these cables to Teensy? I never done such a project so don't know how to connect them at all. I know that Teensy has scheme of pins (which is even on one of your photos here) but with a photos of connected cables already it would be much easier to understand where/how, etc for noobs like me. :)

author
travershenry (author)CosmiChild2015-09-28

Hey, so sorry to not get back to you sooner!

The pdf doesn't have a wire scheme, but I'll try to make one in the next few days. In the mean time the wiring is pretty simple, but that diagram for the teensy can be a bit confusing. Most importantly are the grey numbers beside each pin, on a standard button one pole goes to ground and the other goes to one of the pins between 0 and 23. Hope this helps for now, and I'll update when I get a chance to make a proper diagram. :)

author
CosmiChild (author)travershenry2015-09-28

Thanks a lot and take your time.

It will be a very useful for someone who didn't have a chance to make such a thing before. I do not received all parts yet and will have to study Arduino first. :)

author
CosmiChild (author)2015-09-20

May I ask why you used a rubber cement?
I never head about this and checked wikipedia, but since my English isn't that good to understand everything, I thought it might be better to ask you. :)

author
travershenry (author)CosmiChild2015-09-20

It's just what I had available, and is only really needed to hold it while the holes are drilled, after that the buttons hold the decal in place. Most glues should work fine :)

author
CosmiChild (author)travershenry2015-09-20

Thanks for explanation. Didn't know that it works like a glue.

author
AlistairB (author)2015-09-09

Just wondering how the game deals with the fact that the switches are toggle and not momentary? so for instance move switch to on for (for instance) fire missile or drop landing gear but the switch stays 'on'... are there many functions that map well to switch to on rather than momentary on? other than that, Great 'ible! :)

author
travershenry (author)AlistairB2015-09-11

Hey, good question!

Most games prefer momentary switches like buttons, so some of the ones I used don't toggle, they spring back. However I do play some games that have bindings for things like "flaps down" and "flaps up" instead of just "toggle flaps." For these kinds of games it's okay if the switch stays in each position, and it adds a cool immersive factor.

So basically, it depends on the game if you can use toggling switches.

Happy flying!

author
AlistairB (author)travershenry2015-09-11

Brilliant!
I haven't played flight sims since the amiga days but will be getting into elite: dangerous soon and getting jealous of all the OTT setups I keep seeing. I like the idea of building my own panel :)

author
LouisW8 (author)2015-09-05

Please can you tell me what is the thing in the lower left picture ? Thank you :)

author
travershenry (author)LouisW82015-09-05

Hey! Do you mean the black enclosure thing?

You can find these sorts of project boxes at electronics shops and online, search for Sloped Enclosure, Sloped Pedal Box, Instrument Case, or some combination of those words. There are lots of them on amazon and ebay.

author
LouisW8 (author)travershenry2015-09-06

Okay :) Thank you very mutch ! :)

author
Omega31 (author)2015-09-01

Wow dude I love this project. I play a lot of flying sim, namely Arma 3, Elite Dangerous and Star Citizen coming next. I was always looking for these types of buttons so far ive spent £450 on flying peripherals but this is the one I am looking for. Have you thought of kick-starting this project for flyers? Can I buy this from you?

author
travershenry (author)Omega312015-09-01

Hey Omega,

Thanks so much! I haven't kick started anything, and I probably wont sell this particular one, so I encourage you to build one too! Who knows, if I win the Epilog contest I could sell kits.

In the meantime, happy flying :)

author
Crucio (author)2015-08-28

REALLY REALLY LIKE IT! Great job!

author
travershenry (author)Crucio2015-08-30

Thanks, I appreciate it!

author
1muddyguy (author)2015-08-28

and for hard of hearing could u add a pitch noise out as to have a way to known how much u have output of said pots... or tone for button presses?... to learn where u are on the interface... so blind or deaf is no longer a problem... welcoming all to use this HID... LEARNING and PERFECTING even with disabilities...

author
travershenry (author)1muddyguy2015-08-29

Great idea, I'm sure it wouldn't be too much trouble to add a buzzer or speaker that sounds when a potentiometer is being changed and a tone based on how much it his changing. With pointed knobs it also becomes very easy to feel what angle they are set to, I also like the toggle switches because I can tell if they are on or off just by running my hand over them.

author
Nah yee chern (author)2015-08-28

Can this be used in ANY computer game?How bout' TF2?

author

TF2 is kind of funny about how it takes joystick input, but I think it's possible with a few edits to some .cfg files.

author
Jobar007 (author)Nah yee chern2015-08-28

Why not? If you map the buttons to have your scout shout, "I need a dispenser here!" on repeat, you'll fit right in... ;)