1 of 185

Conductive & resistive

fabrics and yarns

DIY soft switches + sensors

Hard- Soft connections

Components

Programming

Fabricademy | textile & technology academy

Liza Stark

WEEK 5

E-TEXTILES

2 of 185

3 of 185

RESOURCES

GETTING STARTED

Vocabulary list. All state of the art terms we will cover.

Computational Craft. In-depth resources for all topics we cover.

4 of 185

What are electronic textiles?

5 of 185

IT MIGHT LOOK LIKE…

INTRODUCTION

6 of 185

IT ALSO LOOKS

LIKE…

INTRODUCTION

Stymphalian Birds by Audrey Briot

The Knitted Radio by Irene Posch + Ebru Kurbak

A Fabric that Remembers by Laura Devendorf

Magnetic Reverberations by Elizabeth Meiklejohn

7 of 185

HARD TECH,

SOFT WORLD

INTRODUCTION

Different iterations of the WearComp wearable computer by Steve Mann (1981-mid 1990s)

The Musical Jacket by Maggie Orth and Rehmi Post (1998)

8 of 185

HOW TO

GET WHAT YOU WANT

INTRODUCTION

https://www.kobakant.at/DIY/

By Mika Satomi + Hannah Perner-Wilson

9 of 185

APPROACH

INTRODUCTION

We will progress from:

  • Electronics
  • Fabrication
  • Coding

We will center materials throughout.

Credit to Olivia Prior, Kate Hartman and Social Body Lab for this diagram

Electronics

Fabrication

Coding/ Interaction

Materials

10 of 185

This is a fast introduction to electronic textiles.

This deck is a long term resource.

Make a note of what excites you for your assignment.

11 of 185

What is a circuit?

12 of 185

WHAT

CIRCUIT

A circuit is a path for electrical energy to flow. This electrical energy is called current.

All circuits must have a power source and output or load.

LOAD / OUTPUT

LED

PATH

Alligator clips

POWER

SOURCE

3 volt

battery

13 of 185

HOW

CIRCUIT

Current moves from power (+) to ground (-) along our electrical path.

Our work in designing circuits is guiding the current where to go through our conductive paths and components.

+

-

14 of 185

BIG 3

ELECTRICITY 101

We need to understand the basic relationship among these three in order to build circuits.

VOLTAGE

CURRENT

RESISTANCE

15 of 185

VOLTAGE

ELECTRICITY 101

Each circuit has a power source with a different voltage. Components and boards need different voltages to operate safely.

1.5 Volts

3 Volts

9 Volts

16 of 185

VOLTAGE

ELECTRICITY 101

Difference in potential electrical energy measured between two points in a circuit.

KEY FACTS

  • Measured in volts (V)
  • Components and boards are rated for different voltages.

Images from Sparkfun

17 of 185

VOLTAGE

ELECTRICITY 101

Measure with a multimeter

Quick Guide:

  1. Gather your multimeter an.
  2. Turn on your multimeter
  3. If you have a knob, turn it to 20 by the V~.
  4. Put one probe to ground (-) and one to power (+).

18 of 185

VOLTAGE

ELECTRICITY 101

All voltage must be used. If it is not, it will dissipate as heat and could burn components.

+

GROUND

FACT:

LEDs need between 2-3.2 volts to operate. This is called forward voltage.

19 of 185

VOLTAGE

ELECTRICITY 101

All voltage must be used. If it is not, it will dissipate as heat and could burn components. But why??

+

9V Increase

GROUND

~2.2V Decrease

~6.8V Left over

This is too much left over. It will burn the components.

20 of 185

CURRENT

ELECTRICITY 101

Amount of electricity that passes through one point in a circuit.

Current is the water.

KEY FACTS

  • Measured in amps (I)
  • There is a difference between conventional vs electron flow

21 of 185

CURRENT

ELECTRICITY 101

Components are also rated for current. Let’s use this info to return to another question…

250mA with no load

500mA with load

20mA for max brightness

Each pin outputs ~20mA

22 of 185

CURRENT

ELECTRICITY 101

Every electrical component or material has a data sheet. This details all of electrical and physical properties. Check the website you bought it on

WAIT.

How do you know that?

23 of 185

CURRENT

ELECTRICITY 101

We know there is too much voltage. But how does this relate to current?

+

GROUND

~2.2V Decrease

~6.8V Left over

24 of 185

CURRENT

ELECTRICITY 101

Voltage pushes current through the circuit. The more voltage, the more current: they are directly related.

+

GROUND

~2.2V Decrease

~6.8V Left over

Too much of current going back to ground

25 of 185

CURRENT

ELECTRICITY 101

Voltage pushes current through the circuit. The more voltage, the more current: they are directly related.

+

GROUND

~2.2V Decrease

~6.8V Left over

+

GROUND

~8.8V Decrease

~0.2V Left over

Ok amount of current going back to ground

Too much of current going back to ground

26 of 185

CURRENT

ELECTRICITY 101

But how can we solve this without 3 more LEDs? Let’s talk about the final piece…

+

GROUND

~2.2V Decrease

~6.8V Left over

Too much of current going back to ground

27 of 185

RESISTANCE

ELECTRICITY 101

Determines how much electricity (i.e. current) flows through a circuit.

KEY FACTS

  • Measured in ohms (Ω)

LESS resistance

MORE current flows

MORE resistance

LESS current flows

28 of 185

RESISTANCE

ELECTRICITY 101

A resistor limits the amount of electricity that can flow through a certain point. They come in different values (ring color) and wattages (size).

Note: You will generally need a ¼ or ½ watt.

29 of 185

Measure with a multimeter

  • Gather your multimeter, resistor, and velostat.
  • Turn on your multimeter and turn the knob to Ω.
    1. If your multimeter is like this, start at 200.
  • Put one probe to on each side of the resistor.
    • Turn the knob to higher values until you get a reading.
  • Follow the same steps with the fabric.
    • Try putting the probes at different points on the fabric to see how the readings change.

30 of 185

OHM’S LAW

ELECTRICITY 101

Mathematically defines the relationship between voltage, current, and resistance.

V = I * R

V = Voltage in volts

I = Current in amps

R = Resistance in ohms

See Sparkfun’s Tutorial if you want to learn more.

31 of 185

THINK

ELECTRICITY 101

Silently choose your answer:

What will happen to the LED if I put this piece of conductive fabric over the LED legs?

  1. Nothing
  2. Turn off
  3. Start blinking

32 of 185

THINK

ELECTRICITY 101

What will happen to the LED if I put this piece of conductive fabric over the LED legs?

  • Nothing
  • Turn off
  • Start blinking

It caused a short circuit. Instead of going through the LED, electricity traveled straight across the copper fabric.

33 of 185

DEBRIEF

ELECTRICITY 101

If we want to use more than one component, there are two ways we can configure them: series and parallel.

Parallel

with similar forward voltages

Parallel

with different forward voltages

Series

34 of 185

VOLTAGE

ELECTRICITY 101

Forward voltage is the amount of voltage a component uses in a circuit.

Notice how different colors have different values. Red LEDs need 1.95 volts while blue needs 3.2 volts.

LED Color Graph by Jie Qi from the 2013 e-Textile Swatchbook Exchange

35 of 185

FORWARD VOLTAGE

ELECTRICITY 101

Different color LEDs have different forward voltages. If you combine LEDs, but sure to test that they will work together!

36 of 185

LED

COMPONENTS

There are two ways you can connect multiple components:

  • Parallel
  • Series

For LEDs, we will only use parallel >>>>>>>

Parallel

2 Different Electrical Paths

Series

Same Electrical Path

Voltage

Same across all

Must be greater than or equal to sum of forward voltages

Current

Splits among them based on forward voltage

Same across all

37 of 185

Questions?

38 of 185

What materials and tools can I use?

39 of 185

FABRICS

MATERIALS

Properties to consider:

  • Resistance. Check the data sheet - usually measured per square inch
  • Stretchiness. Woven, knit, or nonwoven
  • Solderability. Always test beforehand!
  • Feel. Is this going on the body?)
  • Substrate + productive process. Coated nylon? Woven stainless steel?

40 of 185

THREADS + YARNS

MATERIALS

Properties to consider:

  • Resistance. Check the data sheet
  • Solderability. Always test beforehand!
  • Thickness. What is the ply? Will it fray easily? Is it machine sewable?
  • Substrate + productive process. Plied stainless steel? Coated silver?

From Kobakant >>

Elitex

Karl Grimm

Bekinox

Adafruit Stainless Steel

Silverspun Yarn

41 of 185

ECOTHREADS

SWATCHES

“We present EcoThreads, a sustainable e-textile prototyping approach for fabricating biodegradable functional threads involving two thread-based fabrication methods, wet spinning and thread coating, to fabricate functional threads from biomaterials or modify natural fiber to achieve conductive or interactive functionality.”

EcoThreads Workshop Documentation (Images from the Hybrid Body Lab at Cornell University)

Samples from a workshop in Sept 2024

42 of 185

INKS +

TAPES

MATERIALS

CuPro-Cote by LessEMF

Bare Conductive

Circuit Scribe

Copper Tape

Copper Foil Sheet

Conductive Fabric Tape

43 of 185

HAND

TOOLS

44 of 185

MACHINES

TOOLS

45 of 185

ELECTRONICS

TOOLS

46 of 185

What are my options for creating traces?

47 of 185

TRACES

CREATING CIRCUITS

Traces are the physical paths of conductive material that electricity moves along in a circuit. We want these to be highly conductive (i.e. very low resistance)

48 of 185

FABRIC

TRACES

  1. Copper Taffeta (iron*)
  2. Bremen (iron)
  3. Kassel (iron)
  4. Stretch (iron)
  5. TechniTex Stretch (sewn)
  6. Kassel (sewn)

*Fused with Heat’n’bond. See appendix

A

B

C

D

E

F

49 of 185

FABRIC

TRACES

Second Skin by Rachel Freire

Connextyle by Jessica Marsch

50 of 185

THREAD

TRACES

  • Karl Grimm High Flex Silver (machine, bobbin)
  • Karl Grimm High Flex (machine, bobbin)
  • Karl Grimm High Flex Silver (machine, 3 threads, zigzag)
  • Karl Grimm High Flex (machine, 1 thead, zigzag)
  • Karl Grimm High Flex Silver (hand sewn, running)
  • Stainless steel (hand sewn, running)
  • Karl Grimm High Flex (hand sewn, chain stitch)

A

B

C

D

E

F

G

51 of 185

THREAD

TRACES

Threaded Frequencies by Anuvad Innovation Studio

The Embroidered Computer by Irene Posch and Ebru Kurbak

52 of 185

What inputs can I make?

53 of 185

INPUT

OVERVIEW

Information or data that enters a system, like a button press.

DIGITAL

Switches

On/off

0110111101101110

ANALOG

Sensors

Range of values

1023, 521, 34

54 of 185

Switches

55 of 185

SWITCHES

DIGITAL

A switch is a break in a circuit.

Since the circuit is not complete, no electricity can flow to the components.

56 of 185

MOMENTARY

SWITCHES

Momentary switches (aka push buttons) stay open as long as you hold them by pressing conductive materials into contact.

Non-conductive fabric

Conductive

Foam with holes

Conductive

Non-conductive fabric

57 of 185

TOGGLE

SWITCHES

Press, zip, slide, etc two pieces of conductive material together. These stay open in one position and closed in the other.

58 of 185

STROKE

SWITCHES

Close the circuit by pressing conductive materials into contact.

59 of 185

TILT

SWITCHES

A conductive bead or pompom makes contact with conductive fabric patches based on its position.

60 of 185

Sensors

61 of 185

SENSORS

ANALOG

We can use resistance to get a broader range of values. By allowing more current to get through, you can change the brightness of an LED, the frequency of a sound, or the speed of a motor.

By varying resistance of your input, you can change the output. That is why they are also called variable resistors.

62 of 185

RESISTANCE

ELECTRICITY 101

Determines how much charge flows through a circuit.

KEY FACTS

  • Measured in ohms (Ω)

The lower the resistance, more current flows.

The higher the resistance, less current flows.

63 of 185

GOAL

SENSORS

Design a textile interface that allows us to manipulate resistance by building different structures and layouts.

What factors that impact resistance?

LESS

MORE

64 of 185

FACTORS

RESISTANCE

DISTANCE

Resistance increases over distance no matter what the material

CONTACT

Some materials are pressure sensitive will decrease in resistance when pressure is applied to them.

SURFACE AREA

Increasing the size of the area for electricity to flow will decrease the resistance.

We can change resistance in three ways.

65 of 185

FACTORS

RESISTANCE

DISTANCE

Resistance increases over distance no matter what the material

CONTACT

Some materials are pressure sensitive will decrease in resistance when pressure is applied to them.

SURFACE AREA

Increasing the size of the area for electricity to flow will decrease the resistance.

We can change resistance in three ways.

66 of 185

FACTORS

RESISTANCE

DISTANCE

Resistance increases over distance no matter what the material

CONTACT

Some materials are pressure sensitive will decrease in resistance when pressure is applied to them.

SURFACE AREA

Increasing the size of the area for electricity to flow will decrease the resistance.

We can change resistance in three ways.

67 of 185

FACTORS

RESISTANCE

DISTANCE

Resistance increases over distance no matter what the material

CONTACT

Some materials are pressure sensitive will decrease in resistance when pressure is applied to them.

SURFACE AREA

Increasing the size of the area for electricity to flow will decrease the resistance.

We can change resistance in three ways.

68 of 185

MATERIALS

SENSORS

CONDUCTIVE YARN

Silver or stainless steel spun with other fibers, good for stretch sensors

Resistance decreases as you press or stretch.

VELOSTAT

Carbon impregnated film, cheap, resilient, non-stretch

EEONTEX

Nonwoven, VERY high resistance

69 of 185

MATERIALS

SENSORS

Polysense uses a process called in-situ polymerization, effectively dying a fabric to become piezoelectric. Any porous material can be dyed/coated.

Documentation here: https://counterchemists.github.io/

Images from PolySense

Stymphalian Birds by Audrey Briot

CCC Leggings by Kobakant and CounterChemists

70 of 185

THINK

CIRCUITS IN ACTION

What will happen to the LED when I connect this knit conductive yarn to the battery?

  • It will be bright the harder I press it
  • It will stay off
  • It will blink on and off really fast

71 of 185

THINK

CIRCUITS IN ACTION

What will happen to the LED when I connect this knit conductive yarn to the battery?

  • It will be bright the harder I press it
  • It will stay off
  • It will blink on and off really fast

The more you press, the more electricity gets through the yarn i.e. the resistance of the yarn decreases.

72 of 185

Construction

73 of 185

PRESSURE

SENSORS

When pressed, the resistance decreases allowing more electricity to flow through the circuit. Use this to track pressure/weight on an interface or object.

Pressure sensors by Kobakant

74 of 185

PRESSURE

DESIGN

These are great for small to medium size projects.

CONDUCTIVE FABRIC

VELOSTAT

DOTTED LINE

REGULAR FABRIC

CONDUCTIVE FABRIC

VELOSTAT

DOTTED LINE

REGULAR FABRIC

CONDUCTIVE THREAD

75 of 185

PRESSURE

DESIGN

These matrices are great for small or large scale.

CONDUCTIVE FABRIC

VELOSTAT

DOTTED LINE

REGULAR FABRIC

Leave space so the two don’t touch

CONDUCTIVE THREAD

VELOSTAT

If you want more control, you can create a true matrix and attach each thread of one side to different pins

76 of 185

PRESSURE

DESIGN

A pompom and small woven patches are great for small scale and fun to touch!

CONDUCTIVE ROVING

YOU CAN ALSO USE CONDUCTIVE YARN TO MAKE A POMPOM

CONDUCTIVE THREAD OR YARN TO CONNECT

CONDUCTIVE YARN

77 of 185

BEND

SENSORS

Resistance decreases as bent and more contact is made. Very similar to a pressure sensor, but better for measuring joint movement.

78 of 185

BEND

DESIGN

Works for small and large scale. Great for wearables.

CONDUCTIVE FABRIC

VELOSTAT

DOTTED LINE

REGULAR FABRIC

CONDUCTIVE THREAD

CONDUCTIVE FABRIC

VELOSTAT

DOTTED LINE

REGULAR FABRIC

79 of 185

BEND

DESIGN

Works best for smaller scale on joints in wearable projects.

CONDUCTIVE FABRIC

EEONTEX

REGULAR FABRIC

80 of 185

STRETCH

SENSORS

The more a resistive material is stretched, the more its resistance will decrease because it has more surface area to cover.

81 of 185

POTENTIOMETER

SENSORS

Adjust resistance by connecting conductive and resistive material through a wiper at different points in the circuit. The farther away, the more resistance.

Knit circular potentiometer

Fabric linear potentiometer

Analog tilt sensor

82 of 185

RESOURCES

CONSTRUCTION

Check out these zines for a more in-depth explanation of how construct switches and a knit stretch sensors.

83 of 185

Design Considerations

84 of 185

OVERVIEW

CONSIDERATIONS

  • What is the context of my project?
  • How sensitive does my sensor need to be?
  • What scale does my project require?

To design your own sensors, ask yourself these questions to determine interaction, form, construction, and material application:

85 of 185

CONTEXT

CONSIDERATIONS

What is the context of my project?

DAILY USE

PERFORMANCE

WEARABLE

NON-WEARABLE

86 of 185

SENSITIVITY

CONSIDERATIONS

How sensitive does my sensor need to be?

LOW

HIGH

Hard press or bend to activate

Light press or bend to activate

87 of 185

Pressure

Matrix

LOW

HIGH

Pressure

Sensor Type

Pressure

Sensor

Pompom /

Woven

SENSITIVITY

88 of 185

LOW

HIGH

Bend

Sensor Type

Sandwich

VELOSTAT

Surface

EEONTEX

SENSITIVITY

89 of 185

SCALE

CONSIDERATIONS

What scale does my project require?

SMALL

Cover a small or short area

LARGE

Cover a wide or long area

Sensitivity is more of an issue here

You need to account for more resistance since the materials will go over more distance

Try to use this to your advantage as you consider construction options

90 of 185

INSPIRATION

SENSORS

TacTile (NIME) by Aranya Khurana

91 of 185

INSPIRATION

SENSORS

Crochet Interface by Mengjie Zheng

Lilytronica by Afroditi Psarra

92 of 185

INSPIRATION

SENSORS

experimental textile instruments by Michelle Vossen, Dianne Verdonk, and Roald

93 of 185

INSPIRATION

SENSORS

A Fabric That Remembers by Laura Devendorf

Pressure Tuffet by Liza Stark

94 of 185

Æ SENSATION MAP

SWATCHES

A kit of textile electronics sensors for teaching and learning created by Ieva Marija Dautartaite as her Fabricademy final project. Designed to be used in school FabLabs, this kit allows students to experiment and make more quickly with less barriers.

95 of 185

ETEXTILE SWATCH

EXCHANGE

SWATCHES

A platform for sharing physical work samples in the field of electronic textiles. The exchange wishes to emphasize the importance of physicality and quality workmanship in an increasingly digital world.

The exchange is organized by Hannah Perner-Wilson

96 of 185

Questions?

97 of 185

How do I make connections between hard and soft materials?

98 of 185

HARD TO

SOFT

CONNECTIONS

Multi-stranded wire by Kobakant

Snap breakout by Kobakant

Second Skin by Malou Beemer

FlexAbility by Anna Blumenkranz, Lara Grant, Adrian Freed

99 of 185

PERMANENT

SOLDER + SEW

  1. Curl the legs of the LED and sew them into the circuit
  2. Solder onto the fabric if possible.

Solder if you can and ALWAYS cover knots and joints with fabric or hot glue.

100 of 185

PERMANENT

SOLDERING SMD

Place a bit of solder onto the thread or fabric and back of component first, then solder them together. Use flux and tweezers to make your life easier - it takes some getting used to.

Solder if you can and ALWAYS cover knots and joints with fabric or hot glue.

101 of 185

PERMANENT

SOLDER + SEW + CRIMP

  • Use a crimp bead to connect to thread
  • Use pliers to create a sewable hole in a wire
  • Solder directly onto fabric
  • Sew the wire to the fabric
  • Sew directly into the perfboard using conductive thread

A

B

C

D

E

102 of 185

DETACHABLE

GOOD FOR PROTOTYPING

  1. Hand sewn snap + conductive thread
  2. Machine snap + bonded conductive fabric
  3. Silicon wire + safety pin
  4. Conductive thread insulated in paracord + clip with conductive tape

A

B

C

D

103 of 185

ISOLATE

PREVENT SHORTS!

  • Fabric (with iron-on adhesive)
  • Paracord
  • Beads
  • Tape
  • Embroider
  • Sew under

Always cover knots with fabric or hot glue!

A

B

C

D

E

F

104 of 185

WATCH OUT

COMMON MISTAKES

Make sure you have a strong connection. Use your multimeter to test. If sewing, make sure you go round the hole at least 3 times.

Secure loose threads. Glue knots to prevent them from fraying.

105 of 185

Questions?

106 of 185

How do I program

sensor behaviors?

107 of 185

BIG IDEAS

PROGRAMMING

  • Many (MANY) different boards
  • Program flow is sequential
  • Switches: External vs Built in resistors
  • Sensors: Voltage dividers
  • Use the serial monitor to make information visible and debug
  • 3 strategies to make data meaningful
  • Find your own debugging process

108 of 185

Microcontrollers

109 of 185

COMPUTERS

HELLO WORLD

Different computers are designed to do different things.

110 of 185

PROCESS

OUTPUT

INPUT

FEEDBACK

Take information from the physical world

//Sensors

Control output in the physical world

//Actuators

Due something to the information

111 of 185

ARDUINO

HELLO WORLD

An open-source electronics prototyping platform. It is a hardware and software.

112 of 185

LILYPAD

ARDUINO

Leah Buechley developed the first Arduino designed specifically for wearables in 2006, the LilyPad Arduino.

113 of 185

BOARDS

ARDUINO

There are many different boards you can use for an eTextiles or wearable project. The board you choose will depend on the functionality, form, and materials.

Remember: It’s best to start your project with the Arduino Uno.

LilyPad Main Board

LilyPad SimpleSnap

Adafruit

Flora

Adafruit

Gemma MO

Teensy

LC

FabriXiao

114 of 185

PIN

ARDUINO

A pin is how inputs (buttons, etc) and outputs (LEDs, speakers, etc) communicate with the Arduino.

TX/RX

//serial - transmit/receive

3 ground pins

3 power pins

// 3 volts, 5 volts, VIN ( you can plug 9 volts here)

115 of 185

PIN

ARDUINO

A pin is how inputs (buttons, etc) and outputs (LEDs, speakers, etc) communicate with the Arduino.

14 Digital I/O Pins

On Off

High Low

6 PWM pins ~

ADC

Output range of 0-255

//Use if you want to fade an LED!

6 Analog Input pins

Input range of 0-1023

116 of 185

GPIO PINS

ARDUINO

You will need to use different pins depending on the type of input and output.

Input

Output

Digital

On Off

High Low

Example:

Button

On Off

High Low

Example:

Blinking LED

Analog

Input range of 0-1023

ADC

Example:

Pressure Sensor

Output range of 0-255

PWM

Example:

Fading LED

117 of 185

PINOUT

ARDUINO

TIP: Check documentation before committing to new boards!

118 of 185

FABRIXIAO

ARDUINO

You will be using the FabriXiao, a breakout board for the Xiao ESP32-C3 developed by Adrián Torres. The examples in the next section will show a few different boards, but the concepts are the same for all. Here is excellent documentation for this board and tutorials.

119 of 185

Components + Tools

120 of 185

BOARD + CABLE

COMPONENTS+TOOLS

First Rule of Debugging

Make sure you are using a data cord NOT a power cord

121 of 185

Use solid core (on left) for breadboards and stranded for flexible soldering.

Come in different values (ring color) and wattages (size).

Use to connect out to handmade sensors and/or connect components if using a sewable board.

CORE

COMPONENTS+TOOLS

JUMPER WIRE

RESISTORS

ALLIGATOR CLIPS

122 of 185

Vertical lines are connected

Horizontal lines are connected

If you don’t have a board with sewable pins, you will need this!

BREADBOARDS

COMPONENTS+TOOLS

123 of 185

Hello, World

124 of 185

Top Toolbar

Upload

Select Board/Port

Serial Monitor

Text editor

THE IDE

PROGRAMMING

125 of 185

Side Toolbar

Sketchbook

Boards Manager

Library Manager

Message Pane

THE IDE

PROGRAMMING

126 of 185

PROGRAM

FLOW

PROGRAMMING

To program our Arduino, we give it a set of instructions (or commands) in the form of code.

  • When we click upload, the compiler translates our higher level, C++-like code to lower level machine code (i.e. binary) so the Arduino can read it.

00110010

10011000

127 of 185

PROGRAM

FLOW

PROGRAMMING

The compiler reads and runs those instructions sequentially.

  • We can use pre-made functions to guide (or control) our program’s flow based on our goal.
  • Anything in the setup() happens once.
  • Anything in the loop() happens forever.

128 of 185

THINK ABOUT IT

PROGRAMMING

Review the code right. Take a moment to think through what you think is happening in human language.

129 of 185

Premade functions like digitalWrite() allow you to perform actions on your Arduino. Sometimes they take parameters like the pin number.

BLINKING

PROGRAMMING

digitalWrite(pin, HIGH/LOW);

delay(value in milliseconds);

pinMode(pin, INPUT/OUTPUT);

130 of 185

IDE SETUP

PROGRAMMING

You must tell Arduino what board and port you are using.

  1. Plug in your board.
  2. Click the dropdown menu in the top toolbar
  3. Select your board on the right port (usually /dev/cu… on Mac and COM on PC)

You may need to do some additional set up depending on the board

If you don’t see it there, go to Tools and select the specific board and port there

131 of 185

Switches

Reading Digital Input

132 of 185

Goal

Turn on an LED if a button is pressed

133 of 185

EXTERNAL

RESISTOR

OPTION 1

Using a pull down resistor ensures it is in a high or low state so the Arduino can read it.

The standard is 10K Ohms (brown, black, orange) and is connected between GRD and the signal pin.

Switch Lead 1

Switch Lead 2

134 of 185

  • Sets up two components in variables
  • SETUP: Configures the pins as input or output
  • LOOP
    • Constantly checks the button to see if pressed or not
    • Controls the LED based on the button:
      • If the button is pressed (HIGH), it turns the LED on
      • If the button is not pressed (LOW), it turns the LED off

CODE

OPTION 1

See Examples > Digital > Blink

135 of 185

BUILT IN

RESISTOR

OPTION 2

If you don’t have resistors or extra space for one, you can use built in pull up resistors.

This will activate the internal 20K ohm resistor on a pin that connects to power. Note that this is different from pull down, which goes to ground.

Switch Lead 1

Switch Lead 2

136 of 185

BUILT IN

RESISTOR

OPTION 2

Because the resistor is attached to power instead of ground, this inverts the logic of on and off. We can change this in the code inside the conditional.

//normally on

pinMode(D2, INPUT);

HIGH LOW

//normally off

pinMode(D2, INPUT_PULLUP);

HIGH LOW

137 of 185

SETUP:

  • Uses INPUT_PULLUP to activate built in resistor.
  • TIP: Use D# not just # (e.g. D6 vs 6)

LOOP: Constantly checks the button to see if pressed or not and stores in sensorVal

  • If button is NOT pressed (sensorVal is HIGH), turn LED off (LOW)
  • If button IS pressed (sensorVal is LOW), turn LED on (HIGH)

CODE

OPTION 2

See Examples > Digital > DigitalInputPullup

138 of 185

Sensors

Reading Analog Input

139 of 185

Goal

Increase the brightness of an LED when the sensor is activated

140 of 185

The sensors we construct measure changes in resistance.

But Arduino is all digital. It cannot read changes in resistance, but it can read changes in voltage.

ARDUINO CAN’T READ RESISTANCE

SENSORS

Image from Kobakant

141 of 185

You can divide the voltage by using 2 resistors.

As the ratio between two resistors changes, the voltage you get in the between them changes.

VOLTAGE

DIVIDERS

SENSORS

This means we can send Arduino a change in voltage, which it can use!

For more on voltage dividers, see KOBAKANT’s tutorial or the Sparkfun tutorial.

Diagram from Kobakant

142 of 185

CIRCUIT

SENSORS

This is a voltage divider. We need it to translate the changes in resistance to changes in voltage for the Arduino to read it. 10K Ohms (brown, black, orange) is a standard value to use.

143 of 185

CODE

SENSORS

Review the code right. Take a moment to think about what is happening in human language.

What do you think the LED behavior will be?

144 of 185

THINK ABOUT IT

SENSORS

Unlike digital switches, analog sensors output a range of values.

But how can we make those values visible in order to do something useful, like visualize pressure using an LED?

145 of 185

SERIAL

SENSORS

Serial communication is a type of communication protocol that computers, microcontrollers, and sensors use to talk to each other.

These devices transmit and receive data by sending digital pulses back and forth at an agreed upon rate called the baud rate (usually 9600).

Technically speaking, it is a UART asynchronous serial protocol.

Image from Adafruit

146 of 185

The serial monitor makes information visible. This is very helpful to:

  • Debug your circuit or code
  • Read values
  • Lots more, but these are the most important now!

Key functions:

Serial.begin(9600);//baud rate

Serial.println(“String”);

Serial.println(pin);

Always start the serial port

Print incoming values. Use -ln to add a line break between each one

The right icon will opens the monitor, the left opens a graph

147 of 185

Questions?

148 of 185

STARTER

CODE

SENSORS

Sensor Starter Code: readSensVal_STARTER.ino

149 of 185

Depending on your sensor, the values coming in might not match the 0 to 255 range we want for the LED or another output.

We will learn 3 strategies to do this:

  • mapping()
  • constrain()
  • Smoothing

MAKING SENSE OF DATA

SENSORS

150 of 185

MAPPING

STRATEGY 1

map() maps a number from one range onto another.

35

976

0

255

map(value,35,976,0,255)

151 of 185

Find the lowest and highest values using the serial monitor:

Step 1: Change value to sensorValue

Step 2: Let your sensor rest for 10 seconds. This is your fromLow

Step 3: Press your sensor as hard as you can. This is your fromHigh

Step 4: Add 0 and 255 as the last two values

MAPPING

STRATEGY 1

map(sensorValue,fromLow,fromHigh,0,255)

152 of 185

CONSTRAIN

STRATEGY 2

constrain() keeps values within a certain range.

35

976

0

255

11

constrain(value,0,255)

-2

🚫

When we are mapping, we may get a value that throws a negative number or a value outside of the range we want. Constrain allows us to remove these values.

153 of 185

CONSTRAIN

STRATEGY 2

x: the number to constrain, all data types

a: the lower end of the range, all data types

b: the upper end of the range, all data types

constrain(x, a, b)

154 of 185

Smoothing reads input values repeatedly, stores ten in an array, then takes the average and repeats the process over again. If you have jumpy values, use this.

File > Examples > Analog > Smoothing

SMOOTHING

MEANINGFUL DATA

155 of 185

Choose one place to start:

  • Hardware
  • Software

CHECKLIST

DEBUGGING

  • Is Arduino plugged in?
  • Did I connect ground and power to the breadboard?
  • Is my LED burnt out?
  • Are my components plugged in the right way?
  • Do I have a short circuit?
  • Is my button plugged in correctly?
  • Is my switch/sensor constructed properly? (e.g. did the conductive material shift and make contact where it should not)
  • Did I use INPUT instead of INPUT_PULLUP or vice versa?
  • Do my pins match up between software and hardware?
  • Is my code implementing the commands as I expect?

156 of 185

Questions?

157 of 185

TAKEAWAYS

REVIEW

  • Keep your circuits clean. Tie up loose threads and secure them with glue to avoid short circuits.
  • Use pull down or pull up resistors with switches. Don’t forget to invert the logic with built in pull up resistors!
  • There are many strategies to make your data useful. For example, printing to the serial monitor, mapping, constraining, and smoothing.
  • Electricity Rules. (1) Electrons are lazy (2) Electricity hates waste (3) Circuits are a system
  • We can manipulate resistance in 3 ways to create custom sensors. (1) Distance (2) Contact (3) Surface area
  • Create secure connections. Be sure to test them with a multimeter.

158 of 185

Your assignment

159 of 185

See the appendix for more resources!

ASSIGNMENT

FOR NEXT WEEK

  1. Create one digital soft switch AND one analog soft sensor. Use the appendix for additional resources!
  2. Connect the switch AND sensor to Arduino. Upload a program that allows you to read the incoming values using the serial monitor. Use this sample code if you need support getting started.
    1. Extension: Use the map() or other functions to get more meaningful data.
  3. Connect your switch OR sensor to the Arduino to control a LED or mini vibration motor on a breadboard. See sample code linked above.
  4. Integrate the switch OR sensor and the output you used above in a swatch using hard-soft connections.

160 of 185

Thank You!

LIZA STARK

thesoftcircuiteer.net

161 of 185

Appendix: Resources

162 of 185

TUTORIALS

RESOURCES

163 of 185

ACCESS

(US)

MATERIALS

But where can I buy these awesome materials?

There are many other places - research!

LessEMF (NY State)

  • Good for textiles - copper taffeta, stretchy conductive, velostat

VTech Textiles (NY State)

  • Good for textiles and thread; have technitex; more on the expensive side

Shieldex (formerly Statex) (US distributor)

  • Easy to purchase in small quantities; ask about samples for educators

Adafruit (NY State)

  • Small quantities of stretch conductive fabric, non-woven Eeontex, stainless steel conductive thread (pls don’t buy velostat here)

Sparkfun (NY State)

  • Small quantities of stretch conductive fabric, non-woven Eeontex, stainless steel conductive thread (pls don’t buy velostat here)

164 of 185

ACCESS

(EU)

MATERIALS

But where can I buy these awesome materials?

There are many other places - research!

Karl Grimm (Germany)

  • The best conductive thread; comes in large cone - about $120 (with VAT and shipping) for a lifetime supply.

Bart and Francis (Belgium)

  • These people are amazing. They have a bunch of random conductive materials that may or may not change. They will not respond to inquiries about conductivity :)

Shieldex (formerly Statex) (Germany)

  • Easy to purchase in small quantities; ask about samples for educators

Bekaert

  • Good for resistive yarns and threads; *conductive wool*; have to order wholesale - look for distributors/contact rep (also presence in Georgia)

ImBut (Germany)

  • Don’t really work with their materials that much; have to order wholesale - look for distributors/contact rep

165 of 185

SUSTAINABILITY

MATERIALS

Electronics + Textiles

Two biggest producers of waste globally and consumers of resources that exploit the land and people on it.

eTextiles

Not reasonable to separate in order to recycle/reuse.

Some researchers are thinking about the whole lifecycle and designing new materials. Keep an eye here in 2024!

Best Practices for Us

Design for low/no waste

Design for separation

Learn more - a few resources are here (folder in need of an update)

166 of 185

Appendix: Switch + Sensor Diagrams

167 of 185

FABRIC

TRACES

(A) Use a low setting on the iron with no steam. (B) Place the Heat’N’Bond over the fabric, then place another piece of light fabric on top. (C) Place the iron on the fabric and hold for 7-10 seconds. (D) Let it sit and cool, then repeat if necessary. (E) Cut the fabric as you wish, then remove the backing and iron it onto your piece.

A

B

C

D

E

F

168 of 185

MOMENTARY

169 of 185

TOGGLE //SNAPS

170 of 185

TOGGLE //ZIPPER

171 of 185

STROKE

HOW TO

172 of 185

TILT

173 of 185

PRESSURE //VELOSTAT

174 of 185

PRESSURE //EEONTEX

175 of 185

BEND

176 of 185

POTENTIOMETER //KNIT

177 of 185

POTENTIOMETER //FABRIC

178 of 185

POTENTIOMETER //ANALOG TILT

179 of 185

STRETCH //FABRIC

180 of 185

STRETCH //KNIT

181 of 185

Appendix: Additional References

182 of 185

183 of 185

SENSING TEXTURES: TACTILE RESISTANCE

SWATCHES

Created by Afroditi Psarra, Sadaf Sadri, Esteban Agosin, Grace Barar, Rylie Sweem, Cindy Xu, Ruoxi Song, and Zoe Kaputa. Images from https://www.dx-softlab.com/zine

184 of 185

FLEXABILITY

SWATCHES

An e-Textile Kit For People With Limited Mobility

Flexibility created by Anna Blumenkranz, Lara Grant, and Adrian Freed. Images from http://flex-ability.org/

185 of 185

PROJECTS

WOVEN SENSORS