Making Things Interactive

March 6, 2008

MidTerm Project: Ventillated Jacket

Filed under: 7: Mid-Term Project,Siddartha Butalia — sbutalia @ 9:10 pm

Step-by-Step of how I reached my end results 

 Step 1. Attaching the thermistors to sense temperature: I began by creating a an input switch, tweaked to give a reasonable range of input voltages for the thermistor. This took a while to get right, as initially I was getting incoherent data. (below is a picture of the setup)


Step 2. calibrating the thermistors (scaling): The scaling was performed with the assumption that the thermistors gave off a linear voltage-temperature output. With this I plotted 2 points approximately and ran a regression analysis to determine a trend line. This trendline i used to come up with my fahrenheit values. With this I attached a number LED which was wired and coded as shown below. this was done so I could walk around freely with a jacket and understand which temperatures were uncomfortable and comfortable. I found that values over 85 (Fahrenheit) seemed quite uncomfortable. I then decided to leave this as a variable in my code which could be defined whenever.


Free Image Hosting at www.ImageShack.us

sourcecode for the hardwiring of the LED (functions)

void LEDOutput(int tempF){
  if(tempF > 0){
    if(tempF >10){
      if(tempF >20){
        if(tempF >30){
          if(tempF >40){
            if(tempF >50){
              if(tempF>60){
                if(tempF>70){
                  if(tempF>80){
                    if(tempF>90){
                      nine();
                    }
                    else{
                    eight();
                  }}
                  else{
                  seven();
                }}
                else{
                six();
              }}
              else{
              five();
            }}
            else{
            four();
          }}
          else{
          three();
        }}
        else{
        two();
      }}
      else{
      one();
    }}
    else{
    zero();
    }}
}

void nine()
{
  allclear();
  half();
  digitalWrite(13,HIGH);
  digitalWrite(12,HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(9,HIGH);
  digitalWrite(7, HIGH);
  digitalWrite(6,HIGH);
}

void eight(){
  allclear();
  half();
  digitalWrite(13,HIGH);
  digitalWrite(12,HIGH);
  digitalWrite(11,HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(9,HIGH);
  digitalWrite(7,HIGH);
  digitalWrite(6,HIGH);
}

void seven(){
  allclear();
  half();
  digitalWrite(13,HIGH);
  digitalWrite(9,HIGH);
  digitalWrite(7,HIGH);
  digitalWrite(6,HIGH);
}

void six(){
  allclear();
  half();
  digitalWrite(13,HIGH);
  digitalWrite(12,HIGH);
  digitalWrite(11,HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(9,HIGH);
  digitalWrite(7,HIGH);
}

void five(){
  allclear();
  half();
  digitalWrite(13,HIGH);
  digitalWrite(12,HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(7,HIGH);
  digitalWrite(9,HIGH);
}

void four(){
  allclear();
  half();
  digitalWrite(13,HIGH);
  digitalWrite(12,HIGH);
  digitalWrite(9,HIGH);
  digitalWrite(7,HIGH);
}

void three(){
  allclear();
  half();
  digitalWrite(12,HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(9,HIGH);
  digitalWrite(7,HIGH);
  digitalWrite(6,HIGH);
}

void two(){
  allclear();
  half();
  digitalWrite(12,HIGH);
  digitalWrite(11,HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(7,HIGH);
  digitalWrite(6,HIGH);
}

void one(){
  allclear();
  half();
  digitalWrite(7,HIGH);
  digitalWrite(9,HIGH);
}

void zero()
{
  allclear();
  half();
  digitalWrite(13,HIGH);
  digitalWrite(11,HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(9,HIGH);
  digitalWrite(7,HIGH);
  digitalWrite(6,HIGH);
}

void allclear(){
for(int i=0; i < 8; i++){
  digitalWrite(6+i,LOW);
  }
}

void half(){
  if(int(tempF) % 10 > 5)
  {
    digitalWrite(8,HIGH);
  }
}

Step 3. experimenting with various ways to actuate fabric with muscle wire: Initially i wanted the vents to open and close as gills, this however was easier said and done. Finally i came upon using this method to actuate the flaps. I use the pushing nature of muscle wire, it is quite strong when enough current is applied to the wire. Understanding this I had to use a transistor which allowed large currents to flow through.

Step 4. Assembly: the method of creating the jacket was as follows, I cut out the flaps in the two layer jacket. Then i fused the edges together with fabric fuser and an iron, after that I created the “muscles.” I created these by taking each end and crimping them into copper tubes. the other ends of the tubes were attached to outgoing wires. after doing all the attachments, i soldered in the edges for a tighter fit. In order to successfuly insulate the components from both themselves and the fabric, I used heat shrink tubing to encase the joints. all exposed joints where soldered for strength and conductivity as well as shrink tubed to eliminate as much malfunction as possible. the wires and other components were taped onto the inside layer of fabric which proved to be strong enough. The next step was to determine which wires to use etc. I ran the power supplies through the front pockets as to utilize space to the maximum. Below one will find how the whole jacket is wired in a simple system level diagram indicating components, inputs and outputs.


int inputPin[3];      //declares array of analog inputs
int outputPin = 8;    //declares pin attached to transistor
float tempF[3];        //declares variable to store temperature values in
float tempAVG;        //declares variable to store the average temp in
int threshTemp = 95;  //defines the temperature at which the vents open

void setup() {
  inputPin[0] = 5;              //defining the input pins
  inputPin[1] = 4;
  inputPin[2] = 3;
  pinMode(10, INPUT);          //defining input and output pins
  pinMode(outputPin, OUTPUT);
  pinMode(inputPin[0], INPUT);
  pinMode(inputPin[1], INPUT);
  pinMode(inputPin[2], INPUT);
  pinMode(13, OUTPUT);

  Serial.begin(9600);          

 }

void loop(){

  tempF[0] = (0.236827*analogRead(inputPin[0])-3.962);  //storing the temperatures from all three thermistors
  tempF[1] = (0.236827*analogRead(inputPin[1])-3.962);
  tempF[2] = (0.236827*analogRead(inputPin[2])-3.962);
  tempAVG = (tempF[0]+tempF[1] + tempF[2])/3;          //calculating the avg temp
  Serial.print(int(tempF[0]));                          //output of values for debugging/checking
  Serial.print(int(tempF[1]));
  Serial.println(int(tempF[2]));
  Serial.println(int(int(tempAVG)));

  if((int(tempAVG) > threshTemp) || digitalRead(10) > LOW){  //checks whether temp is > than the threshold or if the manual override button has been pushed
    digitalWrite(outputPin,HIGH);
    digitalWrite(13,HIGH);
  }else{
  digitalWrite(outputPin,LOW);
digitalWrite(13,LOW);
}

}

note* after break I will try and post up some directions/hints for working with muscle wire in the context of my project

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: