Wearable tech – Scarf – Jovana Ivanovic

Hey guys!
Sorry for the late post.. I had to make an entirely different project since the one I was working on was taking too much time/funds (HOWEVER, I will pursue it for the final project);Instead of making the scarf like I did/tried last time I decided to purchase this one to avoid the holes and messed up patch work (I need to work on my knitting..) What the scarf does is it has a photo resistor in it and it detects light; very simple code; if there is light the 2 led’s are off however in the absence of it they turn on!

The code:

int lightPin = 0;
int ledPin1=3;
int ledPin2=4;
void setup()
{
Serial.begin(9600);
pinMode( ledPin1, OUTPUT );
pinMode( ledPin2, OUTPUT );
pinMode( lightPin, INPUT );
}

void loop()
{
Serial.println(analogRead(lightPin));
if (analogRead(lightPin)> 400)
{
digitalWrite(ledPin1, HIGH);

} else {
digitalWrite(ledPin1, LOW);
}
delay(10);
Serial.println(analogRead(lightPin));
if (analogRead(lightPin)> 400)
{
digitalWrite(ledPin2, HIGH);

} else {
digitalWrite(ledPin2, LOW);
}
delay(10);
}

 

The Living shirt

Concept:

My design is to show the basic function of how the human body works. I used red LED to represent the heartbeat, and the white LED to represent the movement of when air enters the lungs. I have also incorporated the temperature sensor with the shirt, so the Led will only light up when it senses the body temperature.

 

Component:

  • LilyPad Arduino Board Simple
  • Lilypad temperature  Sensor
  • Conductive Thread
  • 3 AAA Battery
  • 8 red LEDs
  • · 12 white LEDs

 

Circuit diagram:

 

Process:

I have been spending a lot of time on this project for the past 3 weeks. Using the Lilypad Arduino board is a big challenge for me, since I don’t have much knowledge about creating circuits and computer programing. I think to trying to get the code working is the most difficult thing in the world. After I figured out the code and made sure the pin works, I then figured out the circuit, which was another challenge. In order to avoid the conductive thread touching each other, I used hot glue to put a coating on the thread. I find sewing a little pocket at the inside of the shirt is  a great way to to contain the battery pack, to avoid it from falling off the shirt.

 

ARDUINO CODE:

int LED1 = 10;

int LED2 = 9;

int LED3 = 11;

int LED4 = 16;

int LED5 = 6;

 

int sensorPin = 3; // select the input pin for the temperature sensor

int sensorValue = 0; // variable to store the value coming from the sensor

float temperatureC; // temperature

 

void setup() {

 

  pinMode(LED1, OUTPUT); // declare the LED Pins as OUTPUTs:

  pinMode(LED2, OUTPUT);

  pinMode(LED3, OUTPUT);

  pinMode(LED4, OUTPUT); // declare the LED Pins as OUTPUTs:

  pinMode(LED5, OUTPUT);

 

  Serial.begin(9600);

 

}

 

void loop() {

 

  sensorValue = analogRead(sensorPin);  // read the value from the sensor:

  delay(500); 

 

  temperatureC = ((sensorValue *5.0/1024) – 0.5) * 100 ; //converts inputs into degrees centigrades

 

  if (temperatureC > 40 && temperatureC < 60)

 

  {

    digitalWrite(LED1, HIGH); //tells pin 10 to turn on

    delay(500); //waits for 2 seconds

    digitalWrite(LED1, LOW); //tells pin 10 to turn off

    delay(200); //waits 1 second

    digitalWrite(LED2, HIGH); //tells pin 10 to turn on

    delay(500); //waits for 2 seconds

    digitalWrite(LED2, LOW); //tells pin 10 to turn off

    delay(200); //waits 1 second

    digitalWrite(LED3, HIGH); //tells pin 10 to turn on

    delay(500); //waits for 2 seconds

    digitalWrite(LED3, LOW); //tells pin 10 to turn off

    delay(200); //waits 1 second

    digitalWrite(LED4, HIGH); //tells pin 10 to turn on

    delay(500); //waits for 2 seconds

    digitalWrite(LED4, LOW); //tells pin 10 to turn off

    delay(200); //waits 1 second

    digitalWrite(LED5, HIGH); //tells pin 10 to turn on

    delay(100); //waits for 2 seconds

    digitalWrite(LED5, LOW); //tells pin 10 to turn off

    delay(100); //waits 1 second

    digitalWrite(LED4, HIGH); //tells pin 10 to turn on

    delay(100); //waits for 2 seconds

    digitalWrite(LED4, LOW); //tells pin 10 to turn off

    delay(100); //waits 1 second

    digitalWrite(LED5, HIGH); //tells pin 10 to turn on

    delay(100); //waits for 2 seconds

    digitalWrite(LED5, LOW); //tells pin 10 to turn off

    delay(100); //waits 1 second

    digitalWrite(LED4, HIGH); //tells pin 10 to turn on

    delay(500); //waits for 2 seconds

    digitalWrite(LED4, LOW); //tells pin 10 to turn off

    delay(200); //waits 1 second

    digitalWrite(LED3, HIGH); //tells pin 10 to turn on

    delay(500); //waits for 2 seconds

    digitalWrite(LED3, LOW); //tells pin 10 to turn off

    delay(200); //waits 1 second

    digitalWrite(LED2, HIGH); //tells pin 10 to turn on

    delay(500); //waits for 2 seconds

    digitalWrite(LED2, LOW); //tells pin 10 to turn off

    delay(200); //waits 1 second

    digitalWrite(LED1, HIGH); //tells pin 10 to turn on

    delay(500); //waits for 2 seconds

    digitalWrite(LED1, LOW); //tells pin 10 to turn off

    delay(200); //waits 1 second

    digitalWrite(LED5, HIGH); //tells pin 10 to turn on

    delay(200); //waits for 2 seconds

    digitalWrite(LED5, LOW); //tells pin 10 to turn off

    delay(200); //waits 1 second

    digitalWrite(LED5, HIGH); //tells pin 10 to turn on

    delay(200); //waits for 2 seconds

    digitalWrite(LED5, LOW); //tells pin 10 to turn off

    delay(200); //waits 1 second

    digitalWrite(LED5, HIGH); //tells pin 10 to turn on

    delay(200); //waits for 2 seconds

    digitalWrite(LED5, LOW); //tells pin 10 to turn off

    delay(200); //waits 1 second

    digitalWrite(LED5, HIGH); //tells pin 10 to turn on

    delay(200); //waits for 2 seconds

    digitalWrite(LED5, LOW); //tells pin 10 to turn off

    delay(200); //waits 1 second

 

  }

  else if (temperatureC < 40 ) //lights jacketLED

  {

    digitalWrite(LED1, LOW); //tells pin 10 to turn on

    digitalWrite(LED2, LOW); //tells pin 10 to turn on

    digitalWrite(LED3, LOW); //tells pin 10 to turn on

    digitalWrite(LED4, LOW); //tells pin 10 to turn off

    digitalWrite(LED5, LOW); //tells pin 10 to turn off

  }

 

  Serial.print(temperatureC);

  Serial.print(” C – “);

  Serial.println(sensorValue);

 

}

 


 

Human-Cephalopod Acknowledgement Jacket

 

The first version of the Jacket used a 3.3 coin cell battery and holder with an accelerometer for sensing forward motion. The original idea was to have an item of clothing that lit up when the wearer was in motion, to alert other people that I was moving from hiding place to hiding place, like a small, tasty poisonous squid.I tested the accelerometer to only display data collected from the X access, as it was the forward (or backward) motion being captured that I wanted to represent. However after discussing this in class, it seemed likely that the Jacket would not flash for long enough based on that data, since it was only tracking moving from a standing position to a walking position.

The first prototype used red LEDs, a colour that could be driven by the 3.3 volt coin cell battery. Using this LED series calculator, I planned for each LED to have a 100 ohm resistor. I assembled a batch of them and covered the resistor with heat shrink to protect the solder and component from shorting out. The Jacket had lovely sinuous curves and patterns already stitched into it, so I planned to have my conductive traces echo those shapes.

The second prototype uses conductive snaps, a blue LED and a 3.7 rechargeable lithum battery. The Fray Stop fabric glue was too thin to anchor the ends of my 4 ply conductive thread, I used masking tape to isolate the ends of each knot while I was testing and building. Since the traces were very thin for the ones that connected to the LED, I only cut out the middle of the swirl. I found that having the entire swirl cut out meant it shifted too much when being ironed down. After ironing it in place, but leaving the end of it free, I cut out the rest of it, separating the positive and negative ends.

For the modularity of the coat, and for ease of testing, I designed a squid pocket to hold the microcontroller and the battery. I sewed snaps on the back of it for power, ground, pin 19 and pin 11. I planned circuit so that additional LEDs could be added in parallel, up to 5 in total. I tested markers on fabric before painting the top cover of the pocket, I wanted a simple, waterproof line drawing. The Sharpie bled too much on my test version so for the final drawing I used acrylic paint on the body of the squid and then outlined it in Sharpie.

The code I used for this project came from the tilt sensor tutorials on Lady Ada. All I had to edit was the input and output pin numbers. I found that a gentle rocking motion was better for completing the circuit with the tilt sensor, but having it on my shoulder where the previous accelerometer was didn’t create enough movement to close the circuit. I moved the sensor to my elbow, so that I could bend and raise my arm to trigger the sensor. This resulted in a casual hand wave being the best motion to trigger the LED, so I changed the title of the piece.

I experimented with using acrylic paint to seal the ends of the conductive thread notes, but repeat applications are needed to make that look tidy.

The final code for this project is the tilt sensor code posted on adafruit, with pin numbers updated for my project:


/* Better Debouncer
*
* This debouncing circuit is more rugged, and will work with tilt switches!
*
* http://www.ladyada.net/learn/sensor/tilt.html
*/

int inPin = 19;         // the number of the input pin
int outPin = 11;       // the number of the output pin

int LEDstate = HIGH;      // the current state of the output pin
int reading;           // the current reading from the input pin
int previous = LOW;    // the previous reading from the input pin

// the follow variables are long's because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long time = 0;         // the last time the output pin was toggled
long debounce = 50;   // the debounce time, increase if the output flickers

void setup()
{
pinMode(inPin, INPUT);
digitalWrite(inPin, HIGH);   // turn on the built in pull-up resistor
pinMode(outPin, OUTPUT);
}

void loop()
{
int switchstate;

reading = digitalRead(inPin);

// If the switch changed, due to bounce or pressing...
if (reading != previous) {
// reset the debouncing timer
time = millis();
}

if ((millis() - time) > debounce) {
// whatever the switch is at, its been there for a long time
// so lets settle on it!
switchstate = reading;

// Now invert the output on the pin13 LED
if (switchstate == HIGH)
LEDstate = LOW;
else
LEDstate = HIGH;
}
digitalWrite(outPin, LEDstate);

// Save the last reading so we keep a running tally
previous = reading;
}

Responsive Wearable : Seeing Red

Hello Everyone!

This is my third time trying to put up this post (its deleted twice before…SUPER FRUSTRATING), so this will be brief. Prof. Hartman, if you need more in depth descriptions let me know.

My concept was figuring out how to communicate emotional gestures through light and shape. I used a red LED, FSR, LilyPad Arduino, 3V battery and conductive thread.

Below are my process images, Arduino code and circuit diagram:

Process Work Images (click on link to view)

Circuit Diagram for Responsive Wearable copy (click on link to view)

ARDUINO CODE:

 

int sensorPinarm = A3;                 // Arm sensor is connected to analog pin 4
int sensorPinwaist = A4;               // Waist sensor is connected to analog pin 3
int ledPinyellow = 6;                  // Yellow LED is connected to digital pin 6
int ledPinred = 9;                     // Red LED is connected to digital pin 9
int sensorValuearm = 0;   // variable to store the value coming from the Arm sensor
int sensorValuewaist = 0; // variable to store the value coming from the Waist sensor

void setup()  
{

  pinMode(ledPinred, OUTPUT);         // sets the ledPinred to be an output
  pinMode(sensorPinarm, INPUT);       // sets the Arm sensor to be an input
  digitalWrite(ledPinred, LOW);       // turn the red LED off
  Serial.begin(9600);

}

void loop()                 // perform actions if conditions are met
{
  sensorValuearm = analogRead (sensorPinarm);
  Serial.println(sensorValuearm);  

if (sensorValuearm >= 50 )
{ digitalWrite(ledPinred, LOW);
}                           // if the waist sensor is greater than , then the red LED turns on

else
{ digitalWrite (ledPinred, HIGH);
}           // if the waist sensor is less than , then the red LED turns off

}

 

Thanks for taking a look! Hope you enjoy!

 

– Ash

 


 

Responsive Tech Project: The bendie arm, blinkie light, slevie wearable thingie

This project was my first attempt with the dreaded code writing learning curve. I wasn’t sure what to do so I started with the hard ware side of it. I was intrigued by the notion of a stretch sensor so I went to Creatron and found me a stretch sensor. They came in two lengths,3 and 4 inch and stretch 150% longer than it’s stock length; I was pretty amazed at that alone. I then hooked up the prototype circuit to the Lillypad board (pictured bellow) and the LED. I then plugged it into the Arduino software. I tried a couple of mapping attempts with what seemed to be success but when I went back to re-edit the sample code (bellow) it didn’t matter what values I put in. I am sure I didn’t do something right, numbers, values etc. The code still worked for what I needed and all I had to do was reassign the pins and…success! The circuit worked with two sample codes. The blink sample worked the best but the fade also worked.

Here is a video! http://youtu.be/UEAB3H3sQvw

The Code:

const int analogInPin = A5; // Analog input pin that the potentiometer is attached to
const int analogOutPin =5; // Analog output pin that the LED is attached to

int sensorValue = 168; // value read from the pot
int outputValue = 0; // value output to the PWM (analog out)

void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}

void loop() {
// read the analog in value:
sensorValue = analogRead(analogInPin);
// map it to the range of the analog out:
outputValue = map(sensorValue, 0, 1023, 0, 255);
// change the analog out value:
analogWrite(analogOutPin, outputValue);

// print the results to the serial monitor:
Serial.print(“sensor = ” );
Serial.print(sensorValue);
Serial.print(“\t output = “);
Serial.println(outputValue);

// wait 2 milliseconds before the next loop
// for the analog-to-digital converter to settle
// after the last reading:
delay(2);
}

WIth all that worked out I thought of applications on the body. I decided on the crook of the arm. It had great stretch potential, lots of common movement over minimal distances. I thought of making a complex arm band system but found some welders sleeves in my kit at home. They are worn to protect from sparks when needed. I used conductive tread and hand stitched every circuit trace. I was careful to ensure that they didn’t short any where by routing threads over and under crosses and around the opposite side for the light to ensure they didn’t cross. After carefully stitching everything, I tried on the device to make sure it still worked as well as the prototype did. The pictures bellow show the completed sleeve with the Lillypad, batteries, resistor attached to the stretch sensor on one side and the Lillypad LED light with built in resistor on the other side all connected with conductive tread. I could probably have gotten away with using a button cell battery instead.

When worn the device’s LED light blinks faster with less resistance. Streeetch your arm and the light blinks slower. A simple gesture with a simple form using a simple code. Mission accomplished!!

light yourself up

Concept

During last year’s winter I was hit by a car while walking in the dark. So for this project, I wanted to add LED lights to the back of the wool hat so it can be used as a safety device as well as maintain it’s aesthetic view.

Components

  • LilyPad LED White x 3
  • LilyPad Arduino Board Simple
  • Lilypad Light Sensor
  • Conductive Thread
  • 3 AAA Battery

Circuit diagram

 Codes

Originally I was planning to insert a Lilypad buzz sensor to the product so it will give out a buzz signal to the users when the light is on.However; I found it really difficult combining the two sensors together. Therefore, instead of having two sensors together, i chose to insert the light sensor only. I first applied the set of codes provided by the Arduino tutorial, this set of codes allows me to turn the LED lights on and off but this is not what i desired. In order to have different brightness levels, adjustment was made and it is shown below:

int ledPin = 9; // LED is connected to digital pin 9
int led2Pin = 10; // LED is connected to digital pin 10
int led3Pin = 11; // LED is connected to digital pin 11
int led4Pin = 6; // LED is connected to digital pin 6
int led5Pin = 5; // LED is connected to digital pin 5

int sensorPin = A2; // light sensor is connected to analog pin 2
int sensorValue; // variable to store the value coming from the sensor

void setup()
{
pinMode(ledPin, OUTPUT); // sets the ledPin to be an output
pinMode(sensorPin, INPUT); // sets the ledpin to be an input
Serial.begin(9600); //initialize the serial port

}

void loop() // run over and over again
{
sensorValue = analogRead(sensorPin); // read the value from the sensor
analogWrite(ledPin, abs(sensorValue/4-255)); // 0=255, 255=0
analogWrite(led2Pin, abs(sensorValue/4-255)); // 0=255, 255=0
analogWrite(led3Pin, abs(sensorValue/4-255)); // 0=255, 255=0
analogWrite(led4Pin, abs(sensorValue/4-255)); // 0=255, 255=0
analogWrite(led5Pin, abs(sensorValue/4-255)); // 0=255, 255=0
Serial.println(sensorValue); // send that value to the computer
delay(100); // delay for 1/10 of a second
}

 

 

Another set of codes were made in order to get the best result and it’s shown below:

int ledPin = 5; // LED connected to digital pin 13
int ledPin1 = 6;
int ledPin2 = 9;
int ledPin3 = 10;
int ledPin4 = 11;

int sensorPin = A2; // light sensor is connected to analog pin 0
int sensorValue = 0; // variable to store the value coming from the sensor
int sensorFrequency = 100; // number of milliseconds between sensor readings

int lightThreshold1 = 10; // threshold below which light turns on
int lightThreshold2 = 500; // threshold below which light turns OFF

void setup()
{
pinMode(ledPin, OUTPUT); // sets the ledPin to be an output

pinMode(ledPin1, OUTPUT); // sets the ledPin to be an output
pinMode(ledPin2, OUTPUT); // sets the ledPin to be an output
pinMode(ledPin3, OUTPUT); // sets the ledPin to be an output
pinMode(ledPin4, OUTPUT); // sets the ledPin to be an output

Serial.begin(9600); //initialize the serial port

}

void loop() // run over and over again
{
sensorValue = analogRead(sensorPin); // read the value from the sensor
Serial.println(sensorValue); // send that value to the computer

/* Turn on the LEDs if the light sensor drops below threshold */
if (sensorValue <= lightThreshold1){
analogWrite(ledPin, 255); // turn the LED on

analogWrite(ledPin1, 255); // turn the LED on
analogWrite(ledPin2, 255); // turn the LED on
analogWrite(ledPin3, 255); // turn the LED on
analogWrite(ledPin4, 255); // turn the LED on
}
else if (sensorValue > lightThreshold2) // turn the LEDs off
{
analogWrite(ledPin, 0); // turn the LED off
analogWrite(ledPin1, 0); // turn the LED off
analogWrite(ledPin2, 0); // turn the LED off
analogWrite(ledPin3, 0); // turn the LED off
analogWrite(ledPin4, 0); // turn the LED off
}
else {
analogWrite(ledPin, 10);
analogWrite(ledPin1, 10);
analogWrite(ledPin2, 10);
analogWrite(ledPin3, 10);
analogWrite(ledPin4, 10);
}

/* Delay for defined delay period */
delay(sensorFrequency);
}

Detail of the final project:

                                        Right Pouch for the Lilypad Simple                                                                       Left pouch for the battery

  

Back view of the hat with the LED lights attached                                                                            Brightest at night/ dark ares                                                                                                     Dimmer with room light

                                     Fully off under the light/sun

 

 

Responsive Wearable

CODE:

int ledPin = 11; // LED connected to digital pin 13
int ledPin1 = 10;
int ledPin2 = 9;
int ledPin3 = 6;
int ledPin4 = 5;

int sensorPin = A2; // light sensor is connected to analog pin 0
int sensorValue = A2; // variable to store the value coming from the sensor
int sensorFrequency = 100; // number of milliseconds between sensor readings

int lightThreshold = 10; // threshold below which light turns on

void setup()
{
pinMode(ledPin, OUTPUT); // sets the ledPin to be an output

pinMode(ledPin1, OUTPUT); // sets the ledPin to be an output
pinMode(ledPin2, OUTPUT); // sets the ledPin to be an output
pinMode(ledPin3, OUTPUT); // sets the ledPin to be an output
pinMode(ledPin4, OUTPUT); // sets the ledPin to be an output

Serial.begin(9600); //initialize the serial port

}

void loop() // run over and over again
{
sensorValue = analogRead(sensorPin); // read the value from the sensor
Serial.println(sensorValue); // send that value to the computer

/* Turn on the LEDs if the light sensor drops below threshold */
if (sensorValue <= lightThreshold){
digitalWrite(ledPin, HIGH); // turn the LED on

digitalWrite(ledPin1, HIGH); // turn the LED on
digitalWrite(ledPin2, HIGH); // turn the LED on
digitalWrite(ledPin3, HIGH); // turn the LED on
digitalWrite(ledPin4, HIGH); // turn the LED on
}
else // turn the LEDs off
{
digitalWrite(ledPin, LOW); // turn the LED off

digitalWrite(ledPin1, LOW); // turn the LED off
digitalWrite(ledPin2, LOW); // turn the LED off
digitalWrite(ledPin3, LOW); // turn the LED off
digitalWrite(ledPin4, LOW); // turn the LED off
}

/* Delay for defined delay period */
delay(sensorFrequency);
}

Lämpötila

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Lämpötila is an interactive winter hat that monitors the ambient temperature and reflects the analysis of changes in temperature through a series of LEDs accordingly.

Lämpötila Documentation

Lämpötila Video

Lämpötila Process Video