Making Things Interactive

May 14, 2008

Final Project: PhytoBot “Augmenting Plant Behavior Through Robotics”

The PhytoBot is a semi-intelligent plant which responds to external stimulus (light intensity and light location) and responds to it as a phototropic plant would. Essentially it is designed as a piece of interactive artwork for operation over a long period of time. The motivation driving this was triggered by the lack of understanding & acceptance of plants as reactive living organisms. Many of us are so used to placing life on merely objects that have visual and audible external responses which can be seen by the naked eye. Plants on the other hand tend to be overlooked as their responses are more drawn out over time and hence we tend to see them as inanimate objects.

 

The PhytoBot has two degrees of freedom and motion, rotational and angular (from the normal). The rotational range of motion is 360 degrees whereas the vertical/angular range is approximately 70 degrees. The second component of the response is the pulsing lights on the face. The lights pulse from on to off in a smooth glowing fashion as if the plant was breathing. The variance in frequency is driven by the amount of light given to the plant. A fast pulse indicates that the plant is healthy, and a slow pulse indicates that the plant is in need of more light. There are two basic mechanical features within the PhytoBot. When the PhytoBot actively seeks light, it is oriented by two servos in the x and y axes. When the light has been located the plant will twitch depending on how far away the light source is. For example a closer point light will produce more twitching than if the Plant was facing the sun.  

Parts List:

– Plastic Laser Cut Structural Parts
– Foam Petals
– Foam core Box
– 4 Photo sensors
– 1 Green LED
– Wire (Solid core Flexible)
– Cable Wire
– 1 Standard Servo
– 1 Continuous rotation servo
– Screws
– 1 Arduino Microcontroller
– 4 100kOhm resistors
– Circuit boards for soldering components
– Acrylic glue

How it is Built: The PhytoBot is built primarily from laser cut acrylic parts. It was paramount to have my parts laser cut as they needed to fit correctly with minimal error. The whole plant can be divided up into 4 segments, the fixed base, rotating housing, stem and face. Each segment has their specific application and all working together complete the PhytoBot. The fixed base houses the rotational servo which in turn rotates the whole rotating housing. The rotating housing contains the stem servo. This stem servo is attached to the face via a cable wire through the stem. The stem supports the plant as it stands erect and also provides just the right amount of resistance to allow the plant to return to its erect position when not being pulled down. The face contains all the sensors and lights which provide the input and outputs of the whole plant. All the parts barring the petals were glues together using acrylic glue. This provided a strong hold and minimal movement/slop between the moving components.

Currently Im working on making a complete days time lapse video of my plant. Its a lot harder than I thought so the video isnt up as yet

April 30, 2008

Course Feedback

I enjoyed the concept of giving us weekly assignments to keep us occupied as well as learning. There is no better method of learning than by actually doing. Additionally, people in the class all came in with varying levels of knowledge, and for them to have to learn everything about electronics is unnecessary. With doing things by hand, the level of complexity is determined by one’s self.

I enjoyed the classes where jet would bring in and show us various links online of interesting projects. Firstly, it was good inspiration for our projects, and secondly for someone not coming from a purely artistic background, my exposure to this “culture” is very limited. It was very interesting to see what people are doing in this design space.

The idea of having a fairly complex midterm project forced us to push ourselves and understand how long building something would take. I learned from my midterm fiasco and began planning my final project much earlier.

The class blog is also a great place to look for ideas, assistance and just a simple, easy to use information interface for everyone. I’ve never used a blog for a class, but I think it is a great tool.

There was hardly anything I felt negatively about in the class. My comment is more of a suggestion to improve the class for others. I felt that diving straight into Arduino code was difficult for many people who did not have a programming background. I would suggest, the first few classes should be devoted to getting the class to think in steps, block diagrams, flowcharts etc. this way it is a little less daunting than having to decipher a foreign language.

Reflecting on the semester that was, I have really enjoyed this class for two major reasons. The freedom it gave me in pursuing projects that brought enjoyment to me and really giving me confidence in my ability to learn and undertake tasks associated with electronics and microcontrollers.

April 15, 2008

Final Project

Currently I have a manually working plant which can rotate from left to right and move up and down with inputs from two potentiometers. I have been having difficulty working with the input values from the photosensor (eliminating noise) and then problems with the servo twitching and not responding correctly to the photosensor values.

int pulse = 0;
int StemServoPin = 10;
int BaseServoPin = 11;
int LED = 5;
long count = 0;
int phi[] = {100};
int theta[] = {180} ;
int buffer = 5000;

void setup() {
  pinMode(StemServoPin, OUTPUT);
  pinMode(BaseServoPin, OUTPUT);
  pinMode(LED, OUTPUT);
  pinMode(0, INPUT);
  pinMode(1, INPUT);
  Serial.begin(9600);
  digitalWrite(13,HIGH);
  }

void pulseStemServo(int phi)
{
  int time;
  time = phi*10+1500;
  digitalWrite(StemServoPin, HIGH);
  delayMicroseconds(time);
  digitalWrite(StemServoPin, LOW);
}

void pulseBaseServo(int theta)
{
  int time;
  time = theta*0.555+1450;
  digitalWrite(BaseServoPin, HIGH);
  delayMicroseconds(time);
  digitalWrite(BaseServoPin, LOW);
}

int smooth(int buffer, int Pin){
  long sum = 0;
  for(int i = 0; i  100){
    count = 0;}
  count++;

  phi[count] = smooth(buffer, 0);
  theta[count] = smooth(buffer, 1);

  Serial.print(phi[count]);
  Serial.print(":");
  Serial.println(theta[count]);

  pulseBaseServo(theta[count]);
  pulseStemServo(phi[count]);

}

These photos are of my project from Saturday.

Laser Cut Parts before assembly

some of the mounting parts

The base assembled

closeup of the stem which shows the actuator cable

Initial version of the plant which broke

 

March 25, 2008

Final Project Proposal

Final Project Proposal

I aim to create a robot which represents a stationary living organism i.e. plant, flower, tree etc. The goal is to embed as many life-like, even human characteristics into the organism. As of now I have determined inputs such as light, presence of user, sound (maybe music), and temperature.  These inputs will work together to ultimately drive various responses observed by the user. Some of the outputs I have been thinking of are, actuation, based on presence of user, amount of sunlight received (like a plant, possibly a light following plant like a sunflower), possibly even response to music/loud noise etc. Another output I want to incorporate is visualization of happy/sad emotions through lights and posture. For example, a droopy, blue plant can signify sadness whereas a erect orange plant signifies happiness. Sadness and happiness can be determined through 4 metrics, amount of sunlight received, amount of interaction (not just presence, but change of presence) & loudness of noise (louder leads to negative emotion). The inspiration came from two interactive toys, the Tamaguchi and Digimon. I want to see this artifact being treated just as one would treat a real plant, give it sunlight, water (maybe not this iteration) & even sound.

Parts List

          Photo sensors

          Thermistors

          IR or Proximity sensors (need to purchase)

          Microphone (need to purchase)

          Various Resistors

          Transistors

          Servo Motors (need to purchase) w/ Links

          Arduino Microcontroller

          External Power Supply

          Solar Panels (need to purchase)

          Fasteners (need to purchase)

          Wire

          Materials for building the base, stem, etc.

          String/Wire for actuation

          Diodes

State Diagram

 

 

Pseudo code

Initialize Metrics

Calibrate w/ Environment (Light, Noise, Temp)

Initialize Interaction variable

Begin Operating Loop

                Read Inputs, Light, Temp, Sound, Rate Interaction

                Evaluate Emotion Rating (if emotion rating is too low, organism dies and loop exits)

                Output Emotion Module (Drive Light & Rigidity)

                Determine which branch to drive

                Drive Either Follow User, Follow Light or Idle (Drive Servos)

                Return Loop

Flow Chart 

 

  

Electric Schematic 

Yet to be decided

 Related Products/Projects 

Here are a few links about Robotany and other products which aim to achieve similar goals:

http://accad.osu.edu/~rinaldo/ 

http://danielbauen.com/robotany/

http://amorphicrobotworks.org/works/grt/fabrication.htm

 

March 20, 2008

Assignment 8(a): State Machine Design

Filed under: 8: State Machine,Siddartha Butalia — sbutalia @ 12:38 am

so for my state machine I wanted to create something with more than one input hence multiple states which arise from the various combinations possible. I was thinking of having a object which could grow and shrink depending on the amount of light given to it. and if it detected music/sound it would twitch slightly. The states are given below with the input drivers for each state.

March 6, 2008

MidTerm Project: Ventillated Jacket

Filed under: 7: Mid-Term Project,Siddartha Butalia — sbutalia @ 9:10 pm

Step-by-Step of how I reached my end results 

 Step 1. Attaching the thermistors to sense temperature: I began by creating a an input switch, tweaked to give a reasonable range of input voltages for the thermistor. This took a while to get right, as initially I was getting incoherent data. (below is a picture of the setup)


Step 2. calibrating the thermistors (scaling): The scaling was performed with the assumption that the thermistors gave off a linear voltage-temperature output. With this I plotted 2 points approximately and ran a regression analysis to determine a trend line. This trendline i used to come up with my fahrenheit values. With this I attached a number LED which was wired and coded as shown below. this was done so I could walk around freely with a jacket and understand which temperatures were uncomfortable and comfortable. I found that values over 85 (Fahrenheit) seemed quite uncomfortable. I then decided to leave this as a variable in my code which could be defined whenever.


Free Image Hosting at www.ImageShack.us

sourcecode for the hardwiring of the LED (functions)

void LEDOutput(int tempF){
  if(tempF > 0){
    if(tempF >10){
      if(tempF >20){
        if(tempF >30){
          if(tempF >40){
            if(tempF >50){
              if(tempF>60){
                if(tempF>70){
                  if(tempF>80){
                    if(tempF>90){
                      nine();
                    }
                    else{
                    eight();
                  }}
                  else{
                  seven();
                }}
                else{
                six();
              }}
              else{
              five();
            }}
            else{
            four();
          }}
          else{
          three();
        }}
        else{
        two();
      }}
      else{
      one();
    }}
    else{
    zero();
    }}
}

void nine()
{
  allclear();
  half();
  digitalWrite(13,HIGH);
  digitalWrite(12,HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(9,HIGH);
  digitalWrite(7, HIGH);
  digitalWrite(6,HIGH);
}

void eight(){
  allclear();
  half();
  digitalWrite(13,HIGH);
  digitalWrite(12,HIGH);
  digitalWrite(11,HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(9,HIGH);
  digitalWrite(7,HIGH);
  digitalWrite(6,HIGH);
}

void seven(){
  allclear();
  half();
  digitalWrite(13,HIGH);
  digitalWrite(9,HIGH);
  digitalWrite(7,HIGH);
  digitalWrite(6,HIGH);
}

void six(){
  allclear();
  half();
  digitalWrite(13,HIGH);
  digitalWrite(12,HIGH);
  digitalWrite(11,HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(9,HIGH);
  digitalWrite(7,HIGH);
}

void five(){
  allclear();
  half();
  digitalWrite(13,HIGH);
  digitalWrite(12,HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(7,HIGH);
  digitalWrite(9,HIGH);
}

void four(){
  allclear();
  half();
  digitalWrite(13,HIGH);
  digitalWrite(12,HIGH);
  digitalWrite(9,HIGH);
  digitalWrite(7,HIGH);
}

void three(){
  allclear();
  half();
  digitalWrite(12,HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(9,HIGH);
  digitalWrite(7,HIGH);
  digitalWrite(6,HIGH);
}

void two(){
  allclear();
  half();
  digitalWrite(12,HIGH);
  digitalWrite(11,HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(7,HIGH);
  digitalWrite(6,HIGH);
}

void one(){
  allclear();
  half();
  digitalWrite(7,HIGH);
  digitalWrite(9,HIGH);
}

void zero()
{
  allclear();
  half();
  digitalWrite(13,HIGH);
  digitalWrite(11,HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(9,HIGH);
  digitalWrite(7,HIGH);
  digitalWrite(6,HIGH);
}

void allclear(){
for(int i=0; i < 8; i++){
  digitalWrite(6+i,LOW);
  }
}

void half(){
  if(int(tempF) % 10 > 5)
  {
    digitalWrite(8,HIGH);
  }
}

Step 3. experimenting with various ways to actuate fabric with muscle wire: Initially i wanted the vents to open and close as gills, this however was easier said and done. Finally i came upon using this method to actuate the flaps. I use the pushing nature of muscle wire, it is quite strong when enough current is applied to the wire. Understanding this I had to use a transistor which allowed large currents to flow through.

Step 4. Assembly: the method of creating the jacket was as follows, I cut out the flaps in the two layer jacket. Then i fused the edges together with fabric fuser and an iron, after that I created the “muscles.” I created these by taking each end and crimping them into copper tubes. the other ends of the tubes were attached to outgoing wires. after doing all the attachments, i soldered in the edges for a tighter fit. In order to successfuly insulate the components from both themselves and the fabric, I used heat shrink tubing to encase the joints. all exposed joints where soldered for strength and conductivity as well as shrink tubed to eliminate as much malfunction as possible. the wires and other components were taped onto the inside layer of fabric which proved to be strong enough. The next step was to determine which wires to use etc. I ran the power supplies through the front pockets as to utilize space to the maximum. Below one will find how the whole jacket is wired in a simple system level diagram indicating components, inputs and outputs.


int inputPin[3];      //declares array of analog inputs
int outputPin = 8;    //declares pin attached to transistor
float tempF[3];        //declares variable to store temperature values in
float tempAVG;        //declares variable to store the average temp in
int threshTemp = 95;  //defines the temperature at which the vents open

void setup() {
  inputPin[0] = 5;              //defining the input pins
  inputPin[1] = 4;
  inputPin[2] = 3;
  pinMode(10, INPUT);          //defining input and output pins
  pinMode(outputPin, OUTPUT);
  pinMode(inputPin[0], INPUT);
  pinMode(inputPin[1], INPUT);
  pinMode(inputPin[2], INPUT);
  pinMode(13, OUTPUT);

  Serial.begin(9600);          

 }

void loop(){

  tempF[0] = (0.236827*analogRead(inputPin[0])-3.962);  //storing the temperatures from all three thermistors
  tempF[1] = (0.236827*analogRead(inputPin[1])-3.962);
  tempF[2] = (0.236827*analogRead(inputPin[2])-3.962);
  tempAVG = (tempF[0]+tempF[1] + tempF[2])/3;          //calculating the avg temp
  Serial.print(int(tempF[0]));                          //output of values for debugging/checking
  Serial.print(int(tempF[1]));
  Serial.println(int(tempF[2]));
  Serial.println(int(int(tempAVG)));

  if((int(tempAVG) > threshTemp) || digitalRead(10) > LOW){  //checks whether temp is > than the threshold or if the manual override button has been pushed
    digitalWrite(outputPin,HIGH);
    digitalWrite(13,HIGH);
  }else{
  digitalWrite(outputPin,LOW);
digitalWrite(13,LOW);
}

}

note* after break I will try and post up some directions/hints for working with muscle wire in the context of my project

February 24, 2008

Assignment 6: Making more motion (actuation)

Filed under: 6: More Motion,Siddartha Butalia — sbutalia @ 2:28 pm

So i tried to build on my DC motors from last week. I simplified the sensors to a switch to focus on building other components. I aimed to slow down the DC motor by using a rubber band setup. This was not as seccesfull, but i learned how hard it was to prototype details with foam core. the code is a simple algorithm which takes a switch input, and drives a motor

 here are some photos & the code:

Free Image Hosting at www.ImageShack.us Free Image Hosting at www.ImageShack.us


int ledPin = 13;    // defines the check pin
int inputPin = 2;   // defines input for sensor A
int motorPin = 9;   // defines output for motor A

void setup() {

  pinMode(ledPin, OUTPUT);      // declare check LED Pin
  pinMode(motorPin,OUTPUT);     // declare Motor PinA
  pinMode(inputPin, INPUT);     // declare SensorA input Pin

  Serial.begin(9600);
 }

void loop(){

  while (digitalRead(inputPin) == HIGH) {        // check if the input is on
    digitalWrite(ledPin, HIGH);   // turn check LED On
    digitalWrite(motorPin,HIGH);  // turn Motor A On
  } 

    digitalWrite(ledPin, LOW);  // turn check LED Off
    digitalWrite(motorPin,LOW); // turn Motor A Off

}

 


	

February 12, 2008

Assignment 5: Making Motion

Filed under: 5: Making Motion,Siddartha Butalia — sbutalia @ 1:43 am

For this assignment I wanted to understand the basics of motor control and how to switch using a transistor. On the other side, i wanted to experiement with photo sensors as I may end up using them in my end of year project. The program I wrote basically takes two analog inputs from two seperate photo sensors which are connected as switches, these in turn control individual motors. I experimented a lot with the analog inputs creating a calibration phase and implementing a sensitivity factor into the sensors. I found it to work quite well, and the calibration section was definetley (successfull under dark and light conditions). The one thing i noticed while fine tuning the sensors is that they are very tricks to use when there is one source of light and not much ambient light. If i had more time i would have wanted to incorporate more photosensors to actually try and analyze the environment, understanding whehter or not the light is ambient, or harsh directional through differences in calibration voltages.

Free Image Hosting at www.ImageShack.us

 heres the code:


int ledPin = 13; // defines the check pin
int CalPin = 12; // defines the Calibration LED Pin
int inputPin = 2; // defines input for sensor A
int inputPin1 = 3; // defines input for sensor B
int ValA = 0; // Initializes Sensor A reading
int ValB = 0; // Initializes Sensor B reading
int motorPin = 8; // defines output for motor A
int motorPin1 = 9; // defines output for motor B
int CalA = 0; // Initializes Sensor A calibration reading
int CalB = 0; // Initializes Sensor B calibration reading
float Sens = .85; // Defines the sensitivity of the photocells (0 - 1.0 "always on")

void setup() {

pinMode(ledPin, OUTPUT); // declare check LED Pin
pinMode(motorPin,OUTPUT); // declare Motor PinA
pinMode(motorPin1, OUTPUT); // declare Motor PinB
pinMode(12,OUTPUT); // declare Calibration Complete Pin
pinMode(inputPin, INPUT); // declare SensorA input Pin
pinMode(inputPin1, INPUT); // declare SensorB input Pin

Serial.begin(9600);
digitalWrite(CalPin, HIGH);
delay(500);
digitalWrite(CalPin, LOW);
delay(500);
CalA = analogRead(1); // Retrieve Ambient Light value for A
CalB = analogRead(0); // Retrieve Ambient Light value for B
digitalWrite(CalPin, HIGH); // Confirms Calibration Complete
delay(500);
digitalWrite(CalPin,LOW);
}

void loop(){

ValA = analogRead(1); // Retrieve Light value Sensor A
ValB = analogRead(0); // Retrieve Light value Sensor B

if (ValA > CalA*Sens) { // check if the input is larger than the threshold (taken from calibration & sensitivity factor)
digitalWrite(ledPin, LOW); // turn check LED OFF
digitalWrite(motorPin,LOW); // turn Motor A OFF
}
else {
digitalWrite(ledPin, HIGH); // turn check LED ON
digitalWrite(motorPin,HIGH); // turn Motor A ON
}

if (ValB > CalB*Sens) { // check if the input is larger than the threshold (taken from calibration & sensitivity factor)
digitalWrite(ledPin, LOW); // turn check LED OFF
digitalWrite(motorPin1,LOW); // turn Motor B OFF
}
else {
digitalWrite(ledPin, HIGH); // turn check LED ON
digitalWrite(motorPin1,HIGH); // turn Motor B ON
}
}

February 5, 2008

Assignment 4, Counting Sensor

Filed under: 4: Counting Sensor Input,Siddartha Butalia — sbutalia @ 4:20 am

with this assignment i wanted to explore output options more as im going to be diving into different sensor inputs for my projects. lights tend to be interesting so I wanted to experiment with differnt ways of outputting actions with lights. My output is a series of growing and fading LEDs which are dependant on how long you hold down the switch for. I still have a counter which adds up the total number of button presses and keeps track of it.

[ youtube=http://www.youtube.com/watch?v=VKqE7xAhVAA ]

Link to Video

Here is the code:

int switchPin = 2;              // Switch connected to digital pin 2
int count = 0;                  // Counter
int ledPin = 13;                // test pin
int flag = 0;                   // variable to check for holding of the button
void setup()                    // run once, when the sketch starts
{
  Serial.begin(9600);           // set up Serial library at 9600 bps
  pinMode(switchPin, INPUT);    // sets the digital pin as input to read switch
  for (int i=8; i  1){                      // the fancy LED output
    analogWrite(8, 15);
    if (flag > 2){
      analogWrite(8,255);
      if (flag > 3){
        analogWrite(9, 15);
        if (flag > 4){
          analogWrite(9,255);
          if (flag > 5){
            analogWrite(10,15);
            if (flag > 6){
              analogWrite(10,255);
              if (flag > 7) {
                analogWrite(11,15);
                if (flag > 8 ) {
                  analogWrite(11,255);
                }
              }
            }
          }
        }
      }
    }
  }
  Serial.println(count);       // used to check the accuracy of the counter
  delay(100);
  digitalWrite(ledPin,LOW);
  if(flag < 2){     digitalWrite(11,LOW);     delay(50);     digitalWrite(10,LOW);     delay(50);     digitalWrite(9,LOW);     delay(50);     digitalWrite(8,LOW);   } }[/sourcecode] and i have no idea why my youtube thing wont work or why this wordpress link keeps coming inside my sourcecode

January 29, 2008

Assignment 2: Term Project Idea

Filed under: 2: Term Project Idea,Siddartha Butalia — sbutalia @ 2:21 am
Tags: , , ,

So for my term project I would like use sensors for something useful. I have two ideas that I have not decided between as yet. The first idea, is a shirt or even cap which is fitted with motion/photo sensors covering places where ones eye cannot see (behind the head etc.) with these sensors I aim to build a sort of “spidey sense”/”sixth sense” which could help in detecting objects at certain ranges etc.

The second idea is an alarm clock with sensors that can detect ones state, sleep, awake, falling asleep and adjust accordingly. This one seems a little more difficult on the tehnology end, so I wil have to do a little bit more research on this.

Next Page »

Blog at WordPress.com.