SlideShare a Scribd company logo
1 of 26
A Sample E-Textiles Project
LED
LED
(parallel)
RGB
LED
Battery
Vibration
Motor
Metallic
Patch
Sensor
LilyPad Arduino
Components of the Codeable Circuit
• This circuit is codeable, which means that you can control whether or not
these components are activated or not, using inputs and outputs.
• Outputs – the LEDs, the RGB light, the buzzer.
– You can make these different components (called ‘actuators’) turn on
and off and different rates, patterns, etc.
– *Note – To make these controllable/codeable (not always on), at least
one side (usually the + end) needs to be attached to a numbered or A-
pin; the other end can be attached to + or – pin
• Inputs – metallic patches
– You can take a reading of electrical current or conductivity (generally).
If you touch both then you ‘close the circuit’
– *Note - these need to be attached to A-pins (and the – pin) for taking
readings.
E-Textiles
Circuitry Rules
_
+
Rules for Connecting Components
This LED is always on because it’s connected to the + and – pin.
_
+
Rules for Connecting Components
This LED can be programmed/controlled
because you can code pin 5 (polarity).
_
+
Rules for Connecting Components
This LED can be programmed/controlled
because you code pin A5 (polarity).
You can also connect the LED to any other
numbered or lettered pin if you want to control it
(though note that only numbered pins can execute
‘analogWrite’ for behaviors such as fade).
Rules for Connecting Components
This is also possible. Both pin 5
AND pin 6 would need to be
programmed.
_
+
_
+
Rules for Connecting Components
A Parallel Circuit – both LEDs function in the same way
(by coding pin 5).
_
+
_
+
Rules for Connecting Components
Also a Parallel Circuit – both LEDs function in the
same way *by programming pin 5)
_
+
_
+
Rules for Connecting Components
Not a parallel circuit. These LEDs
function separately (coding pin 5 or
pin 6) even though they have a
shared ground (-).
_
+
Rules for Connecting Components
In order to attach the metallic patches, you need to connect one patch to the –
pin and the other patch to one of the A-pins. You can tell the A-pin to take a
‘reading’ of electrical current (generally).
Basically, when you touch both of these, you ‘close the circuit’ (because your
body is conductive and can carry current) and then the A-pin can be told to read
this, and do something as a result.
Rules for Connecting Components
The patch connected to the – pin
can also be attached to other
components to act as a ground.
The patches and LEDs act in the
same way.
_
+
Programming E-Textiles
This is a basic blink program
int bird = 5;
void setup() {
pinMode(bird, OUTPUT);
}
void loop() {
digitalWrite(bird, HIGH);
delay(1000);
digitalWrite(bird, LOW);
delay(1000);
}
This section is for naming variables.
Here, we are calling pin 5 “bird” so
we don’t always have to write 5 in
the below section. Or if we can
quickly change the pin # (if you
resew it) without having to change
each place below.
This is a basic blink program
int bird = 5;
void setup() {
pinMode(bird, OUTPUT);
}
void loop() {
digitalWrite(bird, HIGH);
delay(1000);
digitalWrite(bird, LOW);
delay(1000);
}
This is the setup section, where you
write up the conditions that we
want to exist throughout the
program, even when it’s going
through different behaviors. Here,
we setup the pin named bird to be
an output for electricity (an
actuator).
This is a basic blink program
int bird = 5;
void setup() {
pinMode(bird, OUTPUT);
}
void loop() {
digitalWrite(bird, HIGH);
delay(1000);
digitalWrite(bird, LOW);
delay(1000);
}
This is the loop section, or the
‘action’ of the program. Basically,
what this code says is:
Turn on pin 5 (voltage high)
Wait 1000 milliseconds
Turn off pin 5 (voltage low)
Wait 1000 milliseconds
This is a basic blink program
int bird = 5;
void setup() {
pinMode(bird, OUTPUT);
}
void loop() {
digitalWrite(bird, HIGH);
delay(1000);
digitalWrite(bird, LOW);
delay(1000);
}
Basic human sensor program
int sensorValue; //a placeholder for the function below
int MetalPatch = A3; //if your metallic patch is attached to pin A5 and the
other one is attached to the - pin
void setup() {
Serial.begin(9600); //gets touch sensor ready to read value - analog
digitalWrite(MetalPatch, HIGH); //start circuit for human sensing circuit
pinMode(MetalPatch, INPUT); //sets A3 as an input of electricity, for reading
}
void loop() {
sensorValue = analogRead(MetalPatch); //read values from light sensor
Serial.println(sensorValue); //show values in serial monitor window
delay(300); //delay time determines how often the Lilypad will read the
sensor
} Everything to the right of // is a comment and doesn’t get compiled as part of the
code. The way this code works is that you need to upload it to your board, then
press the magnifying glass icon in the upper right corner of your Arduino window.
This will open the serial monitor window, which will show you readings based on the
electrical flow
Basic conditional program w/ human sensor
int sensorValue;
int MetalPatch = A3;
Int bird = 5;
void setup() {
Serial.begin(9600);
digitalWrite(MetalPatch, HIGH);
pinMode(MetalPatch, INPUT);
pinMode(bird, OUTPUT);
}
void loop() {
sensorValue = analogRead(MetalPatch);
Serial.println(sensorValue);
delay(300);
if (sensorValue>1000) {
digitalWrite(bird, LOW); }
else {
digitalWrite(bird, HIGH); }
}
This program includes a conditional statement, which
is indicated by the if/then statement in the loop.
Basically it’s saying that: if the sensor has a reading
over 1000 (usually indicating an open circuit, no one is
touching) then turn the LED bird off, otherwise (when
someone is touching) turn the LED bird on.
You can create more complex conditionals by adding
more conditions like ranges (see below for example)
if (sensorValue>300) {
digitalWrite(led1, HIGH);
digitalWrite(led2, LOW);
}
else if (sensorValue<=299 && sensorValue>10) {
digitalWrite(led1, LOW);
digitalWrite(led2, HIGH);
}
Else {
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
}
More resources
• Explore the Examples section of Arduino
(under File > Examples)
• Look at Sew Electric.org
• Look around Instructables
E-Textiles
Sewing Rules
Tips for E-Textiles Sewing
• Stitch components onto fabric three times for the
best conductivity.
• Remember that this thread is metallic and can
easily cause short circuits if they touch (due to
frayed thread, messy knots, etc.) To help secure
these, you can use regular masking tape or felt
for insulation, or clear nail polish.
• Remember to keep your – and + lines separate
(otherwise, you’ll cause a short circuit)
• Look online or to your friends or classmates for
basic hand sewing techniques (threading needle,
tying knots, basic running stitch)
https://www.youtube.com/watch?v=u8_jsUgsWyo&t=159s
https://www.youtube.com/watch?v=G6QHeNoqe9U&t=121s
https://forum.arduino.cc/index.php?board=13.0
http://www.geekmomprojects.com/led-matrix-shirt/#
https://www.sparkfun.com/tutorials/312
https://learn.sparkfun.com/tutorials/light-up-plush
https://learn.sparkfun.com/tutorials/tags/lilypad?page=all
https://learn.sparkfun.com/tutorials/marquee-party-bag
https://learn.sparkfun.com/tutorials/light-up-pennant-with-e-textiles

More Related Content

Similar to E textiles tutorial

Arduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYArduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYVishnu
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalTony Olsson.
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalTony Olsson.
 
Programming with arduino
Programming with arduinoProgramming with arduino
Programming with arduinoMakers of India
 
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdfJayanthi Kannan MK
 
Syed IoT - module 5
Syed  IoT - module 5Syed  IoT - module 5
Syed IoT - module 5Syed Mustafa
 
arduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfarduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfssusere5db05
 
Arduino windows remote control
Arduino windows remote controlArduino windows remote control
Arduino windows remote controlVilayatAli5
 
Arduino cic3
Arduino cic3Arduino cic3
Arduino cic3Jeni Shah
 
IoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensorsIoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensorssaritasapkal
 
Electronz_Chapter_2.pptx
Electronz_Chapter_2.pptxElectronz_Chapter_2.pptx
Electronz_Chapter_2.pptxMokete5
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slidesmkarlin14
 
Arduino slides
Arduino slidesArduino slides
Arduino slidessdcharle
 
Basic arduino sketch example
Basic arduino sketch exampleBasic arduino sketch example
Basic arduino sketch examplemraziff2009
 
Arduino for Beginners
Arduino for BeginnersArduino for Beginners
Arduino for BeginnersSarwan Singh
 

Similar to E textiles tutorial (20)

Arduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYArduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIY
 
Arduino Programming Basic
Arduino Programming BasicArduino Programming Basic
Arduino Programming Basic
 
publish manual
publish manualpublish manual
publish manual
 
Fun with arduino
Fun with arduinoFun with arduino
Fun with arduino
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
 
Programming with arduino
Programming with arduinoProgramming with arduino
Programming with arduino
 
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
 
Syed IoT - module 5
Syed  IoT - module 5Syed  IoT - module 5
Syed IoT - module 5
 
arduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfarduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdf
 
Arduino course
Arduino courseArduino course
Arduino course
 
Arduino windows remote control
Arduino windows remote controlArduino windows remote control
Arduino windows remote control
 
Arduino cic3
Arduino cic3Arduino cic3
Arduino cic3
 
IoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensorsIoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensors
 
Electronz_Chapter_2.pptx
Electronz_Chapter_2.pptxElectronz_Chapter_2.pptx
Electronz_Chapter_2.pptx
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slides
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
 
Arduino intro.pptx
Arduino intro.pptxArduino intro.pptx
Arduino intro.pptx
 
Basic arduino sketch example
Basic arduino sketch exampleBasic arduino sketch example
Basic arduino sketch example
 
Arduino for Beginners
Arduino for BeginnersArduino for Beginners
Arduino for Beginners
 

More from University of Washington (9)

Johnny final pitch
Johnny final pitch Johnny final pitch
Johnny final pitch
 
Kids vr johnny
Kids vr johnnyKids vr johnny
Kids vr johnny
 
VR Research
VR ResearchVR Research
VR Research
 
AR Educational Game Design
AR Educational Game DesignAR Educational Game Design
AR Educational Game Design
 
Blended Learning
Blended LearningBlended Learning
Blended Learning
 
What is your dream
What is your dream What is your dream
What is your dream
 
Kind TV
Kind TVKind TV
Kind TV
 
VR education
VR education VR education
VR education
 
Finding the orange guy
Finding the orange guyFinding the orange guy
Finding the orange guy
 

Recently uploaded

A level Digipak development Presentation
A level Digipak development PresentationA level Digipak development Presentation
A level Digipak development Presentationamedia6
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵anilsa9823
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...home
 
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service AmravatiVIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
MASONRY -Building Technology and Construction
MASONRY -Building Technology and ConstructionMASONRY -Building Technology and Construction
MASONRY -Building Technology and Constructionmbermudez3
 
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...Amil baba
 
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Yantram Animation Studio Corporation
 
SCRIP Lua HTTP PROGRACMACION PLC WECON CA
SCRIP Lua HTTP PROGRACMACION PLC  WECON CASCRIP Lua HTTP PROGRACMACION PLC  WECON CA
SCRIP Lua HTTP PROGRACMACION PLC WECON CANestorGamez6
 
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service Bhiwandi
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service BhiwandiVIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service Bhiwandi
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service BhiwandiSuhani Kapoor
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130Suhani Kapoor
 
Fashion trends before and after covid.pptx
Fashion trends before and after covid.pptxFashion trends before and after covid.pptx
Fashion trends before and after covid.pptxVanshNarang19
 
Design Portfolio - 2024 - William Vickery
Design Portfolio - 2024 - William VickeryDesign Portfolio - 2024 - William Vickery
Design Portfolio - 2024 - William VickeryWilliamVickery6
 
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...Amil baba
 
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779Best VIP Call Girls Noida Sector 44 Call Me: 8448380779
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779Delhi Call girls
 
The history of music videos a level presentation
The history of music videos a level presentationThe history of music videos a level presentation
The history of music videos a level presentationamedia6
 
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceanilsa9823
 
VIP Kolkata Call Girl Gariahat 👉 8250192130 Available With Room
VIP Kolkata Call Girl Gariahat 👉 8250192130  Available With RoomVIP Kolkata Call Girl Gariahat 👉 8250192130  Available With Room
VIP Kolkata Call Girl Gariahat 👉 8250192130 Available With Roomdivyansh0kumar0
 
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...Suhani Kapoor
 
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130Suhani Kapoor
 
How to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our SiteHow to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our Sitegalleryaagency
 

Recently uploaded (20)

A level Digipak development Presentation
A level Digipak development PresentationA level Digipak development Presentation
A level Digipak development Presentation
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
 
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service AmravatiVIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
 
MASONRY -Building Technology and Construction
MASONRY -Building Technology and ConstructionMASONRY -Building Technology and Construction
MASONRY -Building Technology and Construction
 
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...
 
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
 
SCRIP Lua HTTP PROGRACMACION PLC WECON CA
SCRIP Lua HTTP PROGRACMACION PLC  WECON CASCRIP Lua HTTP PROGRACMACION PLC  WECON CA
SCRIP Lua HTTP PROGRACMACION PLC WECON CA
 
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service Bhiwandi
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service BhiwandiVIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service Bhiwandi
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service Bhiwandi
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
 
Fashion trends before and after covid.pptx
Fashion trends before and after covid.pptxFashion trends before and after covid.pptx
Fashion trends before and after covid.pptx
 
Design Portfolio - 2024 - William Vickery
Design Portfolio - 2024 - William VickeryDesign Portfolio - 2024 - William Vickery
Design Portfolio - 2024 - William Vickery
 
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
 
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779Best VIP Call Girls Noida Sector 44 Call Me: 8448380779
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779
 
The history of music videos a level presentation
The history of music videos a level presentationThe history of music videos a level presentation
The history of music videos a level presentation
 
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
 
VIP Kolkata Call Girl Gariahat 👉 8250192130 Available With Room
VIP Kolkata Call Girl Gariahat 👉 8250192130  Available With RoomVIP Kolkata Call Girl Gariahat 👉 8250192130  Available With Room
VIP Kolkata Call Girl Gariahat 👉 8250192130 Available With Room
 
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...
 
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
 
How to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our SiteHow to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our Site
 

E textiles tutorial

  • 3. Components of the Codeable Circuit • This circuit is codeable, which means that you can control whether or not these components are activated or not, using inputs and outputs. • Outputs – the LEDs, the RGB light, the buzzer. – You can make these different components (called ‘actuators’) turn on and off and different rates, patterns, etc. – *Note – To make these controllable/codeable (not always on), at least one side (usually the + end) needs to be attached to a numbered or A- pin; the other end can be attached to + or – pin • Inputs – metallic patches – You can take a reading of electrical current or conductivity (generally). If you touch both then you ‘close the circuit’ – *Note - these need to be attached to A-pins (and the – pin) for taking readings.
  • 5. _ + Rules for Connecting Components This LED is always on because it’s connected to the + and – pin.
  • 6. _ + Rules for Connecting Components This LED can be programmed/controlled because you can code pin 5 (polarity).
  • 7. _ + Rules for Connecting Components This LED can be programmed/controlled because you code pin A5 (polarity). You can also connect the LED to any other numbered or lettered pin if you want to control it (though note that only numbered pins can execute ‘analogWrite’ for behaviors such as fade).
  • 8. Rules for Connecting Components This is also possible. Both pin 5 AND pin 6 would need to be programmed. _ +
  • 9. _ + Rules for Connecting Components A Parallel Circuit – both LEDs function in the same way (by coding pin 5). _ +
  • 10. _ + Rules for Connecting Components Also a Parallel Circuit – both LEDs function in the same way *by programming pin 5) _ +
  • 11. _ + Rules for Connecting Components Not a parallel circuit. These LEDs function separately (coding pin 5 or pin 6) even though they have a shared ground (-). _ +
  • 12. Rules for Connecting Components In order to attach the metallic patches, you need to connect one patch to the – pin and the other patch to one of the A-pins. You can tell the A-pin to take a ‘reading’ of electrical current (generally). Basically, when you touch both of these, you ‘close the circuit’ (because your body is conductive and can carry current) and then the A-pin can be told to read this, and do something as a result.
  • 13. Rules for Connecting Components The patch connected to the – pin can also be attached to other components to act as a ground. The patches and LEDs act in the same way. _ +
  • 15. This is a basic blink program int bird = 5; void setup() { pinMode(bird, OUTPUT); } void loop() { digitalWrite(bird, HIGH); delay(1000); digitalWrite(bird, LOW); delay(1000); } This section is for naming variables. Here, we are calling pin 5 “bird” so we don’t always have to write 5 in the below section. Or if we can quickly change the pin # (if you resew it) without having to change each place below.
  • 16. This is a basic blink program int bird = 5; void setup() { pinMode(bird, OUTPUT); } void loop() { digitalWrite(bird, HIGH); delay(1000); digitalWrite(bird, LOW); delay(1000); } This is the setup section, where you write up the conditions that we want to exist throughout the program, even when it’s going through different behaviors. Here, we setup the pin named bird to be an output for electricity (an actuator).
  • 17. This is a basic blink program int bird = 5; void setup() { pinMode(bird, OUTPUT); } void loop() { digitalWrite(bird, HIGH); delay(1000); digitalWrite(bird, LOW); delay(1000); } This is the loop section, or the ‘action’ of the program. Basically, what this code says is: Turn on pin 5 (voltage high) Wait 1000 milliseconds Turn off pin 5 (voltage low) Wait 1000 milliseconds
  • 18. This is a basic blink program int bird = 5; void setup() { pinMode(bird, OUTPUT); } void loop() { digitalWrite(bird, HIGH); delay(1000); digitalWrite(bird, LOW); delay(1000); }
  • 19. Basic human sensor program int sensorValue; //a placeholder for the function below int MetalPatch = A3; //if your metallic patch is attached to pin A5 and the other one is attached to the - pin void setup() { Serial.begin(9600); //gets touch sensor ready to read value - analog digitalWrite(MetalPatch, HIGH); //start circuit for human sensing circuit pinMode(MetalPatch, INPUT); //sets A3 as an input of electricity, for reading } void loop() { sensorValue = analogRead(MetalPatch); //read values from light sensor Serial.println(sensorValue); //show values in serial monitor window delay(300); //delay time determines how often the Lilypad will read the sensor } Everything to the right of // is a comment and doesn’t get compiled as part of the code. The way this code works is that you need to upload it to your board, then press the magnifying glass icon in the upper right corner of your Arduino window. This will open the serial monitor window, which will show you readings based on the electrical flow
  • 20. Basic conditional program w/ human sensor int sensorValue; int MetalPatch = A3; Int bird = 5; void setup() { Serial.begin(9600); digitalWrite(MetalPatch, HIGH); pinMode(MetalPatch, INPUT); pinMode(bird, OUTPUT); } void loop() { sensorValue = analogRead(MetalPatch); Serial.println(sensorValue); delay(300); if (sensorValue>1000) { digitalWrite(bird, LOW); } else { digitalWrite(bird, HIGH); } } This program includes a conditional statement, which is indicated by the if/then statement in the loop. Basically it’s saying that: if the sensor has a reading over 1000 (usually indicating an open circuit, no one is touching) then turn the LED bird off, otherwise (when someone is touching) turn the LED bird on. You can create more complex conditionals by adding more conditions like ranges (see below for example) if (sensorValue>300) { digitalWrite(led1, HIGH); digitalWrite(led2, LOW); } else if (sensorValue<=299 && sensorValue>10) { digitalWrite(led1, LOW); digitalWrite(led2, HIGH); } Else { digitalWrite(led1, LOW); digitalWrite(led2, LOW); }
  • 21. More resources • Explore the Examples section of Arduino (under File > Examples) • Look at Sew Electric.org • Look around Instructables
  • 23. Tips for E-Textiles Sewing • Stitch components onto fabric three times for the best conductivity. • Remember that this thread is metallic and can easily cause short circuits if they touch (due to frayed thread, messy knots, etc.) To help secure these, you can use regular masking tape or felt for insulation, or clear nail polish. • Remember to keep your – and + lines separate (otherwise, you’ll cause a short circuit) • Look online or to your friends or classmates for basic hand sewing techniques (threading needle, tying knots, basic running stitch)
  • 24.