9. Wearables¶
Research¶
Vocab (Definitions shared by Liza Stark)
- Coil: winding a material in a sequence of rings or other shapes
- Diode: a component that allows electricity to flow in one direction only
- Electromagnet: A temporary magnet by running current through a wire. This is called an electromagnet.
- Enamel wire: Thin wire with insulated enamel coating
- Fiber Optics: Light shines in one end, travels down the strand, and emerges at the other end. There is a clear internal core and an external coating called cladding. The quality of the fiber determines how much the light will degrade over distance.
- LED: light emitting diode
- Permanent magnet: a magnet that retains its magnetic properties in the absence of an inducing field or current.
- Shape memory alloys (SMAs): metals that change shape when they are heated to a certain temp. They behave like regular metals when cool and return to preset shape when heated.
- Thermochromic Ink: pigments change from one state to another in the presence of heat.
This week was focused on actuators (i.e., the output) of e-textiles. This includes (but is not limited to!):
Actuator Type | Other Details | Photo | Other Details |
---|---|---|---|
Speakers | Can be created by spiraling conductive material to fabric, running current through it (w/ input from Arduino or other computer) & then activated with permanent magnets | Folding Frequencies by EJ Tech (See video here) | |
Lights | Includes LEDs, Neopixels (RGB LEDs with drivers embedded in a chip), fiber optics | Fiber Optic Dress by Zac Posen | |
Flipping Beads | By Creating a Coil and putting a (permanent) magnetic bead inside, we can flip the bead by changing the current (and thus charge) of the circuit | Flip-Dot Fabric by KobaKant | |
Heating | Includes using Theromchromic Ink which changes color when heat is added, but also includes heat pads | "Heat embedded under garment to soothe menstrual cramps on-the-go" made by Olivia Cueva | |
Shape Memory Alloys (SMA) | SMAs change shape when heated to a certain temperature, so we can use fleixnol (SMA thread) to contract & thus change shape of the fabric it is sewn in | SMA Smocking by KobaKant |
Other Things I learned * Don't test your LED on the 5V battery
This week I was mostly focused on fabric speakers because I was so blown away learning about them. In her lecture, Liza included some information I found very useful on how to optimize the fabric speakers.
- Coil Tightness: Tighter coil = louder volume (because it has a stronger magnetic field)
- *Material: Stiffer fabric = louder volume (because the waves are vibrating off the material)
- Magnet Size: Larger magnet = louder volume
- Magnet Placement: Closer magnet is to center = louder volume
References & Inspiration¶
KobaKant, Olivia Cueva
ADD INSPO
Tools¶
- Copper tape
- Diode
- Mosfet transistor
- 9V battery
- Crocodile clips
- Arduino and/or Fabrixiao
- Soldering Iron
- Enameled copper wire
- Magnets
- Computer
Process and workflow¶
Build paper circuit¶
First I built this circuit copied from guidance by Liza Stark in her lecture. This allows us to power the circuit with a 9V battery while using the input from the Arduino. The diode allows the electricty to only flow in one direction, while the transistor is "as an electrical switch. By applying a small amount of voltage to the gate using the Arduino, current can flow between the drain and the source" as defined by Liza Stark.
In my version I didn't include the resistor because we didn't have this one and we thought it wasn't necessary with the transistor we were using. However, both Jeanne and my transistor's stopped working a few days in, so its possible it was necessary.
Testing Actuators¶
Vibrating Bead¶
I tested out the circuit using this vibrating actuator. I attached it in the circuit and tested it with the blinking sketch from Arduino. This would be a really cool option as an actuator for blind users to indicate when they approach something.
Headphone Speaker¶
I took off the cover of this headphone speaker to expose the wires and the speaker. I attached it in the circuit and tested it with the blinking sketch from Arduino. Then I found code online (HERE ADD LINK) for the Game of Thrones theme song and experimented with that. You can see in the first video the way the speaker vibrates.
ADD PHOTO
Blinking code:
Game of Thrones code:
Moving Coil¶
To understand how a fabric speaker would work, we connected a coil of enameled copper wire to the circuit, but not yet attached to fabric. We put a magnet in the center and saw how it was moved by the current with the blinking code. This illustrates how the sound is made in a fabric speaker, because the coil "tries" to move, but it is locked against fabric and is forced to vibrate against the fabric.
Fabric Speaker¶
I made 3 fabric speakers. Two with thin covered coper wire (red) and one with thicker copper wire covered in purple. I experimented with the 3 types to see if I could amplify the sound, however they all seemed pretty similar to me in terms of volume.
The first one was a spiral, not particularly tight with this thin red wire. Turn up the volume on the video, its quite quiet
Then I tried a tighter sprial with the same wire. Then I tried again with this purple wire, both tighter and longer. But I didn't really see a difference between them.
Flip Dot¶
ADD VIDEO
For the flip dot, I followed the instructions from Liza Stark's lecture. I created a coil, sewed it into some fabric, soldered the exposed ends of the wire into some copper tape and loosely sewed a magnet into the coil. Unfortunately we didn't have any magnetic beads so I had to make do with the magnet though it doesn't stay as solidly centered as a bead and requires a bit of fiddling.
But I found this experiment really cool because its so simple and you can clearly see how the changing of the direction of the current (done by putting (+) of battery on one end of the coil and (-) on the other and then swapping) creates a magnetic field that attracts/repels the magnet.
Fully Fabric Actuator¶
I didn't get a chance to finish this piece (I hope soon)! But I wanted to build the paper circuit above fully on fabric with a matching fabric speaker and use a pressure sensor to change the output on the fabric speaker. To have a practically fully soft circuit and use some of the code I wrote during the E-Textiles week
I cut out conductive fabric on a laser cutter for both the circuit and the speaker with the settings below.
Power: 55 Speed: 20
I wrote the code below to pick up on the amount of pressure put onto the pressure sensor and speed up or slow down the output music. Soon to be tested!
FabricXiao¶
I soldered and tried my fabric speaker with the FabriXiao, but unfortunately it didn't work. I'm still not sure why. I connected the circuit in the exact same way and I was able to use the headphone speaker with the FabriXiao, but not the fabric speaker. I used the same battery and circuit as I did with Arduino, so there's some other aspect I don't understand.
Blinking Code (Built-in Arduino Sketch)¶
Use the three backticks to separate code.
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Game of Thrones Song¶
Source: https://github.com/hibit-dev/buzzer/blob/master/src/movies/game_of_thrones/game_of_thrones.ino
Use the three backticks to separate code.
// -------------------------------------------------
// Copyright (c) 2022 HiBit <https://www.hibit.dev>
// -------------------------------------------------
// Source: https://github.com/hibit-dev/buzzer/blob/master/src/movies/game_of_thrones/game_of_thrones.ino
#include "pitches.h"
#define BUZZER_PIN 9
int melody[] = {
NOTE_G4, NOTE_C4, NOTE_DS4, NOTE_F4, NOTE_G4, NOTE_C4, NOTE_DS4, NOTE_F4,
NOTE_G4, NOTE_C4, NOTE_DS4, NOTE_F4, NOTE_G4, NOTE_C4, NOTE_DS4, NOTE_F4,
N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16, 8, 8, 16, 16,
8, 8, 16, 16, 8, 8, 16, 16,
8, 8, 16, 16, 8, 8, 16, 16,
4, 4,
16, 16, 4, 4, 16, 16,
1,
4, 4,
16, 16, 4, 4,
16, 16, 1,
4, 4,
16, 16, 4, 4, 16, 16,
1,
4, 4,
16, 16, 4, 4,
16, 16, 1,
4, 4,
16, 16, 4, 4, 16, 16,
2,
4, 4,
8, 8, 8, 8,
1,
2,
2,
2,
2,
2,
4, 4,
1,
2,
2,
2,
2,
2,
4, 4,
8, 8, 16, 16, 8, 8, 16, 16,
8, 8, 16, 16, 8, 8, 16, 16,
4, 16, 16, 8, 8, 16, 16,
8, 16, 16, 16, 8, 8, 16, 16
};
void setup()
{
pinMode(BUZZER_PIN, OUTPUT);
}
void loop()
{
int size = sizeof(durations) / sizeof(int);
for (int note = 0; note < size; note++) {
//to calculate the note duration, take one second divided by the note type.
//e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
int duration = 1000 / durations[note];
tone(BUZZER_PIN, melody[note], duration);
//to distinguish the notes, set a minimum time between them.
//the note's duration + 30% seems to work well:
int pauseBetweenNotes = duration * 1.30;
delay(pauseBetweenNotes);
//stop the tone playing:
noTone(BUZZER_PIN);
}
}
MoonLight Sonata Pressure Code (NOT YET TESTED)¶
// -------------------------------------------------
//
// -------------------------------------------------
// Adapted from https://github.com/hibit-dev/buzzer/blob/master/src/movies/game_of_thrones/game_of_thrones.ino
#include "pitches.h"
#define BUZZER_PIN 9 //output
#define PRESSURE_PIN A5 // input
#define analog_sensor_value
int analog_sensor_value = 0;
int melody[] = {
NOTE_A4, NOTE_D5, NOTE_F5
};
int durations[] = {
};
void setup()
{
pinMode(BUZZER_PIN, OUTPUT);
pinMode(PRESSURE_PIN, INPUT);
Serial.begin(9600);
}
void loop()
{
//input
//when editing, review what "normal" sensor value is and what the range is
analog_sensor_value = analogRead(A5);
Serial.println(analog_sensor_value);
delay(100);
//----> SD note:
//from what I remember value>350 = no pressure not connected, <350 = pressure + connected
//so I need to make inverse function, standard pace lets set at 12 (i.e., 1/12)
// range = 8 - 24 note
// review range of inputs, for now do discrete
// prob want to do something like 350 ---> 12, 450 --> 8, 250 ---> 16
//Option 1
/*if (analog_sensor_value> 350) {
int duration_fraction = 12
}
else {
int duration_fraction = 16
}
*/
//Option 2
float duration_fraction = 4000 / analog_sensor_value
//output
int size = sizeof(melody) / sizeof(int); From old game of thrones code, not sure what sizeof(int) does
for (int note = 0; note++) {
//to calculate the note duration, take one second divided by the note type.
//e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
int duration = 1000 / duration_fraction;
tone(BUZZER_PIN, melody[note], duration);
//to distinguish the notes, set a minimum time between them.
//the note's duration + 30% seems to work well:
int pauseBetweenNotes = duration * 1.30;
delay(pauseBetweenNotes);
//stop the tone playing: ----> SD note: do I need this?
//noTone(BUZZER_PIN);
}
}
Fabrication files¶
-
File: Laser Cut Circuit + Speaker ↩