Month: September 2013

Maxuino/Firmata/Basic LED Set-Up Progress

Posted on Updated on

The basic issue I’m currently running into is figuring out if MAX is actually communicating with Arduino.  I uploaded the firmata code on arduino and my set up with a single red LED starts blinking but stops after a few seconds.  I don’t know if there is only recognition of active communication and my set up on MAX is wrong or if I haven’t loaded all of the necessary software yet.

Screen Shot 2013-09-16 at 8.39.19 PMScreen Shot 2013-09-16 at 8.21.41 PM



Here is the basic outline of the system/software link between arduino – max – projector.



I came up with a pretty basic if then statement too which probably will be glitchy, and perhaps I need to rework into a ratio based calculation, where the rate of change of the viewer  is taken into consideration to make smoother transitions from video frame to video frame.




PING Sensor Arduino Test

Posted on Updated on

Before I try to figure out how to feed serial data from Arduino into MAX, I wanted to make sure my PING Sensor was working and that I could get Object-Distance information displayed live on the serial data monitor.  Heres my video result:

Test 1 Serial monitor(2)


/* Ping))) SensorThis sketch reads a PING))) ultrasonic rangefinder and returns the
distance to the closest object in range. To do this, it sends a pulse
to the sensor to initiate a reading, then listens for a pulse
to return.  The length of the returning pulse is proportional to
the distance of the object from the sensor.The circuit:
* +V connection of the PING))) attached to +5V
* GND connection of the PING))) attached to ground
* SIG connection of the PING))) attached to digital pin 7

created 3 Nov 2008
by David A. Mellis
modified 30 Aug 2011
by Tom Igoe

This example code is in the public domain.


// this constant won’t change.  It’s the pin number
// of the sensor’s output:
const int pingPin = 7;

void setup() {
// initialize serial communication:

void loop()
// establish variables for duration of the ping,
// and the distance result in inches and centimeters:
long duration, inches, cm;

// The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
// Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
digitalWrite(pingPin, HIGH);
digitalWrite(pingPin, LOW);

// The same pin is used to read the signal from the PING))): a HIGH
// pulse whose duration is the time (in microseconds) from the sending
// of the ping to the reception of its echo off of an object.
pinMode(pingPin, INPUT);
duration = pulseIn(pingPin, HIGH);

// convert the time into a distance
inches = microsecondsToInches(duration);
cm = microsecondsToCentimeters(duration);

Serial.print(“in, “);


long microsecondsToInches(long microseconds)
// According to Parallax’s datasheet for the PING))), there are
// 73.746 microseconds per inch (i.e. sound travels at 1130 feet per
// second).  This gives the distance travelled by the ping, outbound
// and return, so we divide by 2 to get the distance of the obstacle.
// See:
return microseconds / 74 / 2;

long microsecondsToCentimeters(long microseconds)
// The speed of sound is 340 m/s or 29 microseconds per centimeter.
// The ping travels out and back, so to find the distance of the
// object we take half of the distance travelled.
return microseconds / 29 / 2;

RGB LED Arduino Kit Test (Hello World)

Posted on

So I just received my Arduino Kit and here is the video of my first project:



int redPin = 11;

int greenPin = 12;
int bluePin = 13;

void setup()
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);

void loop()
setColor(255, 0, 0); // red
setColor(0, 255, 0); // green
setColor(0, 0, 255); // blue
setColor(255, 255, 0); // yellow
setColor(80, 0, 80); // purple
setColor(0, 255, 255); // aqua

void setColor(int red, int green, int blue)
analogWrite(redPin, red);
analogWrite(greenPin, green);
analogWrite(bluePin, blue);


Project 1 Proposal Outline

Posted on Updated on

Basic Interactivity – Sensor Activated Video Feed.

I want to have a projector displaying an image of me from far back. As the viewer approaches the screen, I want to walk forward and approach the viewer with a smile. As they retreat from the projected wall I want to walk backwards or turn around and walk back to my original position.

Potential Setup

An ultrasonic range finding sensor that measures the distance of the viewer from the back wall opposite to the wall in which the image of me is being projected. As the viewer gets further away from the sensor, the video file of me walking forward is played forward. As the viewer gets closer to the sensor, the clip of me runs backwards on MAX, thus I walk backwards in the projected image.

A computer would have to run the MAX/Jitter loop will monitor the microcontroller to sensor data feed and activate the video file when necessary. The projector or monitor will just be attached into the computer and output the video file played upon activation.  I have both MAC and Windows.  If need be I can load Linux onto my Windows laptop.  I don’t know however if I’ll be able to download multiple files of Max/Jitter licenses for different platforms.  I have a 1 year student license for 6.0.

I think I will have to chroma key the video file of myself as the figure in the video file using a blue/green screen so that I can remove the background so that all around me is projected white light, thus making my body appear upon a white wall, far back in the distance (distortion of perspective).  I will use Adobe Premiere/After Effects to do this.


A range finding sensor.  A PING is an ultrasonic range finder from Parallax. It detects the distance of the closest object in front of the sensor (from 2 cm up to 3m).

An alternative beefier sensor with 6M range:


Kinect object for MAX:

I downloaded Homebrew and installed as I have a kinect. I probably will not use for this project.

ARDUINO: I might be able to run the sensor directly into the computer running MAX therefore eliminating the need for any other micro controllers.

Arduino BT:

Projector or LCD. Back projection would permit the ability to allow viewer to approach projection in entirety. Otherwise viewers will have to stay away from projected wall so that their shadows don’t cut off image projection.

MAX/Jitter Video file – Green screen. I want to be in a white background so I blend into the white wall. Could take some tricky lighting to get nice.

I think I will have to chroma key the video file of myself as the figure in the video file using a blue/green screen so that I can remove the background so that all around me is projected white light, thus making my body appear upon a white wall, far back in the distance (distortion of perspective).

Wireless projectors are expensive. If I do a rear projection or create a silhouetted body then I could maybe eventually make them change colors. I could also hide the cords and max run CPU.


I may have to eliminate some features should the complexity become overwhelming.  There are the workshop resources at school as well as around sf.



I hope to have Max/Maxduino/Firmata working correctly and showing PING data by 9/23.

Ill have the video file shot by 9/25

I’ll try to figure out how to write if/then statements in MAX by to attach to Jitter Objects.  Also having the keying done for the video file with green screen needs to be done. 9/30

Getting the Whole coordinated project together and test with projector Oct. 9

Solder Oct 14

Present Oct 17.