Skip to content

5. E-textiles

References and Inspirations

  1. Textielorkest, Michelle Vossen ( Seen exhibition De Tunnel at de Nijverheid, Utrecht,2024). Michelle is an interdisciplinary designer and educator whose focus revolves around textiles and technology.
  2. Sound Like Touch is an organisation that foster the intersection of bodily interaction, technology, and the performing arts.
  3. Flora MIDI Drum Glove by Becky Stern. She is a maker and teacher and provides many DIY tutorials about everything from microcontrollers to knitting.
  4. Lilytronica by Afroditi Psarra. Lilytronica is a project inspired by folk tradition, pop culture and DIY electronics. The work is improvised live and uses three embroidered synthesisers with LilyPad Arduino microcontrollers, sensors, and actuators.
  5. The Embroidered Computer and Knitted Radio by Irene Posch, artist who explores the integration of technological development into art and craft, always considering the social, cultural, technical and aesthetic implications.

Tools

  • Arduino UNO
  • Arduino IDE
  • LEDs
  • Battery 3V
  • Alligator clips
  • Jumper wires
  • Resistors
  • Condactive thread
  • Condactive fabric
  • Laser Cutter
  • Needles, threads, scissors
  • Buzzer

Research

What is a c circuit?

circuit map

Important terms for making a circuit

Voltage, current and resistance Parallel and Series


About Digital Switch and Analog Sensors

Switches and sensors

We started by explorin the circuit and conductivity by using leds lights and a V3 Battery.

1 tutorial

Here you can see the diagrams 1

Diagrams leds

Then we also played around exploring the condactivity of diverse object. In the picture below you can see my water bottle and my ring.

Condactivity test

Then we made a tool to check the conductivity of different materials.

conductivity test

Lastly we worked on a pressure sensor 2

Here is what we did with the Arduino uno

  • Select your board. I always encounter an issue with my port, so I need to select it manually. See below

Select board and port

  • Then we tested the Arduino Uno board through the blink example available on Arduino IDE.

Blink

  • Now that we knew that our board was working, we could test the InOutSerial exmaple. We changed the map to the max brightness value.

InOutSerial

Conductive Sewing Jessica gave us a little tutorial on how to sew with conductive thread. It should always be placed in the bottom bobbin. Conductive thread can be found made of different materials like copper, tin, nickel and silver. Stainless steel is a great choice compared to copper or silver, as it does not oxidize or lose connectivity over time. Stainless steel can also be "smooth", more strong, slippery and springy or "toothy", similar to normal threads, it curls and tangles and it's not as strong.

Digital Switch

For my digital switch I decided to conyinue along with the idea of the video above, so making a pair of gloves that would close the circuit once the hands are joined.

Here is a video and diagrams 3

Analogue Sensor

I decided to make a soft keyboard by mixing different codes I found online with the help of Jessica

Steps

Soft keyboard steps

  1. I prepared the pressure buttons by applying some condactive tape on the main fabric and on the button. I placed some velostat in between

  2. I stitched all the buttons onto the main fabric. If I were to do it again, I’d first connect the bottom piece of conductive tape to the V5 pin. It was a bit tricky to stitch, but still manageable.

  3. I stitch all the buttons to the V5 pin

  4. I stitch the buttons to the resistors and then make a path to GND

  5. I connected the buttons onto the pins (A0, A1, A2, A3). I applyed a piece of fabric in top of the GND path so they would not touch

For my anologue sensor code, I first checkd the serial monitor to check the values of my pressure sensor. I adapted the example code for AnalogInOutSerieal.ino to my board

// Example: AnalogInOutSerial.ino
// https://docs.arduino.cc/built-in-examples/analog/AnalogInOutSerial/

const int analogInPin = A0;  // Analog input pin that the potentiometer is attached to
const int analogOutPin = 9;  // Analog output pin that the LED is attached to

int sensorValue = 0;  // value read from the pot
int outputValue = 0;  // value output to the PWM (analog out)

void setup() {
  Serial.begin(9600);
}

void loop() {
  sensorValue = analogRead(analogInPin);
  outputValue = map(sensorValue, 0, 1023, 0, 255);
  analogWrite(analogOutPin, outputValue);

  Serial.print("sensor = ");
  Serial.print(sensorValue);
  Serial.print("\t output = ");
  Serial.println(outputValue);

  delay(2);
}

By checking the Serial Monitor, I knew that my pressure sensor is working. Instead of working with LEDs like in the digital switch, I decided to use sound. I followed a wearable Art Wrokshop given by Michelle Vossen and I had some material and documentation left and luckily we had a buzzer in the lab I could use.

I had no idea how to actually code in order to obtain sounds from the buzzer, but Irja suggested to just check a basic code for the buzzer online and start from there. This si what I found:

// Arduino tutorial - Buzzer / Piezo Speaker
// More info and circuit: http://www.ardumotive.com/how-to-use-a-buzzer-en.html
// Dev: Michalis Vasilakis // Date: 9/6/2015 // www.ardumotive.com

const int buzzer = 9; // buzzer to Arduino pin 9

void setup() {
  pinMode(buzzer, OUTPUT); // Set buzzer - pin 9 as an output
}

void loop() {
  tone(buzzer, 1000); // Send 1KHz sound signal...
  delay(1000);        // ...for 1 sec
  noTone(buzzer);     // Stop sound...
  delay(1000);        // ...for 1 sec
}

I tested it and it worked! It was only quite annoying. Now I have the buzzer working and linked to one of the pins.

Jessica helped me with the code below, showing how to select the pins and tell the Arduino IDE above which values it should trigger a sound. The pitches were adapted from a tutorial on how to play a melody with a buzzer. In that example, the code used only one pin to play a preset melody, but I wanted something interactive that you could actually play. You can find the code below.

The code used to test two sensors

#include "pitches.h"
// These constants won't change. They're used to give names to the pins used:
const int analogInPin = A0;  // Analog input pin that the potentiometer is attached to
const int analogInPin2 = A1;  // Analog input pin that the potentiometer is attached to

const int analogOutPin = 9;  // Analog output pin that the LED is attached to
const int buzzer = 7; //buzzer to arduino pin 

int sensorValue = 0;  // value read from the pot
int outputValue = 0;  // value output to the PWM (analog out)

void setup() {
  // initialize serial communications at 9600 bps:
  Serial.begin(9600);
  pinMode(buzzer, OUTPUT); // Set buzzer - pin 9 as an output
  // iterate over the notes of the melody:
}

void loop() {
  // read the analog in value:
  sensorValue = analogRead(analogInPin);
  // map it to the range of the analog out:
  //outputValue = map(sensorValue, 0, 1023, 0, 255);// 700, 1023
  if(sensorValue>1000){
  // change the analog out value:
  tone(buzzer, NOTE_C8); // Send 1KHz sound signal...
  Serial.println("sensor is pressed");
  }
  else if(analogRead(analogInPin2)>1000){
  tone(buzzer, NOTE_B6); // Send 1KHz sound signal...

  }
// print the results to the Serial Monitor:
Serial.print("sensor = ");
Serial.println(sensorValue);

// wait 2 milliseconds before the next loop for the analog-to-digital
// converter to settle after the last reading:
        // ...for 1 sec
  noTone(buzzer);     // Stop sound...
        // ...for 1sec
}
The code used to play a melody found on Arduinodocs

/*
  Melody
  Plays a melody
  circuit:
  - 8 ohm speaker on digital pin 8
  created 21 Jan 2010
  modified 30 Aug 2011
  by Tom Igoe
  This example code is in the public domain.
  https://www.arduino.cc/en/Tutorial/Tone

*/

#include "pitches.h"

// notes in the melody:
int melody[] = {

  NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, 0, NOTE_B3, NOTE_C4
};

// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {

  4, 8, 8, 4, 4, 4, 4, 4
};

void setup() {

  // iterate over the notes of the melody:

  for (int thisNote = 0; thisNote < 8; thisNote++) {
    // to calculate the note duration, take one second divided by the note type.
    //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
    int noteDuration = 1000 / noteDurations[thisNote];
    tone(8, melody[thisNote], noteDuration);
    // to distinguish the notes, set a minimum time between them.
    // the note's duration + 30% seems to work well:
    int pauseBetweenNotes = noteDuration * 1.30;
    delay(pauseBetweenNotes);
    // stop the tone playing:
    noTone(8);

  }
}

void loop() {

  // no need to repeat the melody.
}
The pitches library

/*************************************************

 * Public Constants

 *************************************************/

#define NOTE_B0  31
#define NOTE_C1  33
#define NOTE_CS1 35
#define NOTE_D1  37
#define NOTE_DS1 39
#define NOTE_E1  41
#define NOTE_F1  44
#define NOTE_FS1 46
#define NOTE_G1  49
#define NOTE_GS1 52
#define NOTE_A1  55
#define NOTE_AS1 58
#define NOTE_B1  62
#define NOTE_C2  65
#define NOTE_CS2 69
#define NOTE_D2  73
#define NOTE_DS2 78
#define NOTE_E2  82
#define NOTE_F2  87
#define NOTE_FS2 93
#define NOTE_G2  98
#define NOTE_GS2 104
#define NOTE_A2  110
#define NOTE_AS2 117
#define NOTE_B2  123
#define NOTE_C3  131
#define NOTE_CS3 139
#define NOTE_D3  147
#define NOTE_DS3 156
#define NOTE_E3  165
#define NOTE_F3  175
#define NOTE_FS3 185
#define NOTE_G3  196
#define NOTE_GS3 208
#define NOTE_A3  220
#define NOTE_AS3 233
#define NOTE_B3  247
#define NOTE_C4  262
#define NOTE_CS4 277
#define NOTE_D4  294
#define NOTE_DS4 311
#define NOTE_E4  330
#define NOTE_F4  349
#define NOTE_FS4 370
#define NOTE_G4  392
#define NOTE_GS4 415
#define NOTE_A4  440
#define NOTE_AS4 466
#define NOTE_B4  494
#define NOTE_C5  523
#define NOTE_CS5 554
#define NOTE_D5  587
#define NOTE_DS5 622
#define NOTE_E5  659
#define NOTE_F5  698
#define NOTE_FS5 740
#define NOTE_G5  784
#define NOTE_GS5 831
#define NOTE_A5  880
#define NOTE_AS5 932
#define NOTE_B5  988
#define NOTE_C6  1047
#define NOTE_CS6 1109
#define NOTE_D6  1175
#define NOTE_DS6 1245
#define NOTE_E6  1319
#define NOTE_F6  1397
#define NOTE_FS6 1480
#define NOTE_G6  1568
#define NOTE_GS6 1661
#define NOTE_A6  1760
#define NOTE_AS6 1865
#define NOTE_B6  1976
#define NOTE_C7  2093
#define NOTE_CS7 2217
#define NOTE_D7  2349
#define NOTE_DS7 2489
#define NOTE_E7  2637
#define NOTE_F7  2794
#define NOTE_FS7 2960
#define NOTE_G7  3136
#define NOTE_GS7 3322
#define NOTE_A7  3520
#define NOTE_AS7 3729
#define NOTE_B7  3951
#define NOTE_C8  4186
#define NOTE_CS8 4435
#define NOTE_D8  4699
#define NOTE_DS8 4978

Soft Keyboard Scheme 4

This is the final code used with 4 sensors.

*/
#include "pitches.h"

// These constants won't change. They're used to give names to the pins used:
const int analogInPin0 = A0;  // Analog input pin that the potentiometer is attached to
const int analogInPin1 = A1;  // Analog input pin that the potentiometer is attached to
const int analogInPin2 = A2;  // Analog input pin that the potentiometer is attached to
const int analogInPin3 = A3;  // Analog input pin that the potentiometer is attached to

const int analogOutPin = 9;  // Analog output pin that the LED is attached to
const int buzzer = 7; //buzzer to arduino pin 

int sensorValue = 0;  // value read from the pot
int outputValue = 0;  // value output to the PWM (analog out)

void setup() {
  // initialize serial communications at 9600 bps:
  Serial.begin(9600);
  pinMode(buzzer, OUTPUT); // Set buzzer - pin 9 as an output
  // iterate over the notes of the melody:
}

void loop() {
  // read the analog in value:
  sensorValue = analogRead(analogInPin0);
  // map it to the range of the analog out:
  //outputValue = map(sensorValue, 0, 1023, 0, 255);// 700, 1023
  if(sensorValue>70){
  // change the analog out value:
  tone(buzzer, NOTE_C8); // Send 1KHz sound signal...
  Serial.println("sensor is pressed");
  }
  else if(analogRead(analogInPin1)>50){
  tone(buzzer, NOTE_A1); // Send 1KHz sound signal...
  }
 else if(analogRead(analogInPin2)>60){
  tone(buzzer, NOTE_E1); // Send 1KHz sound signal...
  }
 else if(analogRead(analogInPin3)>60){
  tone(buzzer,  NOTE_F4); // Send 1KHz sound signal...
  }
  // print the results to the Serial Monitor:
  Serial.print("sensor = ");
  Serial.println(sensorValue);

  // wait 2 milliseconds before the next loop for the analog-to-digital
  // converter to settle after the last reading:
        // ...for 1 sec
  noTone(buzzer);     // Stop sound...
        // ...for 1sec
}

Fabrication files