5. E-textiles¶
Research¶
E-textiles are textiles integrated with electronic components like sensors, conductive threads, and microcontrollers. They combine traditional fabrics with digital interactivity, allowing the textiles to respond to stimuli like movement, temperature, or pressure. These smart textiles are used in wearables, health monitoring, and interactive fashion, enabling functionalities such as lighting, data collection, and communication. E-textiles use soft, flexible materials like conductive fabrics, avoiding rigid electronics. They provide a platform for innovation across fashion, healthcare, and engineering.
For more details, visit: Electronic Textiles Overview.
get inspired!
Check out and research alumni pages to betetr understand how to document and get inspired
-
Design- Zhahia Albakri - Techwork
-
Trajectory - Ieva Maria Dautartaite
References & Inspiration¶
After watching these videos I wanted to do the same thing but I had no idea how I'd even do that plus I had no materials for that kind of thing.
This collaboration eTextile Crystallography by Rachel Freire and Melissa Coleman inspired me with its luxurious, futuristic aesthetic and focus on growing garments. Rachel Freire’s extensive work with e-textiles also heavily influenced my designs.
I referenced embroidered e-textile samples found on Pinterest to guide my approach.
- Image reference
Tools
Hardware:
- Xiao ESP32-C3 microcontroller
- SMD LEDs
- Resistors
- Push button
- Light Dependent Resistor (LDR)
- Jumper wires
Textiles and Accessories:
- Woven fabric
- Embroidery machine
- Embroidery thread
- Balloon glue dots
Other Equipment:
- Soldering machine
- Power supply (USB cable)
Process and workflow¶
-
Embroidery Design I chose a chenille heart embroidery design, which I created using an embroidery machine. This design served as the base for incorporating LEDs.
-
Soldering While the embroidery machine worked, I soldered jumper wires to the SMD LEDs to prepare them for circuit integration.
DIGITAL sensor¶
Description: A push button controlled how the LEDs lit up based on the number of clicks.
Circuit Setup:
3 SMD LEDs connected to Xiao ESP32-C3 (D1, D2, D3). Push button connected to D10. Resistors connected to the negative side of the LEDs. USB cable for power.
Key Features:
LEDs blinked, faded, or flashed in sequences based on button presses. Adjustments were made to debug and ensure unique patterns for different counts.
Code Example for digital¶
// int blue = D1, white = D2, red = D3, button = D10;
volatile int buttonCount = 0;
unsigned long lastMillis = 0;
unsigned long lastDebounceTime = 0; // Last time the button input was toggled
unsigned long debounceDelay = 200; // Debounce delay in milliseconds
int currentPattern = 0;
bool changePattern = true;
void setup() {
Serial.begin(115200);
pinMode(blue, OUTPUT);
pinMode(white, OUTPUT);
pinMode(red, OUTPUT);
pinMode(button, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(button), buttonPressed, RISING);
}
void loop() {
// Check to change the pattern every second or on button press
if (millis() - lastMillis >= 1000 ) {
if (changePattern) {
currentPattern = buttonCount; // Update current pattern only on change
Serial.println(buttonCount);
choosePattern(currentPattern);
buttonCount = 0; // Reset button count after updating the pattern
changePattern = false; // Block pattern change until next button press
}
lastMillis = millis();
}
delay(50); // Control loop speed
}
void buttonPressed() {
unsigned long currentTime = millis();
// Check if the current time is at least debounceDelay milliseconds
// past the last debounce time
if ((currentTime - lastDebounceTime) > debounceDelay) {
buttonCount++;
changePattern = true;
Serial.println(buttonCount);
lastDebounceTime = currentTime;
lastMillis = millis();
}
}
void choosePattern(int pattern) {
// Reset all LEDs before setting new pattern
digitalWrite(blue, LOW);
digitalWrite(white, LOW);
digitalWrite(red, LOW);
switch (pattern) {
case 1:
// Light Show 1: Blue - Blinking
for (int i = 0; i < 3; i++) {
digitalWrite(blue, HIGH);
delay(200);
digitalWrite(blue, LOW);
delay(200);
}
break;
case 2:
// Light Show 2: White - Fade In and Out
for (int brightness = 0; brightness < 255; brightness += 5) {
analogWrite(white, brightness);
delay(20);
}
for (int brightness = 255; brightness >= 0; brightness -= 5) {
analogWrite(white, brightness);
delay(20);
}
break;
case 3:
// Light Show 3: Red - Quick Flash
digitalWrite(red, HIGH);
delay(100);
digitalWrite(red, LOW);
delay(100);
digitalWrite(red, HIGH);
delay(100);
digitalWrite(red, LOW);
break;
case 4:
// Light Show 4: Blue and White - Alternating
for (int i = 0; i < 4; i++) {
digitalWrite(blue, HIGH);
delay(500);
digitalWrite(blue, LOW);
digitalWrite(white, HIGH);
delay(500);
digitalWrite(white, LOW);
}
break;
case 5:
// Light Show 5: White and Red - Simultaneous Blink
for (int i = 0; i < 3; i++) {
digitalWrite(white, HIGH);
digitalWrite(red, HIGH);
delay(300);
digitalWrite(white, LOW);
digitalWrite(red, LOW);
delay(300);
}
break;
case 6:
// Light Show 6: Blue - Pulse Fade In and Out
for (int brightness = 0; brightness < 255; brightness += 10) {
analogWrite(blue, brightness);
delay(30);
}
for (int brightness = 255; brightness >= 0; brightness -= 10) {
analogWrite(blue, brightness);
delay(30);
}
break;
case 7:
// Light Show 7: Red and White - Running Lights
for (int i = 0; i < 6; i++) {
digitalWrite(red, HIGH);
delay(150);
digitalWrite(red, LOW);
digitalWrite(white, HIGH);
delay(150);
digitalWrite(white, LOW);
}
break;
case 8:
// Light Show 8: All LEDs - Flash Together
for (int i = 0; i < 3; i++) {
digitalWrite(blue, HIGH);
digitalWrite(white, HIGH);
digitalWrite(red, HIGH);
delay(500);
digitalWrite(blue, LOW);
digitalWrite(white, LOW);
digitalWrite(red, LOW);
delay(500);
}
break;
case 9:
// Light Show 9: All LEDs - Strobe Effect
for (int i = 0; i < 10; i++) {
digitalWrite(blue, HIGH);
digitalWrite(white, HIGH);
digitalWrite(red, HIGH);
delay(100);
digitalWrite(blue, LOW);
digitalWrite(white, LOW);
digitalWrite(red, LOW);
delay(100);
}
break;
case 10:
// Light Show 10: Red - Slow Glow
for (int brightness = 0; brightness < 255; brightness += 3) {
analogWrite(red, brightness);
delay(50);
}
for (int brightness = 255; brightness >= 0; brightness -= 3) {
analogWrite(red, brightness);
delay(50);
}
break;
default:
// Default Light Show: All LEDs Sequential Blink
int leds[] = {blue, white, red};
for (int led = 0; led < sizeof(leds)/sizeof(leds[0]); led++) {
digitalWrite(leds[led], HIGH);
delay(250);
digitalWrite(leds[led], LOW);
}
break;
}
}
ANALOG¶
Description: An LDR (light-dependent resistor) replaced the push button. LED brightness and blinking speed adjusted based on light intensity.
Circuit Setup:
3 SMD LEDs connected to D1, D2, D3 on the Xiao ESP32-C3. LDR connected to A0. Resistor and power supply (USB cable).
Code Example for analog¶
```
// int blue = D1, white = D2, red = D3;
// Ensure these are PWM capable for analogWrite
void setup() { Serial.begin(115200); pinMode(blue, OUTPUT); pinMode(white, OUTPUT); pinMode(red, OUTPUT); }
void loop() { int sensorValue = analogRead(A0); // Read the value from the analog sensor int brightness = map(sensorValue, 600, 4095, 0, 255); // Map the sensor value to brightness int flashDelay = map(sensorValue, 600, 4095, 1000, 100); // Map the sensor value to flash delay (slower to faster)
{ // Update LED with new brightness and flashing rate updateLED(blue, brightness, flashDelay); updateLED(white, brightness, flashDelay); updateLED(red, brightness, flashDelay);
delay(50); // Short delay to stabilize loop and reduce sensor reading frequency } }
void updateLED(int ledPin, int brightness, int flashDelay) { analogWrite(ledPin, brightness); // Set the brightness delay(flashDelay); // Wait for the flash delay duration analogWrite(ledPin, 0); // Turn off the LED delay(flashDelay); // Wait for the flash delay duration again }
- Final Assembly Used balloon glue dots to secure the wires at the back of the fabric, ensuring they didn’t touch or shift. Tested both circuits to confirm proper functionality and aesthetics.
Challenges and Learnings¶
Soldering: Soldering SMD LEDs for the first time was challenging due to their small size. After some trial and error, I managed to solder them correctly. Coding: Debugging the code for the digital sensor was time-consuming, as the LED patterns initially did not change. Adjusting the debounce timing and button logic solved the issue. Power Supply: I used a USB connection as I lacked a battery capable of powering all LEDs simultaneously.