E-Textile Pressure-Sensing Kalimba

Series: alt.ctrl activities; builds on Kalimba; Spatial arrangement

A controller built on the physical affordance of stiff strips that can be plucked and bent. It borrows the kalimba's construction, not its sound: the metal tines are replaced by bamboo ones covered in copper tape, and under each tine a piece of piezoresistive fabric measures how hard it presses on its pivot, so each tine measures its own displacement.

The tines' lengths are chosen to place their free ends within reach of the thumbs, not to set pitches: a controller's tines need no tuning. The kalimba's construction suits rapid assembly: a single bar held down by two screws traps all the tines between two pivots. The first version, in 2010, had wooden tines, faster to shape than metal. A tine can be plucked, the pressure setting the size of the pluck, and then bent as a continuous control.

Ten light wooden tines of different lengths under a wooden bar held by two screws, on a clear acrylic disc; a small green circuit board with resistors beside them, red wires running to the tines' copper strips, and a USB cable.
The 2010 prototype: ten wooden tines, a bar held by two screws, a clear acrylic base and the controller board.

Materials

ItemAmazonAdafruitSparkFunSeeed StudioMouser
Bamboo strips, for the tines (the 2010 prototype had ten, of different lengths)
A base for the tines and their pivots: wood, a single 3D-printed structure, or laser-cut acrylic like the prototype's clear disc
For the pivots and the clamp: a half-round rod for the pressure pivot, a strip for the rear pivot, and a bar with two screws
Copper foil tape with conductive adhesive, for the tines, the base strips and the ground bus1128PRT-13827
Piezoresistive fabric, such as Eeonyx's EeonTex, a small piece for each tine; contact the manufacturer, Eeonyx
Pull-up resistors, one for each tine
A microcontroller board with at least one analog input per tine (the 2010 board used a PIC18F2550, which has ten). For example the Seeed Studio XIAO SAMD21: all eleven of its I/O pins are analog inputs102010328713-102010328
Hookup wire
A computer with software that receives OSC, such as Max or Pd

Tools

  • Scissors, for the copper tape and the fabric
  • A saw, a craft knife and sandpaper, for the bamboo
  • For the base: woodworking tools, a 3D printer or a laser cutter
  • A drill and a screwdriver
  • Soldering iron
  • An MCU IDE

Skills

  • Cutting and shaping bamboo
  • Working with copper tape and piezoresistive fabric
  • Soldering
  • Programming an MCU: analog inputs and OSC

Instructions

  1. Cut the tines from bamboo, each long enough to put its free end within reach of the thumbs. They need no tuning.
  2. Cover each tine in copper tape.
  3. Make the base with its two pivots: a half-round pressure pivot near the front, where the tines' free ends will be, and a rear pivot, far enough apart for the bar to sit between them. Wood, a single 3D-printed structure and laser-cut acrylic all serve.
  4. Lay a strip of copper tape on the base for each tine, along the flat base and up over the curve of the half-round pressure pivot, where the tine will rest. Trim each strip to a length that keeps its wire's path to the microcontroller simple.
  5. Run a copper strip along the rear pivot: it is the ground bus that every tine's copper touches.
  6. Put a piece of piezoresistive fabric on each base strip, on top of the pressure pivot, so that it is trapped between the strip and its tine's copper tape.
  7. Lay the tines across the two pivots and clamp them with the bar, held down by two screws between the pivots.
  8. Wire each base strip as a voltage divider: a pull-up resistor from the supply to the strip's wire, which an analog input reads (most microcontrollers cannot enable a built-in pull-up on an analog input; first-generation Arduinos could); the ground bus goes to ground. Measure a tine's resistance at rest and pressed fully, and choose its pull-up near the geometric mean of the two: that gives the widest range of readings.
  9. Program the microcontroller to read each analog input and send the readings as OSC messages, as the 2010 prototype did.
  10. Play: pluck a tine as on a kalimba, its pressure setting the size of the pluck, then bend it for a continuous control.
Side view of one tine: a bamboo tine covered in copper tape rests on piezoresistive fabric on top of a half-round pivot, over a base copper strip, and at the rear on a pivot whose copper strip is the ground bus; a bar held down by a screw presses the tine between the pivots. Below, the base strip runs to an analog input with a pull-up resistor to V+, and the ground bus runs to ground.
How each tine senses pressure: an illustration, not to scale, drawn from the 2010 description.
The prototype from above: copper-taped tines across a round wooden rod and two clear strips on a clear base, copper strips of different lengths below them, and red wires running to a green circuit board.
Another view of the 2010 prototype: the base copper strips are trimmed to different lengths to keep the wiring to the controller board simple.

Variations

  • Wooden tines, as in the 2010 prototype.
  • More analog inputs: the Seeed Studio XIAO MG24 has 19 pins that can be analog inputs, 11 of them on its edge; a Teensy 4.0 (SparkFun DEV-15583) has 14, and a Teensy 4.1 (SparkFun DEV-16771) has 18.
  • OSC over Wi-Fi: an ESP32-S3 board such as Espressif's ESP32-S3-DevKitC-1, reading the tines on its ten ADC1 inputs, GPIO1 to GPIO10: Espressif notes that ADC2 is also used by Wi-Fi.
  • More tines than analog inputs: a 16-channel analog multiplexer, as in the Tablo.

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 "E-Textile Pressure-Sensing Kalimba", the activity at https://adrianfreed.com/etextile-pressure-sensing-kalimba.html.

Write a program for a microcontroller that reads a controller of stiff bamboo tines, each pressing on piezoresistive fabric, on one analog input per tine (the prototype had ten). Each tine is a voltage divider with an external pull-up resistor (most microcontrollers cannot enable a built-in pull-up on an analog input); the reading falls as the tine presses harder.

Calibrate each tine at rest and pressed fully, and scale its reading to a displacement from 0 to 1. Report both a pluck, with its size, and the continuous bend that follows. Send the readings as OSC messages, as the 2010 prototype did, over USB serial or, on a board with Wi-Fi, over the network; on an ESP32, read the tines on ADC1 pins, because ADC2 is also used by Wi-Fi.

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.

Design strategies: