Making a Joystick

Please send comments to Roger (arnans@media.mit.edu)

 

Home

 

Joystick Construction Kit

The Joystick construction kit provides a convenient way to make your own car joystick. It consists of a resistor board, four key-switches, and a connector to the RCX brick. The joystick will occupy one sensor port on the RCX (sensor1). When connected properly, each button on the joystick will give a different sensor value. The continuum car is programmed to recognize these values and will translate them into commands that control its movement.

 

Making a Joystick Construction Kit

Basic principles

The core of the kit is the resistor board. The function of this board is to multiplex four touch sensors into one sensor port on the RCX.  It does this by connecting different resistors in parallel (See figure below). When a switch is pressed, the sensor value on the RCX is determined by the resistance of the resistor that is connected to that switch.

The value that will appear on the RCX can be easily calculated using the following formula.

Sensor Value = 1023 * R / (10 + R)

Where R is the resistance in Kilo-ohm. The following table summarizes the resistance and the sensor values used for each button.

Button Resistance
(kilo-ohm)
Sensor value on the RCX*
Up 0 0
Down 1 93
Left 5 341
Right 10 512

* Sensor values may vary from this calculation depending on the quality of the resistor, cable length, and contacts.

 

Building the resistor board

Use a general purpose PC board to form the body. Then, solder three resistors and five connectors together following the example schematic shown below. The idea is simple and you should feel free to modify the design.

The photo shows how the bottom of the board looks like (the connectors and the resistors are on the other side).

 

Connectors

I generally use female connectors on the board and male connectors on the cable. Bending the board connectors so that it lies flat on the surface is a preferred tip (you can also buy right-angle connectors as well). Using heat-shrinks to strengthen the cable ends are recommended. Hot-gluing the key-switches to a 4x4 Lego piece can make the buttons easier to use. Here's a diagram showing how the complete kit would look like.

 

Summary of parts

 
Part Where to buy Part number
PC board Radio Shack / Digi-key -
Resistors (1k, 5k, 10k) Radio Shack / Digi-key -
Connectors male/female Digi-key (m)929400-01-36-ND
(fm)929974-01-36-ND
Key-switch Digi-key SW411-ND
Lego electric plate www.lego.com  5037