Arm band tilt sensor

When we started everyone had a similar general idea to create a project attached to clothing that would make a noise depending on a certain movement. We eventually decided on a project that was most similar to Arizona’s yoga band idea and Angelina’s step/music idea. Together we decided to create a set of wristbands that would make a sound when a certain motion was done. Initially we wanted each of us to have two wristbands, each set to a different tone so that together they could play a song when moved. We quickly realized, however, that this was not going to be possible because of the amount of work it would involved compared with the amount of time we had. We started by prototyping with a buzzer and a remote on an Arduino. This was able to work fairly well, although we had problems with the remotes not sending signals to the receiver. We found several remotes that worked and then tried to move the whole circuit onto a Lilypad Arduino. After struggling with the coding for a long time, even with the help of Professor Antonius, we found that the libraries were not compatible between the devices we were using. Because of this we were forced to go back to using a regular Arduino for our project. The next hurdle was the remote and how to activate the tone. We wanted to use a tilt sensor to activate or deactivate the tone, so we planned to short circuit a remote so it would always be on, attach a tilt sensor and that would determine whether a signal was sent or not. After trying to use copper tape and trying to solder the remote, we eventually had to settle for pressing the button as well because neither of the other methods were short circuiting the remote. We cut a button out of the remote top and taped it back on in place over the button we were using in the remote. Unfortunately, the button was still really difficult to use and needed to be pressed down hard in order to connect.  We soldered the remote to a 3V coin battery and a tilt sensor so that when the button was pushed and the remote tilted it would turn the tone on and off. Once the Arduino was attached to the breadboard we had initially used for prototyping, we were ready to put the circuit and remote onto wristbands so it could be worn. The Arduino, AA battery pack and breadboard were all connected and large enough to require three wristbands. We used black and pink more for aesthetic choice rather than for any other particular reason. Slits were then cut into the top and bottom of the middle wristband and one end each of the top and bottom wristbands. Carefully we put the circuitry into the wristbands with the arduino in the middle, the breadboard at one end, and the battery pack at the other. The wristband with the breadboard also had a hole in the top layer of fabric in order for the remote sensor to receive signal without being blocked by the fabric. The remote was put into a separate wristband with a hole cut out of the center of the Adidas symbol so it was easy to locate where the push button was. When we initially tried it on, I had the Arduino wristband on one arm and the remote wristband on the other. Immediately we realized that I couldn’t push the button with one arm while trying to point the remote at the same arm. Once someone else put on the remote wristband, we tried it and the buzzer made a tone– it worked! A few flaws with the system include the bulk of the Arduino, the heat of the battery back inside the wristband, the difficulty in pressing the remote button, the overall size of the Arduino wristband and lack of room for a normal sized wrist because of the bulk, and the delicacy of the breadboard in the wristband. When I put on the Arduino wristband just before we presented it, several of the wires connecting the Arduino with the breadboard came undone because of pulling the wristband on. Overall, for future use I’d like to see the circuitry, batteries and all, reduced in size. It would also be nice to have an easier button (aka short circuited or otherwise) and the ability to play more than a single tone.

-Sarah Brooker

#define BUZZER  10                        //Connect Buzzer to Digital Pin 10
#define LED_RED 11                        //Connect a Red LED to Digital Pin 11
#define IR_IN   8                         //Connect the Infrared receiver to Digital Pin 8
 
int Pulse_Width=0;                       //Pulse width
int  ir_code=0x00;                       //IR command code

void timer1_init(void){                  //Initilize timer
    TCCR1A = 0X00; 
    TCCR1B = 0X05; 
    TCCR1C = 0X00;
    TCNT1  = 0X00;
    TIMSK1 = 0X00;  
}

void remote_deal(void){                         //Get IR command
    Serial.println(ir_code,HEX);
    switch(ir_code){
    case 0xff00:                                //Press stop button on the remote controller
        digitalWrite(LED_RED,LOW);              //Turn off red led
        digitalWrite(BUZZER,LOW);               //Silence the buzzer
        break;
    case 0xfe01:                                //Press VOL+ button
        tone(BUZZER, 784, 1000);
        digitalWrite(BUZZER,HIGH); ;             //Turn off Red LED
        break;
    case 0xf609:                                //Press VOL- button
        tone(BUZZER, 640, 1000);
        digitalWrite(BUZZER,HIGH);              //Turn on Buzzer
        break;
    }
}

char logic_value(){                                         // The function determine the logic value "1" and "0".
    while(!(digitalRead(8)));                               //Wait low 
    Pulse_Width = TCNT1;
    TCNT1 = 0;
    if( Pulse_Width >= 7 && Pulse_Width <= 10 ){               //low level 560us
        while(digitalRead(8));                                //Value is high, then wait.
        Pulse_Width = TCNT1;
        TCNT1=0;
        if( Pulse_Width >= 7 && Pulse_Width <= 10 )            //High level 560us
             return 0;
        else if( Pulse_Width >= 25 && Pulse_Width <= 27 )      //High level 1.7ms
             return 1;
    }
    return -1;
}

void pulse_deal()  {                                 //Receive address code and command code pulse function
    int i;   
    // Run 8 zeros
    for(i=0; i<8; i++) {
      if( logic_value() != 0 )                       //If it isn't 0.
          return; 
    }
    // Run 6 ones
    for(i=0; i<6; i++) {
      if(logic_value()!= 1)                        //If it isn't 1.
          return;
    }
    // Run 1 zero
    if(logic_value()!= 0)                          //If it isn't 0.
        return;
    //Run 1 one
    if(logic_value()!= 1)                          //If it isn't 1.
        return;
  
    //decode the commands of IR remote control codes 
    ir_code = 0x00;                                  //clear
    for(i=0; i<16;i++ )  {
      if(logic_value() == 1)   {
        ir_code |=(1<<i);
      }
    }
}

void remote_decode(void){                          //decode function
    TCNT1 = 0X00;       
    while(digitalRead(8)){                         // Value is high, then wait.
      if(TCNT1>=1563) {                            // High level duration exceeds 100ms,which means "no button pressed".
        ir_code = 0xff00;
        return;
      }  
    }
    
    // High level duration doesn't exceed 100ms.
    TCNT1 = 0X00;
    while(!(digitalRead(8)));                           // wait low
    Pulse_Width=TCNT1;
    TCNT1 = 0;
    if(Pulse_Width>=140&&Pulse_Width<=141) {            // 9ms  
        while(digitalRead(8));                          //Value is high, then wait.
        Pulse_Width=TCNT1;
        TCNT1=0;
        if(Pulse_Width>=68&&Pulse_Width<=72) {          //4.5ms
          pulse_deal();
          return;
        }
        else if(Pulse_Width>=34&&Pulse_Width<=36){     //2.25ms
          while(!(digitalRead(8)));                    //wait low
          Pulse_Width=TCNT1;
          TCNT1=0;
          if(Pulse_Width>=7&&Pulse_Width<=10){         //560us
            return; 
          }
        }
    }
}

void setup(){
  unsigned char i;
  pinMode(LED_RED,OUTPUT);                      //Set red led pin output
  Serial.begin(9600);
  pinMode(BUZZER,OUTPUT);                       //Set buaaer pin output
  pinMode(IR_IN,INPUT);                         //Set ir receiver input
}

void loop(){  
  timer1_init();                                //timer init
  while(1){
    remote_decode();                            //decode
    remote_deal();                              //Run decodeerout
  }  
}

Sound Making Wristband

Partner: Kai, Sarah, Arizona and Angelina

Material: 4 wristbands, tilt sensor, remote, breadboard, portable battery, Arduino kit,

Project Description:

In this group project, we made a sound making wristband that can play a sound of tone 640 when the user pressed another wristband (with remote inside) and tilt his or her wrist (with tilt sensor inside).

A potential future application of this project is to have 7 wristbands playing 7 notes (do, re, mi, fa, so, la, si) wearing by different people. Then they can make up a Wristband Chorus. With a conductor getting everyone to play ensemble or synergy, the Wristband Chrous will hopeful play any songs at their wish.

DEMO:

Procedure:

a) Idea Generation

The final idea is actually a combination and recreation of everyone’s own individual idea from brainstorming process. Arizona wants to make a yoga band which can evaluate the difficulty level of different yoga postures and give bonus to the users by triggering different sounds. Sarah wants to make a dress which trigger beautiful music when the sleeves touch the skirt. Kai wants to make a T-shirt which can show different colors according to people’s movement. And I want to make a pair of shoes that can give users instant feedback (such as sound or vibration) based on different

distances the user can walk or run through. The most beautiful thing is we connect everything together and makes a wristband that is intended to track the users’ movement, and give instant feedbacks by trigger sound.

b) Arduino Placement

We used wristbands to hide all the components including breadboard, Arduino kits, battery and the remote. Our initial idea is to hide everything in a single wristband so that it will be more flexible and neat. One of the most important thing to achieve this goal is to have Lilypad to replace the bulky Arduino Uno board. However, it later turned out that we could not find the correct package to communicate to Lilypad, therefore we finally gave up the idea of using Lilypad, and used three wristbands to hold the components. Therefore in the following steps, we all use Arduino Uno but not Lilypad to connect to the other components.

 

 

c) Breadboard Components

On our breadboard, we used a remote sensor, a buzzer, a LED light and resistor. Although we will remove the LED in the final version, we find it really helpful to have it in the testing process, because it can perfectly indicate whether the circuit connected or not. And I think in my future circuit planning, I will reserve a place for some indicator to better control the risk of each step. For the testing code, we use the sample code in the Arduino package, and based on that, we programmed the Volume+ and Volume- buttons to trigger two different tones.

 

d) Tilt Sensor

To add the tilt sensor into the remote, we cracked more than 5 remotes. Great thanks to Antonius for teaching and showing us patiently on how to make the best use of the remote by taking it apart  and connect it to different components (for example by using conductive tape to make the circuit always short) to play out different functions. And we tried reconnect the circuit here by two means: 1) solder the button of the Volume –  to make it always on; 2) take out the battery and connect it to the tilt sensor. For the first part, although we tried for a lot of times with different approaches, it did not work out finally, so we used the conductive tape instead. For the second part, it worked perfectly in the prototype and we soldered the tilt sensor and the battery firmly to connect with the circuit in the remote.

 

Reflection:

As a prototype of the Sound making Wristband, I think our project works well in terms of function. However, it is still far away from our initial idea of making a Wristband Chorus. Actually therefore are three main parts we can further work on to achieve a better result. The first thing is about the size of the wristband, we hope to find a way to use Lilypad to communicate instead of the Arduino Uno therefore we can hide everything in the Wristband in a more neat and flexible way. Secondly,  so far the user still need to press the button to trigger the sound, which might demand too much inputs from the user and undermine the flexibility of a wristband. We intend to solve problem by soldering the button to make it always on. When we found it failed, we used the conductive tape to achieve that. However, at last we found it is still too loose and need users press it by themselves. It would definitely be better if we can optimize this part as well. Last but not least, if we put more efforts in the remote design and make it more sensible and more functional when the user tilt their arm, the project will be more interesting by triggering different sounds with different user interactions.

#define BUZZER  10                        //Connect Buzzer to Digital Pin 10
#define LED_RED 11                        //Connect a Red LED to Digital Pin 11
#define IR_IN   8                         //Connect the Infrared receiver to Digital Pin 8
 
int Pulse_Width=0;                       //Pulse width
int  ir_code=0x00;                       //IR command code

void timer1_init(void){                  //Initilize timer
    TCCR1A = 0X00; 
    TCCR1B = 0X05; 
    TCCR1C = 0X00;
    TCNT1  = 0X00;
    TIMSK1 = 0X00;  
}

void remote_deal(void){                         //Get IR command
    Serial.println(ir_code,HEX);
    switch(ir_code){
    case 0xff00:                                //Press stop button on the remote controller
        digitalWrite(LED_RED,LOW);              //Turn off red led
        digitalWrite(BUZZER,LOW);               //Silence the buzzer
        break;
    case 0xfe01:                                //Press VOL+ button
        tone(BUZZER, 784, 1000);
        digitalWrite(BUZZER,HIGH); ;             //Turn off Red LED
        break;
    case 0xf609:                                //Press VOL- button
        tone(BUZZER, 640, 1000);
        digitalWrite(BUZZER,HIGH);              //Turn on Buzzer
        break;
    }
}

char logic_value(){                                         // The function determine the logic value "1" and "0".
    while(!(digitalRead(8)));                               //Wait low 
    Pulse_Width = TCNT1;
    TCNT1 = 0;
    if( Pulse_Width >= 7 && Pulse_Width <= 10 ){               //low level 560us
        while(digitalRead(8));                                //Value is high, then wait.
        Pulse_Width = TCNT1;
        TCNT1=0;
        if( Pulse_Width >= 7 && Pulse_Width <= 10 )            //High level 560us
             return 0;
        else if( Pulse_Width >= 25 && Pulse_Width <= 27 )      //High level 1.7ms
             return 1;
    }
    return -1;
}

void pulse_deal()  {                                 //Receive address code and command code pulse function
    int i;   
    // Run 8 zeros
    for(i=0; i<8; i++) {
      if( logic_value() != 0 )                       //If it isn't 0.
          return; 
    }
    // Run 6 ones
    for(i=0; i<6; i++) {
      if(logic_value()!= 1)                        //If it isn't 1.
          return;
    }
    // Run 1 zero
    if(logic_value()!= 0)                          //If it isn't 0.
        return;
    //Run 1 one
    if(logic_value()!= 1)                          //If it isn't 1.
        return;
  
    //decode the commands of IR remote control codes 
    ir_code = 0x00;                                  //clear
    for(i=0; i<16;i++ )  {
      if(logic_value() == 1)   {
        ir_code |=(1<<i);
      }
    }
}

void remote_decode(void){                          //decode function
    TCNT1 = 0X00;       
    while(digitalRead(8)){                         // Value is high, then wait.
      if(TCNT1>=1563) {                            // High level duration exceeds 100ms,which means "no button pressed".
        ir_code = 0xff00;
        return;
      }  
    }
    
    // High level duration doesn't exceed 100ms.
    TCNT1 = 0X00;
    while(!(digitalRead(8)));                           // wait low
    Pulse_Width=TCNT1;
    TCNT1 = 0;
    if(Pulse_Width>=140&&Pulse_Width<=141) {            // 9ms  
        while(digitalRead(8));                          //Value is high, then wait.
        Pulse_Width=TCNT1;
        TCNT1=0;
        if(Pulse_Width>=68&&Pulse_Width<=72) {          //4.5ms
          pulse_deal();
          return;
        }
        else if(Pulse_Width>=34&&Pulse_Width<=36){     //2.25ms
          while(!(digitalRead(8)));                    //wait low
          Pulse_Width=TCNT1;
          TCNT1=0;
          if(Pulse_Width>=7&&Pulse_Width<=10){         //560us
            return; 
          }
        }
    }
}

void setup(){
  unsigned char i;
  pinMode(LED_RED,OUTPUT);                      //Set red led pin output
  Serial.begin(9600);
  pinMode(BUZZER,OUTPUT);                       //Set buaaer pin output
  pinMode(IR_IN,INPUT);                         //Set ir receiver input
}

void loop(){  
  timer1_init();                                //timer init
  while(1){
    remote_decode();                            //decode
    remote_deal();                              //Run decodeerout
  }  
}

Group Project Documentation (Leah)

Date: April, 25
Partner: Phyllis, Dania, Diego
Project description:
Our project is a T-shirt that guides a person who wears it direction with the vibrating motors. There are two LDR seniors on two side of the T-shirt, each of them communicates with one Vibrating motor to controls that as a switch. When you use light pointing towards LDR sensor, the read of analog will change and trigger or stop the vibrating motor.
Brainstorm
 As the prompt asked, we have to extend people’s sense in our project. So on the other hand, if we dismiss one sense from a person and add that sense to our project, it can still fulfill the request.  So we will use a blinder to blind one person of our group, to take the sight away and let the person wear the T-shirt. Then another person will use a flashlight to guide the person directions.
Start with code and circuit
We first tried our circuit on the breadboard to get a basic sense of the circuit as well as testing the sensors. They worked well.
Then we started to move the circuit in Lilypad. The circuit looks extremely different and hard to figure out in Lilypad with special circle structure. So we started with a sketch on paper.
Then Daina and Phyllis sewed the circuit into one piece of fabrics with Lilypad. They used conductive thread to connect the component while I helped to made loops on wires so that they will still use wires as main connections of the circuit and sew the wires into the fabric.
 
Diego soldering motors with wires so that we can connect them with wires easily. He used hot glue in connection points to protect the circuit.
 
Design:
We started with making two motors not he shoulders and LDR on the chest. Later we found it is not the best design. For there is a waste of wires in this connect since we had to hide the Lilypad behind. Besides, having LDR on the front looks strange, and the people who are guiding the road will only see the road with LDR on the back.
So I and Diego couch the wires of motors on the two side of backs and we connected all the circuit piece by piece.
Final process:
We used tapes to make the connections stronger and here is the final demo
Accident:
One LDR was broken during the presentation, the connection wire of another motor broke as well. So our project has been working at all during the presentation.
Improve in the future:
Fix two sensors
Used battery instead of the computer as sources.
Make circuit cleaner.

Documentation assignment 5

 

For our group project, we went through a process of narrowing down the main idea, as well as a rather lengthy execution.

First, we were contemplating different projects, some of which aimed at amplifying a sense, and others aimed at depriving of and substituting a sense of the wearer. After discussing several options, we all agreed that it would be interesting to build a project in which someone would have to rely on a third person to move around a space.

When we settled for using vibration motors to guide a blindfolded user, we thought of first using sound as a way to direct the vibration, but then we realized that it made more sense to use light. That is how we ended up coming up with this project: a combination of LDR’s, Vibration motors and an Arduino (lilypad).

In terms of execution, we followed different steps:

  • Testing the circuit in the Arduino
  • Moving the circuit to a piece of fabric
  • Couching the components onto the shirt
  • Final tests

For the first step, we started building a simple circuit with a breadboard and an Arduino. We took the components (2 motors, 2 LDR’s, 2 resistors and a few wires) and built a prototype. Once we got it working, we moved on to the second phase.

For the second part of the execution, we split and I went to do the soldering work while Dania, Phylis and Lea were working on placing the lilypad and the supporting components onto some fabric.

The soldering took a while because of a few things. First, the wires of the motors were very small, so we had to use a lot of solder melted into blobs to seal the connections. Furthermore, the stranded core wires had to be twisted to make the connections and then, after Antonius suggested it, we added hot glue to seal the soldering job. Here are some pictures of the process.

Below, once we got the first parts of the circuit to work, we moved on to the tests to ensure that the motors and LDRs were working. We tried the motors with the code below:

const int motorPin = 9;

void setup(){

pinMode(motorPin, OUTPUT);

}

void loop(){

digitalWrite(motorPin, HIGH);

delay(1000);

digitalWrite(motorPin, LOW);

delay(59000);

}

There is a picture of the LDR readings on the console that shows them working. We used this code to test them:

int sensorPin = A0; // select the input pin for LDR

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

void setup() {

Serial.begin(9600); //sets serial port for communication

}

void loop() {

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

Serial.println(sensorValue); //prints the values coming from the sensor on the screen

delay(100);

}

 

While this was going on, Leah and I moved on to start couching the motors onto the t-shirt. We had a little change of design while executing this part, because originally we thought of putting them on the sleeve, then realized that it might be loose so it would not do its job.

We restructured the circuit, giving it a symmetric shape for the motors and sensors so that it would look neat and be under the user’s shoulder, thus giving him or her the feeling that someone is tapping on their shoulder.

For the last part of the process, once everything was built together, we combined the previously used programs into a very straightforward code that declared the LDRs as an input, the motors as an output and gave them a working range.

On Friday, I was travelling to Shenzhen and the rest of the team finished couching the components and ran our final tests. As you saw in the video we showed in class, everything was pretty much working perfectly until the presentation, which was a shame.

I really enjoyed this project because instead of only focusing on the coding part, I ended up taking part in the execution and it was very fun to work with the group. I really liked the project because it has an important human component – trust – embedded in the core of the idea, and turning this project into fabric and circuitry was very satisfying.

Certainly, there is room for improvement. Antonius suggested that next time we used male to female ends on the connections so that they can be easily changed. That is something that should be implemented in next projects, as it ensures that a broken component does not ruin the project.

All in all, I enjoyed working on this project, and I am very happy with the team, and I think this has prepared me for my final project as it has given me clarity in terms of what sense I want to amplify and through which means.

Lastly, the pictures that I have uploaded so far are very low quality and only 1/3 of all the documentation has been uploaded because my internet is really bad. I will update them from school tomorrow.

EDIT: ALL PICTURES UPLOADED

Talking Fabrics: Group Project

Title: Guide Shirt

Collaborators: Diego, Dania, Leah, Phyllis

Documented by: Phyllis

Materials: LDR*2, Lilypad*1, motor*2, 3.7 V battery*1, wires, T-shirt*1.

Inspiration: “Trust games” have always been popular among friends, so our group agreed on Diego’s idea of designing a new form of trust game on fabrics (which in our case is a shirt).

How It Works

Our project requires a cooperation between two people — A and B. A wears the shirt while B has a torchlight with him/her, and B acts as A’s “guide.” By pointing the torchlight to the left (right) LDR sensor, the motor on the left (right) will vibrate, meaning A should turn left (right). When both motors are vibrating, then A should go straight. All components are built on the shirt (expect the torchlight of course).

Process

To start with, we first drew our circuit on paper to get a clearer idea of building the actual one. Since the components are duplicated in our project, as you may see in the picture below, we only drew half of the entire circuit.

Then we moved the whole circuit onto the Arduino.

To test if this circuit was working, we connected the motors to the Arduino in the simplest way that is shown below.

As you may see from the video below, since it was working well, we decided to move the whole circuit to the lilypad.

Similar to what we had done when building the circuit on the Arduino, Dania and I took turns trying to figure out the circuit on the lilypad. We tried more than three times drawing it on paper, and below is what we considered the best well-explained version.

Then Dania and I took turns sewing the whole circuit onto a piece of fabric. We used conductive thread as the connection between the lilypad/the resisters and the wires (as is shown in the pictures below). Since there are many branches in our circuit, in order to avoid short circuit, we used strong wires as the “trunks” of each branch and made hooks on both sides so that it would be easier to sew the branches with conductive thread. Since conductive thread is kind of hard to be stay in shape, I also twisted the softer wires and twined them onto the stronger ones to make better connections.

Twisting the wires and making hooks on both sides.

After moving the whole circuit onto the lilypad (as is shown below in the left picture), I sewed the wires on the fabric with normal thread to make the whole circuit on the fabric more solid (as is shown below in the right picture) and move the fabric onto our shirt.

 

Initially, we planned to place one motor on each sleeve. However, I realized that the upper parts of the two sleeves (arms) are actually in the air when we are wearing T-shirts, which means the two sleeves actually cannot directly touch our skin. Therefore, in order to improve the functionality of our project, we agreed on moving them to the back, over the LDRs. Diego and Leah finished sewing the motors on the shirt. In case the circuit works, Dania and I took a testing video first before moving on.

It is working well. Dania and I then started placing the LDRs.

 

Since we changed the placement of the LDR, I cut the extra length and placed the LDRS on the shirt under the motors, first using tapes to stabilize them.

After finding the most appropriate position, I used the little scissors (used for cutting threads) to make a hole on each side of the shirt so that the LDRs would appear and detect light efficiently after flipping the shirt inside out.

Below on the left is how our shirt looks inside, and on the right is how it looks like outside.

Reflection and Further Improvement

We did test whether it worked or not after finished everything, and it worked. Unfortunately, we forgot to take a final working video which is so stupid of us… Therefore, it turned out that when we were presenting to our class, one of the motors was off and one of the LDRs was broken.

For further improvement, first, we would definitely remember to take testing videos throughout our process so that we will have something as a backup to show our peers. We did do testings throughout the process, however, taking testing videos while testing is even more important!!

Second, to make it wireless, we will definitely have the 3.7V battery on our circuit so that we don’t have to connect our circuit to the computer.

Third, in terms of the whole design, especially the circuit design, we would spend more time to make it neater, so that it won’t look so confusing and sort of chaotic inside our shirt (but we did try our best to make it as neat as possible!).

int sensorPin1 = A1;
int sensorPin2 = A2;

int sensorValue1 = 0;
int sensorValue2 = 0;

const int motorPin1 = 6;
const int motorPin2 = 13;

void setup() {
  Serial.begin(9600);
  pinMode(motorPin1, OUTPUT);
  pinMode(motorPin2, OUTPUT);
}

void loop() {
  sensorValue1 = analogRead(sensorPin1);
  sensorValue2 = analogRead(sensorPin2);

  //get sensor value
  Serial.print("sensorValue1: ");
  Serial.println(sensorValue1);
  Serial.print("sensorValue2: ");
  Serial.println(sensorValue2);

//turn on motor 1
  if (sensorValue1 >= 1023) {
    digitalWrite(motorPin1, HIGH);
    delay(1000);
  } else {
    digitalWrite(motorPin1, LOW);
  }

//turn on motor 2
  if (sensorValue2 > 800) {
    digitalWrite(motorPin2, HIGH);
    delay(1000);
  } else {
    digitalWrite(motorPin2, LOW);
  }
}

Assignment 5: Tilt Remote Sensor Makes a Sound

In this group project, Angelina, Sarah, Arizona, and I made a tilt remote sensor with the Arduino that can play a sound corresponding to tone 640 when you pressed the remote and tilted your wrist. We attached both the Arduino and the remote to separate wristbands. The Arduino wristband was quite long, spanning with 3 wristbands because it included a condensed breadboard and a portable battery.

 

This is the code for the Arduino. From what I know, you could get a regular remote without the tilt sensor and press volume – and volume + to get different sounds. But, for the conventions of our tilt sensor wristband, we can only play one sound, which came from the volume – button.

In our breadboard, besides wires, we used a buzzer, a sensor, and although in the photo it shows the LED light and resistor, we later realized we did not need it and replaced it with wires. This was because we didn’t need any component of our Arduino to light up, it only needed to receive the tilt sensor from the remote and make the sound. The communication was an audio response to the sensor, and not a visual one.

 

We learned how to correspond the red wires to power and positive and the black wire to ground and negative. This differentiation helped us in the long run in knowing how the breadboard and Arduino worked. The sensor also had a red wire for power, a black wire for ground, and a yellow wire for the Infrared receiver. The buzzer was connected to digital pin 10, and the sensor was connected to digital pin 8. I realize that we didn’t need to connect anything to digital pin 11 after all, because we removed the LED light, but we still just added wires where the resistor and the LED light would be so that it would close and continue the circuit.

For a future project, we should use our time to make more sound with the Arduino, and also make it more compact. We tried transferring it to the lilypad this time, but somewhere along the lines, it didn’t seem to comply, so we reverted back to the Arduino. In the end, I think this was a successful group project, and I got much enjoyment out of working with my group.

Arduino Project

For our Arduino project, my teammate and I based our idea off of holding hands. We placed sensors on the palm of our gloves to turn on a light when our hands attached together. Our long black gloves went down to our elbows with the intention of concealing our wires to give a more wearable look. However, the arduinos and the wires were bulkier than we expected and did not fit inside of the glove. Therefore, our gloves looked like items that belonged in a lab on a factory line. We used the arduino to program the sensors to turn on lights when they connect. This ideally. We connected the wires coming from the arduino to the sensors with conductive thread.  

We used the following codes to program the arduino:

int inValue = 0;

int outValue = 0;

void setup() {

 // put your setup code here, to run once:

 Serial.begin(9600); // this talks to my computer

 pinMode(9,OUTPUT);

 

}

 

void loop() {

 // put your main code here, to run repeatedly:

 inValue=analogRead(0);

 Serial.print(“input Value: “);

 Serial.print(inValue);

 outValue= inValue/8;

 analogWrite(9,outValue);

 Serial.print(” output Value: “);

 Serial.print(outValue);

 Serial.println();

 delay(10);

 

int redPin = 11;

int greenPin = 10;

int bluePin = 9;

//uncomment this line if using a Common Anode LED

//#define COMMON_ANODE

void setup()

{

 pinMode(redPin, OUTPUT);

 pinMode(greenPin, OUTPUT);

 pinMode(bluePin, OUTPUT);  

}

void loop()

{

 setColor(255, 0, 0);  // red

 delay(1000);

 setColor(0, 255, 0);  // green

 delay(1000);

 setColor(0, 0, 255);  // blue

 delay(1000);

 setColor(255, 255, 0);  // yellow

 delay(1000);  

 setColor(100, 120, 80);  // purple

 delay(1000);

 setColor(0, 255, 255);  // aqua

 delay(1000);

 setColor(123,50,48);

 delay(1000);

}

void setColor(int red, int green, int blue)

{

 #ifdef COMMON_ANODE

   red = 255 – red;

   green = 255 – green;

   blue = 255 – blue;

 #endif

 analogWrite(redPin, red);

 analogWrite(greenPin, green);

 analogWrite(bluePin, blue);  

TF: Electronic Fabrics Project

For this project, my partner and I almost immediately came up with the idea to have a t-shirt which activates when hugged by someone else. Using what we learned in class, we built a circuit which involved the following components: Arduino, breadboard, connecting wires, alligator clips, a resistor an LED and a push button. The method for connecting this circuit are as follows:

  1. Make a connection from digital pin 9 on the Arduino to a spot on the breadboard.
  2. In the same row, place one leg of the LED. The other leg can be placed in another row above/below.
  3. One leg of the resistor was placed in the same row as the second leg of the LED.
  4. Finally, a connection was made from that same row (with the resistor) to GRD on the Arduino.
  5. The button was placed onto the breadboard and one wire connection was made from the button to a resistor, then from the resistor to ground on  the breadboard. Finally, from there a connection was made to ground on the Arduino.
  6. On the other side of the button, a connection was made to digital pin 2 on the Arduino
  7. The Arduino was then connected to a computer.

 

 

From this circuit, we detached the wires closing the circuit around the button switch and attached alligator clips to them. We prototyped our idea using two mannequins. We placed two slightly separated, vertical strips of conductive fabric on one of them and connected one alligator clip to each of the two pieces of tape. The rest of the alligator clip was attached to the wires connection which we detached earlier. Next, we placed another piece of conductive tape on the other body horizontally. Once both bodies came together, the horizontal strip closed the circuit and allowed the LED to turn on.

.

 

Since this worked, we decided to use a similar concept on the final. For the design, we decided that we would have a pair of t-shits and each of them would have a heart design printed on them. One heart would have a plug and the other would contain the socket.

The designs were created in Illustrator. First I obtained an image of a heart on thenounproject.com. I also found the plug and socket designs on the same website. I used image trace to convert to a simple vector image and pathfinder to merge the plug to its heart. I deleted any other distracting lines that were not part of the outline which we wished to cut. Moreover, to achieve the same effect that we used in our prototype, we created a circular gap within the socket heart which, once closed by the fully solid cut of plug heart, would close the circuit allowing the LED to turn on.

.

We could have used the laser cutter or the vinyl cutter to print the design. However, we decided to go with the vinyl cutter as we didn’t have much experience with it. Moreover, with the vinyl cutter we could utilize the stickiness of the conductive tape to attach it to the shirt and remove it once we were done with the project. The laser cutter design would require us to use a fusible between the conductive fabric and the shirt, which could possibly leave a residue once removed (even if we used a fusible which would detach upon washing).

We ran into some problems while trying to use the vinyl cutter at IMA since the adhesive mat which is meant to keep the fabric in place while cutting was not sticky enough. After a few futile tries, I met with Antonius in office hours where he taught me how to use his vinyl cutter and the accompanying silhouette program. This process was successful.

Since the socket heart had a gap in the middle, and it would be difficult to tear the independent circle out in the middle then replace it onto the shirt in the exact place it as designed to be in(on Illustrator), we utilized transfer paper. The sticky part of the transfer paper was placed onto the design, the paper attached to theback of the conductive fabric was removed revealing the adhesive part and this was stuck onto the shirt. Next, the transfer paper was carefully removed from the front of the design. The same procedure was repeated for the plug heart which was placed on the other shirt.

 

We decided to use a strip of RGB LEDs(as opposed to single LEDs) for increased visibility around the neck of one of the shirts. We connected this strip to the circuit by soldering one wire to the 12V section of the strip and one to blue section of the strip (these spots are labelled on the strip), then attaching one side to the Arduino (5V) and the other to one to ground. We  used a portable battery to power thecircuit inplace of a laptop. TO make everything a little neater, we placed the circuitry into a Fannie pack.

Once this was done, we simply needed to use alligator clips(stemming from the circuit) to attach the circuit to the independent parts of the socket heart(outer heart and inner circle).  This was done in the same manner as the prototype.

 

Talking Fabrics | Social Switch | Hug Light

Project Name: Hug Light

Partner: Dania

Material: LED strip, Arduino kit, battery, T-shirts

Main Concept:

We want to make sweet T-shirts which will light up when people hug each other. And in order to indicate the idea more clearly, we also decorate the T-shorts with heart-shape plug and socket, therefore when the plug meets the socket, the LED strip light up and warm the huggers. For the T-shirts as the base, we used my T-shirt from NYU Shanghai and NYU Florence. Therefore we think it can also be functioned as NYU Alumni T-shirt when NYU students meet after graduation (Sadly I am now a Senior).

Process:

  1. Prototype our idea on a plain model, we use the conductive tape to achieve the effect that hugging activates lights by creating some gap between the tape on one T-shirt. And when the two T-shirt touches, the circuit connects and works, and the lights are turned on.

2. T-shirts ready

3. Pattern design

 

4. Solder the LED strip and connect it to the Arduino

DEMO of attaching the circuit on two T-shirts:

DEMO of attaching the circuit on one T-shirts and use the conductive tape to connect:

 

 

 

Talking Fabrics: Assignment 5 : Arduino (Leah)

Project: Arduino based gloves
Partner: Arizona Semones
Material: Gloves, two Arduinos, mini breadboards, Arduino attaches, wires
Process:
 Brainstorming:
 This assignment requires to contains a social switch, which means we have to have interactions with each other to trigger the switch of the circuit. So we came up the idea that we can attach our circuit to a pair of gloves. So when people clapping hands or holding their hands, the circuit will become accessible. So we bought gloves from Taobao and start to design.
Design and drafts.
Our original idea is to have two gloves with two conductive tapes as the switch, so we will have four different circuits in total.  So when people clapping different hands, the different circuits will be access
Here are our drafts of design
 
Circuit:
I started to design the circuit. I found that it is hard to active four circuits together. So I decided to just to do two circuits instead. I have one circuit with RGB LED and another circuit with twit switch and another led. I first test the circuit on the breadboard with conductive thread to test whether the circuit will work.
My basic idea is that one of the ground wire of the RGB LED circuit will to the ground of twit switch circuit. The twit switch circuit’s ground wire will go to RGB LED circuit’s ground.
For the coding part. The RGB led needs to import RGB values.
The twit switch needs to be controlled by if statements. The code is like this
 
Attaching the Arduino to the glove.
Then the next part is the most different part for me. It is to figure out a way that can attach the whole circuit into the gloves. The components are small and easy to sew into the glove, but the Arduino itself is way too big. And since our project is a pair of gloves, it is hard to carry the Arduino. Antonius suggested me to sew a little pocket on the back of hand part and have our Arduino into the pocket. Also, he suggested me to use the attachment of Arduino and have the circuit on the mini breadboard instead of separate them in the gloves.
Sewing
 It was still hard to sew the pocket, not the glove. The glove has two layers and I had to sew fabrics to only one side. I tried to roll up the gloves and make the needle through. But it didn’t work.
Finally, I figured out a way of sewing
It is like this.
Since the attachment and the Arduino itself has a gap in between, so I used fabrics went across the gap and sewed the fabric to the glove. The Arduino is attached to the glove in this way without hiding the circuit.
I also cut off shorter wires to make the circuit cleaner.
So here is what it looks like finally
int redPin = 11;
int greenPin = 10;
int bluePin = 9;
 
//uncomment this line if using a Common Anode LED
//#define COMMON_ANODE
 
void setup()
{
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);  
}
 
void loop()
{
  setColor(255, 0, 0);  // red
  delay(1000);
  setColor(0, 255, 0);  // green
  delay(1000);
  setColor(0, 0, 255);  // blue
  delay(1000);
  setColor(255, 255, 0);  // yellow
  delay(1000);  
  setColor(100, 120, 80);  // purple
  delay(1000);
  setColor(0, 255, 255);  // aqua
  delay(1000);
  setColor(123,50,48);
  delay(1000);
}
 
void setColor(int red, int green, int blue)
{
  #ifdef COMMON_ANODE
    red = 255 - red;
    green = 255 - green;
    blue = 255 - blue;
  #endif
  analogWrite(redPin, red);
  analogWrite(greenPin, green);
  analogWrite(bluePin, blue);  
}

// RGB LED

int led = 13;
int buttonPin = 7;
boolean switchState = false;
int buttonState = 0;

void setup() {
  // put your setup code here, to run once:
  pinMode(led, OUTPUT);
  pinMode(buttonPin, INPUT);
  digitalWrite(buttonState, HIGH);
}

void loop() {
  // put your main code here, to run repeatedly:

  buttonState = digitalRead(buttonPin);

  if (buttonState == HIGH) {
    if (switchState == false) {
      switchState = true;
    }
    else {
      switchState = false;
    }

    if (switchState == true) {
      digitalWrite(led, HIGH);

    } else {
      digitalWrite(led, LOW);
    }

    delay(1000);

  }

}

//twit switch