Week 9: E-Textiles and Wearables II
Sketching the design
My purpose was to create a tshirt, where touching a sensor (a microphone or a pressure sensor, initially) a group of leds were illuminated follow the rope of the draw ending finally in the heart.
Designing and printing
1.- I made a draw of the design using paper and a marker.
2.- To digitalize the image:
- I used the picture of the draw
- INKSCAPE:
- File > Import > Emb image
- Object > Bit map
- We obtain a black and white image:
- Rhinoceros:
- File > Open
- After cleaning the image:
Having this only i had to use the plotter to obtain the vynil and i used a tshirt to obtain the final printed design:
Lighting the way
Components:
- 4 yellow textile leds
- 1 red textile led
- conductive thread
- lilypad LDR
- arduino UNO
- a second tshirt (the one that is going to be under the one with the design, where i sewed the circuit)
I used a bread board with a simple LDR and leds to test the circuit and the code:
Then I sewed all the circuit to the tshirt using the conductive thread:
It´s important to be highlighted that one tshirt is going to be over the other, so the LDR is going to de totally covered by fabric. However light can cross it, so we can adjust the threshold of the LDR, and set how many light is enough to switch on the sequence of leds.
Software:
Code:
const int LEDPin = 13;
const int analogPin = A0;
const int umbralalto =60;
const int umbralbajo =15; here we can adjust the threshold of the LDR
int led1 = 3;
int led2 = 5;
int led3 = 6;
int led4 = 9;
int ledR = 11;
void setup()
{
pinMode(LEDPin, OUTPUT);
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT); Serial.begin(9600);
pinMode(ledR, OUTPUT);
Leds off
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(ledR, LOW);
}
void loop(){
int lectura = analogRead(analogPin);
if (lectura ⇐ umbralbajo)
{
digitalWrite(led1, HIGH);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
delay(1000);
digitalWrite(led1, LOW);
digitalWrite(led2, HIGH);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
delay(1000);
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, HIGH);
digitalWrite(led4, LOW); delay(1000);
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, HIGH);
delay(1000);
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(ledR, HIGH); delay(2000); digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW); \ \ digitalWrite(ledR, LOW);
}
print the analog value:
—- ====== Final Result ======
Serial.println(GESHI_QUOTvalor=GESHI_QUOT);
Serial.println(lectura);
delay(100); delay in between reads for stability
}