Introduction: Hack a Joystick (into an NES Controller)
I have an arcade machine project planned for the near future and I started planning ahead. One thing I needed for the arcade machine is a joystick but it had one requirement, it had to be really small because the system itself is planned to be as small as possible. I looked online for small joysticks and had no luck, I then began to look into joysticks found on Xbox controllers and Ps3 controllers. This seemed to be the best route but in most cases you would need a microcontroller to read the analog but I didn't want a microcontroller. I needed the joystick to control only four commands (up, down, left and right) so I wouldn't need precise readings. I was left with hacking a common joystick to read basically as two SPDT switches. So I would have the functionality of switches with the fluidity and appeal of a joystick. This instructable focuses on how to open up and hack/mod a joystick. For fun I ended up adding a joystick to an NES controller using the following method. This hack/mod has many applications. You can use it to control simple things or to add it to game controllers. I hope you enjoy :)
The NES controller I used happened to be a third party device but it will work with a normal controller as they both function the same way.
Watch the video :)
Step 1: Understand How the Joystick Works Before Hacking It.
A joystick is actually a simple device. It uses two potentiometers to control whatever it is used for. A potentiometer is basically a variable resistor in its simplest form. They have three pins but at times only two can be used. Two of the pins are the output pins and the center pin is called the wiper. The wiper moves along a path of resistance going higher or lower. Potentiometers come in different sizes and packages so be sure to research yours in particular for more information. Datasheets are nice! The wiper pin always allows a path to both of the output pins. This allows for a high resistance at one end and a low at the other.
Step 2: Hack and Mod the Pot! (part 1)
Before we take the joystick apart, I decided to supply a small voltage to the wiper pin so you can see that voltage is measured on both output pins. This step will help understand the hack. The wiper was not moved at all while supplying a voltage and measuring.
Step 3: Hack and Mod the Pot! (part 2)
In order to mod the pot we have to remove it from the analog case and scrape away some conductive material. To remove the pot from the joystick simply use a pair of tweezers to bring the two tabs in the center close together and pop it off. I left all the internals of the pot in place because I don't need to do anything to them. We will be focusing on the housing instead. After you pop off the housing study it for a few minutes, you'll notice black paths connecting the two output pins. In the middle top, scrape away a small amount of the black path as shown in the pictures.This breaks the connection of the two output pins and allows the wiper to touch only one of the pins at a time depending on which direction you move it to. I used a small hobby knife to scrape the conductive material. After you finished scraping the material, clean it and reassemble the pot. Do the exact steps to the other pot.
Step 4: Using the Hacked Pot
So after you hacked both pots you may be wondering what you can do with it. Since it now works as a switch you can do a lot with it. for this example I supplied 5 volts to the wiper pins and ran the output pins to four transistors. The transistors control four leds. I assembled the leds on my bread board in a way that relates to the position of the joystick. up, down, left and right. Now when I move the joystick either left, right, up and down the corresponding led will light up. This works by throwing the 5 volts to one of the output pins on the pot and activating the transistor. Just like a switch. The output voltage could go straight to whatever you want to use, The 5 volts was more than enough to power the leds without a transistor but I used transistors to get a base resistance for them. This way I can add this set up to an NES controller.
Step 5: Adding a Joystick to an NES Controller Using the Previous Hack Method
This is where it can get confusing for some. A lot of controllers out there detect when a button goes to ground (0 volts), the NES controller is among that list. So in order to use this method on an NES controller we will need to use a npn transistor. The positive output voltage from the hacked pots controls a transistor by using that voltage and current to turn it on. NPN transistors allow for things to essentially go to ground by turning it on. Since I replaced the directional pad buttons with a joystick I needed to use four transistors to emulate the button being pressed. I took the signal on one side of the buttons on the circuit board and ran it through the collector pin of a transistor, the emitter pin was then soldered to ground. The base pin turns on when the joystick moves and allows the transistor to turn on and connect to ground. The signal running through the transistor is the one before ground. I drew up a schematic on my white board to help aid. Also don't forget a base resistor ;) All of this would be a lot easier to understand if you know how transistors work. As I said earlier, this will work on the original NES controllers as well! I had to route out a circle hole where the dpad was in order to fir the joystick. It works awesomely!
We have a be nice policy.
Please be positive and constructive.