Week 09 – Wearables¶
00 Assignment
- Research and document inspiration from artists, designers and projects exploring interactive wearables, smart textiles and wearable technologies.
- Explore different sensors, actuators and microcontrollers for wearable applications.
- Develop a concept for an interactive wearable integrating electronics and textiles.
- Design and build an electronic circuit using sensors and/or actuators.
- Program and test the interactive behavior of the wearable.
- Integrate electronic components into a wearable structure or garment.
- Document the design process, materials, fabrication techniques, programming and assembly.
- Test the final prototype and evaluate its functionality, movement and wearability.
- Record challenges, modifications and experimental results.
- Reflect on material consumption, waste and the sustainability of wearable electronics.
01 Inspiration & Research¶
For this week’s inspiration, I explored how electronics can make clothing and accessories respond to their surroundings and to the person wearing them. I focused on light, colour and movement: LEDs integrated into textiles, sensors that trigger visual effects, and mechanisms that bring wearable wings to life. These approaches connect to my two projects: a glowing firefly costume and a butterfly hair accessory with moving wings.
01 Chameleon Scarf – Becky Stern / Adafruit
The Chameleon Scarf uses a colour sensor and LEDs to match colours from its surroundings.
02 Vilkas & Kukkia – Joanna Berzowska / XS Labs
Kukkia features flowers that open and close, bringing soft materials to life.
03 Wedding Butterfly – fiveMarch / Instructables
The Wedding Butterfly is a moving butterfly worn as a hair accessory. It combining decorative wings with a small mechanism to create playful, animated jewellery.
Peace Offer is an interactive dress that opens like a flower in response to a handshake. It combines touch sensing and motorised movement, turning a simple interaction between people into a visible transformation.
02 Fierfly¶
Concept & Design¶
For this project, I wanted to combine the techniques from the Soft Robotics week with the electronics and interactive elements of the Wearables week.
My idea was to create a wearable firefly costume for children in the form of a backpack. The inflatable wings were already developed during the Soft Robotics week, so the next step was to design the firefly's body and integrate electronics.
The backpack design allows the costume to be worn over different types of clothing without requiring a complete outfit. This makes it more flexible and practical for children to use.
The main interactive feature is inspired by the natural behavior of fireflies. I want to integrate a light sensor that detects the surrounding brightness and automatically adjusts the LEDs. The darker the environment becomes, the brighter the firefly's body should glow.
If time allows, I would also like to add an optional interactive feature, such as a rainbow lighting mode, to make the costume more playful.
Durability & Practical Considerations
Since the costume is designed for a child, durability is an important part of the design. I know my child, and I expect the costume to be used for more than just one occasion. It should withstand regular movement, running, playing and repeated use.
To make the costume as durable and practical as possible, I considered the following aspects:
- Strong seams: All textile components should be securely sewn together to withstand movement and pulling.
- Secure connections: Straps, wings and other attached elements need reinforced connections to prevent them from coming loose during play.
- Removable electronics: All electronic components should be removable so that the textile body can be washed when necessary.
- Weather limitations: The costume will not be waterproof, as the electronics components are not designed for use in rain.
- Comfort and flexibility: The backpack should allow free movement without restricting the child while playing.
Electronics & Programming¶
Components & Power Supply
For the electronics, I wanted to keep the system relatively simple while making sure it would be suitable for a costume worn by a child.
The main goal is to control the brightness of the LEDs depending on the surrounding light conditions.
For this, I need the following components:
- LEDs: To illuminate the firefly's body and create the glowing effect.
- Light sensor (LDR): To measure the ambient light level.
- Resistor: Together with the LDR, it forms a voltage divider that allows the microcontroller to measure changes in light intensity.
- Adafruit FLORA: A wearable microcontroller that reads the sensor values and controls the LEDs.
- Lipo 3.7V: To provide power to the electronics.
Planned Functionality¶
The FLORA will continuously read the light sensor and adjust the LED brightness accordingly.
- In bright surroundings, the LEDs will glow only slightly or remain off.
- As the environment becomes darker, the LEDs will gradually increase in brightness.
- In darkness, the LEDs will reach their maximum brightness.
If time allows, I would also like to implement an additional rainbow mode as an optional interactive feature.
Programming Setup¶
For programming the Adafruit FLORA, I used the Arduino IDE. Since the FLORA is not included in the default board selection, I first had to install the corresponding board support package and the NeoPixel library.
Step 1 – Installing the Adafruit FLORA Board¶
- Open the Arduino IDE.
- Navigate to
File → Preferences. - Add the following URL under
Additional Boards Manager URLs:
https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
- Open
Tools → Board → Boards Manager. - Search for
Adafruit AVR Boardsand clickInstall. - Connect the FLORA to the computer using a USB cable.
- Select
Tools → Board → Adafruit AVR Boards → Adafruit Flora. - Select the corresponding USB port under
Tools → Port.
The FLORA is now ready for programming.
Step 2 – Installing the NeoPixel Library¶
To control the individually addressable RGB LEDs, I used the Adafruit NeoPixel library.
- Open
Sketch → Include Library → Manage Libraries. - Search for
Adafruit NeoPixel. - Select the library by Adafruit and click
Install. - After installation, navigate to
File → Examples → Adafruit NeoPixel → strandtest.
Step 3 – First LED Test¶
Before integrating the light sensor, I wanted to make sure that the LEDs were working correctly.
For this first test, I connected a strip of 10 NeoPixels to the FLORA.
Connections:
- LED DIN → FLORA D6
- LED 5V → External 5V power supply
- LED GND → Common GND with FLORA and power supply
#include <Adafruit_NeoPixel.h>
#define LED_PIN 6
#define LED_COUNT 10
Adafruit_NeoPixel strip(
LED_COUNT,
LED_PIN,
NEO_GRB + NEO_KHZ800
);
void setup() {
strip.begin();
strip.setBrightness(100);
strip.show();
}
void loop() {
strip.fill(strip.Color(255, 0, 0));
strip.show();
delay(1000);
strip.fill(strip.Color(0, 255, 0));
strip.show();
delay(1000);
strip.fill(strip.Color(0, 0, 255));
strip.show();
delay(1000);
}
The LEDs change color every second.
Step 4 – Building and Testing the Voltage Divider¶
The next step was to connect the light sensor (LDR) to the Adafruit FLORA and test the sensor readings before combining it with the LEDs.
Since the resistance of an LDR changes depending on the amount of light, I used a voltage divider with a 10 kΩ resistor to convert this change into a measurable voltage.
The connections are:
- LDR: One leg connected to 3.3V, the other to A0.
- 10 kΩ resistor: Connected between A0 and GND.
- A0: Reads the voltage between the LDR and the resistor.
To check whether the circuit works correctly, I wrote a simple Arduino program that continuously reads the analog value and displays it in the Serial Monitor.
const int lightSensor = A0;
void setup() {
Serial.begin(9600);
}
void loop() {
int lightValue = analogRead(lightSensor);
Serial.print("Light sensor: ");
Serial.println(lightValue);
delay(200);
}
Wiring the Voltage Divider¶
The voltage divider consists of an LDR and a 10 kΩ resistor connected in series.
The components are connected to the Adafruit FLORA as follows:
- FLORA 3.3V → LDR: Connect one leg of the LDR to the 3.3V pin.
- LDR → FLORA A0: Connect the second leg of the LDR to the analog input A0.
- FLORA A0 → 10 kΩ resistor: Connect one leg of the resistor to the same connection point as A0 and the LDR.
- 10 kΩ resistor → FLORA GND: Connect the remaining leg of the resistor to GND.
The analog input A0 measures the voltage at the connection point between the LDR and the resistor.
Testing the Sensor¶
- Upload the program to the FLORA.
- Open
Tools → Serial Monitorin the Arduino IDE. - Set the baud rate to
9600. - Cover the light sensor with your hand and observe the values.
- Expose the sensor to a light source and compare the readings.
The analog values range from 0 to 1023.
With this voltage divider configuration, brighter surroundings result in higher readings, while darkness results in lower readings.
This test allows me to check the sensor and determine suitable brightness thresholds for controlling the LEDs in the next step.
Final Crucut¶
The final circuit is controlled by an Adafruit Flora, powered by a 3.7 V LiPo battery connected directly to its battery socket. The three NeoPixel strip sections are connected in sequence, with the data output of each section connected to the data input of the next. Pin 6 provides the data signal, while VBATT and GND supply power.
The light sensor consists of an LDR and a 10 kΩ resistor connected as a voltage divider: 3.3 V → resistor → measurement point → LDR → GND. The measurement point is connected to pin 9, allowing the Flora to read the ambient light level and adjust the LEDs so they shine brighter in darker surroundings.
Two conductive contacts, one attached to each hand pump, act as a switch between pin 12 and GND. Bringing the pumps together closes the circuit and activates the rainbow mode. Pin 12 uses the internal pull-up resistor, so no additional external resistor is needed for these contacts.
Programming the Firefly LEDs¶
For my firefly costume, I programmed an Adafruit FLORA using the Arduino IDE and the Adafruit NeoPixel library. The program controls 120 LEDs based on the surrounding light and includes an additional rainbow mode activated by a button.
The program consists of three main functions:
- Startup mode: All LEDs light up green for two seconds when the FLORA starts.
- Light-dependent brightness: A photoresistor measures the ambient light. The darker the environment, the brighter the LEDs glow yellow.
- Rainbow mode: Pressing a button activates an animated rainbow effect for five seconds.
Defining the Components¶
First, I defined the pins used for the LED strip, the light sensor and the button.
The NeoPixel library allows me to control each LED individually.
Startup Animation¶
When the FLORA is switched on, all LEDs light up green for two seconds. This also allows me to check whether the LEDs are working correctly.
The strip.fill() command assigns the same RGB color to all LEDs. The strip.show() command sends the color information to the LED strip, while delay(2000) keeps the LEDs green for two seconds.
Light-Dependent Brightness¶
A photoresistor connected to analog pin A9 measures the surrounding light.
The analog signal is converted into a value between 0 and 1023.
I used two adjustable variables to define the brightest and darkest measured values:
The map() function converts the measured sensor value into an LED brightness value.
Since I installed the photoresistor in the opposite configuration of the voltage divider, a higher sensor value represents a darker environment.
The brightness is limited using constrain() and then applied to the yellow LEDs.
helligkeit = constrain(helligkeit, ledMin, ledMax);
strip.setBrightness(helligkeit);
strip.fill(strip.Color(255, 180, 0));
strip.show();
This creates the desired firefly effect: the costume becomes brighter when the surrounding environment gets darker.
Button-Controlled Rainbow Mode¶
I also added a button to activate a special lighting effect.
The button uses the internal pull-up resistor of the FLORA:
This means the button returns HIGH (1) when it is open and LOW (0) when pressed.
When the button is pressed, the program activates rainbow mode and records the starting time.
if (tasterGedrueckt && tasterFreigegeben && !rainbowAktiv) {
rainbowAktiv = true;
rainbowStart = millis();
tasterFreigegeben = false;
}
The rainbow animation itself is generated using the NeoPixel library:
uint16_t farbVerschiebung =
(millis() / 20UL * rainbowSpeed) % 65536UL;
strip.setBrightness(ledMax);
strip.rainbow(farbVerschiebung);
strip.show();
The strip.rainbow() function distributes different colors across the LED strip. By continuously changing farbVerschiebung, the colors appear to move along the LEDs.
I used millis() instead of a long delay() so the program can keep checking the elapsed time while the animation is running.
After five seconds, the rainbow mode is automatically deactivated:
The program then returns to the normal light-dependent yellow illumination.
Final Result¶
The combination of the photoresistor and the NeoPixel strip creates an interactive lighting system for my firefly costume. The LEDs automatically respond to changes in ambient light, while the button provides an additional colorful animation.
All settings, including the sensor calibration, maximum brightness, rainbow duration and animation speed, can be adjusted directly in the Arduino code.
Fabrication¶
Since I did not have a sewing pattern for the firefly costume, I started by roughly planning the shape and size of the body. Instead of creating a detailed pattern, I decided to work directly with the fabric and adjust the design during the fabrication process.
Step 1 – Cutting the Fabric¶
First, I measured the approximate dimensions of the body and cut out three main fabric pieces:
- One back panel to form the flat side of the backpack.
- Two additional pieces to create the curved, three-dimensional shape of the firefly's body.
- Five additional fabric segments: three yellow and two brown, to create the characteristic segmented appearance of a firefly's abdomen.
- Two long fabric strips to create the shoulder straps, allowing the costume to be worn like a backpack.
The yellow sections will later be illuminated by the LEDs to create the glowing effect.
Step 2 – Sewing the Fabric Segments¶
First, I sewed the two fabric pieces together that would later form the curved, three-dimensional body of the firefly.
Next, I started attaching the yellow and brown fabric segments, working from the bottom to the top to ensure the correct spacing and overlap.
For each segment, I folded the fabric upwards, stitched it in place and then folded it back down. This way, the seam was hidden underneath the overlapping fabric.
By repeating this process, I created a layered structure with concealed seams, giving the firefly's body a segmented appearance.
Step 3 – Sewing the Shoulder Straps and Assembling the Body¶
Next, I sewed the two long fabric strips together to create the shoulder straps. After sewing, I turned them right side out and added an elastic band to make the straps more flexible and comfortable to wear.
I then attached the finished shoulder straps to the back panel of the backpack.
Finally, I sewed the front and back panels together to form the firefly's body.
During this step, I made sure not to accidentally sew the edges of the overlapping yellow and brown fabric segments into the side seams. I wanted these segments to remain loose and movable rather than being completely attached to the body.
Step 4 – Filling the Body¶
To give the firefly's body its rounded, three-dimensional shape, I filled it with leftover fabric scraps from the sewing process.
I gradually added more material until the body had a nice, even curvature and the desired shape.
Step 5 - Testing¶
To achieve the best possible lighting effect, I experimented with different LED strips and their positioning inside the firefly's body.
I tested several arrangements and orientations to see how the light was distributed through the fabric and how the individual LEDs affected the overall appearance.
The goal was to achieve a soft, even glow rather than having individual LED points clearly visible through the fabric.
Step 6 – Preparing the LED Strips¶
Next, I prepared the LED strip I had selected during testing. To distribute the LEDs inside the firefly's body, I divided the strip into three separate sections.
I then soldered cables to both ends of each section so that they could later be connected.
The process consisted of three steps:
Preparing the wires: First, I stripped the insulation from the ends of the cables to expose the conductive wires.
Soldering: Next, I soldered the wires to the corresponding connection pads on the LED strips.
Securing the connections: Finally, I applied hot glue to the solder joints to provide additional protection against moisture and reduce mechanical stress on the connections.
The three LED sections can now be connected using simple plug-in cable connectors. This makes it easier to arrange the LEDs inside the costume and disconnect individual sections when necessary.
Next, I guided the LED strips through small holes in the fabric and connected the individual sections inside the firefly's body.
I then attached the LED strips by hand sewing them along the upper edges of the fabric segments.
Since the LEDs on this particular strip face downwards, I decided to mount the strip upside down, with the LEDs facing towards the fabric rather than outwards.
Step 7 – Creating the Interactive Button¶
For the optional rainbow mode, I wanted to integrate an interactive switch into the existing wing pumps.
I attached one electrical contact to each of the two pumps. When the user holds the two pumps together, the contacts touch and close the electrical circuit, triggering the rainbow lighting mode.
This way, the pumps can still be used to inflate the wings, while bringing them together activates an additional lighting effect without requiring a separate button.
Step 8 – Attaching the Wings¶
Next, I attached the inflatable wings that I had previously created during the Soft Robotics week.
I sewed the wings onto the firefly's body, making sure to leave enough space for the light sensor, which would be integrated later.
I also made sure that the wings were securely attached while remaining flexible enough to move when inflated.
Step 9 – Magnetic Connections for Removable Electronics¶
To make the electronics removable, I decided to attach the fabric piece holding the circuit board to the firefly's body using three magnets.
The magnets serve two purposes: they hold the electronics in place and simultaneously act as electrical connections for the three connections integrated directly into the firefly costume.
This allows me to detach the electronics when necessary, for example when washing the textile body, without having to disconnect individual wires.
Step 10 – Sewing the Electronics¶
Using the techniques I learned during the E-Textiles week, I created several hard-to-soft connections to integrate the electronic components into the fabric.
First, I sewed the light sensor and the resistor onto the fabric. I also attached the cables for the LED strips using stitching.
This allowed me to integrate the electronic components into the textile structure while keeping the connections as secure as possible.
Results¶
Overall, the firefly costume works as intended, and I am quite happy with the result.
However, I noticed that some of the sewn electrical connections are not completely reliable. Occasionally, the LEDs flicker or the electronics do not work properly, probably because some connections become loose or lose contact during movement.
There is definitely room for improvement, especially regarding the reliability of the textile connections. Nevertheless, I am satisfied with the final result and how the different techniques from the Soft Robotics and E-Textiles weeks came together in one wearable project.
03 Butterfly¶
Concept & Design¶
For this project, I wanted to explore how a butterfly’s wing movement could be translated into a small wearable accessory. The idea was to create a butterfly with movable wings that could later be attached to a hair clip, combining a decorative element with a small motorised mechanism.
The concept also includes app control, allowing the wearer to trigger the wing movement and adjust its behaviour, such as the speed or rhythm of the flapping. This would make it possible to interact with the butterfly while wearing it.
This first version was intended as an initial prototype to explore the movement mechanism, electronic control and their integration into the design. My focus was on testing how the individual elements could work together and identifying what would need to be improved.
Electronics & Programming¶
For this prototype, I chose an ESP32 Mini because its compact size makes it suitable for a small wearable accessory. It still offers the features I need for this project, including Wi-Fi connectivity for the planned app control. This allows me to explore wireless interaction while keeping the electronics relatively small.
For the wing movement, I selected small servo motors that can operate at 3.3 V. The servos allow me to control their position and use this movement to open and close the butterfly’s wings.
Setting Up the ESP32 Board¶
To program the board in the Arduino IDE, the ESP32 board package needs to be installed first:
- Open File → Preferences.
- Add the following address to “Additional Boards Manager URLs”:
https://espressif.github.io/arduino-esp32/package_esp32_index.json - Open the Boards Manager, search for “esp32” and install “esp32 by Espressif Systems”.
- Under Tools → Board, select the entry matching the exact ESP32 model.
- Connect the board using a USB data cable and select its port under Tools → Port.
Installing the Servo Library¶
To control the servos, install the ESP32Servo library through the Library Manager in the Arduino IDE. Search for “ESP32Servo” and install the library by Kevin Harrington and John K. Bennett.
The library is included in the sketch as ESP32Servo.h. Each servo is assigned a signal pin using attach(), and its target angle can then be set using write(). Gradually changing this angle allows the wings to move between an open and a closed position. The movement range and timing can later be adjusted to suit the mechanism and create the desired flapping motion.
First Flapping Test¶
To test the butterfly’s movement, I created a simple program that opens and closes the wings three times.
First, I included the ESP32Servo library and created two servo objects, one for the left wing and one for the right wing.
The two constants define the wing positions: GESCHLOSSEN means closed and GEOEFFNET means open. The angles are defined for the left servo; the right servo’s positions are mirrored.
The function setzeFluegel() controls both servos at once. It sends the requested angle to the left servo and calculates the opposite angle for the right servo using 180 - winkel. For example, when the left servo is at 65°, the right servo is at 115°. This mirrored movement allows the wings to open and close together.
Inside setup(), the left servo is assigned to GPIO 4 and the right servo to GPIO 3. The values 1000 and 2000 specify the minimum and maximum control pulse widths in microseconds.
The wings then move to the closed position. A pause of 2000 milliseconds gives me two seconds before the flapping sequence starts.
The following loop repeats the flapping movement three times. Each repetition contains one opening movement and one closing movement.
To open the wings, the angle increases from 65° to 145° in one-degree steps. After each step, the program waits for eight milliseconds. This creates a gradual movement instead of immediately moving to the final position.
To close the wings, a second loop reverses the movement, decreasing the angle from 145° back to 65°. The same delay is used in both directions. A larger delay makes the wings move more slowly, while a smaller delay makes them move faster.
After three complete flaps, the wings remain in the closed position. The test runs only once because the movement is placed inside setup(). The empty loop() means that no further movements are triggered until the board is restarted or reset.
Final Program – Wireless Control¶
For the final program, I added a browser-based interface to the existing flapping test. The ESP32 creates its own Wi-Fi network and hosts a webpage with buttons to start and pause the movement and a slider to adjust its speed.
Additional Libraries
The wireless control requires two additional libraries:
Both are included with the ESP32 board package, so no additional installation is needed. The ESP32Servo library from the first test is still used.
Web Server and HTML Interface
The ESP32 creates its own wireless network using the name and password defined in the program:
A web server runs on port 80:
The control page is stored directly in the sketch. HTML defines the buttons and slider, CSS controls their appearance, and JavaScript sends commands to the ESP32. When the browser requests the main page, the server sends the stored HTML:
Receiving Settings from the Webpage
Pressing a button sends the selected mode to the ESP32 without reloading the page:
The /set route passes this request to handleSet(), which updates the mode. Mode 0 pauses the flapping and returns the wings to their closed position; mode 1 starts continuous flapping.
The slider sends its value through /set?speed=.... The ESP32 stores this setting and limits it to the range from 1 to 100.
The speed setting changes the interval between movement steps, from 20 milliseconds at the lowest setting to 4 milliseconds at the highest.
When the page first opens, it requests /state to retrieve the current mode and speed. This ensures that the interface displays the settings currently stored on the ESP32.
Keeping the Controls Responsive
The main change to the movement code is replacing delay() with timing based on millis(). Instead of pausing the program, it checks whether enough time has passed for the next movement step.
unsigned long jetzt = millis();
if (jetzt - letzteBewegung < wartezeit) {
return;
}
letzteBewegung = jetzt;
This allows the main loop to keep processing browser requests while the butterfly moves, so the speed and mode can be changed during operation.
Connecting to the Butterfly
- Power on the ESP32. The wings start in the closed position.
- Open the Wi-Fi settings on a smartphone or computer.
- Connect to “Butterfly-Control” using the password “Butterfly2026”.
- Stay connected if the device reports that the network has no internet access.
- Open a browser and enter http://192.168.4.1. The actual address is also printed in the Serial Monitor at 115200 baud.
- Press “Standard” to start continuous flapping.
- Move the speed slider to adjust the movement.
- Press “Pause / Startposition” to return the wings to their closed position.
Tip: Some smartphones display a warning because the butterfly’s Wi-Fi network has no internet access. If a message asks whether you want to stay connected, select “Yes” or “Stay connected”. The control page works locally on the ESP32 and does not need an internet connection.
Fabrication¶
Step 1 – Making the Wings
I designed the wings in Fusion 360 and printed the parts using a Prusa 3D printer.
Each wing assembly consists of two parts: a mounting piece that slides onto the servo arm and a removable wing connected to it using magnets.
This allows me to exchange the wings without removing the servo mount, making it easier to test different wing shapes and designs.
I printed the wing parts and servo mounts using a Prusa 3D printer.
Step 2 – Making the Holder
For the holder, I took inspiration from a hair clip secured in the hair with a stick. I integrated a mount for the two servos into this design to hold them in place.
After installing the servos, I soldered their wires to the ESP32.
I secured the connections with hot glue and attached the electronics directly to the 3D-printed holder. As an additional layer of protection, I covered the wires with duct tape.
Here you can see the fully assembled prototype, with the wings, servos and electronics attached to the holder.
Testing¶
This version is still an early prototype, and the first tests revealed several areas that need further development.
The main issue is the power supply. The ESP32 repeatedly resets during operation, which seems to happen when both servos draw too much current at the same time. A next step would be to check the current demand and test a separate, suitable power supply for the servos while keeping a common ground with the ESP32.
The size of the components also needs improvement. The current servos are quite large for a hair accessory. Smaller, lighter servos could make the butterfly more compact and comfortable to wear, provided they can still move the wings reliably.
Another challenge is integrating the battery and routing the cables. The current cable arrangement makes it difficult to attach the prototype securely in the hair. A future version would need a compact power solution and better cable management integrated into the holder.
Another option would be to use a single servo with a gear mechanism to drive both wings in opposite directions. This could reduce the number of electronic components and simplify the wiring. However, the mechanism would need to be tested to check whether one servo can move both wings reliably and whether the overall design becomes smaller and lighter.
Results¶
10 Fiels¶
99 Waste of the Week¶
This week, sewing the firefly costume naturally produced some fabric scraps. Instead of throwing them away, I reused them directly in the costume as stuffing for the firefly's body.
This allowed me to reduce textile waste while also giving the body its shape and volume without needing additional filling material.






























