5. E-Textiles and Wearables I#

During this lesson liza stark showed us the basics to create soft sersor and showed the different ways to create them with fibers and different conductive or resistive materials.

This week’s task is to create an analogue and a digital senor.

I started looking for an inspiration for my sensor among the materials available. I wanted to try to make a single one so that the analogical and the digital one would communicate or work together.

I also wanted to work with the modular pattern to create a continuity with the work done until now.

The first step was to understand which type of analog sensor to make and which model to use.

The pressure sensor is the first model that showed us during the wearable course that I had followed almost a year before, now I want to try something different.

I really liked the potentiometer and the many models developed, the one that most of all I liked was the POTENZIOMETER // FABRIC (tracked).

Once the analogue sen- sor was identified, I tested a conductive mesh fabric to see if placing the positive and the ground at different points could record a different flow of energy but it was not.

Rete metallica code:#

int rete = 10;

int outputValue = 0;

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

void loop() {
  outputValue = (0, 1023);
  analogWrite (rete, outputValue);

  Serial.print ("rete metallica");
  Serial.print (outputValue);
}

The meshfabric could act as a strech sensor.

So I decided to build it with a copper fabric and Eontex according to the indications of the lesson.

The first test was to check if with the map command I could verify a change in values by lengthening and shortening the circuit.

Later knowing that I wanted to use a closure with my modules, I verified that the change of values was there even if the connection was not only at a specific point but along a portion of the circuit. Once again the values changed even if with a lower range.

I did a test with the Eontex resistive fabric. By stretching the fabric the resistance value decreased.

Next I created a sketch on paper and then I reported it on inkscape together with the form of the previous file.

Later I lasered the model and the modular pattern. I also lasered the copper fabric and the eontex.

I glue copper and eontex fabrics to the felt and jersey modules with Bemis sewfree thermo adhesive paper.

The materials I used are:

3 small white leds

1 large yellow led

4 220 Ohm resistors

1 resistance of 10 KOhm

Eontex

Copper fabric

LilyPad Arduino

conductive wire

felt and jersey

With the modules ready I started to build my sensor. I gave a position to the right and left leds and positioned the lilypad. I connected the resistors to the pin and the LEDS and to the gnd. The same I did with the yellow LED. before bringing everything to the gnd I created the connection from the positive to the right side of the modular pattern and created a bridge to pass the rest to the gnd. I connected a resistance of 10 KOhm to an analog Pin and to the gnd on the left side of the modular pattern.

I continued building the module and connecting it to felt.

Then I moved on to build my sketch on Arduino.

 /*
   SENSORE ANALOGICO / POTENZIOMETRO FABRICADEMY:
     Esempi>AnalogInOutSerial

   Reads an analog input pin, maps the result to a range from 0 to 255 for the leds and from 0 to 1023 
   for the sensor and uses the result to set the pulse with modulation (PWM) of an output pin.
   Also prints the results to the Serial Monitor.

   The circuit:
   - potentiometer connected to analog pin 0.
     Center pin of the potentiometer goes to the analog pin A3.
     side pins of the potentiometer go to +5V and ground
   - LEDS connected from digital pin 9, 3, 2 to ground

   Resistive fabric >>> Gnd >>> 10KOhm >>> AnalogPin A3---|
                                                          |
   Conductive fabric >>> Power _________________________ _| 
 */


 const int analogInPin = A3;   // Analog input pin that the potentiometer is attached to
 const int analogLEDpin3 = 9;  // Analog output pin that the LED3 (the last one) is attached to
 const int analogLEDpin2 = 3;  // Analog output pin that the LED2 (the middle one) is attached to
 const int analogLEDpin1 = 2;  // Analog output pin that the LED2 (the first one) is attached to

 int sensorValue = 0;          // value read from the pot
 int outputValue3 = 0;         // value output to the PWM (LED3)
 int outputValue2 = 0;         //                          LED2
 int outputValue1 = 0;         //                          LED1

 void setup() {
   // initialize serial communications at 9600 bps:
   Serial.begin(9600);
 }

 void loop() {
   // read the analog in value:
       sensorValue = analogRead(analogInPin);

   // map it to the range of the analog out:
       outputValue3 = map(sensorValue, 0, 1023, 0, 255);
       outputValue2 = map(sensorValue, 0, 1023, 0, 255);
       outputValue1 = map(sensorValue, 0, 1023, 0, 255);

   // change the analog out value:
      analogWrite(analogLEDpin3, outputValue3);
      analogWrite(analogLEDpin2, outputValue2);
      analogWrite(analogLEDpin1, outputValue1);

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

    Serial.print(" LED3 ");
    Serial.println(outputValue3);
    Serial.print(" LED2 ");
    Serial.println(outputValue2);
    Serial.print(" LED1 ");
    Serial.println(outputValue1);   

   delay(500);

    if (sensorValue <16) {
    // turn LED1 on:
    digitalWrite(analogLEDpin1, HIGH);
  } else {
    // turn LED off:
    digitalWrite(analogLEDpin1, LOW);
 }

   if (sensorValue >=16 && sensorValue<=40) {
    // turn LED1 on:
    digitalWrite(analogLEDpin2, HIGH);
  } else {
    // turn LED off:
    digitalWrite(analogLEDpin2, LOW);
 }

   if (sensorValue >40) {
    // turn LED1 on:
    digitalWrite(analogLEDpin3, HIGH);
  } else {
    // turn LED off:
    digitalWrite(analogLEDpin3, LOW);
 }
  }

It makes me very unhappy that it does not work.

the values always go from 0 to 16.

I have better connected the pattern links and tried with the crocodiles.

I try again to take the video 1 test.

        During the development of the wearable 2 assignment I also set up the sensor that i did for this week.