Intro: Retro Joystick Mouse
Back in the days where men were real men, women were real women and games where pixelated and awesome. The movement of characters was controlled by the almighty joystick but over time games have become more and more complicated and the joystick was tossed aside to accommodate fancy controllers full of buttons and analogue sticks. The time has come for joysticks to make a stand! to rise up and be counted! it is time for joysticks to become mice!!
I got the idea for this project after finding an old Atari joystick at a sale for $1. I wanted to connect it to my computer with out destroying it or its connector. After some research I found that all controllers of this type are just buttons which could be easily mapped to a keyboard keys. Hence this Instructable was born.
This set of instructions can be used to connect any old school gaming controller with a 9 pin plug to a computer (ie Atari and commodore 64 controllers)
Step 1: Tools and Materials
To aid the joystick uprising you will need:
- A joystick or old school controller with a 9 pin connector (I am using a Quick Shot QS - 131) (image 1)
- An old or cheap keyboard (image 1)
- Wire (not shown)
- Paper-clips (image 2)
- Plastic (an old soft drink bottle will do) (image 2)
- Cable tie (not shown)
- Super glue (image 2) or hot glue
- Tape (both duct tape and masking tape) (image 3)
- Soldering iron and solder (image 3)
- A pin vice with 1mm drill bit (image 3)
- Pliers (image 3)
- Wire cutters (image 3)
- Wire strippers (image 3)
- A knife (image 3)
- A Dremel (not shown)
- Permanent marker (not shown)
- multimeter (not shown)
- GlovePie which can be downloaded for free here
Step 2: Pin Hunting
Joysticks and game controllers with this type of 9 pin connector are very simple devices.
They are simply a button between a "5 V rail" and the output pins.
Each controller has a different output pin arrangement although the position of the "5v rail" is common to all. Going by the pin numbering in image 1 the "5 V rail" is at pin 7.
The easiest way to work out which pin relates to what button is to straighten two paper-clips put one into pin 7 and one into pin 1. hook a multimeter across the paper-clips and test all of the joysticks functions (fire,left,right,up and down) if a connection is made, write down the pin number and the action which caused the connection.
repeat the above step moving the paper-clip (currently in pin 1) to each of the other pins on the connector.
note: it is not unusual for a pin to make no connection (only controllers which a large functionality use all the pins)
From my testing I found the following:
2 - right
3 - left
4 - back
5 - forward
7 - 5V
9 - fire
A few things to note:
The blank pins above can be seen in the image, pins 1,6,8 look to have a wider diameter than the other pins, this could help to cut down testing time
The fire buttons on my joystick are actually the same button which means with my controller as is, I will not be able to right click.
Create a pin out diagram and hold onto it. It will be helpful latter
Step 3: Getting Keyed
So armed with a pin out diagram and knowledge on the controller, its time to steal a circuit board to allow the computer to interact with the joystick.
To do this we are going to map the joystick buttons to keyboard keys that don't get used all that often (they need to be keys you will not use while doing day to day things like surfing the web or typing documents (this is to do with programming issues but I'll get into that later))
Unscrew all the screws in the back of the keyboard (make sure to get the one hidden under the feet (image 2))
Removing the back should reveal something like image 3, ie a plastic key matrix and a small circuit board
Remove the key matrix and separate the top and bottom (image 4)
A keyboard works by connecting two separate contacts when a key is pressed, such that each key makes a connection between a unique set of contacts. This project works by replacing keyboard buttons with joystick buttons
As the joystick buttons are all linked to the one 5 volt rail look for keys (that you don't use) on one of the halves of the matrix which are all connected to one contact (see image 6)
For example in my project I used keys in the numpad as I never use them. In the numpad i found that the "/ 8 5 2 0" keys are all connected to the one contact so I chose those keys.
After finding the keys you need to map which other contact they connect to, this is done by simply using a permanent marker to trace the tracks on the other half of the key matrix (image 7)
At this point it is very useful to lay the two halves back on top of each other and on a piece of paper mark which contacts
the body of the keyboard is now useless but you could use it to something like this
Step 4: Board Games
Prepare the contacts from the previous step for soldering (my contacts had a semi-conductor on them which i needed to sand off) (image 1)
Test the contacts by plugging the circuit board into a computer and using a piece of wire to bridge the contacts. All going well those keys should appear on the computer (image 2)
Solder a length of wire to each of the required contacts (image 3)
note: the contacts are very thin and brake quite easily, to prevent this apply duct tape of the top of the wire to hold everything in place
For the first time in this build the controller is ready to interact with a computer. Put each of the wires into the pins corresponding to your pin out diagram and plug the circuit back into a computer (image 4). Now when you move the joystick you should have the numbers appear on the computer. If not go back and check your solder joints and pin out diagram
As you remove each wire mark it with masking tape so you remember which pin it connects to later (image 5)
Step 5: Getting Plugged
If you are like me and dont wont to destroy the joystick or its connector you will need to make a male plug for it
To do this:
Cut a piece of plastic and get it as flat as possible (image 1)
Cut the backs off 6 paper clips (image 2,3)
Make sure they fit and mark on each pin the level it goes in (image 4)
Remove the pins, fold a piece of paper over the connector and reinsert the pins (image 5)
Tape this piece of paper to the plastic and using a pin vice drill holes in the plastic through the holes in the paper (image 6)
Make sure that the pins fit nicely in both the plastic and the connector (image 7)
Using pliers bend a loop in the top of each pin (image 8)
Glue the pins in place such that the level marked on each pin lines up with the plastic (image 9)
Note: if you are using a plastic softdrink bottle do not use hot glue as it will warp the plastic
Cut the main piece of plastic down and use the off cuts to create a surround for the connector (image 10)
Hold the surround in place with glue and duct tape, cut the backing plastic down further (image 11)
Image 12 is the finished connector
Step 6: All Boxed Up
Cut a hole in the project box with a Dremel, this hole needs to be big enough to fit the back of the plug through. (image 1)
Because you cant solder onto a paper clip, wrap one end of a piece of wire around each of the loops on the back of the plug and insulate with tape (image 2)
Note: be sure wrap the wire tightly otherwise the wire may slip and lose connection
Thread the wires through the hole in the box and attach the plug with duct tape and super glue (image 3)
On the other end of the box cut a small channel for the keyboards USB cable (image 4)
Solder the wires coming from the circuit board to the wires come from the plug. Be careful to check that each wire is being soldered to the correct pin (image 5)
Put the circuit board in the box and hold in place with duct tape. attach the cable tie to the USB cable to act as a stop should the cable be pulled (image 6)
Step 7: Joystick Pie
With a completed box its time to get this joystick acting like a mouse.
open up glovePie and download the code bellow (ArcadeMouse.PIE)
the code bellow is the reason that the keys used have to be useless otherwise.
the code swallows those keys if they are pressed on any keyboard and hides them so that the computer doesn't see them except for the mouse output the code gives. it has to be done like this otherwise when you move the joystick or click the fire button the computer gets both the codes output and the button press, resulting in annoying beeps and other randomness.
to get this code working for your joystick the only things which need to be changed are the "var." bits
change var.speed to increase or decrease mouse sensitivity
change var.right = swallow(Right) to swallow the key you used for right on the joystick
for example if you used num pad 4 as right, the code should read "var.right = swallow(NUMPAD4)"
change each of the var."direction" so that it lines up with your joystick output
once you have made the changes click run to start the code
For some reason on some computers this code gets a bit buggy and doesn't release the click when you take your finger off the fire button to fix this problem copy and paste the code below on to the bottom of the code and it should fix it.
if (var.click=True) then
wait 10 ms
If you have any problems with the code going hay wire alt+F4 glovePie and post details below so that I can help fix it
Step 8: SURF!!!
Go out and enjoy your favourite websites in retro style!
I have entered this instructable into the Game.Life 2 contest. If you like it please vote for it