As computing becomes more ubiquitous in our objects, designers need to be more aware of how to design meaningful interactions into electronically enhanced objects. At the University of Washington, a class of junior Interaction Design majors is exploring this question. These pages chronicle their efforts.

Wednesday, June 6, 2012

Brushing Your Teeth with Pause

By Miles Koons and Kim Lewis



Our Concept 

"The average person in the U.S. spends only 17 seconds each time they brush their teeth." -Dr. Harold Katz. This number may sound a little appalling at first, when the recommended time is two to three minutes, but when I began to notice how long I brush my own teeth it started to make more sense. For most people, getting ready in the morning is a rushed process as they are on their way to work, school, or some other important function. Brushing your teeth drops down in priorities when you are  late. Even if you are not in a hurry,  standing around for several minutes while you are brushing your teeth is boring. Not brushing your teeth can lead to many unfortunate consequences, however, with the most obvious including plague, tooth decay, gum disease and overall poor oral health.

Our goal was to design an experience and prototype it with Arduino that would change a person's toothbrushing habits through a fun and positive interaction. When researching, we discovered that the average American spends four to five hours a day watching TV. (mashable.com) What was that you were saying about not having time to brush your teeth? What if we could take some of the enjoyment and entertainment of watching t.v. and incorporate it into the toothbrushing experience?

For our solution we created Pause, an interactive device that encourages users to brush their teeth for the recommended three minutes. It accomplishes this by showing a curated set of puppy videos to entertain the user while they are brushing. When the three minutes have completed, the last opened video plays till the end and a congratulations screen appears letting the user know they have completed the suggested time. By using fun to change behavior, users will look forward to brushing their teeth and try to incorporate it into their daily routines.



How It Works



Pause works by interfacing the Arduino with Processing. A sketch is uploaded to the Arduino that sends serial information over to Processing through the values of 0 or 1. A microswitch is located in the bottom of the toothbrush holder, attached to the breadboard through wires, which is then attached the Arduino through pins 2, GND and 5v. When the microswitch is pressed, this sends a value of 1 to Processing, telling it to wait. Once the toothbrush is removed, the value becomes 0 which then triggers the Pause program.

Pause is set up to call a different puppy video at random using an array. Each video is made up of embedded video codes in an html file that is pulled up locally. It will call videos consecutively once they are done playing for the duration of two minutes and thirty seconds. Once the timer in the Processing sketch reaches this time, it will call the last video and allow it to play out in its entirety before displaying the completed screen. The Processing sketch checks every second to see if the serial value is one or zero, and once the toothbrush is placed back in the holder it is aware to not pull any more videos if the brusher has stopped the brushing process early.

Videos are displayed behind a two way mirror, which has an Ipad behind it.



















Electronic Components Used

Software Used


The Code

Arduino:

//Interfacing an Arduino with Processing
 //Sketch by Kim Lewis and Miles Koons, 2012

 //built off of Button sketch
 //created 2005
 //by DojoDave <http://www.0j0.org>
 //modified 30 Aug 2011
 //by Tom Igoe

 //This sketch works on the Arduino end, to help Processing change a square
 //different colors depending on the input of a button
 //The circuit:
 //* LED attached from pin 13 to ground
 //* pushbutton attached to pin 2 from +5V
 //* 10K resistor attached to pin 2 from ground

 //setting the pin numbers for the LED and button to connect with Arduino

int buttonPin = 2;     // the number of the pushbutton pin
const int ledPin =  13;      // the number of the LED pin
int i = 0;
int buttonState = LOW;  //variable that reads the state of the pushbutton
int val = 0;
void setup()
 {
   Serial.begin(9600);         //initialize the serial communication
   pinMode(ledPin, OUTPUT);    //initialize the LED pin as an output
   pinMode(buttonPin, INPUT);  //initialize the pushbutton pin as an input
 
 
 }

 void loop(){
  val = digitalRead(buttonPin);           // read the state of the pushbutton value:
 
   if (val == HIGH){
     //buttonState = digitalRead(buttonPin); //check if the pushbutton is pressed, if it is the buttonState is HIGH:
   
     if (buttonState == LOW) {            //turn LED off:
   
       Serial.println(0);                 //Send 0 to Processing
       digitalWrite(ledPin, HIGH);
       buttonState = HIGH;
       delay(50);
     }
    } else {
       //turn LED on:
     
      if (buttonState == HIGH) {
   
       Serial.println(1);                 //send 0 to Processing
       digitalWrite(ledPin, LOW);
       buttonState = LOW;
       delay(50);
       //for (i = 0; i < 500; i++) {
       //Serial.println(i);
       //}
     }
   }
 }

Processing:

import processing.serial.*;

Serial myPort; //The serial port
int val;
String [] puppy = new String [57]; //the puppy video string
int [] time = new int [57];
int lastRun = 0;
int countTime = 0;
int videoTime = 0;
int intro = 0;
void setup() {

  String portName = Serial.list()[0];
  myPort = new Serial(this, portName, 9600);

  //here are all of the local puppy files
  puppy[0] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_0.html"; //41 seconds
  puppy[1] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_1.html"; //36 seconds
  puppy[2] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_2.html"; //18 seconds
  puppy[3] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_3.html"; //99 seconds
  puppy[4] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_4.html"; //68 seconds
  puppy[5] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_5.html"; //87 seconds
  puppy[6] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_6.html"; //49 seconds
  puppy[7] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_7.html"; //33 seconds
  puppy[8] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_8.html"; //60 seconds
  puppy[9] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_9.html"; //60 seconds
  puppy[10] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_10.html"; //95 seconds
  puppy[11] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_11.html"; //105 seconds
  puppy[12] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_12.html"; //136 seconds
  puppy[13] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_13.html"; //104 seconds
  puppy[14] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_14.html"; //37 seconds
  puppy[15] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_15.html"; //49 seconds
  puppy[16] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_16.html"; //90 seconds
  puppy[17] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_17.html"; //42 seconds
  puppy[18] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_18.html"; //133 seconds
  puppy[19] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_19.html"; //6 seconds
  puppy[20] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_20.html"; //111 seconds
  puppy[21] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_21.html"; //60 seconds
  puppy[22] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_22.html"; //142 seconds
  puppy[23] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_23.html"; //72 seconds
  puppy[24] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_23.html"; //231 seconds Fix Dis! (video_24 was changed to video_23) need to find a new video
  puppy[25] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_25.html"; //59 seconds
  puppy[26] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_26.html"; //113 seconds
  puppy[27] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_27.html"; //60 seconds
  puppy[28] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_28.html"; //49 seconds
  puppy[29] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_29.html"; //119 seconds
  puppy[30] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_30.html"; //4 seconds
  puppy[31] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_31.html"; //48 seconds
  puppy[32] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_32.html"; //13 seconds
  puppy[33] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_33.html"; //17 seconds
  puppy[34] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_34.html"; //82 seconds
  puppy[35] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_35.html"; //90 seconds
  puppy[36] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_36.html"; //101 seconds
  puppy[37] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_37.html"; //26 seconds
  puppy[38] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_38.html"; //125 seconds
  puppy[39] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_39.html"; //43 seconds
  puppy[40] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_40.html"; //31 seconds
  puppy[41] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_41.html"; //72 seconds
  puppy[42] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_42.html"; //75 seconds
  puppy[43] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_43.html"; //63 seconds
  puppy[44] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_44.html"; //72 seconds
  puppy[45] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_45.html"; //22 seconds
  puppy[46] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_46.html"; //51 seconds
  puppy[47] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_47.html"; //49 seconds
  puppy[48] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_48.html"; //119 seconds
  puppy[49] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_49.html"; //22 seconds
  puppy[50] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_50.html"; //47 seconds
  puppy[51] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_51.html"; //119 seconds
  puppy[52] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_52.html"; //65 seconds
  puppy[53] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_53.html"; //47 seconds
  puppy[54] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_54.html"; //62 seconds
  puppy[55] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_55.html"; //59 seconds
  puppy[56] = "file:///Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/video_56.html"; //59 seconds

  time[0] = 41; //confirmed
  time[1] = 36; //confirmed
  time[2] = 18; //confirmed
  time[3] = 99; //confirmed
  time[4] = 68; //confirmed
  time[5] = 87; //confirmed
  time[6] = 49; //confirmed
  time[7] = 33; //confirmed
  time[8] = 60; //confirmed 
  time[9] = 60; //confirmed 
  time[10] = 95; //confirmed
  time[11] = 105; //confirmed
  time[12] = 136; //confirmed
  time[13] = 104; //confirmed 
  time[14] = 37; //confirmed 
  time[15] = 49; //confirmed
  time[16] = 90; //confirmed 
  time[17] = 42; //confirmed
  time[18] = 133; //confirmed
  time[19] = 6; //confirmed
  time[20] = 111; //confirmed 
  time[21] = 60; //confirmed
  time[22] = 142; //confirmed 
  time[23] = 18; //confirmed
  time[24] = 22; //confirmed
  time[25] = 59; //confirmed
  time[26] = 113; //confirmed 
  time[27] = 60; //confirmed
  time[28] = 49; //confirmed 
  time[29] = 119; //confirmed
  time[30] = 4; //confirmed 
  time[31] = 48; //confirmed 
  time[32] = 13; //confirmed 
  time[33] = 17; //confirmed 
  time[34] = 82; //confirmed 
  time[35] = 90; //confirmed  
  time[36] = 101; //confirmed 
  time[37] = 26; //confirmed 
  time[38] = 125; //confirmed 
  time[39] = 43; //confirmed 
  time[40] = 31; //confirmed 
  time[41] = 72; //confirmed 
  time[42] = 75; //confirmed 
  time[43] = 63; //confirmed 
  time[44] = 72; //confirmed 
  time[45] = 22; //confirmed 
  time[46] = 51; //confirmed 
  time[47] = 49; //confirmed 
  time[48] = 119; //confirmed 
  time[49] = 22; //confirmed 
  time[50] = 47; //confirmed 
  time[51] = 119; //confirmed 
  time[52] = 65; //confirmed 
  time[53] = 47; //confirmed 
  time[54] = 62; //confirmed 
  time[55] = 59; //confirmed 
  time[56] = 59; //confirmed 
}

void draw() {
  if (myPort.available() > 0) {   // If data is available
    val = myPort.read();          // read it and store it in val
  }
  if (val == '1') {
    intro = 1;
  }
  
  if (val == '0') {
    intro = 0;
    lastRun = 0;
    countTime = 0;
    videoTime = 0;
  }

  if (intro == 1) {    // If the serial value is 1   
    if (lastRun == 0) {
      link("file://localhost/Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/pauseloading.html"); // 11 seconds
      println("intro");
    }

    if (lastRun % 60 == 0) {
      countTime += 1;
      println(countTime);
    }  

    if (countTime <= 150) {          
      int randInt = int(random(56));

      if (lastRun % 60 == 0) {

        if (countTime == videoTime || countTime == 13) {  
          String yayPuppies = puppy[randInt];
          videoTime = ((time[randInt]) + (countTime));
          println("video time" + ' ' + videoTime);
          println("yay");
          link (yayPuppies, "_self");
        }
      }
    }

    if (countTime >= 150) {

      if (lastRun % 60 == 0) {

        if (countTime == videoTime) {
          link("file://localhost/Users/kimlewis/Documents/UW%20Work/07_Spring%20Qtr%202012/Art%20387_Physical/06_Final%20Code/completescreen.html");
          println("we have reached the time");
        }
      }
    }

    lastRun += 1;
  }

  val = myPort.read();
}

*** In the array listed above, each link is calling a file on my computer which contains an embed code for the specified video. Here is an example of what one of those embed codes looks like:

<iframe id="ytplayer" type="text/html" width="1024" height="768"
src="http://www.youtube.com/embed/F8sIG9Q4aak?autoplay=1&controls=0&modestbranding=1&rel=0&showinfo=0"
frameborder="0" allowfullscreen>

Previous Unsuccessful Attempts

As much as the successes of a project are important, we thought we would also list some of the things we tried before reaching our final project and why they didn't work for us.


  • Originally we wanted to set up a playlist on youtube that could be embedded into a single html file. The problem with this is YouTube has made it impossible to alter that code or include code to play those videos at random since they have removed their randomize feature. We researched as much as we possibly could and found nothing on how to accomplish this
  • Before we considered screen sharing, we were going to connect the Ipad directly to the Arduino and use Processing.js to run our sketch directly off of the Ipad. There was only one tutorial online that we found for accomplishing this without purchasing the Red Park Serial Cable but it was unclear. We found a gadget which is helpful for connecting the Arduino to the Ipad, which is the Ipad Camera Connection Kit, however it would not let us send serial data which is necessary for our project.
  • For getting the videos onto the Ipad we also considered using a bluetooth usb, but they were either too large, too expensive or too ineffective. We also considered purchasing a bluetooth shield for the Arduino, but it would have been a lot of added cost and wouldn't have shipped in time for our project. 
  • We originally tried another screen sharing program called iTap VNC which was absolutely horrible with trying to figure out setup. 


No comments:

Post a Comment