====== E-textiles and wearables ====== I was following kobakant tutorial for the textile sensor. I chose the [[http://www.kobakant.at/DIY/?p=1856|crochet pressure sensor]] After a while, mi sensor looked like this: {{:fabricademy2017:students:nuria.robles:week5_e-textiles_wearables:collage_2.png?nolink&1156x300}} Next I put velostat between the 2 parts: {{ :fabricademy2017:students:nuria.robles:week5_e-textiles_wearables:collage_3.png?nolink&1156x358 }} Finally I did sew the 2 parts and took care that the contacts didn't touch to each other |{{:fabricademy2017:students:nuria.robles:week5_e-textiles_wearables:7_img_9605.jpg?nolink&292x200|7_img_9605.jpg}} |{{:fabricademy2017:students:nuria.robles:week5_e-textiles_wearables:8_img_9606.jpg?nolink&266x200 |8_img_9606.jpg}} |{{:fabricademy2017:students:nuria.robles:week5_e-textiles_wearables:9_img_9609.jpg?nolink&150x200 |9_img_9609.jpg}} | This is the final look of the pink sensor connected to the ATtiny45: {{ :fabricademy2017:students:nuria.robles:week5_e-textiles_wearables:sensor.jpg?nolink&401x300 |sensor.jpg}} I tested the sensor with the LED and the ATtiny45 and here is a [[https://vimeo.com/240650126|video]] | | {{vimeo>240650126?medium}} | | I connected the sensor to the ATtiny as suggested in the second part of the assignment, and started to sew ;-) |{{:fabricademy2017:students:nuria.robles:week5_e-textiles_wearables:10_img_9612.jpg?nolink&266x200|10_img_9612.jpg}} |{{:fabricademy2017:students:nuria.robles:week5_e-textiles_wearables:11_img_9613.jpg?nolink&266x200|11_img_9613.jpg}} |{{:fabricademy2017:students:nuria.robles:week5_e-textiles_wearables:12_img_9614.jpg?nolink&266x200|12_img_9614.jpg}} | I also did a textile battery holder and got the LED blinking |{{:fabricademy2017:students:nuria.robles:week5_e-textiles_wearables:ass_2.png?nolink&366x300}} |{{:fabricademy2017:students:nuria.robles:week5_e-textiles_wearables:13_img_9623.jpg?nolink&399x300|13_img_9623.jpg}} | The arduino code I used is: /* CODE for the Fabricademy e-textile sensor swatch first built for the Fabricademy 2017 Hannah Perner-Wilson and Mika Satomi, KOBAKANT */ #define sensorPin 3 //#define speakerPin 2 (not tested yet) #define ledPin 0 int sensorValue = 0; //int noiseFrequency = 0; (not tested yet) int ledBrightness = 0; void setup() { pinMode(sensorPin, INPUT); // use digital pin number here //pinMode(speakerPin, OUTPUT);(not tested yet) pinMode(ledPin, OUTPUT); } void loop() { sensorValue = analogRead(sensorPin); // use analog pin number here /*(not tested yet) // MAKE SOUND: if(sensorValue <900){ noiseFrequency = map(sensorValue, 0, 1023, 100, 10000); noise (speakerPin, noiseFrequency); } */ (not tested yet) // FADE LED: ledBrightness = map(sensorValue, 0, 1023, 0, 255); analogWrite(ledPin, ledBrightness); } /* (not tested yet) // MAKE SOUND ON THE ATTINY WITHOUT THE SOUND LIBRARY: void noise (unsigned char noisePin, int frequencyInHertz) { long delayAmount = (long)(1000000 / frequencyInHertz); digitalWrite(noisePin, HIGH); delayMicroseconds(delayAmount); digitalWrite(noisePin, LOW); delayMicroseconds(delayAmount); */ (not tested yet) } The last part I wanted to do is to connect the buzzer and change the sound with the pressure of the fingers over the sensor but I run off time \\