Fabricademy: Wearables and E-Textiles II

Ec736feda4fde63cc72673f64f44406e?s=47 Becky Stewart
November 23, 2017

Fabricademy: Wearables and E-Textiles II

Ec736feda4fde63cc72673f64f44406e?s=128

Becky Stewart

November 23, 2017
Tweet

Transcript

  1. becky@theleadingzero.com theleadingzero.com rebecca.stewart@qmul.ac.uk eecs.qmul.ac.uk/~rebeccas Becky Stewart Fabricademy 2017 E-Textiles and

    Wearables II
  2. Introduction

  3. Spatial Auditory Display for Acoustics and Music Collections

  4. None
  5. GPS Shoes dominicwilcox.com/portfolio/gpsshoes

  6. Meta-Projection Jacket http://www.dazeddigital.com/music/article/16139/1/vase-at-the-tate

  7. Human Harp humanharp.org

  8. Flutter/Stutter

  9. None
  10. Lecturer in School of Electronic Engineering and Computer Science Sophie

    Skach
  11. Textile Stretch Sensors

  12. Wearable computing with e-textiles and audio

  13. mini-assignment: choose an object • Look at interactive objects around

    you/online and think of them as systems. • What are the inputs; what are the outputs? • Are the inputs and outputs digital (only on-off) or variable (have a range of values between fully on and fully off). • This is easier to consider for inputs, don’t worry about the details of outputs right now.
  14. assignment • Make an interactive object. Build off the tools

    and methods you have used so far.
  15. Prep for Thursday • Prepare a pressure or stretch sensor

    • Install Arduino, go through Blink sketch • Doesn’t matter whether an Uno, Lilypad or other Arduino board • Have a multimeter handy
  16. becky@theleadingzero.com theleadingzero.com rebecca.stewart@qmul.ac.uk eecs.qmul.ac.uk/~rebeccas Becky Stewart Fabricademy 2017 E-Textiles and

    Wearables II
  17. Physical Computing

  18. Physical Computing • A computational device can turn a voltage

    into a number and can turn a number into a voltage. • The code running on the device decides what happens to those numbers and how they are created. computer sensor sensor sensor actuator actuator actuator Digital: 0V or 5V —> 0 or 1 Analog: 0V to 5V —> 0 to 1023 Digital: 0 or 1 —> 0V or 5V Analog: 0 to 255 —> 0V to 5V (this is an oversimplification)
  19. Physical Computing • A computational device is necessary to do

    things like • make complex mappings from inputs to outputs • connect to another device with a wired connection like serial or I2C • make a wireless connection like wifi or Bluetooth
  20. Microcontrollers • Runs only one piece of code. • Doesn’t

    use an operating system to manage a bunch of programs. • Quick to start and easy to shut down (add power, take away power). • Usually much more limited than a full computer.
  21. Microcontrollers

  22. Microcontrollers

  23. Single-Board Computers • Needs an operating system to work —

    usually uses a Linux system. • Can handle multiple programs at the same time. • Takes longer to start up, and can be easy to corrupt data if you don’t follow proper shutdown procedures.
  24. Single-Board Computers

  25. Questions?

  26. Sensor Circuits

  27. Digital Sensor Circuits • Digital sensors (usually thought of as

    switches) are cheap. • No calibration. • When connected to a microcontroller, need to use a pull-up or pull-down resistor.
  28. 5v GND Digital Sensor Circuits

  29. None
  30. 5V GND digital pin resistor switch Digital Sensor Circuits

  31. int switchPin = 7; void setup() { pinMode( switchPin); Serial.begin(

    9600 ); } void loop() { int switchValue; switchValue = digitalRead( switchPin ); Serial.println( switchValue ); delay( 300 ); // slow down to make it easier to read }
  32. • Arduinos can only watch changes in voltage. • Not

    changes in resistance or current. • But we can turn a changing current or resistance into a changing voltage by being clever. • Use a circuit called a voltage divider. Analog Sensor Circuits
  33. Vin Vout GND GND R1 R2 Analog Sensor Circuits

  34. Vin Vout 5V GND GND R1 R2 Something between 5V

    and GND Analog Sensor Circuits
  35. Vin Vout 5V GND GND R1 R2 Something between 5V

    and GND Analog Sensor Circuits
  36. Vin Vout 5V GND GND R1 R2 Something between 5V

    and GND = Vout Vin x R1 + R2 R2 Analog Sensor Circuits
  37. Vin Vout GND GND R2 R1 knit sensor Analog Sensor

    Circuits
  38. Vin Vout GND GND R2 R1 knit sensor Analog Sensor

    Circuits
  39. Analog Sensor Circuits = Vout Vin x R1 + R2

    R2 Vin Vout GND GND R1 R2
  40. Vin Vout GND R1 R2 potentiometer *In this circuit, both

    R1 and R2 are changing when the knob is turned. Analog Sensor Circuits
  41. 1. Does the object change resistance when you interact with

    it? Check with a multimeter. 2. If does, create a voltage divider. Decide if you want the object to be R1 or R2. 3. Choose a static resistor that gives you the values you are looking for. Generally you want a value that is halfway between the min and max resistances of your sensor. Analog Sensor Circuits
  42. // to the pins used: const int analogInPin = A0;

    // Analog input pin that the potentiometer is attached const int analogOutPin = 9; // Analog output pin that the LED is attached to int sensorValue = 0; // value read from the pot int outputValue = 0; // value output to the PWM (analog out) 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: outputValue = map(sensorValue, 0, 1023, 0, 255); // change the analog out value: analogWrite(analogOutPin, outputValue); // print the results to the serial monitor: Serial.print("sensor = "); Serial.print(sensorValue); Serial.print("\t output = "); Serial.println(outputValue); // wait 2 milliseconds before the next loop // for the analog-to-digital converter to settle // after the last reading: delay(2); }
  43. Questions?

  44. Actuator Circuits

  45. Actuator Circuits • The main consideration for actuators is how

    much current they need (how much they draw). • An actuator that needs too much current can harm your microcontroller. • Motors and a lot of LEDs will probably need more than your board can supply.
  46. Actuator Circuits From Tech Specs for Arduino Uno Pay attention

    to this number
  47. Actuator Circuits Use a circuit that passes the current through

    something else besides the microcontroller.
  48. Actuator Circuits • PWM is not really an analog signal.

    • If your actuator isn’t working when using analogWrite(), see if it works with digitalWrite().
  49. // to the pins used: const int analogInPin = A0;

    // Analog input pin that the potentiometer is attached const int analogOutPin = 9; // Analog output pin that the LED is attached to int sensorValue = 0; // value read from the pot int outputValue = 0; // value output to the PWM (analog out) 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: outputValue = map(sensorValue, 0, 1023, 0, 255); // change the analog out value: analogWrite(analogOutPin, outputValue); // print the results to the serial monitor: Serial.print("sensor = "); Serial.print(sensorValue); Serial.print("\t output = "); Serial.println(outputValue); // wait 2 milliseconds before the next loop // for the analog-to-digital converter to settle // after the last reading: delay(2); }
  50. Questions?

  51. Hard-Soft Connections

  52. Hard-Soft Connections • E-textiles currently always combine hard (PCB, LEDs,

    etc) components with soft (conductive threads and fabrics). • When adding in a microcontroller, always have to deal with these connections.
  53. Hard-Soft Connections • One of my current works- in-progress •

    Bela is the single-board computer • Sits on a 2-layer fabric circuit board (FCB) • Hard-soft connection is stripped wire sewn onto conductive fabric pads
  54. Hard-Soft Connections 3.3V GND A0 A2 A3 A4 A1 D0

    D1 Ground 3.3V and inputs
  55. Hard-Soft Connections Kobakant’s How to Get What You Want is

    always an excellent resource http://www.kobakant.at/DIY/? cat=32
  56. Hard-Soft Connections Rachel Freire’s safety pin connectors http://www.instructables.com/ id/Safety-Pin-Crocodile-Clips- for-ETextiles/

  57. Hard-Soft Connections Irene Posch’s e-textile tools http://www.ireneposch.net/ tooling/ http://etextile-summercamp.org/ swatch-exchange/pin-probe/

  58. Hard-Soft Connections eTextile Summer School Workshop by Hannah Perner-Wilson and

    Irene Posch http://etextile- summercamp.org/2017/ summerof/pcbattiny-workshop- schedule/
  59. Hard-Soft Connections • When in doubt, use a snap. •

    Solderable and sewable. http://www.geeetech.com/wiki/index.php/LilyPad_Arduino_SimpleSnap
  60. Questions?

  61. Arduino Code

  62. Arduino Code • You learn to write by leaning to

    read — the same is true with code. • Start by reading and reusing code that is already written, then you will build up the experience to write your own sketches. • The example sketches that come with Arduino cover almost every basic interaction you’ll want.
  63. Assignment • Make an interactive object. Build off the tools

    and methods you have used so far. • If you are new to Arduino, just use one of the example sketches. • If you have a little Arduino experience, modify one of the examples. • If you are very experienced with Arduino, fully integrate the board into your project using hard-soft connections.
  64. Questions?