Tuesday, August 4, 2015

Custom Built Fightstick using Arduino Uno

As I was going through all of my collected fightstick parts, it occurred to me that I have all but one component to build myself a second fightstick. I just needed the JLF Sanwa joystick and a box to put all of it in. What really sent me over the edge was when I found a controller box that was being thrown out.
 



I'm not entirely sure what it was originally, but it had a bunch of old controller parts probably for something audio/video related. So naturally, it needed to be destroyed.









Here's a better photo of it after I removed all the old knobs and switches. The tricky part about using this as the fightstick box was figuring out a way to overlay a new piece of metal so that I could place new holes for all the buttons and joystick. There were too many spaced out holes to save the original piece and the faceplate has two bends on the top and bottom at different heights. Later you'll see a photo better explaining what I mean.





I knew the idea that I wanted to go with, but I needed some help from some machinists that work in the dark depths of the Electrical Engineering building. Joe Beeler and Ricky Cardenas, two very talented machinists that made this much easier to put my thoughts into something that could physically be worked.

They cut out the top part of the place leaving the two bends at the bottom so we didn't need to warp aluminum to recreate the original.





They helped size and cut a new piece of aluminum so that we could make a new faceplate. Using a layout that I found at slagcoin  we used radio chassis punches to make perfect holes that would house the buttons and the joystick.

I was incredibly impressed with how well the punches worked. They were very simple to use as well, if not for the punches we would have had to use the CNC to cut the holes.







Here are two angles of the fightstick before all the wiring went into it. We added two buttons on the right of the box to include a start and select button.




I don't have any photos of programming the Arduino Uno because it wouldn't really explain much. Anyways I used some helpful links and sources from the UnoJoy github from Alan Chatham. He did a pretty decent job providing information on how to get the Arduino to be a useful joystick controller. I did however make some changes to the code, however because I was not using any analog joystick inputs and I wanted to map only six buttons for the fightstick.


Here is the Arduino Sample Code
// Changed from
// controllerData.l1On = !digitalRead(10);
controllerData.r2On = !digitalRead(10);

//Commented out all of the analog inputs since I didn't use any of them
// controllerData.leftStickX = 128;
// controllerData.leftStickY = 128;
// controllerData.rightStickX = 128;
// controllerData.rightStickY = 128;


I'm not going to post a tutorial on what steps I did because the GitHub readme file does a pretty decent job at explaining what steps are necessary, but if there are questions I don't mind making some help posts.




Here's the very quick and dirty wiring job. It was 11 pm at this point and I just wanted to finish it and test it. I was a little upset that I soldered directly to each button, but at this point in the project I realized that I only spent a total of $25 for the entire project and didn't want to spend more just to challenge myself to see how cheaply I could make it.

I'm sure I'll go in on this later and replace the soldered wire with something more modular, but for the time being I'm incredibly happy with how this works.









Here's a little photo showing that the fightstick worked on my Playstation 3. Later I tested it on PC successfully. I'm testing on Guilty Gear Xrd in the photo if anyone was interested.






This is Joe Beeler(left) and Ricky Cardenas(right). They were embarrassed I was taking their photo, but these guys were very helpful and without their machinist knowledge I believe that this project would have been much more overwhelming. So this is a big thank you to them.

Also thank you to Alan Chatham for doing a lot of work on the UnoJoy project.