Build a Tether Sensor from String Pots and Joysticks

Series: alt.ctrl activities; builds on Gametrak

Comparable three-axis position sensing is easy to build from readily available string potentiometers and joysticks. A string potentiometer (string pot) measures how far its cable is pulled out; passing the cable through a joystick's knob, as the Gametrak does, adds the cable's two angles.

Materials

ItemAmazonAdafruitSparkFunDigi-Key
String potentiometers, from makers such as Celesco or Penny and Giles. The links are to Celesco's SP series, sold by TE Connectivity Measurement Specialties (SP1, SP2), with measuring ranges up to 50 inchesSP series
Analog joysticks512COM-09032
A microcontroller (MCU) with analog inputs
A base for each sensor, heavy or screwed down (the Gametrak's box is weighted)
Smooth tubing, to guide the cable to the joystick

Tools

  • Soldering iron
  • Screwdriver
  • A drill, for mounting the parts on the base

Skills

  • Soldering
  • Programming an MCU's analog inputs
  • Sending OSC messages

Instructions

  1. Fix the string pot to a base that stays put when the cable is pulled: the Gametrak's box is weighted.
  2. Mount the joystick so that the cable runs from the string pot to the joystick's knob, and guide the cable there through smooth tubes along a clean path, as the Gametrak does to keep its readings precise.
  3. Pass the cable through a hole in the joystick's knob, as the Gametrak passes each of its thin nylon tethers through a hole in its joystick's knob. On the thumb joysticks linked above, the knob is the rubber cap, so the hole goes through the cap.
  4. Wire each potentiometer as a voltage divider: one end to the MCU's ground, the other to the supply its analog inputs measure against (within the joystick's and the string pot's ratings; Adafruit's joystick is usable up to 5 V), and the wiper to an analog input. Each sensor takes three inputs: the string pot's, and the joystick's two.
  5. Calibrate each axis: record its reading with the cable all the way in and pulled out as far as you will play, and with the joystick tilted to each side.
  6. Send the readings as OSC messages, one address for each axis, such as /left/x, scaled as CNMAT's o.io.gametrak scales a Gametrak's (the angles from -1 to 1, the extension from 0 to 1), so that software written for the Gametrak (see Set Up a Gametrak for Music) reads either.

Variations

  • Space the sensors as the instrument needs: a Gametrak's two sit at a fixed distance unless it is taken apart, as for the Kotrak.
  • Leave out the joystick for a single axis: the string pot alone measures how far the cable is pulled.
  • Drive a home-made string pot's reel with a motor, to change the cable's pull while playing: the SMC 2009 paper notes that the original Gametrak patent describes haptic feedback, with the tether's response controlled dynamically.

Related resources

Coding Prompt Build Block

A prompt to give a coding assistant, to start the code for this activity. Copy the box, answer its questions about your board and pins, and test what comes back on the bench before you rely on it.

I am building "Build a Tether Sensor from String Pots and Joysticks", the activity at https://adrianfreed.com/tether-sensor-string-pots.html.

Write a program for a microcontroller that reads tether sensors, each made from a string potentiometer, which measures how far its cable is pulled out, and an analog joystick that the cable passes through, which measures the cable's two angles: three analog inputs for each sensor.

Calibrate each axis's range, and send the readings as OSC messages with an address for each axis, such as /left/x, as a Gametrak's readings are named, so that the same software can read either.

Libraries to explore:

Before writing anything, ask me what I am using: the board and its pins, or the software (such as Max, Pd or Python), and check its documentation for what this needs. Put the pin numbers, ranges and other settings in one block at the top, each with a comment. Say which of the libraries above you use, and why. Start with a test that shows the raw readings, so that I can check the wiring and the ranges before the rest.

This activity by Adrian Freed is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0): you may share and adapt it with attribution, for non-commercial purposes such as personal projects and teaching, and you must share adaptations under the same licence. Product names and links belong to their suppliers.