====== Week 9: E-Textiles and Wearables II ====== ---- ===== Sketching the design ===== {{ :fabricademy2017:students:edgardelarubia:week_9:img_20171227_133801_495.jpg?nolink&500x549 |img_20171227_133801_495.jpg}} 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. {{ :fabricademy2017:students:edgardelarubia:week_9:img_20180213_153837.jpg?nolink&400x533 |img_20180213_153837.jpg}} 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: {{ :fabricademy2017:students:edgardelarubia:week_9:dibujo.png?nolink&400x636 }} * Rhinoceros: * File > Open * After cleaning the image: {{ :fabricademy2017:students:edgardelarubia:week_9:captura_4.jpg?nolink&700x219 |captura_4.jpg}} Having this only i had to use the plotter to obtain the vynil and i used a tshirt to obtain the final printed design: {{ :fabricademy2017:students:edgardelarubia:week_9:img_20180213_193813.jpg?nolink&500x667 |img_20180213_193813.jpg}} ---- ====== 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) {{ :fabricademy2017:students:edgardelarubia:week_9:img_20180219_163529.jpg?nolink&450x338 |img_20180219_163529.jpg}} I used a bread board with a simple LDR and leds to test the circuit and the code: {{vimeo>256433274?medium}} Then I sewed all the circuit to the tshirt using the conductive thread: {{:fabricademy2017:students:edgardelarubia:week_9:img_20180216_195218.jpg?nolink&350x467|img_20180216_195218.jpg}}{{:fabricademy2017:students:edgardelarubia:week_9:img_20180216_202326.jpg?nolink&350x467|img_20180216_202326.jpg}}{{:fabricademy2017:students:edgardelarubia:week_9:img_20180216_195527.jpg?nolink&350x467|img_20180216_195527.jpg}} ==== ==== ==== 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. ==== {{ :fabricademy2017:students:edgardelarubia:week_9:img_20180216_195306.jpg?nolink&450x600 |img_20180216_195306.jpg}} ==== 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: \\ Serial.println(__GESHI_QUOT__valor=__GESHI_QUOT__); \\ Serial.println(lectura); \\ delay(100); // delay in between reads for stability \\ } //'' // —- ====== Final Result ====== // {{vimeo>256438136?medium}}