# LightUp Dress

The inspiration for this project comes from the many Disney films I’ve watched in the past. The main focus of this product is not the dress itself, but the idea of wearing a dress. When you wear a dress, you want it to feel elegant, pretty, and magical. Just as the princesses in Disney films feel as they transform with the dresses, the sparkles that fly out, the fireworks in the background…etc.

The idea was that I would recreate this using LEDs and accelerometer embedded within the dress.

Parts

• LED string
• Dress
• Resistor

Process

I first tried to design and make a dress of my own but due to my lack of tailoring skills, I quickly gave up on my pile of fabric and went out and bought a dress.

Code

/*

Dec 9th, 2014
Kenix Po
*/

//———-Variables———-
//
//—–Constants—–
const int xpin = A5; // x-axis
const int ypin = A3; // y-axis
const int zpin = A4; // z-axis
//
int dressThreshold = 100;
int dressPin = 5;
int dressLight = 0;
//———-[test]———-
//Smoothing
//
int xindex = 0;                  // the index of the current reading
int xtotal = 0;                  // the running total
int xaverage = 0;                // the average
//
int yindex = 0;                  // the index of the current reading
int ytotal = 0;                  // the running total
int yaverage = 0;                // the average
//
int zindex = 0;                  // the index of the current reading
int ztotal = 0;                  // the running total
int zaverage = 0;                // the average

void setup(){
//
Serial.begin(9600);
//
//
pinMode(xpin, INPUT);
pinMode(ypin, INPUT);
pinMode(zpin, INPUT);
pinMode(dressPin, OUTPUT);
//
//
//
}//setUp ends

void loop(){
//
//
// advance to the next position in the array:
xindex = xindex + 1;

// if we’re at the end of the array…
// …wrap around to the beginning:
xindex = 0;

// calculate the average:
//
delay(1);

// advance to the next position in the array:
yindex = yindex + 1;

// if we’re at the end of the array…
// …wrap around to the beginning:
yindex = 0;

// calculate the average:
//
delay(1);

// advance to the next position in the array:
zindex = zindex + 1;

// if we’re at the end of the array…
// …wrap around to the beginning:
zindex = 0;

// calculate the average:
//
delay(1);

//—–Dress LightUp—–
if( zaverage <= (dressThreshold – 20) || zaverage >= (dressThreshold + 20)){
//
if (dressLight <= 255){
dressLight = dressLight + 10;
analogWrite(dressPin, dressLight);
//
}
}
else if((zaverage <= dressThreshold + 20) && (zaverage >= dressThreshold – 20)){

dressLight = 0;
/* while(dressLight >= 0){
//
dressLight = dressLight – 10;
}
analogWrite(dressPin, dressLight);
//
*/
}
//
//—–Serial Monitor Display—–
Serial.print(xaverage);
Serial.print(“\t”);
//
Serial.print(yaverage);
Serial.print(“\t”);
//
Serial.print(zaverage);
Serial.print(“\n”);
//
}//loop ends

Circuit

Concept:

For this assignment, the theme of the piece was  the word “shocked”. I took inspirations from nature as well as traditional headpieces of various cultures for the presentation of this piece. The piece consists of 2 servo motors, each connected to a pair of “wings” mounted onto a head band. When the user raises their hand to their head in ‘shock’, they will be in position to press a button, triggering the opening of the wings.  I choose this  motion to convey the feeling of shocked to reflect the user’s reaction. Just as a Dilophosaurus(image 1) would open it’s fins to ward off predators, the user is opening the wings in attempt to seem larger, more menacing, and to better convey a feeling of power with the head piece(image 2, 3).

image 1.

image 2.

image 3.

Process:

I first sought the parts need to build the piece. The hardest part was figuring out how to construct the motion of the wings opening. In the end, the joint was constructed by drilling a hole through 3 bbq skewers(3 one each wing) and inserting a screw to hold it in place and to act as a pivot point(or axle). I then attached one of the joints securely to the headband and the anther to a servo. The joints were then tried together so that the movement of the servo would be translated across all thee joints.

The most difficult part of the piece was securing all the wires in place and finding a way to support the arduino uno as the lilypad did not provide enough power for the servos and using the Uno was the simplest solution.

Code:

/*——————-
KENIX PO
2434140
——————-*/
#include <Servo.h>

Servo myServo_1;
Servo myServo_2;

//——Variables—–
int buttonPin = 7;
int buttonVal= 0;
int rightFin = 0;
int leftFin = 179;
//

void setup()
{
Serial.begin(9600);
pinMode(buttonPin, INPUT);
myServo_1.attach(8);
myServo_2.attach(9);
} //setup ends

void loop()
{
//
if (buttonVal == HIGH){
//
if((rightFin <= 179) && (leftFin >= 89)){
rightFin++;
leftFin–;
}
}
else if (buttonVal == LOW){
rightFin = 0;
leftFin = 179;
}

myServo_1.write(rightFin);
myServo_2.write(leftFin);
//
Serial.println(buttonVal);
//
delay(10);
} //loop ends

Layout:

Images:

# Dramatic Dejection

Concept:

The theme of this piece is to allow the wearer of this piece to convey the emotion of dejection; “a sad and depressed state; low spirits”. To do so, I went with the idea of a theatrical mask, which in tradition, is devoid of emotions. The blank gaze created by the unaltered mask allowed me to achieve wide ranges of emotions, including that of dejection.

Process:

The process it self was fairly simple. I cut a LED string to a desired length and glued it into position within the mask to resemble a tear drop. I then hooked up the ADXL335 accelerometer to the LilyPad and wrote a simple code for in. Within the code, I had included a thresh-hold for which the accelerometer’s designated x-axis would trigger the pin on the LilyPad that’s connected to the LED string to turn on (light up).

Schematic & Code:

/*

Oct 6th, 2014
Kenix Po
Contains partial code from:
*/

//———-Variables———-
int xPin = A5;                  // x-axis
int tearPin = 5;
//
int sampleDelay = 500;   //number of milliseconds between readings

void setup()
{
// initialize the serial communications:
Serial.begin(9600);
//
pinMode(xPin, INPUT);
pinMode(tearPin, OUTPUT);
}//setup ends

void loop()
{
//
delay(1);
float zero_G =512;
float scale =102.3;
//
Serial.print(((float)x – zero_G)/scale);
Serial.print(“\t”);
//
delay(sampleDelay);
//
if((((float)x – zero_G)/scale) <= (-0.70)){ //checks if the x-axis is past the set threshhold.
digitalWrite(tearPin, HIGH);
}
else if((((float)x – zero_G)/scale) >= (-0.70)){
digitalWrite(tearPin, LOW);
}
//
}//loop ends

Pics:

An epiphany:

During the class demo, I had proclaimed that the reason the light turns on when head tilts back is due to the number thresh hold of the accelerometer is equal to the number set as the condition to turn the LED on. After much thought, the answer was much more simple. This “glitch” was not due to the value neglecting it’s denomination, and set as an absolute value. This simple error was in fact caused by physics, thanks newton. As stated in the third law; for every action, there is an opposite and equal re-action, as I tilt my head back, the acceleration in the axis matched the thresh hold I had set to sense the gravitational acceleration to trigger the LED. I had set the original thresh hold to 0.7G, meaning my acceleration by tilting my head backwards was also 0.7G, hence the LED only flickered and had not stayed on when my head was tilted back.