Assignment 8 Update: Video Interaction with Ultrasonic sensor

One of the things I wanted to explore in this class was the relationship between sensors and video playback, and what kinds of content would work in an installation with sensors. I did a simple experiment to update my week 8 assignment, which was to create an interaction between Arduino and Processing via a serial connection.

I used an Ultrasonic sensor to try out an interaction with a video that zooms in and out on a small note. Your proximity to the sensor makes the video scroll along its timeline, in relationship to sensor values. The video itself zooms in and out creating a relationship of distance with the viewer’s distance. I wanted to reverse the interaction, so that the closer you get to the screen and sensor, the further away the object/subject in the video gets. On a conceptual level, instead of facilitating your viewing experience, it problematizes it, in a way that may frustrate the viewer or depending on content, make it fun to try to read the message. This is the basic interaction:

The quick video I tested it with is here. What needs some adjustment is the sensor value code, but that would require testing in an empty space. It works well enough to express the interaction outlined.

Arduino Code
const int analogInPin = A0;  // Analog input pin that the potentiometer is attached to

int sensorValue = 0;        // value read from the sensor

void setup() {

void loop() {
// read the analog in value:
sensorValue = analogRead(analogInPin);

// print the results to the serial monitor:
//Serial.print(“sensor = ” );


Processing Code

// Creation and Computation Assignment Week 8
// Based on Exercise 16-5 from Learning Processing by Daniel Shiffman

import processing.serial.*;

Serial myPort;        // The serial port
int videoControl;


Movie myMovie;

void setup() {
size(320, 240);
myMovie = new Movie(this, “”);
String portName = Serial.list()[0];  //initializing serial port
myPort = new Serial(this, portName, 9600);

void draw() {
float ratio = videoControl / (float) width;;
image(myMovie, 0, 0);

void serialEvent(Serial myPort) {  // serial analog read
int inByte =;
float ratio = videoControl / (float) width;

Comments are closed.