loading

Greetings and welcome to my tutorial on creating a fightstick using Arduino.

This project is a fightstick created primarily for use with PC and PlayStation 3 and was made for my Rapid Prototyping course at the University Of West GA. The only guideline for the project was that it had to include a physical element and use an arduino chip.

When thinking about what I would want to make I realized that my current fightstick was to large and heavy to take to conventions where I may or may not want to use it. So I thought I could use an arduino to create a smaller, lightweight fightstick.

Overall I greatly enjoyed the process and learned quite a few things about how basic wiring and electronics work. I hope anyone following this tutorial will also enjoy it and learn from it.

Step 1: Buying Your Equipment (Buttons)

For my stick I decided that I wanted a traditional 8 button layout for the main face buttons. I also wanted a start and select button.

The buttons are easily found here: http://www.focusattack.com/controls/pushbutton/by-...

Impotent notes:

30mm are considered the stranded button size while 24mm are the smaller buttons commonly used as start or select buttons. You will likely want to go with the 30mm size, although I used all 24mm for my project.

Also make sure to pay attention to the connector size. Either .110" or .187" should work fine but you will have to buy different wires based on the connector size. For my project I used .110" exclusively.

Step 2: Buying Your Equipment (JoyStick)

One of the most important part of a fightstick is the stick its self. The stick comes in two parts

Something of note that I learned while working on this project is that traditional arcade sticks like the one linked above do not use analog input and instead simply use 4 miro-switches (think buttons being pressed by the stick). these miro-switches tell if the stick is being tilted left, right, down or up.

Step 3: Buying Your Equipment (The Arduino and It's Wires)

Next on the shopping list is the arduino that will read your stick and button inputs. For this I used an Arduino Uno (http://www.amazon.com/arduino-org-A000066-Arduino-....) Any model that has 14 inputs and 2 grounds will work but this tutorial will be for an Uno.

Next is wiring for the Arduino. The arduino uno takes a usb B while most any usb you will want to use will use usb A so you will need to wire accordingly. Also for convince you will likely want to be able to access the aduino's usb port indirectly from outside the box.

I recommend one of these two ways to do this:

  1. Using a long B to A usb you will need:
    • Long usb B to A cable. This will be used to connect to the computer or console (http://www.focusattack.com/10-foot-male-a-b-usb-2-...
    • B male to b female. This will connect your arduino to a open port you can put on the outside of your box (http://www.newegg.com/Product/Product.aspx?Item=9S...)
  2. Using a long A to A usb you will need

In my project I went with approach 1 but in the end the only difference will be the size and shape of the hole you will need to make in your box to house the usb port.

Step 4: Buying Your Equipment (The Rest of the Wires)

While looking at the buttons you may have noticed the 2 pronged plug. This is what will connect to the wires that will connect to the arduino. It is important to know that one is used as the actual input wire, with the other used as a grounding line. Both pongs can do either job so you don't have to worry about which one is which. Also take note the number of grounds on your arduino. The uno only has 3, and one will be used by your joystick, so you will need to daisy chain your grounding wire for at least a majority of your 10 buttons.

This is the list of wires you will need:

Important Note: If your stick does not come with its own wires as the one in my link did you will need to acquire suitable wires for that as well. This includes 4 wires for the 4 micro-switches as well as 1 extra for the grounding wire.

Step 5: (Optional) Build a Prototype.

Now that you have all of the electronic components you may find it beneficial to make a prototype of your box so you can see how the project will come together when you are finished. In my project I found a $3 cardboard box that was somewhat sturdy but easy to cut through. While this step is optional I recommend it as it will show you what your working with as well as how you should you should go about making your box (especially if you don't just copy this tutorial)

Step 6: Splicing Wires.

This next step is to make all of your wires usable. As you may have noticed the ends of the .110" wires are just stubs that will not be able to plug into your arduino. However the m/m jumper wires will plug into your arduino. To solve this problem you will need to splice these wires together.

For this step you will need:

  • Soldering iron
  • Solder
  • Heat-shrink
  • Wire cutters
  • Ohmmeter

If you have never spliced wires before you may want to do some more research about it but here are the basic steps for this project:

  1. Thread the .110" wire through the heat-shrink.
  2. cut into the rubber of the .110" wire and remove so that the wire is exposed. Twist the rubber while doing so, so that the wire is twirled and not frayed.
  3. Cut off one end of the m/m jumper wire and repeat what you did in step one
  4. Carefully twist the .110" and the jumper wire together. The goal here it to create a twist that will stop the wires from pulling apart.
  5. Use a soldering iron and solder to coat the splice with a smooth coat of solder. This will add more strength to the splice
  6. Move the heat shrink over the splice and shrink it by waving a lighter under it (be sure to not burn the wires. Do this by constantly moving the lighter)
  7. Test your wire with a Ohmmeter by touching the ohmmeter's red and black wires to each ends of your wire. If the ohmmeter reads the resistance as less then 1 you're good.

You will need to repeat this process for all 10 buttons' input wires, the daisy chain ground wire, and the joysticks 4 wires + it's ground wire.

Important Note:

You don't need to worry to much about messing up this step if you purchased the links I've provided in this tutorial because not only will you have more wires then you need but also the .110" wires are much longer then they need to be. Because of this if you mess up you can just cut off more wire and try again from step one. The Exception to this are the wires for the joystick and the grounding wire. As such I recommend saving those until you are comfortable with the process.

Step 7: Programming the Arduino

As for the programming side of things this project is actually fairly simple due to an open source project called UnoJoy. Please visit there Getting started page for a great tutorial on how to start using their code.

Things to note about UnoJoy:

  • The folder "UnoJoyArduinoSample" contains code for a full controller, including analog sticks. This is not what we want. In their Examples folder there is code for a BasicFightStick. For my project I used this a starting point however it did not fully suit my purposes so I had to add code for the R1/RB, L1/LB,R2/RT, L2/LT, and select buttons. My code can be found below.
    • Be sure to note which pin numbers correspond to witch button.
  • The unojoy visualizer never worked for me. However this should not be an issue as you can just as easily go into the windows control panel -> hardware and sound -> Devices and Printers window to see if the controller is recognized. Then right click the controller ->game controller settings->proprieties this window will show you exactly what inputs your arduino is sending out.
  • During my project I had to flash the arduino in and out of arduino mode many times and never encountered any issues. Because of this don't be afraid to do this as well if you are needing to make modification to my code.

Step 8: Building a Box

Next you will need to buy/create your final housing for your electronics. There are numerous options for this but below is a guide for my approach.

For my project I was looking for a more portable slant at a fightstick. Because of this I decided to build my box out of composite board with a white board face. This material provides a decent balance of strength and weight. To create the box I had 6 boards and 4 molding pieces cut. Due to a miss-cut and inexperience my boards were 10.5" x 13" x 2", however I would recommend:

  • a left and right 2" x 8"
  • a front and back 2" x 13"
  • a top and bottom 13+" x 8+"
  • 4 2" tall molding pieces
  • Important note: To create a better box I recommend adding the height of the side panels to your top and bottom panels. That way your top and bottom will extend over the edges of the side panels. In example if your left and right board is 2" x 8" x .5" the you would want to make you top and bottom 14" x 8". Likewise if your front and back board were 2" x 13" x .5" you would want to make your top and bottom 13" x 9".

What you will need:

  • A Drill.
  • A 1" (for 24mm buttons) or ~1.2" (for 30mm) circular drill bit.
  • 2 to 6 bolts with nuts to hold your joystick to the board
  • 8 wood screws
  • Appropriately sized drill bits for the bolts and the wood screws as well as any bolts or screws needed for your USB mount.
  • appropriately sized Philips screwdriver
  • ~12/16" circular drill bit
  • Wood glue
  • Sandpaper
  • Duct tape

The Steps:

  1. Drill holes into the face plate using the circular drill bit for your 24mm(1") or 30mm(~1.2") buttons.
  2. Drill one more 1" or ~1.2" hole into your face plate. This will be where your stick will come out of.
    • Note: The placement of your stick and buttons are your preference however a set up similar to mine is considered standard.
  3. Drill 2 to 6 appropriately sized holes near your joystick hole to house the bolts needed to hold the stick in place.
  4. Glue one piece of molding to the 2 end edges of the left and right panel. Wait overnight for glue to dry fully
  5. Glue the front and bottom to the outside edges of the molding. Allow glue to dry.
    • If done correctly you should have a frame with the molding pieces on the inside corners.
    • Plan on the front and back panels to over lap the left and right panels at the corners. This will allow for a smoother corner.
  6. Place the bottom panel over the frame. Drill a hole through the bottom panel in order to start a pilot hole in the 4 molding pegs that lay in the corners. Place a wood screw in the holes and tighten with screwdriver.
  7. (Optional) To fill in any cracks/increase strength add glue around the inside bottom edges of the box, allow time to dry.
    • At this point Your project should resemble picture 2 shown for this step.
    • If any holes remain feel free to plug them with duct tape.
  8. Drill a hole in the middle of the back panel using the ~12/16". This will be used for the usb port you are using.
    • Important Note: This is approximate measurement used for USB method 1 in step 3 and is likely not accurate. You will need to do your own measurements to see what size hole you will need.
  9. Drill holes near you USB hole to house the screws/bolts need to keep the USB mount in place.
  10. Flip over the frame and repeat step 5 for the front panel.

Step 9: Final Step: Putting It All Together.

After you box has been made you are ready to thread the wires of the buttons through the holes in the top of the top panel. The button should be able to fit snugly in the hole while having no chance of being pushed through.

Secondly stick the joystick from the bottom of the top panel through its hole then use the holes you made for the bolts to hold it in place. Screw in the ball or bat top into the stick then use a Flathead screwdriver to lock the top in using the metal bit at the base of the stick

Next plug in the arduino to your computer. Make sure it has the correct code loaded, and that it is in the Unojoy "joystick" mode. Then plug all of the pins of all of the buttons and the joystick to their appropriate pin hole in the arduino. If your are unsure of the button layout of a fightstick here is the order of buttons read left to right from top left to bottom right

  1. X/Square
  2. Y/Triangle
  3. RB/R1
  4. LB/L1
  5. A/Cross
  6. B/Circle
  7. RT/R2
  8. LT/L2

Important Note: My code its mapped so that it will work with X-input control schemes, However the computer will not recognize the controller as a X-input device. In short this means that for PC games the controller will likely have to be remapped. Luckily, as is the case with Ultra Street Fighter IV there is a controller setting suite that will let you remap any button to anything, including menu navigational buttons.

Lastly, screw in the top panel and your ready to play any fighting game on PC or PS3.

Optional: For most other consoles such as Xbox 360, PS4, and Xbox One there are devices that will let you bypass the authentication process allowing you to use any controller (such as the one you just made). One such device is called the Titan One and can be found here. All you will need is an actual controller for said console and a USB cord. Then plug in the Titan One into the console. Plug the real controller into the Titan One and wait for it to read 0. Then unplug the real controller and plug in your new custom made arduino fightstick.


<p>Nice instructable. I made a fightstick a while back using a mega. I used a mega because i bought some clear buttons with leds with them and i wanted them to light up when pressed and fade to off when released. if anyone is interested in the leds and want the code and a wiring diagram feel free to ask.</p>
<p>I was thinking about making one with Neopixels, but I like the idea of light on when pressed and fading out rather than predictable light patterns. Could you toss me the diagram and code?</p>
<p>as i said above, give me a week tops if you need the diagram. and yes single neopixels would be viable, but i bought these green transparent buttons, so there would be no point of having rgb lighting for me at least. i originally planned for it to have &quot;stand by&quot; lighting patterns when not touched for a certain period of time such as a chaser, wave fading, and/or random blinking, stuff like that, but i scrapped it out because it didnt play nice with the state machine i implemented in the sketch.</p>
<p>or below, the reply to the other person.</p>
<p>I would also be interested in the code. I am a mentor on a First Robotics team and we could use this as an auxiliary control panel. Thank you.</p>
<p>i've uploaded the sketch to my google drive. <br><a href="https://drive.google.com/folderview?id=0B1-uQUwHvA7bNTdRb3p0ODBTc2s&usp=sharing" rel="nofollow">https://drive.google.com/folderview?id=0B1-uQUwHvA..<br></a>i used this convenient library that takes care of the PWM fade, because i did not want to reinvent the wheel.<br><a href="https://github.com/jgillick/arduino-LEDFader" rel="nofollow">https://github.com/jgillick/arduino-LEDFader</a><br><br>if you need a diagram, give me like a week to get back to it, im quite busy with school. you can look at the sketch and try to figure out what pins press what and what pwm outputs correspond to which inputs if you need it now. i wired it a bit quick and dirty and i would have to go back and do just that because i probably threw out the paper in which i noted the pins and their corresponding buttons. i dont know if the ones in the sketch are really the equivalent ones.<br></p>
is it possible to make 2 player control with single UNO?
<p>The Arduino Mega version of UNOJOY, called MEGAJOY (if i remember the name correctly) does support the interface of two seperate controllers. </p>
Yes and no. If I remeber correctly the unojoy library has a set up for two players running off of one Arduino. However I'm more than certain that an uno will not have enough pins to accommodate that many buttons. Mabey a different arduino will work? ( Unless of course the only game you're going to play is divekick lol)
<p>Nice, Thanks for the link to the buttons and joystick, i have been looking for a website like that for a few days now, ever since happ.com got wrecked by suzo. I really appreciate links that work. I find it to be quite annoying when people link to sold ebay auctions. </p>
<p>Nice home made Controller</p>

About This Instructable

20,421views

122favorites

License:

More by JamesT107:Arduino FightStick 
Add instructable to: