Wearables¶
Inspiration & Ideation¶
I have always been interested in exploring unique ways of working with light and color, so during this week's global lecture, I was closely watching the examples of integrating lighting into fashion. I was most drawn to fiber optics, or other linear lighting solutions, to create organic swopping light clusters, but weaving lighting into textiles was also of interest to me.
Applications of lighting in fashion (slide 40, Liza Stark)
Fiber optics in textile (slide 54, Liza Stark)
Having previously worked with handmade enamel wire electromagnets and Arduino-controlled MOSFET power delivery for SMAKS, a kinetic sculpture, I knew that making electromagnets and speakers could be a finicky, time-consuming, process.
Handmade electromagnet coils with Arduino-controlled timing (SMAKS documentation)
In order to keep the week simple and follow my interests in lighting, I decided to stick to LEDs and premade actuators for my swatches. I also tried to keep my hard-soft connection wiring as minimal as possible, so I chose not to use speaker amplifiers and motor drivers, which would have added extra data lines to sew and/or make pads for.
Tools¶
- Microcontroller: Seed Studio Xiao ESP32-C3 with FabriXiao breakout
- Soldering setup: soldering iron, fume extractor, solder, flux
- Programming environment: Arduino IDE
- Vector editor for circuit diagrams: Affinity Designer 2
Prep & Power Circuit¶
After the global lecture on Tuesday, I started to prep for the week by putting together a FabriXiao board and creating my paper power circuit. Our lab reviewed a shipment of unpopulated FabriXiao PCBs and had ESP32-C3, RP2040, and SAMD21 variants of the Seeed Studio Xiao lying around from Fab26. Checking the FabriXiao documentation1, I learned that only the ESP32-C3 and RP2040 Xiao boards were compatible with the carrier, and since the RP2040 lacked onboard battery management1, I moved forward with the ESP32-C3. I didn't have much experience with and soldering, so I thought that running both the FabriXiao and Xiao pads, then applying flux and heating, would increase my chances of getting a solid connection. When I put the board together, I couldn't tell if the solder on the Xiao side was melting, and the tinned pads left a gap between the boards. After soldering, I checked continuity between the Xiao pads and their corresponding FabriXiao pads using a multimeter.
I wasn't sure why we were making our power circuits with copper tape on paper. despite this, I moved forward with replicating the circuit from Liza Stark's global lecture2. I folded the copper tape over itself when making 90° turns, and although I found that the tape had continuity through its adhesive backing, I soldered the joints between two tape pieces. I used different model of transistor (RFP30N06LE) than the recommendation, but it had the same pinout and worked for my use case. In order to reduce that chances my cardstock backing burning during the soldering process, I added flux to the tape before tinning it with solder, which helped the solder to melt and flow faster.
Power circuit diagram (slide 101, Liza Stark)
Actuator Swatches¶
For both of my actuator swatches, I used 10x10cm squares of rigid felt as the base and stuck two 4x1.25cm pieces of conductive fabric tape to the top edge as pads for alligator clips. I could then sew along the conductive fabric and down onto the main felt area to create my circuits.
I incorporated current limiting resistors into my swatches to allow them to be powered directly off the FabriXiao's pins, but in the end, I hooked both up to the paper power circuit using the FabriXiao's high current 5V rail as the power source. My actuators were designed for 3V power, so without the Xiao's 3.3V output exposed on the FabriXiao breakout, the resistor were still helpful for safely powering components off 5V.
LED Filament¶
We had a few 3V red LED filaments/noodles in the lab, so I decided to make a swatch with an organic squiggle of light. Having worked with LED filaments in the past, I knew that they lacked any form of protection and needed to be powered carefully. Ideally, they should be powered with constant current drivers rather than a standard constant voltage power source, but small drivers are hard to find. Since I last worked with LED filaments, Adafruit has released a small constant current boost converter for LEDS, but the simpler alternative is to use a current limiting resistor. I previously used high wattage resistors to reduce heat buildup, but this week, I just used a standard ¼W 47Ω resistor to limit the current to below 50mA on the FabriXiao's 5V power. Testing with alligator clips and the Arduino "fade" example sketch, the filament pulsed but was quite dim with visible diodes. I thought the low brightness might have something to do with the thick orange phosphor coating on the filament, so I moved on to sewing the circuit.
Once I had the swatch circuit sewn, I stopped working on it and moved onto testing and making the other components for the week, leaving the conductive switching exposed on the back and the edges of the conductive tape pads unfinished. If I had more time, I would have sewn a second piece of felt around the edges of the swatch to cover the back, and in the process, worked my way around the edges of the pads for a more durable result.
I ended up testing the filament swatch using my paper power circuit with the FabriXiao's 5V rail as the power source to reduce the potential for overdrawing from the output pins. As expected, the filament glowed nicely. I had used black thread to tack a few points on the filament down to the black felt base, so the thread created divisions in the light. I had thought about matching the thread color to the light and decided against it, but I would probably use clear monofilament or color-matched thread in the future.
LED filament swatch demo
Haptic Motor¶
I wanted to power a single haptic motor directly off the FabriXiao. We had 3V rated (1.5V-3.7V), 85mA motors in the lab, so I initially planned to use a 47Ω current-limiting resistor. Running the Arduino "fading" example sketch, the motor produced a noticeable ramp up in vibration, even with limited power. When pressed against the tabletop, the vibration became almost unnoticeable though, so I needed to a swatch material that would allow the vibration to be felt. I tested cutting a slot into the thickness of a piece of foam packaging and found that, with the motor inside the foam, the entire piece vibrated. This meant that for my swatch, I could simply encase the foam in felt and add conductive pads.
When I tested the final swatch powered directly off the FabriXiao's ouput pins, the vibrations were noticeable but not strong enough to capture on video. However, using the paper power circuit with the FabriXiao's 5V rail as the power source, the vibrations became much stronger.
Haptic motor swatch demo (raise volume)
Microcontroller Swatch (Jessica Stanley Tutorial)¶
I wasn't sure about what type of wearable to create for my microcontroller swatch, but when I tested diffusing NeoPixels with white TPU and ripstop nylon fabrics during Jessica Stanley's tutorial, I liked the visual effect and started thinking about a clip-on light for outdoor use that would always turn on when secured to clothes/bags. I didn't have time to properly design a water-resistant enclosure or work with diffusion, so I treated the swatch as just an opportunity to test a sewn version of the circuit.
Fabrication¶
Testing¶
When I went to test my swatch, I was able to get the NeoPixels lit but the snap switch just didn't work. In the serial monitor, I always got a reading of 1 (closed), no matter what state the snap was actually in. Testing continuity with a multimeter, I found no continuity with the snap open and continuity when closed, so the switch itself worked and I knew that there had to be an issue elsewhere in the circuit. I tried checking resistance between different points on the circuit and microcontroller and found that there was always a high resistance, around 0.9MΩ, between areas that should have had no continuity, which was likely due to the microcontroller's internal wiring. Hooking up by soft button from the E-Textiles week, I measured the same resistance but still managed to get usable open and closed readings on the serail monitor. Using the external button in place of the snap, I got my code working as if I had the functional integrated switch.
Code¶
I used Adafruit's NeoPixel "strandtest" example code as the basis for my own so I could make use of the rainbow color mode. After setting my NeoPixel pin/count and adding definitions for the snap pin/state, I removed all of the color functions except for the one I needed. I wanted the lights to come on whenever the snap was closed and stay off when open, so I added an if statement to run the rainbow lighting when the switch was on and an else statement to clear the strip in any other situation. The example code called on the function rainbow(), defined later in the sketch, which, once started, would run endlessly without exiting, preventing the snap state from ever being checked again. The function was pretty simply, so I just moved it directly into the if statement and added a check of the snap state within the loop.
// A basic everyday NeoPixel strip test program.
// NEOPIXEL BEST PRACTICES for most reliable operation:
// - Add 1000 uF CAPACITOR between NeoPixel strip's + and - connections.
// - MINIMIZE WIRING LENGTH between microcontroller board and first pixel.
// - NeoPixel strip's DATA-IN should pass through a 300-500 OHM RESISTOR.
// - AVOID connecting NeoPixels on a LIVE CIRCUIT. If you must, ALWAYS
// connect GROUND (-) first, then +, then data.
// - When using a 3.3V microcontroller with a 5V-powered NeoPixel strip,
// a LOGIC-LEVEL CONVERTER on the data line is STRONGLY RECOMMENDED.
// (Skipping these may work OK on your workbench but can fail in the field)
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1:
#define LED_PIN D4
// How many NeoPixels are attached to the Arduino?
#define LED_COUNT 5
// Declare our NeoPixel strip object:
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
// Argument 1 = Number of pixels in NeoPixel strip
// Argument 2 = Arduino pin number (most are valid)
// Argument 3 = Pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
int snapPin = D8; // pin location of switch
int snapState = 0; // store snap closure state (0,1)
// setup() function -- runs once at startup --------------------------------
void setup() {
// These lines are specifically to support the Adafruit Trinket 5V 16 MHz.
// Any other board, you can remove this part (but no harm leaving it):
#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
clock_prescale_set(clock_div_1);
#endif
// END of Trinket-specific code.
strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
strip.show(); // Turn OFF all pixels ASAP
strip.setBrightness(50); // Set BRIGHTNESS to about 1/5 (max = 255)
}
// loop() function -- runs repeatedly as long as board is on ---------------
void loop() {
snapState = digitalRead(snapPin); // store current snap state
if (snapState == 1) {
// Hue of first pixel runs 5 complete loops through the color wheel.
// Color wheel has a range of 65536 but it's OK if we roll over, so
// just count from 0 to 5*65536. Adding 256 to firstPixelHue each time
// means we'll make 5*65536/256 = 1280 passes through this loop:
for(long firstPixelHue = 0; firstPixelHue < 5*65536; firstPixelHue += 256) {
// strip.rainbow() can take a single argument (first pixel hue) or
// optionally a few extras: number of rainbow repetitions (default 1),
// saturation and value (brightness) (both 0-255, similar to the
// ColorHSV() function, default 255), and a true/false flag for whether
// to apply gamma correction to provide 'truer' colors (default true).
strip.rainbow(firstPixelHue);
// Above line is equivalent to:
// strip.rainbow(firstPixelHue, 1, 255, 255, true);
strip.show(); // Update strip with new contents
delay(20); // Pause for a moment
// main change to Adafruit strandtest.ino example: continuously check snap state and exit loop if not closed
snapState = digitalRead(snapPin);
if (snapState != 1) {
exit(0);
}
}
}
// if snap is not closed, keep the light strip blank/off
else {
strip.clear();
}
}
Results¶
Testing with the external button in place of the snap switch, the rainbow lighting came on with the button held down, and when released, turned off after a short delay to complete the light frame.
Microcontroller swatch demo with external soft button
When I disconnected the button, I noticed that the lights came on just from the alligator clips touching the input pad. The lights also came on when I touched the pad with my finger, so I had somehow accidentally made a capacitive touch sensor using the FabriXiao's GPIO pads.
Accidental capacitive touch switch
Just as I did with the LED filament swatch, I stopped working on my microcontroller swatch once I had finished the conductive sewing. I left the back conductive stitching exposed and didn't sew down the snap strap or isolation patch. Since I was just treating the swatch as a proof-of-concept for the circuit itself, it served its purpose, but I had to be careful when handling the piece and disconnecting the snap.
Reflection & Thinking Towards the Future¶
Using one of these content weeks to test out one aspect of a more involved project, in this case the soft circuit for a diffused, water-resistant safety light, could be an approach to continue using in this program. I found it helpful to narrow the scope of my work to something more manageable for the week while still maintaining a connection to my more creative concept.
There were a lot of deliverables to fit into this week, so I tried to keep my work as simple as possible. Even though the concepts for the week were easy to grasp and I kept my circuits simple, I wasn't able to get everything done and left some of my samples with unfinished edges after completing the circuits. Just sewing a single line with the conductive thread could take up to an hour, and I'm still not sure why.
I would like to shift from Arduinos to ESP32-based microcontrollers for networked smart lighting applications, so although my first experience with the Xiao produced unexpected results, I plan to try working with the boards again. I suspect that my handheld SMD soldering of the Xiao to the FabriXiao breakout just wasn't great and possibly caused issues with a few pins.














