Instrumental weaving

Instrumental weaving, e-textile making sounds when you apply different pressures on it (Fabricademy, FabTextiles, Fab Lab Barcelona, 2017)

Project : Create a weaving pressure sensor playing sounds.

Process :
(1) Sketch the soft sensor
(2) Measure the weaving conductivity
(3) Create the pressure sensor
(4) Calculate the resistance of the sensor
(5) Build the circuit
(6) Code the Arduino
(7) Play frequency sounds first test
(8) Improve the weaving sensor : materials, resistance and code
(9) Play the musicale scale according to the pressure second test
(10) Upload the code in an ATtiny microcontroller & finish the circuit

Material :
- conductive fabrics & threads
- multimeter
- paper & pen
- cissors
- tape & textile glue
- audio tape & metal wire
- aluminium foil
- velostat
- resistance led + 1K2
- potentiometer
- 1 LED
- cables & crocodiles
- breadboard
- Arduino & Arduino software
- ATtiny microcontroller

(1) Sketch the soft sensor
For starting a project I usually start to draw some sketches in my notebook. I liked the idea of creating a soft instrument and I wanted to use the weaving technique to create my sensor. I imagined a weaving pressure sensor making sounds. Instead of using regular wool threads, I used cassette tapes for weave and for making my weaving conductive i decided to use metal wire.

(2) Mearure the weaving conductivity
After building my conductive weaving I measure the resistance with a multimeter. My wire weaving is really conductive, between 0,3 ohm and 0,0 ohm of resistance. I will need to have a resistance to my future circuit otherwise I will burn the led by giving to much power.

(4) Create the pressure sensor
For building a pressur sensor I need 3 layers : my conductive weaving, velostat and an other conductive layer. The velostat made of polymeric foil impregnated with carbon black is a piezoresistive material. The velostat is ideal for making pressure sensor because its resistance decreases with the pressure. After create the conductive weaving I wanted to make a first test to see if my pressure sensor will work. I took the silver strech conductive fabric for making my temporary second conductive layer.

(4) Calculate the resistance of the sensor
Connect your sensor to a multimeter for caclulate the resistance of the pressure sensor. Clip with a crocodile the first layer of the sensor (here the conductive weaving) to the negative probe and clip with a second crocodile the thrid layer of the sensor (here the silver strech conductive fabric) to the positive probe. The crocodiles helps to stabilize the readings of your multimeter. You can se on the multimeter screen that at realesed state the soft sensor have a resistance of 06,73 kΩ (Rmax) and at pressure state 141,1 Ω (Rmin). For calculate the good resistance for your soft sensor you need to take the middle of the range between the resistance maximum (Rmax) and the resistance minimum (Rmin). Here I calculate that I will need a 3kΩ resistor for my soft sensor.

(5) Build the circuit
For building your circuit you need : an Arduino, a breadboard, cables and crocodiles, a speaker, the soft sensor and its resistor, a led and its resistor. The breadboard allows you to experiment and visualize your circuit before solding it. Start to connect the Arduino power 5V to the positive line of your breadboard and the power ground (GND) on the negative line. Then, connect the first layer of the soft sensor (the weaving part for exemple because the sensor doesn’t have a negative or a positive so wich layer doesn’t matter) to its resistor and the analog pin (A0 for exemple) and the thrid layer (the silver stretch conductive fabric) to the negative line of the breadboard link with the GND. Add in parralele the speaker and also the LED to two digital pins (here the 13 for the led and the 10 for the speaker). At the end, connect the Arduino to your computer and open Arduino software.

(6) Code the Arduino
Open Arduino, go to File / Examples / 01. Basics / Digital Read Serial. Then, enter the sensorPin, the speakerPin, the ledPin number and open the serial monitor. The serial monitor pop-up in a new window and receives the serial values of your sensor pin in the Analog A0. You can see bellow two screenshots of the serial monitor readings, the window 1 is giving the sensor datas at released state (values between 207 and 213) and the window 2 is giving the sensor datas at pressure state (values between 88 and 37). Now we can test our circuit by ginving to the ledpin a threshold value for lighting up. Let’s set up a threshold value at 100 for turing the lamp on when you press the weaving sensor.

(7) Play frequency sounds first test
After check that my circuit was working I wanted to start playing sounds with the soft sensor. I downloaded and installed Mozzi a library of sounds for Arduino. Then, I opened File / Examples / Mozzi / 03. Sensors / Piezo_Frequency. You can see the sensor playing frequency sounds in the video bellow. The problem is I couldn’t find why my soft sensor was stopping the sounds instead of creating them. I knew that I had to improve the code because the result was not as I expected.

(8) Improve the weaving sensor : materials, resistance and code
After this first test, I wanted to improve my code but also the precision of the sensor serial values and the final object.
# materials
The silver stretch conductive fabric I used before for the soft sensor is an expansice material, I wanted to create my sensor with cheaper and more accessible material. I thought of aluminium foil because it’s cheap, conductive, flexible, thin and most of the people have one in their kitchen.
# resistance
Because I change one layer of the pressur sensor I had to re-calculate the resistance of it. But this time, for being more precise I measured it with a potentiometer. « A potentiometer is a manually adjustable, variable resistor with three terminals. Two terminals are connected to a resistive element, the third terminal is connected to an adjustable wiper. The position of the wiper determines the output voltage. » (Read more about potentiometer on I changed my resitor for a 1k2.
# code
I wanted to be able to create different sounds according to the pressure on the soft sensor. I opened File / Examples / 02. Digital / toneMelody and took the pitches references of the musicale scale to integrate them into my code. I used the treshold command for controling the sounds, the more you press the sensor, the lowest is the treshold number and the higher the sound get. DO - RE - MI - FA - SOL - LA - SI - DO