Converting a Sidewinder 3D pro joystick to USB
Posted by Jim Morris on Sat Oct 24 14:50:02 -0700 2009
In playing with my new Rovio I decided that my Old MS Sidewinder 3D Pro Joystick would be an excellent way to control it, as it has the twist which can rotate the Rovio, and the joystick up/left/down/right can move the Rovio in those directions while still facing forward.
The problem is that the joystick has a game port connector, and my
Linux workstation does not have a game-port. After doing the obligatory
Googling I found
this Exactly what I
needed, except this was for Windows not Linux. Thinking I would have
to modify the code I contacted Grendel who graciously sent me the
source code for the project, however it turns out the code he wrote
was so good it works as is on Linux, I just needed to modprobe
sidewinder
and it worked.
The project is based on a great little hackers device called a Teensy a relatively cheap general purpose programmable USB dev board. It has lots of sample code showing it being a keyboard or mouse or serial port etc. It is programmed in C using the avr-gcc toolchain. This is like a Basic Stamp with USB, something I needed years ago but couldn't find. Now I have one I forgot what I needed it for many years ago, but it is in my arsenal now.
The only thing I needed to do, as I was on Ubuntu Hardy (8.04 LTS) and
not 8.10 or newer, was to build the avr-gcc toolchain myself. The one
included with Hardy did not recognize the atmel mmcu atmega32u4 type,
which is relatively new. This process is made much easier with a
script you can get from this
thread,
Note you need to register with the forum to see the download
links. The file you want is
build-avr-gcc-4.3.3-libc-1.6.7-insight6.8-arch25-fix.zip
. Make sure you
read the first post of the thread and make sure you have all the
dependencies installed first according to the pre-reqs.txt file in the
download. (Especially the libmpfr-dev which I missed initially).
Anyway I prototyped the circuit using the photos provided in Grendels post, and plugged it into a Windows XP system and it worked, then I plugged it into my Linux box and dmesg told me it recognized the joystick device..
[926661.299475] input,hidraw8: USB HID v1.11 Joystick [Detlef <Grendel> Mueller Microsoft SideWinder 3D Pro (USB)] on usb-0000:00:1d.7-4.3
I then downloaded jstest which is a simple joystick test program, and all the degrees of freedom were recognized.
I wanted to make the proto more robust so I designed a PCB layout using ExpressPCB's free PCB design and schematic tool (Windows based but runs fine under Wine on Linux). These guys will make 3 off 3.8" x 2.5" PCBs MiniBoard for around $50, which is a get price if you can't make your own. However I decided that for this one off project I'd just do a PCB prototype instead, so I sent the PCB layout to Grendel as thanks for all his hard work, in case he ever wants to go into production for this great little project.
I got a Schmartboard board (around $5 from Fry's) and a Rt Angle female pcb mount 15 pin DSub connector (.99c), and soldered the components and jumper wires. The DSUB needed coaxing onto the board as I guess the pin spacing is not the standard 0.01", however Shmartboard does have a board especially for dsub connectors, Fry's did not stock it though. I like these Schmartboards, they are cheap and well built, through hole, and you can even do surface mount if you have to. They are a lot better quality than what you can get from Radio shack!
As a side note, as I am getting older and it has been 10 years since I did any pcb soldering I found that my eyesight has deteriorated to the point that I needed a magnifying lamp to do this work, and that my hand is no longer as steady as it was, and that my old trusty Weller 35W pro soldering iron was too hot and unwieldy, and I was making solder bridges everywhere and melting the wire and connectors. (That did not used to happen when I was younger ;) So I splashed out and got a nice new Hakko 936 soldering station, with the 907 iron and a very fine soldering tip and some very fine solder. This made this go a lot smoother, although finding the right temperature to use was hit and miss.
The last component was putting the finished product into a box. None of the Radioshack boxes I had lying around would fit, so remembering that I had great fun building an Acrylic box for my PC (which I eventually ditched for a Silenced case), I made a little acrylic box for the converter. A trip to Tap Plastics to get the adhesive was all that was needed as I still had some Acrylic scraps laying around.
Anyway that was my project for this week. Next up writing the code to control the Rovio with my Sidewinder 3D Pro. What Language to use?? Ruby, C++/Qt, Java, maybe learn a new one like Groovy? Hmmm what a Dilemma.
need 2 no how 2 buy it