Wearables¶
Final work of this week¶
References, research & inspiration¶
i never realise robotics can be so interesting until i saw soft robotic, till now i though robotic is only made of the rigid metal bodies but it is beyond that, using the platics and with the help of the pressure, we can achive more reults.Some of the inspirations i found in nasa projects
Process and workflow¶
As always, collecting and preparing the raw materials is one of the first things I do before starting any assignment. I gathered the necessary materials for this week's project. This week is mostly to deal with the electonics, i visited the lab to the get the stuffs
Step 1. Making the Y Sign on My Dyed Shirt (Output Actuators)¶
This idea came to me during a dinner with Rico in town. We were talking about the difference between Fab Academy and Fabricademy. Fab Academy is more about HOW to make things, while Fabricademy also makes us think about WHY we make things and what purpose they serve.
That conversation got me thinking about my own project. Why should I just put LEDs on a shirt to make it glow? Is there a meaning behind it?
Since our lab didn't have NeoPixels, I decided to use ordinary LEDs instead. I started sewing the LEDs onto my naturally dyed shirt, arranging them in the shape of the letter Y.
The Y stands for WHY. I wanted to bring this idea into my shirt as a reminder of the conversation we had with Rico. For me, it is not just about making a shirt that lights up, but also about having a reason behind what I make. After all, why are we making these things in the first place? It was about giving the technology a purpose and making the garment communicate an idea.
Code for Y-shirt¶
Use the three backticks to separate code.
int leds[] = {11, 10, 9, 5, 6, 4};
int totalLEDs = 6;
int buttonPin = 2;
bool lightsOn = false;
bool lastButtonState = HIGH;
unsigned long previousTime = 0;
unsigned long debounceTime = 0;
int effect = 1;
int currentLED = 0;
int blinkCount = 0;
bool blinkState = false;
void setup() {
for (int i = 0; i < totalLEDs; i++) {
pinMode(leds[i], OUTPUT);
}
pinMode(buttonPin, INPUT_PULLUP);
}
void loop() {
// BUTTON CONTROL
bool currentButtonState = digitalRead(buttonPin);
if (lastButtonState == HIGH && currentButtonState == LOW) {
if (millis() - debounceTime > 200) {
lightsOn = !lightsOn;
debounceTime = millis();
// Reset all effects
effect = 1;
currentLED = 0;
blinkCount = 0;
blinkState = false;
previousTime = millis();
// Turn all LEDs OFF
for (int i = 0; i < totalLEDs; i++) {
digitalWrite(leds[i], LOW);
}
}
}
lastButtonState = currentButtonState;
// RUN EFFECTS ONLY WHEN SWITCHED ON
if (lightsOn) {
// EFFECT 1: RUNNING LIGHTS
if (effect == 1) {
if (millis() - previousTime >= 300) {
// Turn previous LED OFF
if (currentLED > 0) {
digitalWrite(leds[currentLED - 1], LOW);
}
// Turn current LED ON
digitalWrite(leds[currentLED], HIGH);
currentLED++;
previousTime = millis();
// Move to Effect 2
if (currentLED >= totalLEDs) {
effect = 2;
previousTime = millis();
}
}
}
// EFFECT 2: ALL LEDs ON
else if (effect == 2) {
if (currentLED == totalLEDs) {
for (int i = 0; i < totalLEDs; i++) {
digitalWrite(leds[i], HIGH);
}
currentLED++;
previousTime = millis();
}
if (currentLED > totalLEDs &&
millis() - previousTime >= 1000) {
for (int i = 0; i < totalLEDs; i++) {
digitalWrite(leds[i], LOW);
}
effect = 3;
blinkCount = 0;
blinkState = false;
previousTime = millis();
}
}
// EFFECT 3: BLINK TWICE
else if (effect == 3) {
if (millis() - previousTime >= 300) {
blinkState = !blinkState;
for (int i = 0; i < totalLEDs; i++) {
digitalWrite(leds[i], blinkState ? HIGH : LOW);
}
if (blinkState == false) {
blinkCount++;
}
previousTime = millis();
// Two complete blinks finished
if (blinkCount >= 2) {
effect = 1;
currentLED = 0;
previousTime = millis();
}
}
}
}
}
¶
int leds[] = {11, 10, 9, 5, 6, 4};
int totalLEDs = 6;
int buttonPin = 2;
bool lightsOn = false;
bool lastButtonState = HIGH;
unsigned long previousTime = 0;
unsigned long debounceTime = 0;
int effect = 1;
int currentLED = 0;
int blinkCount = 0;
bool blinkState = false;
void setup() {
for (int i = 0; i < totalLEDs; i++) {
pinMode(leds[i], OUTPUT);
}
pinMode(buttonPin, INPUT_PULLUP);
}
void loop() {
// BUTTON CONTROL
bool currentButtonState = digitalRead(buttonPin);
if (lastButtonState == HIGH && currentButtonState == LOW) {
if (millis() - debounceTime > 200) {
lightsOn = !lightsOn;
debounceTime = millis();
// Reset all effects
effect = 1;
currentLED = 0;
blinkCount = 0;
blinkState = false;
previousTime = millis();
// Turn all LEDs OFF
for (int i = 0; i < totalLEDs; i++) {
digitalWrite(leds[i], LOW);
}
}
}
lastButtonState = currentButtonState;
// RUN EFFECTS ONLY WHEN SWITCHED ON
if (lightsOn) {
// EFFECT 1: RUNNING LIGHTS
if (effect == 1) {
if (millis() - previousTime >= 300) {
// Turn previous LED OFF
if (currentLED > 0) {
digitalWrite(leds[currentLED - 1], LOW);
}
// Turn current LED ON
digitalWrite(leds[currentLED], HIGH);
currentLED++;
previousTime = millis();
// Move to Effect 2
if (currentLED >= totalLEDs) {
effect = 2;
previousTime = millis();
}
}
}
// EFFECT 2: ALL LEDs ON
else if (effect == 2) {
if (currentLED == totalLEDs) {
for (int i = 0; i < totalLEDs; i++) {
digitalWrite(leds[i], HIGH);
}
currentLED++;
previousTime = millis();
}
if (currentLED > totalLEDs &&
millis() - previousTime >= 1000) {
for (int i = 0; i < totalLEDs; i++) {
digitalWrite(leds[i], LOW);
}
effect = 3;
blinkCount = 0;
blinkState = false;
previousTime = millis();
}
}
// EFFECT 3: BLINK TWICE
else if (effect == 3) {
if (millis() - previousTime >= 300) {
blinkState = !blinkState;
for (int i = 0; i < totalLEDs; i++) {
digitalWrite(leds[i], blinkState ? HIGH : LOW);
}
if (blinkState == false) {
blinkCount++;
}
previousTime = millis();
// Two complete blinks finished
if (blinkCount >= 2) {
effect = 1;
currentLED = 0;
previousTime = millis();
}
}
}
}
}
Step 2. Making a Speaker with Textiles¶
I really liked the idea of making a speaker using textiles, which was presented by Liza Stark. So, I thought I would give it a try and make something similar using copper tape.
Unfortunately, my lab did not have some of the materials mentioned in the demonstration, especially the TIP120 transistor and insulated copper wire. However, I managed to find a bar magnet, so I thought I would try making it with the materials available.
For my first attempt, I made a larger coil using copper tape in a square spiral shape. I also tried combining it with the bar magnet, but sadly, it did not produce any sound.
I thought maybe the coil size was the problem, so I reduced the size of the copper tape and increased the number of turns in the coil. I tried again, but still no sound.
Later, I started thinking that perhaps the magnet was not strong enough. Since I was using a bar magnet, I decided to visit the workshop to look for a stronger one. Luckily, I managed to find a stronger magnet and tried the setup again. Unfortunately, even with the stronger magnet, I still couldn't get any sound from my speaker.
Although I couldn't make it work, it was interesting to experiment with different coil sizes, the number of turns and different magnets. It also made me realise that even a small change in the materials or setup can affect the result.
Step 3. Making a Flower Wearable Design¶
This idea came from looking at military ranks. Different ranks, from officers to higher-ranking officers, have their own symbols and badges. I noticed that some of these symbols include flowers, which caught my interest.
I started thinking, instead of making a flower that just stays in one position, what if I could make it move? Since I already had copper capacitive touch sensors, I thought of using them to control a small motor attached to the flower.
The idea is that whenever someone touches the sensor, the flower starts rotating. I thought this would be more interesting than having a normal static flower on the garment. It also brings together textiles, electronics and movement, making the wearable a little more interactive.
With the help of my sisters, i started to make flower, which is first try, which can be always improve later.
Code for Flower wearbable¶
Use the three backticks to separate code.
#include <CapacitiveSensor.h>
#include <Servo.h>
// Capacitive sensor
CapacitiveSensor sensor = CapacitiveSensor(4, 2);
// Two servo motors
Servo servo1;
Servo servo2;
const long THRESHOLD = 300;
bool alreadyTriggered = false;
void setup() {
Serial.begin(9600);
// Connect servos
servo1.attach(9);
servo2.attach(10);
// Starting positions
servo1.write(0);
servo2.write(0);
sensor.set_CS_AutocaL_Millis(0xFFFFFFFF);
}
void loop() {
long reading = sensor.capacitiveSensor(30);
Serial.println(reading);
if (reading > THRESHOLD && !alreadyTriggered) {
alreadyTriggered = true;
// Both servos move
servo1.write(90);
servo2.write(90);
delay(1000);
// Both return
servo1.write(0);
servo2.write(0);
delay(1000);
}
// Reset after releasing touch
if (reading < THRESHOLD / 2) {
alreadyTriggered = false;
}
delay(50);
}
¶
#include <CapacitiveSensor.h>
#include <Servo.h>
// Capacitive sensor
CapacitiveSensor sensor = CapacitiveSensor(4, 2);
// Two servo motors
Servo servo1;
Servo servo2;
const long THRESHOLD = 300;
bool alreadyTriggered = false;
void setup() {
Serial.begin(9600);
// Connect servos
servo1.attach(9);
servo2.attach(10);
// Starting positions
servo1.write(0);
servo2.write(0);
sensor.set_CS_AutocaL_Millis(0xFFFFFFFF);
}
void loop() {
long reading = sensor.capacitiveSensor(30);
Serial.println(reading);
if (reading > THRESHOLD && !alreadyTriggered) {
alreadyTriggered = true;
// Both servos move
servo1.write(90);
servo2.write(90);
delay(1000);
// Both return
servo1.write(0);
servo2.write(0);
delay(1000);
}
// Reset after releasing touch
if (reading < THRESHOLD / 2) {
alreadyTriggered = false;
}
delay(50);
}
Tools¶
-
Arduino Uno
-
LEDs and connecting wires
-
Resistors
-
Copper tape
-
Capacitive touch sensor
-
Servo motor
-
Bar magnet
-
Fabric and sewing materials
-
Naturally dyed shirt
-
Breadboard and jumper wires
-
Computer and Arduino IDE
Weekly Reflection & Critical Thinking¶
-
Exploring wearable technology: This week helped me understand that wearable technology goes beyond LEDs and glowing garments. It can also respond to touch, produce movement and explore sound. I particularly enjoyed making the interactive flower wearable with the help of my sisters.
-
Learning through challenges: Not everything worked as expected. My textile speaker experiment was unsuccessful, partly because some important materials, such as the TIP120 transistor and insulated copper wire, were not available in the lab. It was difficult to achieve the intended result without the proper materials. This made me realise how important access to the right tools and materials is when experimenting with electronics.
-
Purpose and future improvements: The conversation with Rico reminded me to always ask WHY before making something. The Y-shaped LED design became a reminder of this idea. If I had more time and the necessary materials, I would improve the flower mechanism and revisit my textile speaker experiment.



















