Paja

Icon

Rapid prototyping for music, art and design work

Control surface for Google Maps

By Mr. V & Miriam Lerkenfeld

The aim is to make a more fun and physical experience linked to google street view, where the user through movement controls the direction and view of the web service. Furthermore we wanted to stir away from the traditional keys and make a dynamic and fun way to see new parts of the world: Tokyo, Los Angeles, Paris, you decide where to go!

After few different concept ideas, we created an interactive controller for Google Maps. It consists of an Arduino board, an old keyboard, two kinds of sensors; accelerometer sensor – measures tilt and motion, ultrasonic sensors -measures distance and eight switches. Basically, the programme reads the values from the sensors and these control the keyboards’ pre-defined keys. The accelerometer control the camera’s pan and tilt keys(w,a,s,d), whereas, two different sensors (Ping))) ultrasonic sensor) control the horizontal movement in the the street (arrow keys).

Keyboard and sketches

Keyboard and sketches

Distance measurement controlling forward, back, left and right

Distance measurement controlling forward, back, left and right

Setup: circuit between arduino and keyboard with the switches

Setup: circuit between arduino and keyboard with the switches

Schematic Drawing of Google Map project

Schematic Drawing of Google Maps project

Arduino code for Google Maps project

// 2009 mlab.uiah.fi/paja
// PING))) Ultrasonic sensor

int pingPin1 = 14;  // This pin is connected pin SIG in PING))) Ultrasonic sensor, the digital 1 is equivilant to analog 0
int pingPin2 = 15;  // This pin is connected pin SIG in PING))) Ultrasonic sensor
int duration1;
int duration2;

int memsicXPin = 10;  //pin to read x axis value
int memsicYPin = 11;  //pin to read y axis value
int valInt; // variable for output switch statement

int pinInt1 = 2;
int pinInt2 = 3;
int pinInt3 = 4;
int pinInt4 = 5;

int pinInt5 = 6;
int pinInt6 = 7;
int pinInt7 = 8;
int pinInt8 = 9;

void setup()
{
  Serial.begin(9600);

  pinMode(pinInt1, OUTPUT);      // sets the digital pin as output
  pinMode(pinInt2, OUTPUT);
  pinMode(pinInt3, OUTPUT);
  pinMode(pinInt4, OUTPUT);
  pinMode(pinInt5, OUTPUT);      // sets the digital pin as output
  pinMode(pinInt6, OUTPUT);
  pinMode(pinInt7, OUTPUT);
  pinMode(pinInt8, OUTPUT);
}

void loop()
{
  // Pulse out
  // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
  // We give a short LOW pulse beforehand to ensure a clean HIGH pulse.

  pinMode(pingPin1, OUTPUT);
  digitalWrite(pingPin1, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin1, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin1, LOW);

  pinMode(pingPin1, INPUT);
  duration1 = pulseIn(pingPin1, HIGH);
  Serial.println(duration1);

  pinMode(pingPin2, OUTPUT);
  digitalWrite(pingPin2, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin2, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin2, LOW);

  pinMode(pingPin2, INPUT);
  duration2 = pulseIn(pingPin2, HIGH);
  Serial.println(duration2);

  //delay(100);

  if(duration1 > 200 || duration1  1400 && duration1 < 2000){
      Serial.println("Forward");
      Serial.print("X: ");
      Serial.print(duration1);
      Serial.println();
      digitalWrite(pinInt6,HIGH);
      delay(500);
  }

  //Key backward arrow
  if(duration1  200){
    Serial.println("Backwards");
    Serial.print("X: ");
    Serial.print(duration1);
    Serial.println();
    digitalWrite(pinInt5,HIGH);
    delay(500);
  }

  if (duration1 > 500 && duration1  200 && duration2  1300 && duration2  200 && duration2  500 && duration1 < 1300){
    digitalWrite(pinInt8,LOW);
    digitalWrite(pinInt7,LOW);
  }
}

else{
    digitalWrite(pinInt5,LOW);
    digitalWrite(pinInt6,LOW);
    digitalWrite(pinInt7,LOW);
    digitalWrite(pinInt8,LOW);
    delay(10);
  }

  int pulseX;    // raw data of x axis from accelerometer
  int pulseY;    // raw data of y axis from accelerometer
  int gravityX;  // X axis gravity
  int gravityY;  // Y axis gravity

  /w/value = pulseIn(pin, state);
  //Pin: Pin number (0 - 13, 14 to 19 are in analog input pins)
  //State: Specifies whether the puse to be mesured is low(0) or high(1)
  //value: the measured pulse duration will be stored.
  pulseX = pulseIn(memsicXPin, HIGH);
  gravityX = ((pulseX / 10) - 500) * 8;	

  pulseY = pulseIn(memsicYPin, HIGH);
  // calculating the pulse to 1/1000 g
  gravityY = ((pulseY / 10) - 500) * 8;

if(gravityX  500){

   //Key W
  if (gravityX > 500){
      Serial.println("Up (w)");
      Serial.print("X: ");
      Serial.print(gravityX);
      Serial.println();
      digitalWrite(pinInt1,HIGH);
  }
  //Key S
  if (gravityX < -500){
    Serial.println("Down (s)");
    Serial.print("X: ");
    Serial.print(gravityX);
    Serial.println();
    digitalWrite(pinInt2,HIGH);
  }
}

else if (gravityY  500){
   //Key A
  if (gravityY  500){
    Serial.println("Right (d)");
    Serial.print("Y: ");
    Serial.print(gravityY);
    Serial.println();
    digitalWrite(pinInt4,HIGH);
}
}

else{
    digitalWrite(pinInt1,LOW);
    digitalWrite(pinInt2,LOW);
    digitalWrite(pinInt3,LOW);
    digitalWrite(pinInt4,LOW);
    delay(10);
  }

}
Facebook Twitter Email

Category: Media Lab Helsinki, Student Projects

Tagged:

2 Responses

  1. […] Control surface for Google Maps by Miriam L Smith and Väinö Toppinen […]

  2. […] Control surface for Google Maps by Miriam L Smith and Väinö Toppinen 2. Tangible communication by Liisa Tervinen and Anusha Lyer […]

Social links powered by Ecreative Internet Marketing