How awake am I?

I was sick for this lab, so I decided to see just how awake I was in bed. I decided to graph how much pressure I was applying to my husband pillow (that’s honestly what it’s called). The more pressure, the more likely I was asleep/resting.


Materials

  • FSR
  • Jumper wires
  • Resistor
  • Breadboard
  • Arduino

Arduino Code:

<span class="coMULTI">The circuit:
 Any analog input sensor is attached to analog in pin 0.

 created 2006
 by David A. Mellis
 modified 9 Apr 2012
 by Tom Igoe and Scott Fitzgerald

 This example code is in the public domain.

 http://www.arduino.cc/en/Tutorial/Graph
 */</span>

<span class="kw1">void</span> <span class="kw3">setup</span><span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span>
  <span class="co1">// initialize the serial communication:</span>
  <span class="kw1">Serial</span>.<span class="kw1">begin</span><span class="br0">(</span><span class="nu0">9600</span><span class="br0">)</span><span class="sy0">;</span>
<span class="br0">}</span>

<span class="kw1">void</span> <span class="kw3">loop</span><span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span>
  <span class="co1">// send the value of analog input 0:</span>
  <span class="kw1">Serial</span>.<span class="kw1">println</span><span class="br0">(</span><span class="kw1">analogRead</span><span class="br0">(</span>A0<span class="br0">)</span><span class="br0">)</span><span class="sy0">;</span>
  <span class="co1">// wait a bit for the analog-to-digital converter</span>
  <span class="co1">// to stabilize after the last reading:</span>
  <span class="kw1">delay</span><span class="br0">(</span><span class="nu0">2</span><span class="br0">)</span><span class="sy0">;</span>
<span class="br0">}</span>

Processing Code:

import processing.serial.*;
 String portname = "/dev/cu.usbmodem1421"; // or "COM5"
 Serial port;
 String buf="";
 int cr = 13; // ASCII return == 13
 int lf = 10; // ASCII linefeed == 10

int serialVal = 0;
 float xPos = 0; // horizontal position of the graph
 float yPos = 0; // vertical position of the graph

void setup() {
 size(800,600); // window size
 // List all the available serial ports
 port = new Serial(this, portname, 9600);
 background(#081640);
 }

void serialEvent (Serial myPort) {
 // get the byte:
 int inByte = myPort.read();
 // print it:
 println(inByte);
 yPos = height - inByte;
 }

void draw () {
 // draw the line in a pretty color:
 stroke(#FFD700);
 line(xPos, height, xPos, yPos);
 // at the edge of the screen, go back to the beginning:
 if (xPos &gt;= width) {
 xPos = 0;
 // clear the screen by resetting the background:
 background(#081640);
 } else {
 // increment the horizontal position for the next reading:
 xPos++;
 }
 }
 

Final project proposal

We plan to continue the project we outlined in our midterm presentation. The patch will work with Adafruit FLORA’s suite of wearable, sewable products in order to get a close-to-skin form factor. For a prototype, this will likely involve fabric rather than something that adheres to the skin, but should be wearable nonetheless.

Here is the list of products we anticipate experimenting with:

  • FLORA sensor pack – includes ancillary items like conductive thread and various sensors
  • Heating modules
  • Bluetooth modules
  • Pressure-sensitive conductive sheets
  • Haptic motor controllers
  • Vibrating mini motor discs
  • Temperature sensors

While we do not anticipate using each item to create our prototype, we see this as an opportunity to try out different sensations and sensors to see what people respond to the most, and use those for our prototype.

The VR Life

I was able to experience the HTC Vive this past week – my second time playing with VR. What I enjoyed the most about this experience was the fact that I was entirely immersed in this world. It reminded me of being in a Star Trek ‘holodeck’, and excited me about the future of media and entertainment.

What I liked the least (which is directly related to what I liked the most) was that I couldn’t tell when someone was near me. For example, Kimiko walked into the room while I was playing a game and I had no idea until she said my name. I instantly felt exposed and insecure. One way the design team could fix this problem is to have an icon on your screen that shows when someone is approaching you (ex: motion sensors attached to the Vive) so you aren’t entirely unprepared.

Meet Bruce

This weekend, Andrea and I teamed up to create a little robot named Bruce.  We were able to get him to move forward (albeit in a somewhat circular pattern) by altering the starting and ending servo motor angles. We also had to compensate for the second servo motor being in a reverse position from the first. We modified the code by adding the second servo, such that for when one’s angle was 70 for example, the second would be 180-70.

Photo of Bruce

Watch Bruce go!


components

  • 2 servo motors
  • a box lid
  • 10 bamboo sticks
  • 3 furniture pads
  • 1 lobster mascot (named Bruce)
  • 3 plastic spoons
  • 1 ball of putty
  • A lot of electrical tape
  • 1 9v battery + connecter
  • 1 arduino
  • 1 breadboard
  • several connecting wires

code

/* Sweep

 by BARRAGAN &lt;<a href="http://barraganstudio.com/" target="_blank" data-saferedirecturl="https://www.google.com/url?hl=en&amp;q=http://barraganstudio.com&amp;source=gmail&amp;ust=1476725158252000&amp;usg=AFQjCNEtAsotC8FoEERQ3L7tZlE7qzEjOA">http://barraganstudio.com</a>&gt; 

 This example code is in the public domain.

 modified 8 Nov 2013

 by Scott Fitzgerald

 <a href="http://arduino.cc/en/Tutorial/Sweep" target="_blank" data-saferedirecturl="https://www.google.com/url?hl=en&amp;q=http://arduino.cc/en/Tutorial/Sweep&amp;source=gmail&amp;ust=1476725158252000&amp;usg=AFQjCNFbhjp8v_fLHwCEwLBWq6db81Ygew">http://arduino.cc/en/<wbr />Tutorial/Sweep</a>

*/ 

#include &lt;Servo.h&gt; 

 

Servo myservo;

Servo myservo1;// create servo object to control a servo 

                // twelve servo objects can be created on most boards

 

int pos = 0;    // variable to store the servo position 

int potPin = A0;

 

void setup() 

{ 

  myservo.attach(9);  // attaches the servo on pin 9 to the servo object 

  myservo1.attach(10);

} 

 

void loop() 

{ 

  for(pos = 70; pos &lt;= 180; pos += 1) // goes from 70 degrees to 180 degrees 

  {                                  // in steps of 1 degree 

    myservo.write(pos); 

    myservo1.write(230 - pos);

    Serial.print(-pos);    // tell servo to go to position in variable 'pos' 

    delay(7);    // waits 15ms for the servo to reach the position 

  } 

  for(pos = 180; pos&gt;=70; pos-=1)     // goes from 180 degrees to 70 degrees 

  {                                

    myservo.write(pos); 

    myservo1.write(230 - pos);    // tell servo to go to position in variable 'pos' 

    delay(7);                       // waits 15ms for the servo to reach the position 

  } 

}

Whirlygig

Description

I started this project by wanting to create a moving cat toy for my kitten, Juno. She’s home by herself most of the day and gets quite bored. This would be a way to keep her entertained, as well as healthy. I failed to see the flaws in my plan, however: 1. cats are afraid of loud noises, and 2. they’re more interested in playing with wires than the toy.

Juno, ruining her chances of a new toy

I changed direction and decided to create a toy for myself from my childhood: a pinwheel. I’m quite a fan of origami, so I welcomed the exercise. I created the pinwheel from a large piece of orange construction paper (a tribute to the Giants who just lost the series), used a ceramic straw to form a sturdy base, and two LEDs on either side to create a fun, multi-colored spiral effect. I also added a piece of cork to keep the pinwheel from flying off the motor. Finally, the potentiometer controls how quickly the pinwheel spins.

Watch the video!


Components:

  • 1 Arduino
  • 1 Breadboard
  • 1 Resistor (1kΩ)
  • 1 potentiometer
  • 1 DC motor
  • 1 Transistor
  • 1 Diode
  • Several jumper cables
  • Tape
  • 1 Ceramic straw
  • 1 Piece of cork from a wine bottle
  • 1 Piece of orange construction paper (and 1 paper cut)
  • 2 LED lights
  • 2 Cell batteries

View the set-up


Code

/*
 * one pot fades one motor
 * modified version of AnalogInput
 * by DojoDave &lt;http://www.0j0.org&gt;
 * http://www.arduino.cc/en/Tutorial/AnalogInput 
 * Modified again by dave
 */

int potPin = 0; // select the input pin for the potentiometer
int motorPin = 9; // select the pin for the Motor
int val = 0; // variable to store the value coming from the sensor
void setup() {
 Serial.begin(9600);
}
void loop() {
 val = analogRead(potPin); // read the value from the sensor, between 0 - 1024
 Serial.println(val);
 analogWrite(motorPin, val/4); // analogWrite can be between 0-255
}

Thoughtless Act: Saving Private Veggie

Frozen vegetables and fruit can be incredibly useful (particularly peas, I’ve found). They’re inexpensive, last forever, and in some cases can be even better than the raw version. But, every time I open a bag, I’m at risk for spillage. Moreover, the contents will freeze over once the bag has been opened, so it becomes nearly impossible to access the contents a second time without also getting ice. Not great for cooking. I co-opted a few clips and the wire rack in my freezer to solve the problem:

binder-clips-for-vegetables

One solution would be to change the design of these bags to include some kind of closing mechanism (like a Ziploc sliding closure) that allows for the removal of air from the bag. You could further improve the design by making the bag thicker and flattening the bottom of the bag to enable it to stand up properly for better organization.

Quickening and slowing childhood

Summary

When I first heard the piezo speaker output, I instantly thought of Super Mario Bros. The theme song has a similar tone, and is a game which led me to think of some kind of joystick like the ones used on the old controllers.I cut an old toilet paper tube and attached the speaker and part of a pot to one half, which attaching the turning part of the pot to the other half. By turning the two halves in opposite directions, you can control the tempo of the song.

You can watch the video here!


Components

  • Arduino
  • Breadboard
  • 1 potentiometer
  • 1 piezo speaker
  • hookup wires
  • toilet paper roll, scissors, tape

Code

/*
 Arduino Mario Bros Tunes
 With Piezo Buzzer and PWM

 Connect the positive side of the Buzzer to pin 3,
 then the negative side to a 1k ohm resistor. Connect
 the other side of the 1 k ohm resistor to
 ground(GND) pin on the Arduino.

 by: Dipto Pratyaksa
 last updated: 31/3/13
*/

/*************************************************
 * Public Constants
 *************************************************/

#define NOTE_B0 31
#define NOTE_C1 33
#define NOTE_CS1 35
#define NOTE_D1 37
#define NOTE_DS1 39
#define NOTE_E1 41
#define NOTE_F1 44
#define NOTE_FS1 46
#define NOTE_G1 49
#define NOTE_GS1 52
#define NOTE_A1 55
#define NOTE_AS1 58
#define NOTE_B1 62
#define NOTE_C2 65
#define NOTE_CS2 69
#define NOTE_D2 73
#define NOTE_DS2 78
#define NOTE_E2 82
#define NOTE_F2 87
#define NOTE_FS2 93
#define NOTE_G2 98
#define NOTE_GS2 104
#define NOTE_A2 110
#define NOTE_AS2 117
#define NOTE_B2 123
#define NOTE_C3 131
#define NOTE_CS3 139
#define NOTE_D3 147
#define NOTE_DS3 156
#define NOTE_E3 165
#define NOTE_F3 175
#define NOTE_FS3 185
#define NOTE_G3 196
#define NOTE_GS3 208
#define NOTE_A3 220
#define NOTE_AS3 233
#define NOTE_B3 247
#define NOTE_C4 262
#define NOTE_CS4 277
#define NOTE_D4 294
#define NOTE_DS4 311
#define NOTE_E4 330
#define NOTE_F4 349
#define NOTE_FS4 370
#define NOTE_G4 392
#define NOTE_GS4 415
#define NOTE_A4 440
#define NOTE_AS4 466
#define NOTE_B4 494
#define NOTE_C5 523
#define NOTE_CS5 554
#define NOTE_D5 587
#define NOTE_DS5 622
#define NOTE_E5 659
#define NOTE_F5 698
#define NOTE_FS5 740
#define NOTE_G5 784
#define NOTE_GS5 831
#define NOTE_A5 880
#define NOTE_AS5 932
#define NOTE_B5 988
#define NOTE_C6 1047
#define NOTE_CS6 1109
#define NOTE_D6 1175
#define NOTE_DS6 1245
#define NOTE_E6 1319
#define NOTE_F6 1397
#define NOTE_FS6 1480
#define NOTE_G6 1568
#define NOTE_GS6 1661
#define NOTE_A6 1760
#define NOTE_AS6 1865
#define NOTE_B6 1976
#define NOTE_C7 2093
#define NOTE_CS7 2217
#define NOTE_D7 2349
#define NOTE_DS7 2489
#define NOTE_E7 2637
#define NOTE_F7 2794
#define NOTE_FS7 2960
#define NOTE_G7 3136
#define NOTE_GS7 3322
#define NOTE_A7 3520
#define NOTE_AS7 3729
#define NOTE_B7 3951
#define NOTE_C8 4186
#define NOTE_CS8 4435
#define NOTE_D8 4699
#define NOTE_DS8 4978

#define melodyPin 3
//Mario main theme melody
int melody[] = {
 NOTE_E7, NOTE_E7, 0, NOTE_E7,
 0, NOTE_C7, NOTE_E7, 0,
 NOTE_G7, 0, 0, 0,
 NOTE_G6, 0, 0, 0,

 NOTE_C7, 0, 0, NOTE_G6,
 0, 0, NOTE_E6, 0,
 0, NOTE_A6, 0, NOTE_B6,
 0, NOTE_AS6, NOTE_A6, 0,

 NOTE_G6, NOTE_E7, NOTE_G7,
 NOTE_A7, 0, NOTE_F7, NOTE_G7,
 0, NOTE_E7, 0, NOTE_C7,
 NOTE_D7, NOTE_B6, 0, 0,

 NOTE_C7, 0, 0, NOTE_G6,
 0, 0, NOTE_E6, 0,
 0, NOTE_A6, 0, NOTE_B6,
 0, NOTE_AS6, NOTE_A6, 0,

 NOTE_G6, NOTE_E7, NOTE_G7,
 NOTE_A7, 0, NOTE_F7, NOTE_G7,
 0, NOTE_E7, 0, NOTE_C7,
 NOTE_D7, NOTE_B6, 0, 0
};
//Mario main them tempo
int tempoFast[] = {
 12, 12, 12, 12,
 12, 12, 12, 12,
 12, 12, 12, 12,
 12, 12, 12, 12,

 12, 12, 12, 12,
 12, 12, 12, 12,
 12, 12, 12, 12,
 12, 12, 12, 12,

 9, 9, 9,
 12, 12, 12, 12,
 12, 12, 12, 12,
 12, 12, 12, 12,

 12, 12, 12, 12,
 12, 12, 12, 12,
 12, 12, 12, 12,
 12, 12, 12, 12,

 9, 9, 9,
 12, 12, 12, 12,
 12, 12, 12, 12,
 12, 12, 12, 12,
};

int tempoSlow[] = {
 6, 6, 6, 6,
 6, 6, 6, 6,
 6, 6, 6, 6,
 6, 6, 6, 6,

 6, 6, 6, 6,
 6, 6, 6, 6,
 6, 6, 6, 6,
 6, 6, 6, 6,

 4, 4, 4,
 6, 6, 6, 6,
 6, 6, 6, 6,
 6, 6, 6, 6,

 6, 6, 6, 6,
 6, 6, 6, 6,
 6, 6, 6, 6,
 6, 6, 6, 6,

 4, 4, 4,
 6, 6, 6, 6,
 6, 6, 6, 6,
 6, 6, 6, 6,
};

int speaker = 3;
int sensorValue = 0; // variable to store value coming from sensor
int pot = A0;

void setup(void)
{
 Serial.begin(9600);
 pinMode(speaker, OUTPUT);//declare speaker as output
}
void loop()
{
 sensorValue = analogRead(pot);
 Serial.println("ready");
 Serial.println(sensorValue);

 // iterate over the notes of the melody:
 if (sensorValue &lt; 500) {
 Serial.println("slow");
 Serial.println(" 'Mario Theme1'");
 int size = sizeof(melody) / sizeof(int);
 for (int thisNote = 0; thisNote &lt; size; thisNote++) {

 // to calculate the note duration, take one second
 // divided by the note type.
 //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
 int noteDuration = 1000 / tempoFast[thisNote];

 buzz(melodyPin, melody[thisNote], noteDuration);

 // to distinguish the notes, set a minimum time between them.
 // the note's duration + 30% seems to work well:
 int pauseBetweenNotes = noteDuration * 1.30;
 delay(pauseBetweenNotes);

 // stop the tone playing:
 buzz(melodyPin, 0, noteDuration);

 }

 } else {

 Serial.println(" 'Mario Theme2'");
 int size = sizeof(melody) / sizeof(int);
 for (int thisNote = 0; thisNote &lt; size; thisNote++) {

 // to calculate the note duration, take one second
 // divided by the note type.
 //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
 int noteDuration = 1000 / tempoSlow[thisNote];

 buzz(melodyPin, melody[thisNote], noteDuration);

 // to distinguish the notes, set a minimum time between them.
 // the note's duration + 30% seems to work well:
 int pauseBetweenNotes = noteDuration * 1.30;
 delay(pauseBetweenNotes);

 // stop the tone playing:
 buzz(melodyPin, 0, noteDuration);

 }
 }
}

void buzz(int targetPin, long frequency, long length) {
 digitalWrite(13, HIGH);
 long delayValue = 1000000 / frequency / 2; // calculate the delay value between transitions
 //// 1 second's worth of microseconds, divided by the frequency, then split in half since
 //// there are two phases to each cycle
 long numCycles = frequency * length / 1000; // calculate the number of cycles for proper timing
 //// multiply frequency, which is really cycles per second, by the number of seconds to
 //// get the total number of cycles to produce
 for (long i = 0; i &lt; numCycles; i++) { // for the calculated length of time...
 digitalWrite(targetPin, HIGH); // write the buzzer pin high to push out the diaphram
 delayMicroseconds(delayValue); // wait for the calculated delay value
 digitalWrite(targetPin, LOW); // write the buzzer pin low to pull back the diaphram
 delayMicroseconds(delayValue); // wait again or the calculated delay value
 }
 digitalWrite(13, LOW);

}

Midterm Sketches – The Patch (Molly + Sasha)

We are proposing a patch that you wear on your skin. The patch can generate warmth, light (possibly in shapes), and pressure. The receiver can then send these sensations back to the original sender. See sketches below for examples.

33f39d48-24a3-4429-8a6f-a43a3b7dcfd9-png

Small patch, worn on the arm (similar to a temporary tattoo). Allows for sharing gestures, like a stroke of the arm, or sharing a drawing that you feel and that appears on your patch.

file_000-1

Pre-determined shapes (ex: happy face) could be shared when experiencing certain emotions. Can also share a feeling or warmth of a ‘hug’ via a pressurized warmth.

Feeling VR

This summer I worked at YouTube. As a result, I was able to test out some up and coming products. One of these was the next version of the VR headset. I had never tried VR before, and was frankly skeptical. After seeing videos of VR, I thought the quality was crude and therefore unable to create a realistic rendition or illicit any real emotion. This summer proved me wrong. 

Though the view wasn’t always entirely realistic (at times, it was choppy looking side to side), the feelings were entirely real. I tried going on a roller coaster, and felt scared. In the pit of the my stomach scared. Walking away from this experience made me see emotions and experiences entirely differently. If I can feel something just by seeing it rather than actually experiencing it, are feelings like that of fear or motion sickness just mental? It left me thinking I could possibly take more control over my emotional state than I realized – probably with the help of systems like the one I had tried. 

Thinking back to the Holmquist article, this possibility of training ones’ emotions via a virtual simulation feels quite like a cargo cult design. You are entering a space that creates the semblance of an experience, to which you may react as you normally would, but it does not actually create that experience. The user can potentially walk away from such an experience thinking they now know how they will react in that actual experience.

Take my roller coaster example – after trying it out in VR, I may now think that this is how I will react on an actual roller coaster. However, the simulation is only somewhat reflective of a real experience. I may enjoy it less in real life because there novelty of using the VR device is missing. I may feel less queasy in my stomach because the cold wind is refreshing my face. But, because I had an emotional reaction to the simulation, my mind thinks I have just experienced a roller coaster. Per Homlquist’s warning, it is important here for the developer/ designer to indicate to the user how much they should take away from their VR experience.