All posts by cp11qk

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.

maxresdefault

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

 

Parts

  • Lilypad
  • ADXL 335 (for lilypad)
  • LED string
  • Dress
  • Conductive Thread
  • 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.

SAM_1246 SAM_1247

SAM_1242 SAM_1243 SAM_1244 SAM_1245 SAM_1248 SAM_1251

Code

/*
LilyPad ADXL335 Dress

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
const int numReadings = 10;
//
int xreadings[numReadings];      // the readings from the analog input
int xindex = 0;                  // the index of the current reading
int xtotal = 0;                  // the running total
int xaverage = 0;                // the average
//
int yreadings[numReadings];      // the readings from the analog input
int yindex = 0;                  // the index of the current reading
int ytotal = 0;                  // the running total
int yaverage = 0;                // the average
//
int zreadings[numReadings];      // the readings from the analog input
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);
//
for (int thisReading = 0; thisReading < numReadings; thisReading++)
xreadings[thisReading] = 0;
//
for (int thisReading = 0; thisReading < numReadings; thisReading++)
yreadings[thisReading] = 0;
//
for (int thisReading = 0; thisReading < numReadings; thisReading++)
zreadings[thisReading] = 0;
}//setUp ends

void loop(){
//
//—–Readings[input]—–
//
// subtract the last reading:
xtotal= xtotal – xreadings[xindex];
// read from the sensor:
xreadings[xindex] = analogRead(xpin);
// add the reading to the total:
xtotal= xtotal + xreadings[xindex];
// advance to the next position in the array:
xindex = xindex + 1;

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

// calculate the average:
xaverage = xtotal / numReadings;
//
delay(1);

// subtract the last reading:
ytotal= ytotal – yreadings[yindex];
// read from the sensor:
yreadings[yindex] = analogRead(ypin);
// add the reading to the total:
ytotal= ytotal + yreadings[yindex];
// advance to the next position in the array:
yindex = yindex + 1;

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

// calculate the average:
yaverage = ytotal / numReadings;
//
delay(1);

// subtract the last reading:
ztotal= ztotal – zreadings[zindex];
// read from the sensor:
zreadings[zindex] = analogRead(zpin);
// add the reading to the total:
ztotal= ztotal + zreadings[zindex];
// advance to the next position in the array:
zindex = zindex + 1;

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

// calculate the average:
zaverage = ztotal / numReadings;
//
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”);
//
delay(500);// delay before next reading:
}//loop ends

Circuit

Screen Shot 2014-12-09 at 5.13.02 PM

 

Assignment 3: Servo headpiece

 

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).

http://img3.wikia.nocookie.net/__cb20090430172730/jurassicpark/images/8/8e/JP-Dilophosaurus1.jpg

image 1.

http://img838.imageshack.us/img838/6158/headdress.jpg

image 2.

http://3.bp.blogspot.com/-2CQv2Ys8G5E/Ti2Myxz8-VI/AAAAAAAAAz4/O7gwVI1m7P0/s400/Native+indian_chief_headdress.png

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()
{
buttonVal = digitalRead(buttonPin);
//
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:

Screen Shot 2014-10-28 at 9.33.30 PM

Images:

headpiece_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:

/*
LilyPad ADXL335 Test

Oct 6th, 2014
Kenix Po
Contains partial code from:
http://www.geeetech.com/wiki/index.php/LilyPad_Accelerometer_ADXL335
*/

//———-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()
{
int x = analogRead(xPin);
//
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:

DSC_7412 DSC_7414

DSC_7410DSC_7411

 

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.