Hide-away Hoodie

IMG_0202 IMG_0203 IMG_0205

Project Description 

My concept for this project is a sort of wearable “fortress of solitude” for individuals who find public spaces stressful. The item, when not active, resembles a completely ordinary hooded sweatshirt. The wearer activates the sweatshirt’s unique properties whenever she is in an overwhelming situation by zipping it up over her face. The hood then becomes a private space for the wearer, secluded from the outside world. Her favorite music plays and calming lights pulsate within the hood, controllable by a discrete set of controls. A thick layer of fabric within the hood ensures that light and sound doesn’t escape beyond the hood space.

 

Materials

-Lilypad MP3 Arduino
-1000mAh LiPo battery
-2x Small speakers
-LED string lights
-3x Bobbins conductive thread
-12”x13” Sheet conductive fabric
-12”x12” Sheet velostat
-50” Thin steel wire
-1000-ohm resistor
-Assorted wires
-Un-hooded sweatshirt
-2 yd Cotton-jersey fabric (to match sweatshirt)
-1 yd Blackout fabric
-50” Zipper
-Sewing and soldering materials

 

Code

/*
 "Hide-away Hoodie"
 Jessica Peter
 9 December 2013

 This sketch is a modified version of the "Prank" and "Player" example
 sketches written by Mike Grusin of SparkFun Electronics available 
 online at https://github.com/sparkfun/LilyPad_MP3_Player

 Uses the SdFat library by William Greiman, which is supplied
 with this archive, or download from http://code.google.com/p/sdfatlib/

 Uses the SFEMP3Shield library by Bill Porter, which is supplied
 with this archive, or download from http://www.billporter.info/
 */

#include <SPI.h>            // To talk to the SD card and MP3 chip
#include <SdFat.h>          // SD card file system
#include <SFEMP3Shield.h>   // MP3 decoder chip

// LilyPad MP3 Player pin definitions:

const int volUp = A0;
const int nextSong = A4;
const int volDown = 1;
const int prevSong = A5;
const int zipper = 0;

const int EN_GPIO1 = A2; // Amp enable + MIDI/MP3 mode select
const int SD_CS = 9;     // Chip Select for SD card

int volUpPrev;
int volUpCur;
long volUpDebounce;

int nextSongPrev;
int nextSongCur;
long nextSongDebounce;

boolean nextSongButton;

int volDownPrev;
int volDownCur;
long volDownDebounce;

int prevSongPrev;
int prevSongCur;
long prevSongDebounce;

int zipperRead;
boolean zipped = false;

static unsigned int volume = 75;

// Create library objects:

SFEMP3Shield MP3player;
SdFat sd;
SdFile file;
char track[13];

boolean debugging = false;

void setup()
{
  unsigned char result;

   pinMode(volUp, INPUT);
   pinMode(nextSong, INPUT);
   pinMode(volDown, INPUT);
   pinMode(prevSong, INPUT);

   digitalWrite(volUp, LOW);
   digitalWrite(nextSong, LOW);
   digitalWrite(volDown, LOW);
   digitalWrite(prevSong, HIGH);
   digitalWrite(zipper, HIGH);

  // Turn the amplifier chip off and start the MP3 chip
  // in MP3 mode:

  pinMode(EN_GPIO1,OUTPUT);
  digitalWrite(EN_GPIO1,LOW);  // MP3 mode / amp off

  if (debugging)
  {
    Serial.begin(9600);
    Serial.println(F("Hide-away Hoodie"));
  }

  // Initialize the SD card:

  if (debugging) Serial.print(F("initialize SD card... "));

  result = sd.begin(SD_CS, SPI_HALF_SPEED); // 1 for success

  if (result != 1) // Problem initializing the SD card
  {
    if (debugging) Serial.print(F("error, halting"));
  }
  else
    if (debugging) Serial.println(F("success!"));

  // Start up the MP3 library:

  if (debugging) Serial.print(F("initialize MP3 chip... "));

  result = MP3player.begin(); // 0 or 6 for success

  // Check the result, see the library readme for error codes.

  if ((result != 0) && (result != 6)) // Problem starting up
  {
    if (debugging) Serial.print(F("error code "));
    if (debugging) Serial.print(result);
    if (debugging) Serial.print(F(", halting."));
  }
  else
    if (debugging) Serial.println(F("success!"));

  // Change to the root directory of the SD card:

  sd.chdir("/",true);

  // Set the VS1053 volume. 0 is loudest, 255 is lowest:

  MP3player.setVolume(75,75); //we reset this later

  // Turn on the amplifier chip:

  digitalWrite(EN_GPIO1,HIGH);
  delay(2);

}

void loop()
{

  static unsigned long next = 0L;

  // Play the files on the SD card. Over and over and over...
if(zipped == true){

  if (!MP3player.isPlaying()) // if not playing...
  {
    getNextTrack();
    startPlaying();
  }

   MP3player.setVolume(volume, 0);

volUpCur = analogRead(volUp);

if (volUpCur != volUpPrev && volUpCur <= 500 && volume > 5 && (millis() - volUpDebounce) > 150){
  volume -=5;
  volUpDebounce = millis();
}

volUpPrev = volUpCur;

nextSongCur = analogRead(nextSong);

if (nextSongCur != nextSongPrev && nextSongCur <= 300 && (millis() - nextSongDebounce) > 150){
    stopPlaying();
    //next track plays automatically
    nextSongDebounce = millis();
}

nextSongPrev = nextSongCur;

Serial.println(analogRead(nextSong));

prevSongCur = analogRead(prevSong);

if (prevSongCur != prevSongPrev && prevSongCur <= 250 && (millis() - prevSongDebounce) > 150){
  stopPlaying();
  getPrevTrack();
  startPlaying();
  prevSongDebounce = millis();
}

prevSongPrev = prevSongCur;

volDownCur = digitalRead(volDown);

if (volDownCur != volDownPrev && volume < 70 && (millis() - volDownDebounce) > 100){
  volume +=5;
  volDownDebounce = millis();
}

volDownPrev = volDownCur;

}

zipperRead = digitalRead(zipper);

if (zipperRead == 1){
 zipped = false;
 stopPlaying();
} else {
 zipped = true;

}

}

void getNextTrack()
{
  // Get the next playable track (check extension to be
  // sure it's an audio file)

  do
    getNextFile();
  while(isPlayable() != true);
}

void getNextFile()
{
  // Get the next file (which may be playable or not)

  int result = (file.openNext(sd.vwd(), O_READ));

  // If we're at the end of the directory,
  // loop around to the beginning:

  if (!result)
  {
    sd.chdir("/",true);
    getNextTrack();
    return;
  }
  file.getFilename(track);  
  file.close();
}

boolean isPlayable()
{
  // Check to see if a filename has a "playable" extension.
  // This is to keep the VS1053 from locking up if it is sent
  // unplayable data.

  char *extension;

  extension = strrchr(track,'.');
  extension++;
  if (
    (strcasecmp(extension,"MP3") == 0) ||
    (strcasecmp(extension,"WAV") == 0) ||
    (strcasecmp(extension,"MID") == 0) ||
    (strcasecmp(extension,"MP4") == 0) ||
    (strcasecmp(extension,"WMA") == 0) ||
    (strcasecmp(extension,"FLA") == 0) ||
    (strcasecmp(extension,"OGG") == 0) ||
    (strcasecmp(extension,"AAC") == 0)
  )
    return true;
  else
    return false;
}

void startPlaying()
{
  int result;

  if (debugging)
  {
    Serial.print(F("playing "));
    Serial.print(track);
    Serial.print(F("..."));
  }  

  result = MP3player.playMP3(track);

  if (debugging)
  {
    Serial.print(F(" result "));
    Serial.println(result);  
  }
}

void stopPlaying()
{
  if (debugging) Serial.println(F("stopping playback"));
  MP3player.stopTrack();
}

void getPrevTrack()
{
  // Get the previous playable track (check extension to be
  // sure it's an audio file)

  do
    getPrevFile();
  while(isPlayable() != true);
}

void getPrevFile()
{
  // Get the previous file (which may be playable or not)

  char test[13], prev[13];

  strcpy(test,track);

  do
  {
    strcpy(prev,track);
    getNextTrack();
  }
  while(strcasecmp(track,test) != 0);

  strcpy(track,prev);
}

 

Process

General Decisions:

I was faced with the issue of having one less pin than I would need to attach the lights and all the controls. I assumed that the speaker pins were just basic input/output pins and decided to connect the lights to one of those, and attach the speaker pins in parallel. On attaching, I noticed that this output was specifically designed to be used with speakers, and the lights grew brighter as the music grew louder. Since I initially intended to add some kind of effect that would make the lights appear to react to either the music or the wearer’s actions (such as grow brighter depending on how hard the controls are pressed), this offered a more sophisticated-looking alternative that made the lights’ behaviour appear more connected to the quality of the music.

 

Arm Controls:

I designed the arm controls in a square arrangement with circular buttons for volume up and volume down, and for next and previous song. I used foam board, conductive fabric and velostat for all of the buttons except for the volume down button, which was made with a sponge interfacing (to accommodate the fact that trigger 4 only accepts digital input). I chose to use velostat in order to create pressure-triggered buttons rather than simple analog soft switches as I initially had issues getting a consistent reading with the foam interfacing. Later, I discovered that this might have been due to the face that the first trigger pin, unlike the second and third trigger pins, requires a pull-up resistor. I also disliked the obvious bulge of the foam interfacing for my discrete set of controls.

vMUvNIMG_0195

I connected the “ground” conductive fabric strips together to form a trace.

 

IMG_0193IMG_0201

 

Before sewing the controls in, I quickly embroidered a simple set of button icons over where the buttons would be placed on the sleeve to provide the wearer with a subtle haptic interface.

 

Hood:

I tested a variety of silhouettes with paper before deciding on a pattern. I wanted something wide that sloped forward from the wearer’s face so as not to hurt her eyes with the pulsating lights. I used this pattern three times: twice on the jersey fabric for the inside and outside layers of the hood, once for the blackout fabric.

I sewed the outside layer of the hood together from the jersey fabric and created a frame from the steel wire to fit inside. I then sewed the blackout fabric onto the frame and then connected both to the outside layer of jersey.

I added legs to the mini-speakers before sewing them onto the jersey. I connected them in parallel and then added conductive fabric tabs at the top of the hood for where the zipper switch would be installed. I was careful not to let any wires other than the pin switch on the speakers touch the wire frame. I sewed down from the speakers and zipper switch tabs with conductive thread and added more strips of conductive thread at the base of the hood to connect to the microcontroller later.

9PzvKIMG_0479

I distributed the string lights in the hood with a slight bias towards positions at the crown so as not to put them futilely behind the wearer’s head while at the same time not positioning too many right in front of the wearer’s eyes.

IMG_0484

I sewed the hood inside the neck of the sweatshirt and then added the zipper switch.

 

Zipper switch:

To make the zipper switch, I slightly modified Beckie Stern’s TV-B-Gone zipper switch to include conductive fabric tabs which I could later use to connect to the inside of the hood (in order to hide the conductive thread/fabric leading to the microcontroller). After installing the zipper, I connected the fabric tabs on these to the conductive fabric tabs I installed earlier within the hood.

IMG_0478IMG_0476

 

Connections:

The microcontroller is located in a pouch at the back of the hoodie. I made the connections with a combination of conductive fabric and conductive thread. I connected the speakers and lights first in order to test the basic functioning of the output before connecting the arm controller pad.

 

IMG_0485 IMG_0198IMG_0199IMG_0200

When conductive fabric ribbon overlapped other conductive fabric on the hoodie, I covered it in multiple layers of the grey jersey to limit the chance of interference. The last connection I made was the pull-up resistor connection to the first trigger.

 

End result 

The hoodie works more or less as designed. There is still a bit of noise resulting from uncovered conductive fabric connections, and the buttons should be recalibrated now that the they can actually be worn. However, these issues could easily be fixed by lining the hood and altering the Arduino code. I did not check to see if songs that make use of left/right channel EQ play well through the parallel-connected speakers.

Spark

Slide01 Slide02 Slide03 Slide04 Slide05 Slide06 Slide07 Slide08 Slide09 Slide10

Presentation – Loud Tech

Slide01

Slide02

Slide03

Slide04

Slide05

Slide06

Slide07

Slide08

Slide09

Slide10

Slide11

Slide12

Blinking Heart Mask (Lynn)

photo no wires

For this project I created a mask which has lights integrated that blink at the rate of the wearer’s pulse. The mask was fabricated  using threads sewn on water soluble stabilizer. An LED string was added to the mask, and connected to a heart rate monitor.

Video Demonstration

Blog Presentation

Coding For Mask

Fire Necklace

Javid.M. Final Project

Modern Flapper Dress – Paula Teixeira

My final project: Documentation for Flapper Dress

Wearable for Kids

wearablericardo

Wraithguard: Final Project Boris Kourtoukov

The post can be found on my blog.