PitchSqueak

Group: Bonnie Eisenman (bmeisenm), Mario Alvarez (mmcgil), Erica Portnoy (eportnoy), Valentina Barboy (vbarboy)

Description: We built a cardboard “robot” that responds to having its hand held and its nose tweaked. When you hold its hand, its heart glows and it burbles in robot-speak. Its nose is a potentiometer which controls the color of its eyes. We built PitchSqueak because we wanted to build a puppy, but we couldn’t with the given materials, so we figured that an interactive robot was a decent second choice. We’re all kids at heart and we like kids’ toys. (Also, we wanted to experiment with the buzzer.) While we don’t have any kids on hand to test PitchSqueak with, we all find him quite delightful, so we judge this project to be a success. Improvements we would include if possible would be making the cardboard construction better, and making the potentiometer easier to turn. Originally we had also envisioned having PitchSqueak respond to having his head petted, using the linear Softpot.

Photo Feb 20, 9 54 27 PM Photo Feb 20, 9 40 22 PM Photo Feb 20, 9 32 36 PM Photo Feb 20, 9 10 10 PM

Photos of sketches:

A mini-weather-station with sensors that record the ambient light and temperature, and periodically tweets them.

A mini-weather-station with sensors that record the ambient light and temperature, and periodically tweets them.

A "musical instrument" whose pitch and volume can be controlled using the Softpot and the potentiometer.

A “musical instrument” whose pitch and volume can be controlled using the Softpot and the potentiometer.

PitchSqueak! An interactive robot/toy whose heart glows and he babbles when you hold his hand. You can also change the color of his eyes.

PitchSqueak! An interactive robot/toy whose heart glows and he babbles when you hold his hand. You can also change the color of his eyes.

 

Storyboard:

Our storyboard. Little Timmy learns to be nice to people / robots!

Our storyboard. Little Timmy learns to be nice to people / robots!

PitchSqueak in Action:

List of parts:

  • 1 buzzer
  • 1 potentiometer
  • 1 FSR
  • 1 red LED
  • 1 RGB LED
  • 1 breadboard
  • 1 cardboard box
  • Electrical tape
  • Wires
  • Paper
  • 1 Arduino
  • 1 USB cable

Instructions for Recreation:

We constructed PitchSqueak out of a cardboard box. We cut out a rectangle of cardboard for the face, and cut holes for the eyes, heart, and nose. The holes for the eyes and heart were covered with paper to diffuse the light from the LEDs. The potentiometer was placed in the hole for the nose and secured with electrical tape. We then used a second piece of cardboard for a “shelf” between the heart and the eyes, to shield the two LEDs from each other. The red LED was taped to the hole for the heart. Electrical tape was used for connecting the wires to the potentiometer. We then cut out a second piece of cardboard for the body, as well as cardboard arms. We taped the FSR to one of the arms, and then attached the arms to the body. Next we connected the body to the face. We taped the LED for the eyes to the top of the robot’s body, inside. Finally, we connected all the sensors according to our circuit diagram with the breadboard.

Circuit diagram.

Source code:

/* Pitch squeak! */

// Pins:
int greenPin = 10;     // analog pin for the green component of RGB LED
int heart = 7;        // the analog pin for the red LED (heart)
int fsrPin = 2;       // the FSR and 10K pulldown are connected to this pin
int potPin = 0;       // the potentiometer is connected to this pin
int music = 3;        // pin that connects to music

// Input: 
int fsrReading;       // the analog reading from the FSR resistor
int potRead;          // the analog reading from the potentiometer

// Constants: 
int brightness = 255;   // the brightness the LED glows with

void setup(void) {
  // We'll send debugging information via the Serial monitor
  Serial.begin(9600);

  // Set the modes of the pins
  pinMode(heart, OUTPUT);
  pinMode(music, OUTPUT); 
  pinMode(greenPin, OUTPUT);
  pinMode(potPin, INPUT);
  pinMode(fsrPin, INPUT);
}

void loop(void) 
{
  fsrReading = analogRead(fsrPin);
  potRead = analogRead(potPin);
  /*
  Serial.print("FSR reading = ");
  Serial.println(fsrReading);     // the raw analog reading  
  Serial.print("Pot reading = ");
  Serial.println(potRead);     // the raw analog reading
  */
  int greenVal = potRead/4.0; // convert 0-255 to 0-1023
  analogWrite(greenPin, greenVal);

  // Light up heart and make noise if hand squeezed
  if (fsrReading >= 500)
  {
    analogWrite(heart, brightness);
    digitalWrite(music, HIGH);
    for(int i=0; i<10; i++) {
      int r = random(0,255);
      analogWrite(music,r);
      delay(100);
     }
     digitalWrite(music, LOW);
     analogWrite(heart, 0);
  }
  else {
    digitalWrite(music, LOW);
  }
}