Skip to content

5. E-textiles

Research 𝜗𝜚

E-textiles, are fabrics that integrate electronic components such as conductive threads, sensors, LEDs, and microcontrollers directly into the material, allowing textiles to sense, respond, and interact with their environment. Unlike traditional electronics that are attached to clothing as separate devices, e-textiles are embedded into the structure of the fabric itself.

Electronics basics 𓂃˚₊⊹

This is everything I needed to know to start experimenting with electronics:

By Samantha Sánchez, 2025

A microcontroller (the one on the photo above) is a small electronic “brain” used to control objects or interactive systems. It receives information through inputs (such as buttons or sensors), processes it using a program, and generates a response through outputs (such as lights, motors, or sounds). All of this happens within a single chip that integrates a processor, memory, and connection pins (the tiny wholes called "D0, D1, D2,...")

The one we used it´s the seeed XIAO-RP2040.

During this project, I learned to work with Arduino IDE programming. Arduino is a hardware and software platform used to create interactive projects. Essentially, it allows physical objects to sense, process, and respond.

I downloaded Arduino in order to use the microcontroller. It´s important to add Seeed Studio XIAO RP2040 board package to your Arduino IDE, to do this go to:

File > Preferences, and fill Additional Boards Manager URLs with the url below:

https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json 
Go to Tools-> Board-> Boards Manager..., type the keyword "RP2040" in the searching blank. Select the lastest version of "Raspberry Pi Pico/RP2040" and install it.

Also i added new libraries, Arduino libraries are collections of pre-written code that simplify the use of electronic components.

On my list of materials i had NeoPixels, a NeoPixel is an individually addressable RGB LED that can display a wide range of colors.The Adafruit NeoPixel library allows me to control individually addressable RGB LEDs using Arduino. Through this library, I can easily change colors, brightness, and create visual responses using a single data pin

This is how i downloaded it: Library-> searchbar "Adafruit NeoPixel"-> install

You can download many more libaries depending on your components.

Select your board and the port of the information before start working:

To connect the Xiao use a data wire.

To upload your code to the microcontroller you first need to verify it and send it:

✴︎𓊆References & Inspiration𓊇˳✧༚

The inspiration for my project came from the concept and aesthetics of altars dedicated to the Virgin of Guadalupe that can be found on the street or in some homes in Mexico. Mexico is a highly Catholic country, and many people are very devoted to this figure. These altars often incorporate some type of LED lights as decoration, and I have sometimes noticed that those LED lights are accompanied by a small speaker playing Christmas music or carols. I am not religious; however, these images are very common and part of everyday life where I live, so I took inspiration from them.

  1. Mexico shrine, Lettie, lettiemusic, 2012
  2. Mexico Shrire, unknown author, Via Pinterest
  3. Mexico Shrire, unknown author, Via Pinterest
  4. How to Sew an Electronic Circuit, rmarchesi, Instructables
  5. Let’s Put LEDs in Things!, Phillip Burgess, adafruit

Heart ♡

Tools

  • Thinkercad
  • Felt
  • Thread & niddle
  • LEDs
  • Copper tape
  • Resistors 1/4 w
  • Battery switch
  • Cable jumpers
  • Soldering iron and tin

Process and workflow

I started by cutting a piece of felt into a heart shape and sewing a piece of lace around it; this became my base line for designing the circuit.

By Samantha Sánchez, 2025

Circuit simulated in Tinkercad:

Actual circuit:

By Samantha Sánchez, 2025

I used a battery with a switch as the power source and tried to place one LED at each point of the heart. As conductive materials for the circuit, I used a combination of copper tape and electrical wires, joining them with solder. It was truly a process of trial and error with the materials I had available.

Altar

†། ͝ ݁ ︶♱︶ ݁ ͝ །†

Tools

  • Arduino IDE
  • Felt
  • Thread & niddle
  • LEDs with resistor
  • Copper tape
  • Cooper wire
  • Lilypad
  • Seeed XIAO-RP2040
  • USB data wire
  • Computer
  • Embroidery hoop
  • Soldering iron and tin

Process and workflow

I started by making my sketch, traced it onto the felt, adjusted it in my embroidery hoop, and embroidered my design.


By Samantha Sánchez, 2025


Code

I started by generating my code by writing a detailed prompt on Chat GPT describing what I wanted to happen: a light blinking to the rhythm of a song, like a nativity set.

1. Generate a COMPLETE Arduino sketch that plays a simple “nativity-style” melody on a passive buzzer using tone(), and at the same time makes ONE single LED blink with each note.
2. Buzzer on digital pin 7.
3. LED on A0 (used as a digital output).
4. Define constants for 4th-octave notes (DO, RE, MI, F#4, G4, A4, B4) with their corresponding frequencies.
5. Structure the loop() into 3 sections or “Phrases” (A, B, C), like a short song.
6. For each note: alternate the LED between HIGH and LOW so the blinking is synchronized with the melody.
7. Use delays with durations similar to: 300–450 ms per note, plus pauses between phrases.
8. At the end of each phrase: use noTone(buzzer) followed by a resting delay.
9. At the end of phrase C: turn the LED off and add a longer resting delay before repeating.

This was the result:

// --- CÓDIGO: Melodía tipo nacimiento con un solo LED (A0) ---
// Buzzer: pin 7
// LED: A0 (parpadea con la melodía)

#define BUZZER_PIN 7
#define LED_PIN A0

// Notas (4ª octava)
#define NOTE_DO  262   // C4
#define NOTE_RE  294   // D4
#define NOTE_MI  330   // E4
#define NOTE_FS4 370   // F#4
#define NOTE_G4  392   // G4
#define NOTE_A4  440   // A4
#define NOTE_B4  494   // B4

void setup() {
  pinMode(LED_PIN, OUTPUT);
  pinMode(BUZZER_PIN, OUTPUT);
}

void loop() {
  // --- Frase A ---
  digitalWrite(LED_PIN, HIGH); tone(BUZZER_PIN, NOTE_G4); delay(350);
  digitalWrite(LED_PIN, LOW);  tone(BUZZER_PIN, NOTE_A4); delay(350);
  digitalWrite(LED_PIN, HIGH); tone(BUZZER_PIN, NOTE_B4); delay(450);
  digitalWrite(LED_PIN, LOW);  tone(BUZZER_PIN, NOTE_A4); delay(300);
  digitalWrite(LED_PIN, HIGH); tone(BUZZER_PIN, NOTE_G4); delay(450);
  digitalWrite(LED_PIN, LOW);  tone(BUZZER_PIN, NOTE_MI); delay(350);
  digitalWrite(LED_PIN, HIGH); tone(BUZZER_PIN, NOTE_RE); delay(300);
  digitalWrite(LED_PIN, LOW);  tone(BUZZER_PIN, NOTE_DO); delay(600);
  noTone(BUZZER_PIN);
  delay(500);

  // --- Frase B ---
  digitalWrite(LED_PIN, HIGH); tone(BUZZER_PIN, NOTE_MI);  delay(300);
  digitalWrite(LED_PIN, LOW);  tone(BUZZER_PIN, NOTE_G4);  delay(350);
  digitalWrite(LED_PIN, HIGH); tone(BUZZER_PIN, NOTE_A4);  delay(350);
  digitalWrite(LED_PIN, LOW);  tone(BUZZER_PIN, NOTE_G4);  delay(350);
  digitalWrite(LED_PIN, HIGH); tone(BUZZER_PIN, NOTE_FS4); delay(300);
  digitalWrite(LED_PIN, LOW);  tone(BUZZER_PIN, NOTE_MI);  delay(350);
  digitalWrite(LED_PIN, HIGH); tone(BUZZER_PIN, NOTE_RE);  delay(300);
  digitalWrite(LED_PIN, LOW);  tone(BUZZER_PIN, NOTE_G4);  delay(700);
  noTone(BUZZER_PIN);
  delay(600);

  // --- Frase C ---
  digitalWrite(LED_PIN, HIGH); tone(BUZZER_PIN, NOTE_G4);  delay(300);
  digitalWrite(LED_PIN, LOW);  tone(BUZZER_PIN, NOTE_A4);  delay(300);
  digitalWrite(LED_PIN, HIGH); tone(BUZZER_PIN, NOTE_B4);  delay(400);
  digitalWrite(LED_PIN, LOW);  tone(BUZZER_PIN, NOTE_A4);  delay(300);
  digitalWrite(LED_PIN, HIGH); tone(BUZZER_PIN, NOTE_G4);  delay(450);
  digitalWrite(LED_PIN, LOW);  tone(BUZZER_PIN, NOTE_MI);  delay(300);
  digitalWrite(LED_PIN, HIGH); tone(BUZZER_PIN, NOTE_G4);  delay(450);
  digitalWrite(LED_PIN, LOW);  tone(BUZZER_PIN, NOTE_A4);  delay(350);
  digitalWrite(LED_PIN, HIGH); tone(BUZZER_PIN, NOTE_G4);  delay(800);
  noTone(BUZZER_PIN);
  digitalWrite(LED_PIN, LOW);
  delay(1200);
}

Circuit

By Samantha Sánchez, 2025

This is how it sounds:

Velostat ⊹﹏﹏﹏⊹

  • Arduino IDE
  • Felt
  • Velostat
  • Alligator clips
  • Jumper wires
  • Computer
  • NeoPixel
  • Seeed XIAO-RP2040
  • USB data wire

Velostat is a pressure-sensitive material that changes its electrical resistance when force is applied. When compressed, its resistance decreases.

I made my velostat sensor layering one piece of felt with a piece of copper tape on it, a piece of velostat (the black square) and another piece of felt and copper wire, just like this:

You can sew the separate pieces of fetl togethet to prevent the from moving.

By Samantha Sánchez, 2025

What I was aiming for as a result was that when the threshold value was below 500, it would be considered as being pressed, in order to control a NeoPixel and make it change color each time it was pressed.

Code made in chat gpt:

void loop() {
  sensorValue = analogRead(SENSOR_PIN);   // Lee el valor del Velostat

  //  ESTA ES LA LINEA NUEVA
  Serial.println(sensorValue);             // Muestra el valor en el Monitor Serial

  // Detección de presión (ajusta el umbral según tus lecturas)
  if (sensorValue < 500 && !isPressed) {
    isPressed = true;   // Indica que fue presionado

    // Cambia el color del NeoPixel
    colorIndex = (colorIndex + 1) % (sizeof(colors) / sizeof(colors[0]));
    pixels.setPixelColor(0, colors[colorIndex]);
    pixels.show();
    delay(200);         // Evita cambios demasiado rápidos
  }

  // Si ya no hay presión, reinicia el estado
  if (sensorValue > 500 && isPressed) {
    isPressed = false;
  }
}

Final result:

Conclusions

This week was especially challenging, as it was my first time working with electronics and programming. At the beginning, I felt uncertain about how sensors, microcontrollers, and code could come together in a single system. Learning to use Arduino required patience, experimentation, and a lot of trial and error. Working with soft sensors such as Velostat and visual outputs like NeoPixels pushed me out of my comfort zone. Despite the difficulties, I was able to consolidate a clear project by the end of the week. This experience not only strengthened my technical skills, but also gave me confidence to continue exploring electronics as part of my design practice.

---