The One Man Show

Description

In our endeavour to make a sonorous musical instrument, we wanted to explore the sounds different materials make on being impinged. We started with a lamp screen and brainstormed ideas around what role it could play in an interactive musical instrument. Someone suggested that it could represent a caricature of a one man band, replete with arms and legs. It sounded like a great idea and we we forged ahead with it.

We are using 4 Arduinos to control 4 Servo motors. Two of the motors are responsible for controlling the rattle and the maraca, which manifest themselves in the form of arms. The third motor controls the bobbing head, while the fourth one is responsible for impinging the tin lamp screen from the inside.

Materials used

  • Balloon
  • Cardboard
  • 4 Arduinos
  • 4 Breadboards
  • Wires
  • Pipe cleaners
  • Popsicle sticks
  • Masking tape
  • Lamp screen
  • Thread

/*
* Servo with Potentiometer control
* Theory and Practice of Tangible User Interfaces
* Nisha, Elena and Mudit are using the same code
*/

int servoPin = 7; // Control pin for servo motor
int potPin = 0; // select the input pin for the potentiometer

int pulseWidth = 0; // Amount to pulse the servo
long lastPulse = 0; // the time in millisecs of the last pulse
int refreshTime = 20; // the time in millisecs needed in between pulses
int val; // variable used to store data from potentiometer

int minPulse = 500; // minimum pulse width

void setup() {
pinMode(servoPin, OUTPUT); // Set servo pin as an output pin
pulseWidth = minPulse; // Set the motor position to the minimum
Serial.begin(9600); // connect to the serial port
Serial.println("servo_serial_better ready");
}

void loop() {
val = analogRead(potPin); // read the value from the sensor, between 0 - 1024

if (val > 0 && val <= 999 ) { pulseWidth = val*2 + minPulse; // convert angle to microseconds Serial.print("moving servo to "); Serial.println(pulseWidth,DEC); } updateServo(); // update servo position } // called every loop(). void updateServo() { // pulse the servo again if the refresh time (20 ms) has passed: if (millis() - lastPulse >= refreshTime) {
digitalWrite(servoPin, HIGH); // Turn the motor on
delayMicroseconds(pulseWidth); // Length of the pulse sets the motor position
digitalWrite(servoPin, LOW); // Turn the motor off
lastPulse = millis(); // save the time of the last pulse
}
}

Sam's code

int servoPin = 7; // Control pin for servo motor
int lightSensorPin = 0; // input for light sensor

int pulseWidth = 0; // Amount to pulse the servo
long lastPulse = 0; // the time in millisecs of the last pulse
int refreshTime = 20; // the time in millisecs needed in between pulses
int val; // variable used to store data from serial port
long lastUpdate = 0; // last update of ring

int minPulse = 500; // minimum pulse width
int maxPulse = 2250; // maximum pulse width
int lightLimit; // calibrated limit for light

void setup() {
pinMode(servoPin, OUTPUT); // Set servo pin as an output pin
pulseWidth = 1156; // Set the motor position to the minimum
Serial.begin(9600); // connect to the serial port
Serial.println("Servo control program ready");
val = analogRead(lightSensorPin);
lightLimit = val - 100; // calibrated light
}

void loop() {
val = analogRead(lightSensorPin); // read the value from the sensor, between 0 - 1024
//Serial.println(val);
// Ring bell
if (val < lightLimit) {
pulseWidth = 1400;
lastUpdate = millis();
while (millis() - lastUpdate <= 200) { updateServo(); } pulseWidth = 1156; } updateServo(); // update servo position } // called every loop(). // uses global variables servoPi, pulsewidth, lastPulse, & refreshTime void updateServo() { // pulse the servo again if rhe refresh time (20 ms) have passed: if (millis() - lastPulse >= refreshTime) {
digitalWrite(servoPin, HIGH); // Turn the motor on
delayMicroseconds(pulseWidth); // Length of the pulse sets the motor position
digitalWrite(servoPin, LOW); // Turn the motor off
lastPulse = millis(); // save the time of the last pulse
}
}

Video: https://drive.google.com/a/berkeley.edu/file/d/0B7JCq5np49-7S1hZRVIzOVJjLXc/view?usp=sharing

 

img_20161107_134025

 

VR is for real

In what was my first encounter with HTC Vive, there were several experiences which blew my away. In particular, the one which involved mounting a bow on the arrow really arrested my senses. I remember actually feeling the tension on the string as I arched the bow backwards. The continuous click sound and haptic feedback from the controller definitely helped. Finally, releasing the arrow also felt really close to the real thing i.e the trajectory that my arrow followed closely mirrored what it would have in the real world.

I would improve this experience by making it easier to find the spot on the bow where the bow is mounted. Currently, it seemed like there was a learning curve involved in this process. I would also add the ability to mount objects lying around you and have the user fire them as an alternative projectile. I’m guessing it’ll be fun to observe how the target would be affected when hit by different objects, for example, a stick vs a can.

The part I liked least involved reaching the castle where all the action was taking place. Doing this was particularly intuitive since it required to me interact with the interface in a different way than I interacted with the rest of it. Due to the interaction being a little incoherent, the flow broke my natural train of thought. I would change this by adding visual cues indicating how might the interaction is expected to play out, so the user isn’t left guessing.

Let’s crawl

Description

It was hard to derive linear motion out of a motor whose direction of rotation alternates. Initially I tried to design shoes out of erasers but it turns out the friction was too much for it to begin moving. The video for this attempt can be found here – https://goo.gl/photos/QXmh7DSLDyzkFmXM8

 

To fix this problem, I tried removing the feet and reworked the placement of wires. I got something which moves a little but only on a rough surface like that of a carpet or a rug – https://goo.gl/photos/5Jiy4hLLPD3BEsbm6

 

Components

Arduino Board
Bread board
Servo motor
Wires

 


/*
 * Servo with Potentiometer control
 * Theory and Practice of Tangible User Interfaces
 * October 11 2007
 */

int servoPin = 7;      // Control pin for servo motor
int potPin   = 0;      // select the input pin for the potentiometer

int pulseWidth = 0;    // Amount to pulse the servo
long lastPulse = 0;    // the time in millisecs of the last pulse
int refreshTime = 20;  // the time in millisecs needed in between pulses
int val;               // variable used to store data from potentiometer

int minPulse = 500;   // minimum pulse width

void setup() {
  pinMode(servoPin, OUTPUT);  // Set servo pin as an output pin
  pulseWidth = minPulse;      // Set the motor position to the minimum
  Serial.begin(9600);         // connect to the serial port
  Serial.println("servo_serial_better ready");
}

void loop() {
  val = analogRead(potPin);    // read the value from the sensor, between 0 - 1024
  
  if (val > 0 && val <= 999 ) {
    pulseWidth = val*2 + minPulse;  // convert angle to microseconds
    
    Serial.print("moving servo to ");
    Serial.println(pulseWidth,DEC);
  
  }
  updateServo();   // update servo position
}

// called every loop(). 
void updateServo() {
  // pulse the servo again if the refresh time (20 ms) has passed:
  if (millis() - lastPulse >= refreshTime) {
    digitalWrite(servoPin, HIGH);   // Turn the motor on
    delayMicroseconds(pulseWidth);  // Length of the pulse sets the motor position
    digitalWrite(servoPin, LOW);    // Turn the motor off
    lastPulse = millis();           // save the time of the last pulse
  }
}

Pencil sharpener

Description

I attached a pencil to the rotating end of my DC motor and held the other end of the pencil inside a pencil sharpener. When I turn this setup on, the pencil rotates rapidly inside the sharpener and subsequently sharpens the lead.

Components

Arduino Board
Bread board
DC motor
Wires
Batteries
Pencil
Sharpener


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
}

img_20161011_210850

Thoughtless acts are everywhere

This is a thoughtless act that I am guilty of. Often, when I need to keep my Macbook charger nearby so I don’t have to reach for it when I need it the most, I tend to clip it to the side of the screen. While this is really convenient, it is a thoughtless act because the screen isn’t really designed for holding the charging cable or for that matter, anything else. It will actually be helpful if there was a proper solution to the problem of wanting to keep the cable nearby.

img_20161011_014108

Twinkle Twinkle little star

Description

I have tried to build a circuit which plays the children’s poem Twinkle Twinkle little star when the light is shining on the piezo electric light sensor. This can be used in children’s books where the poem starts playing as soon as the child turns to a particular page.

Components

Arduino Board
Bread board
Piezo speaker
Wires
Photocell

int speakerPin = 3;
int potPin = 0;
int val = 0;

int length = 15; // the number of notes

//twinkle twinkle little star
char notes[] = "ccggaag ffeeddc ggffeed ggffeed ccggaag ffeeddc "; // a space represents a rest
int beats[] = { 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 4 };
int tempo = 300;

void playTone(int tone, int duration) {
  for (long i = 0; i < duration * 1000L; i += tone * 2) {
    digitalWrite(speakerPin, HIGH);
    delayMicroseconds(tone);
    digitalWrite(speakerPin, LOW);
    delayMicroseconds(tone);
  }
}

void playNote(char note, int duration) {
  char names[] = { 'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C' };
  int tones[] = { 1915, 1700, 1519, 1432, 1275, 1136, 1014, 956 };
  
  // play the tone corresponding to the note name
  for (int i = 0; i < 8; i++) {
    if (names[i] == note) {
      playTone(tones[i], duration);
    }
  }
}

void setup() {
  pinMode(speakerPin, OUTPUT);
}

void loop() {
  digitalWrite(speakerPin, LOW);
  val = analogRead(potPin);    // read value from the sensor
  val = val*2;                 // process the value a little
  //val = val/2; 
  
  for (int i = 0; i < length; i++) {
    digitalWrite(speakerPin, HIGH);
    delayMicroseconds(val);
    digitalWrite(speakerPin, LOW);
    delayMicroseconds(val);
    if (notes[i] == ' ') {
      delay(beats[i] * tempo); // rest
    } else {
      playNote(notes[i], beats[i] * tempo);
    }
    
    // pause between notes
    delay(tempo / 2); 
  }
}

Brushy – the brushing companion

picture1
The child steps on the stool to brush teeth. There is a pressure sensor on the stool that activates the interface housed in a two way mirror.

The interface has a character (in this case Elmo, but can be changed as the child wishes). The character has his mouth open with teeth visible.

As the child grabs the brush and starts brushing her teeth, her hand’s motion is replicated by a brush in Elmo’s mouth.

The child can see Elmo’s teeth getting cleaner as she brushes.

Once all teeth are white, brushing concludes.

After brushing is done, Elmo says thankyou and goodnight (cuing the child to sleep).

picture2

img_20161004_000311

img_20161004_000422

BB-8 Sphero

I find the Star Wars inspired BB-8 robot toy developed by Sphero to be a delightful example of interactive industrial design. Remotely controlled by a smartphone, it embodies a personality which is both attractive and engaging. The toy is a remarkable feat of engineering, both in terms of industrial design and user experience. As an example, the robot’s head needed to be designed to exhibit even the slightest of movements relative to the rest of the body. If the head were simply fixed atop a rolling ball, the BB-8 would have been unable to convey the same depth or range of emotions to the user. In the end, it was decided to attach the head magnetically in order to allow it assume any position on it’s across the 360 degrees.

Moreover, the BB-8 makes friendly sounds in response to voice commands to the user which help endear it to a person really quickly. For example, when the user asks it to go to sleep, you will find the robot enunciating – in an electronic yet textured voice – no.

In an interview, Sphero’s founder said that this robot was born out of a spherical rolling ball that they had earlier created. But the challenges of creating the BB-8 were unique. To overcome these, he said that they first built a prototype to see how the actual product would behave, and whether it would do everything they expected it to. This immediately reminded me of generative prototyping in the paper by Holmquist. Just like Holmquict discusses, Sphero used a prototype to prove that the technology exists and is fully equipped to support the required interactions. At the same time, they did not let the prototype fool them into a bubble where every problem was solved: there still existed realistic design challenges which Sphero solved while building the actual product.

Pressure sensor

My program lights up different LEDs on the Arduino based on the pressure applied to the FSR. On low pressure, it’s green; on medium, blue and on higher pressure, red. It can be used in trash cans to check for the amount of trash inside, or installed under the insoles of shoes to check how relaxed the fit is.


const int ledGreen = 7; // Level Min
const int ledBlue = 4; // Level Medium
const int ledRed = 2; // Level Full
int fsrPin = A0; 
int fsrReading; 
void setup(void) {
   // Debugging information via the Serial monitor
   Serial.begin(9600);
   pinMode(ledRed, OUTPUT);
   pinMode(ledBlue, OUTPUT);
   pinMode(ledGreen, OUTPUT);
}
void loop(void) {
   fsrReading = analogRead(fsrPin); 
   if (fsrReading <=512) {
      digitalWrite(ledRed, LOW);
      digitalWrite(ledGreen, LOW);
      digitalWrite(ledBlue, LOW);
   }
   if (fsrReading > 512 && fsrReading <= 600) {
      digitalWrite(ledRed, LOW);
      digitalWrite(ledGreen, HIGH);
      digitalWrite(ledBlue, LOW);
   }
   if (fsrReading > 600 && fsrReading <= 680) {
      digitalWrite(ledRed, LOW);
      digitalWrite(ledGreen, LOW);
      digitalWrite(ledBlue, HIGH);
   }
   if (fsrReading > 680) {
      digitalWrite(ledRed, HIGH);
      digitalWrite(ledGreen, LOW);
      digitalWrite(ledBlue, LOW);
   }
   //Serial.print("Analog reading = ");
   Serial.println(fsrReading); // Raw analog reading
   delay(250); // Slow down the output for easier reading
}

img_20160928_075818

To do light

As I am wrapping up my homework from yet another week of academic rigor, I can’t help but wish that my environment reflected my feelings of accomplishment and ‘reward’ me for all I have achieved in this past week.

I almost always use Google Keep to keep track of the tasks that I need to complete in a given amount of time. Whenever I complete a task, I find myself opening the app to strike out that particular task. The feeling that I experience by striking out tasks and getting to end of my to do list gives me a sensation of pseudo bliss – I suppose it’s caused by the release of dopamine. To mirror these feelings, and to display information which has hitherto been contained inside fancy apps, I propose the idea of a To-Do Light.

In my mind, this is a light which connects to your smartphone and syncs with your preferred To Do List app – Google Keep, Evernote etc. Once synced, the light, connected to a power outlet may glow a deep shade of red to indicate a long list of tasks which needs to be tackled. The red light becomes a metaphor for work that needs to be done by the user. I think red makes for an appropriate color in this scenario since it generally commands attention, and for a lot of people, it also symbolizes urgency. As the user completes tasks and checks off those items off his/her list, the color of the light changes to mild hue of yellow/saffron to indicate work being done. Once the user completes his final task, the light changes to a bright white to symbolize bliss and happiness.

In many ways, the colour of the light at any stage of the user’s to do list becomes a metaphor for what many people strapped for time feel inside of them. To make the light transition to different, milder colors seems only reasonable to do in order to realize the user’s digital strikethroughs in the real world.