Skip to content

E-textiles

Week 5 assignment for Fabricademy. Everything before this week was made of material that never had to conduct anything. This week the material has to carry a signal, and the interesting part is not the circuit — it is the two centimetres where a soft thing has to meet a hard pin and keep working. I started by learning a Grove Beginner Kit — uploading and editing example sketches — and ended with a soft switch made of two pieces of conductive fabric, wired in series with the kit's LED, that needs no code at all.

1. Objective

weekly assignment

Check out the weekly assignment here or login to your NuEval progress and evaluation page.

What this week is. A soft circuit is a circuit where the conductor is also a material: it bends, it drapes, it can be sewn. That single change moves the difficulty somewhere unusual. Electrically, a switch made of fabric is the simplest circuit in the world — two conductors and a gap. Mechanically it is hard: the gap has to stay open when nobody is pressing, close when somebody is, and survive being folded in a pocket in between.

The other half of the week is the boundary between the soft part and the hard part. A microcontroller has metal pins at 2.54 mm pitch; a piece of fabric has no pins at all. Every soft circuit problem eventually becomes a hard–soft connection problem, and that connection is the thing that fails first in wearables.

What I made. Two things, in order:

  • The learning half — my first uploaded sketch (the CapacitiveSensor library demo), and the kit's light example with analogRead() printed to the onboard OLED, so I could see a number change when I shadowed the sensor and work out what that number is.
  • A soft switch — two pieces of silver-plated conductive fabric, one lead on each, pressed together by a thumb, wired in series between the board's power and the kit's LED. Press and the circuit closes. No program is involved anywhere in this loop.

1.1 Where this stands against the checklist

Checklist item Status
Build one digital soft sensor done — the conductive-fabric switch (§ 5)
Build one analogue soft sensor, different material and technique not yet — the light sensor is a hard module on the board, not a soft sensor I made
Document readings with analogRead() partial — one reading, on the OLED, not logged
Integrate both into a textile swatch, hard–soft connections not yet
Document circuit and schematic partial — wiring described in § 5.3, schematic still to draw
Document swatches / samples partial — video of the switch working
Upload Arduino code as text done — the library demo as run, § 4.2
Video of the swatch functioning done — see § 6

I am keeping this table because it is more useful than pretending the week is finished. Two rows are still open, and both are the parts that make a soft circuit a textile rather than a bench demo.

2. References & inspiration

  • Grove Beginner Kit for Arduino (Seeed Studio) — the kit I learned on. Ten modules on one PCB, each able to be snapped off and reconnected with a Grove cable, which is exactly the hard–soft boundary this week is about: the modules are hard, the cable is the adapter.
  • How To Get What You Want (Plusea / Kobakant) — the reference library I went back to for soft switches and pressure sensors. Their documentation is the reason I made the separator a separate piece instead of gluing the two fabric layers together at the edges.
  • Grove connectors are 4-pin (VCC, GND and two signals), which is worth knowing before soldering anything: the fabric never touches the microcontroller, it touches a wire that ends in a connector.

3. Tools & materials

  • Grove Beginner Kit for Arduino — one PCB with snap-off modules: OLED 0.96″, buzzer, LED, 2× button, rotary potentiometer, light sensor, sound sensor, temperature & humidity sensor, 3-axis accelerometer, plus a Grove cable set
  • Arduino IDE with the kit's board support installed
  • Silver-plated conductive fabric — two pieces, roughly 3 × 4 cm each
  • Thin stranded wire — one red, one orange, for the two poles
  • A soft separator — paper / thin foam, so the two fabric faces do not touch at rest
  • Soldering iron, tape, scissors, a card to build on

4. Part one — learning the board

4.1 What the kit actually is

The Grove Beginner Kit is a single PCB with ten modules printed onto it, each already wired to the same microcontroller underneath. Every module can be snapped out and reconnected with a Grove cable — which is why the second video shows the same modules lying loose on the bench: same pieces, no longer joined by copper.

A Grove Beginner Kit for Arduino board with its OLED display, buzzer, LED, buttons, rotary potentiometer, light sensor and sound sensor, lying on a bench

The kit on the bench. Left column: buzzer, OLED, two buttons; centre: the pin headers and the yellow analogue row; right: rotary potentiometer, LED module, temperature and sound sensors. The OLED is the useful part for learning, because it can show a number without a serial monitor.

6 s. The light example running: the OLED prints a live reading and the number changes when a hand shades the sensor. This is the whole loop of the week in miniature — a physical quantity becomes a number, and the number is visible.

4.2 The first thing I uploaded

The board does nothing until it is told. The first sketch I uploaded was the example that ships with the CapacitiveSensor library — not because the soft switch needs it, but because it is the shortest sketch that does something visible: it times how long a pin takes to charge through a high-value resistor, which is a way of measuring the capacitance of whatever touches the receive pin. Foil, a wire, a finger — the number on the serial monitor changes. This is where "the board runs instructions" stopped being abstract for me: change a value, upload again, and the stream of numbers changes with it.

Two honest footnotes. The sketch is Paul Badger's 2008 library demo, uploaded unmodified — my contribution was reading it line by line and changing numbers to see what moved. And it is the learning half of the week, not the switch: the switch in § 5 is the opposite of this sketch, because it has no measurement in it at all.

#include <CapacitiveSensor.h>

/*
 * CapitiveSense Library Demo Sketch
 * Paul Badger 2008
 * Uses a high value resistor e.g. 10M between send pin and receive pin
 * Resistor effects sensitivity, experiment with values, 50K - 50M. Larger resistor values yield larger sensor values.
 * Receive pin is the sensor pin - try different amounts of foil/metal on this pin
 */

CapacitiveSensor   cs_4_2 = CapacitiveSensor(4,2);        // 10M resistor between pins 4 & 2, pin 2 is sensor pin, add a wire and or foil if desired

void setup()                    
{
   cs_4_2.set_CS_AutocaL_Millis(0xFFFFFFFF);     // turn off autocalibrate on channel 1 - just as an example
   Serial.begin(9600);
}

void loop()                    
{
    long start = millis();
    long total1 =  cs_4_2.capacitiveSensor(30);

    Serial.print(millis() - start);        // check on performance in milliseconds
    Serial.print("\t");                    // tab character for debug windown spacing

    Serial.print(total1);                  // print sensor output 1
    Serial.println("\t");

    delay(10);                             // arbitrary delay to limit data to serial port 
}

Download: CapacitiveSensorSketch.pde 3

4.3 The number on the screen

Close-up of the Grove kit's OLED display reading "Light: 384"

Light: 384. In room light the same line reads a little over 500; shaded by a hand it drops to 384. It is not a unit of anything — it is the raw output of a 10-bit analogue-to-digital converter, so the whole range is 0–1023 and the scale is the sensor's own voltage divider, not brightness in lux.

That distinction is the thing I actually learned from this half of the week. analogRead() does not measure light. It measures a voltage between 0 and the board's reference, and reports it as an integer from 0 to 1023 — about 4.9 mV per step on a 5 V board. Everything else is calibration, and I had not calibrated this sensor, so 384 is a number rather than a measurement. For a soft sensor that matters even more: a fabric pressure sensor will also hand me a number with no unit, and the only honest way to use it is to record both ends — what it reads untouched and what it reads under a thumb — and set the threshold between them.

5. The soft switch

5.1 Why start with a switch

A switch is the one soft sensor where the lack of calibration does not matter, because the output is a decision instead of a value: it is either closed or it is not. That makes it the right first component to build badly and still have work — the first version can be two pieces of fabric and a piece of paper, and it either lights the LED or it does not.

5.2 How it is built

Two pieces of silver-grey conductive fabric with a red and an orange wire attached, resting on a white card, being pressed by a thumb

The switch itself, about the size of a thumbnail. Two squares of silver-plated conductive fabric, one thin wire attached to each, kept apart by a soft separator. Press with a thumb and the two faces meet; release and the separator pushes them apart again.

Three decisions are inside that small object, and none of them are electrical:

  • Fabric, not foil. Metal foil would work and would be easier to solder, but it creases and then stays creased — a switch that is permanently half-closed. Conductive fabric recovers its shape, which is what makes it a switch rather than a contact.
  • A separate separator, not a glued sandwich. If the two layers are joined at the edges, the middle can never open fully and the switch leaks. Loose layers with a spacer between them keep the gap at rest.
  • The wire joint is the weak point, not the fabric. The fabric conducts beautifully; the place where a stranded copper wire meets a woven silver surface is where resistance creeps up and where flexing eventually breaks it. This is the hard–soft connection, and in a wearable it is the part that has to be strain-relieved rather than the part that has to be pretty.

5.3 How it is wired

The wiring is the simplest circuit that has a switch in it. Power comes from the board's 5 V pin — the board is only a bench supply here, nothing on it is running. One lead goes to the first piece of fabric; the other piece of fabric connects to the LED module's signal line, and the LED module takes care of the rest: it already contains its current-limiting resistor. The whole circuit is source → fabric gap → lamp → ground, with exactly one moving part and no calculations to get wrong.

This matters for how to read the week. The switch is doing the job of a switch, not the job of a sensor: when it closes, current flows, and nothing anywhere reads a pin. There is no program in the loop, and that was the point — I wanted the smallest circuit that uses a soft component, and this is it.

Two properties of this switch I can describe without instruments:

Property What it does
Actuation pressure, no travel — there is no click point, so there is no tactile feedback
Rest state normally open; the separator decides how open
Contact quality varies with pressure and with how flat the thumb is — a fingertip edge gives a worse contact than the pad
Bounce physically there — two flexible surfaces meet gradually instead of snapping — but invisible on an LED; it only becomes a problem when a pin starts counting presses

5.4 What this circuit cannot do yet

Series wiring makes the LED honest — lit means closed — but it also means the switch is invisible to the microcontroller. Nothing measures the press, so nothing can be counted, timed, logged or debounced. The next version is one wire different: move the LED-side lead from power to a digital input read with INPUT_PULLUP, and the same two pieces of fabric become a sensor. Unpressed then reads HIGH, pressed reads LOW — the inversion ("pressed" reading as 0) is the trap waiting in that step, so I am writing it down here before I walk into it.

6. Results

13 s. Thumb on the fabric, LED on; thumb off, LED off. The modules are snapped out of the kit and lying loose, connected by cables — the same board as § 4.1, taken apart.

The Grove kit's modules laid out on the bench with a hand pressing the conductive-fabric switch, two thin wires running from the switch back to the board

The full setup: the switch on a card at the right, two leads running back to the board's digital connector, everything held down by nothing but gravity and hope.

What works. The switch closes and the LED follows it, every press, in the whole clip. The fabric needs very little force — a thumb resting on it is enough — and it recovers when released, so the separator is doing its job. There is no mechanism to jam and nothing to click.

What I have not measured, and would need before calling this a sensor rather than a demo: the resistance across the contact (multimeter, at rest and pressed), the force at which it closes, and whether it bounces — which I can only see with the serial plotter or by counting edges in software. A switch that looks clean on an LED can still produce ten edges per press, and a microcontroller reading that as a trigger would fire ten times.

What I would change. The two leads leave the fabric as bare wire joints, and that is the part most likely to break the first time this goes onto a garment. The next version needs the joint backed with a fabric patch and stitched down — or better, the wire stitched into the fabric with conductive thread, so the strain goes into the textile instead of into solder.

7. What is still open

The honest state of this week is: one soft component works, and the checklist asks for two plus a swatch.

  1. An analogue soft sensor. The obvious partner is pressure — either a piezoresistive layer (velostat / EeonTex) between two fabric electrodes, or a knitted resistive strip. Its whole point is that it gives a range, so it is the one that must be calibrated and logged: analogRead() at rest, at light press, at hard press, plotted.
  2. A textile swatch. Both sensors on one piece of fabric, connected with conductive thread, hard–soft joint strain-relieved. That is the actual deliverable of the week, and it is what turns a bench circuit into a wearable.
  3. A proper schematic. A photograph of a working circuit is not a schematic; the switch wiring has to be drawn, because that is the one part a reader cannot infer from the picture.
  4. Make the switch an input. Move one lead to a pin with a pull-up and print presses to serial; that is also where debounce stops being a theoretical question.

8. Reflection

The surprise of this week was where the difficulty sits. I expected the electronics to be the hard part, and the electronics were barely there: two wires, a gap, a lamp — and the only code I ran was someone else's example. The hard part was the fabric joint — turning a woven surface into something a copper wire can attach to and survive. That is the problem I have been circling in my own work without naming it: the place where two materials with different behaviour have to stay joined.

There is something conceptually useful here too. In my drawing and painting work a surface holds a mark; here a surface carries a signal, and the signal is only as reliable as the connection. A soft circuit that flickers is not a broken circuit — it is a circuit telling me the truth about a bad joint. I like that the material is the diagnostic.

What I am least satisfied with is that this is still a component, not a piece of clothing. A switch on a card is a demonstration; integrating it into a swatch with hard–soft connections is the row of the checklist that would actually teach me something, because that is where weight, washing and the body come in.

9. Files & references


  1. Reference: Seeed Studio; Grove Beginner Kit for Arduino; wiki and example sketches; accessed Nov 2026; wiki.seeedstudio.com. Used for the board's pinout and the light-sensor example in § 4. ↩

  2. Reference: Plusea / Kobakant; How To Get What You Want; soft sensor and switch library; accessed Nov 2026; kobakant.at/DIY. Used for the layered construction of the switch in § 5.2. ↩

  3. File: CapacitiveSensorSketch.pde — the CapacitiveSensor library demo (Paul Badger, 2008), uploaded unmodified as the learning step in § 4.2. The soft switch in § 5 uses no code; this file is the upload that taught me where code lives. ↩↩