Emerging Interfaces

E-Textile Sensors Tutorial: Building Soft Inputs From Conductive Thread and Velostat

Stitched pressure, stretch and bend sensors that survive being worn — plus the connection problem that kills most e-textile projects, and why your sensor reads differently after you wash it.

Rigid sensors are easy and wrong for anything on a body. A force-sensitive resistor taped to a sleeve works on the bench and fails the first time someone moves, because it does not bend where the arm bends and it does not stay put.

A sensor made of the garment behaves differently: it stretches, folds, and distributes pressure the way the fabric does. The constructions are simple — the hard parts are connections and drift.

Bela’s walkthrough of fabric interfaces with conductive thread.

Materials, and which to pick

Conductive thread — silver- or stainless-steel-coated. Sewable by hand, and on many machines in the bobbin. Resistance is not negligible: typically tens of ohms per metre for stainless, lower for silver-coated. For signal paths that is fine. For power it is not — a long thread run to an LED array will drop enough voltage to dim it, which is a confusing failure to diagnose.

Stretch conductive yarn — resistance rises as it stretches. This is the sensor for anything measuring elongation, not just a wire.

Velostat / Linqstat — a carbon-impregnated polythene film whose resistance falls under pressure. Cheap, comes in sheets, cuts with scissors, and is the basis of nearly every soft pressure sensor. Not stretchy; it is a filling, not a fabric.

Conductive fabric — woven or knit with metal fibres. Low resistance, good for electrodes and contact pads, solderable in some varieties.

Non-conductive stabiliser — felt, interfacing, neoprene. You will need more of this than you expect.

Construction 1 — Pressure (the Velostat sandwich)

Five layers, and the order matters:

   insulating fabric  (outer)
   conductive fabric  ← electrode A, lead to pin
   Velostat
   conductive fabric  ← electrode B, lead to GND
   insulating fabric  (outer)

Press it and the Velostat’s resistance drops, typically from hundreds of kΩ unpressed to a few kΩ under firm pressure.

Make the Velostat layer larger than the electrodes, overhanging on all sides by a centimetre. If the electrodes can touch at the edges you have a short, and it will be intermittent — the worst kind of fault.

Insulate the outer layers properly. Skin is conductive and sweaty skin is more so. An unsealed electrode on the body becomes part of the circuit.

Construction 2 — Stretch

Sew stretch conductive yarn in a line, or better a zigzag, along the axis you want to measure. Resistance rises as it extends.

Two things to know:

Zigzag or couch it, don’t sew it taut. A straight tight stitch has almost no travel before it is simply pulling on the fabric. A zigzag has slack to give, which is where your usable range lives.

It is hysteretic. Resistance on the way back down does not retrace the way up, and it does not fully return for a second or two. For gesture this is irrelevant. For absolute position it means you cannot calibrate once and trust the number — you need a moving baseline.

Construction 3 — Bend

A strip of Velostat between two conductive fabric electrodes, laminated so that bending compresses one side. Resistance changes with curvature.

Less linear and less repeatable than a commercial flex sensor, and far more durable in a garment, because it bends with the cloth instead of being a rigid strip glued across a joint.

Reading it

All three are resistors, so all three need a voltage divider:

3V3 ──[ R_fixed ]──┬── to ADC pin
                    │
              [ fabric sensor ]
                    │
                   GND

Choose R_fixed near the geometric mean of your sensor’s range. If it swings 2 kΩ to 200 kΩ, use about 20 kΩ. This centres the usable swing in the middle of the ADC range instead of bunching it at one end. Measure your actual sensor with a multimeter first — the published ranges are approximations and your construction is not the one they measured.

const int PIN = A0;
float baseline = 0;
float smoothed = 0;

void setup() {
  Serial.begin(115200);
  long sum = 0;
  for (int i = 0; i < 64; i++) { sum += analogRead(PIN); delay(5); }
  baseline = sum / 64.0;            // calibrate at rest, every boot
  smoothed = baseline;
}

void loop() {
  int raw = analogRead(PIN);
  smoothed = smoothed * 0.8 + raw * 0.2;     // EMA, light
  float delta = smoothed - baseline;

  // Slowly track the baseline so drift doesn't accumulate.
  if (fabs(delta) < 8) baseline = baseline * 0.999 + smoothed * 0.001;

  Serial.println(delta);
}

The baseline tracking is the part that makes it usable in the real world. Fabric sensors drift — with temperature, humidity, how long they have been compressed, and whether they were washed. A fixed calibration taken at the start of an exhibition will be wrong by the afternoon. A slow-moving baseline that only updates when nothing is happening handles it.

The connection problem, which is what actually kills projects

Do not solder to conductive thread. The coating wicks solder badly, the flux weakens the fibre, and the joint becomes a stiff point in a flexible material — which is precisely where repeated bending concentrates and breaks it. It works on the bench and fails in a week.

What works instead, in order of reliability:

Sew through the pad. Most sewable microcontrollers have large holed pads. Stitch through the hole six or eight times and tie off. Mechanical contact across many strands, and compliant.

Crimp. A crimp bead or ferrule on a bundle of thread, then solder to the crimp — metal to metal, with the stiff joint moved away from the flex point.

Snap fasteners. Metal press studs are conductive, mechanically strong, and make your piece detachable — so the electronics come off before the garment goes in the wash. This is the single best decision available in a wearable project.

Conductive adhesive or eyelets for fabric-to-fabric.

And regardless of method: strain-relieve every connection. A blob of flexible glue or a few stitches of ordinary thread anchoring the conductive thread a centimetre back from the joint, so movement pulls on the anchor and not the contact.

Washing, sweat and the things nobody mentions

Conductive thread oxidises. Silver-coated thread’s resistance rises over months, faster with sweat. Stainless steel is more stable and harder to sew.

Washing changes your calibration. Resistance after washing is not resistance before. Design for recalibration at power-on, which the code above does.

Humidity matters. A Velostat sensor reads differently in a humid room. If a piece has to behave consistently across a run, a baseline that tracks slowly is not optional.

Nothing with a battery should go in a machine. Snaps, so it detaches.

Where to go next

  • Matrices. Rows of conductive thread on one side of a Velostat sheet and columns on the other gives you a pressure-sensing grid from two layers of thread. Scan it row by row and you have a soft touchpad — this is how pressure mats are made.
  • Capacitive instead of resistive. A patch of conductive fabric as a capacitive electrode senses proximity and touch with no pressure needed, and pairs well with the ESP32’s built-in touch pins.
  • Embroidery machines. A domestic machine with conductive thread in the bobbin will sew repeatable sensor geometry, which is the difference between one prototype and twelve matching garments.
  • Knit it in. Machine knitting with conductive yarn produces sensors that are structurally part of the fabric rather than applied to it — the active research frontier here, and worth watching.