Tag Archives: #week12

WEEK12-Further Iteration

The goal of the project- Try the basic set up for final project form, and two robotic plants with different motion included. One is made with the stepper motor(Ferns) and the other one is muscle wire(Flytrap). In this iteration, I want to test the light and visual effect of this project as well as differentiate random and systematic movement of robotic plants. Also, one important implementation of this iteration is to add the interaction part, using Kinect and Unity to communicate with Arduino, audiences can interact with this set by walking around in the room.

Main components:

Arduino UNO

Xbox Kinect 2

0.012mm muscle wires

tip120

330-ohm resistor

12v stepper motors

motor shield for stepper motor

12v 6a power source

How it works:

For the demo can see the playtest video below. Kinect– using the infrared camera to detect audience’s body skeleton and find the x, y, z-axis. Unity– using the c# program to enable the trigger function when audiences touch the certain area  (there are five little yellow people models spread on the screen representing different location). When the models being triggered, Unity will send a byte to the serial monitor in Arduino. Arduino– in code, there is a processing message which will start to heat up the wire and rotate the motor, by typing “on” in the serial monitor, the function loop will start to run. To conclude, by connecting these three different platforms, I can achieve an indirect interaction without using a sensor. For the final setup, the audience will not see the unity interface so that they can just walk around, being captured by Kinect, and the robotic plants will move based on their movement without notice.

Circuit and CODE:

The following circuit includes the detail for connecting muscle wire correctly, note that there are two sides of muscle wires, one side should go to the middle leg of the transistor(TIP 120), and the other should go to the positive side, which is 12v 6a (+) in this circuit. The other two legs of transistor go separately to GND & resistor- Pin, the reason for pin leg output can actually control the transistor and open the circuit for electricity to go through the wire. Be very aware of the external power source, don’t connect it to Arduino unless you want to burn it. Just connect positive and negative side to breadboard like how you use 9V battery to power up the circuit.

CODE in Arduino:

#include <Stepper.h>

const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);

String buf;
char c;
int flower=6;
int flower1=4;
int flower2=5;
int led = 2;

void setup() {
pinMode(flower,OUTPUT);
pinMode(led, OUTPUT);
// set the speed at 60 rpm:
myStepper.setSpeed(60);
// initialize the serial port:
Serial.begin(9600);
}

void loop() {
while (Serial.available() > 0) {
c = Serial.read();
if (c == ‘\n’) {
processMessage();
buf = “”;
} else {
buf += c;
}
}
}

void processMessage() {
Serial.println(“processMessage”);
if (buf.equals(“on”)) {

//0.005″wire
digitalWrite(flower,HIGH);
digitalWrite(led,HIGH);
//
digitalWrite(flower1,HIGH);
digitalWrite(flower2,HIGH);
delay(3000);
digitalWrite(flower,LOW);
digitalWrite(led,LOW);
digitalWrite(flower1,LOW);
digitalWrite(flower2,LOW);
delay(8000);

for(int i=0;i<6;i++){
// step one revolution in one direction:
Serial.println(“clockwise”);
myStepper.step(stepsPerRevolution);
delay(500);

// step one revolution in the other direction:
Serial.println(“counterclockwise”);
myStepper.step(-stepsPerRevolution);
delay(500);
}

}
}

Problem encountered:

I spent a lot of time to caculate and test the right amount of electricity for the wire. Using the specs chart of wire and the formula of voltage caculation from computational craft class slides really help me alot.

 

For the playtest plan, I record a simple demo video to show the interaction. I would like to know people’s reaction toward the movement of plants, it’s interesting to look at or not. Also, I am curious about if they are aware of what interaction they are adding up to this system.