Tuesday, October 19, 2010

Week 5

After the critique of our week 4 solar tracker we decided to focus more on the 2-axis tracker itself and not its application. This resulted in a redesign of the solar tracking mechanism with inspiration coming from the eye. As light enters the eye, it is concentrated to a point where it comes into contact with the retina. The biomimicry aspect of our device comes from how the solar tracker receives the signal to move. Similar to an eye, the light comes through a pinhole and contacts the sensor array (similar to rods and cones in a eye). The light is then read as a number and the device responds by moving towards it. 


 The device consists of a sphere (the eye) fixed at two points to a turntable so it can rotate freely. An arc of pegs (the mohawk) is attached to the bottom of the sphere and meshes with a gear (powered by a servo) that rotates the eye. The image below shows the preliminary sketches for the movement mechanism of our solar tracker.The gear/mohawk mechanism is then attached to another servo that allows the whole eye to rotate on the xy plane by moving  the turntable. The second image is a photograph of one of the joints connecting the turntable and the xy plane servo. The slit in the bar allows the system to adjust in height small amounts to prevent the servo from lifting the lid off the device. 

Below is a video of the partially constructed device that allows you to see the movement on both the xy and yz planes. 


This is an image of our fully functional two-axis solar tracking device. When the pin hole has oriented with a light source, the green led indicator light comes on  and is visible through the front of the acrylic case. 


This is the code used for operating the servos to track a light source. It is very similar to the one used last week but with the light values mapped to 1050 to account for one of the photoresistors being a different type and reading a much higher value.



#include <Servo.h>

Servo zyplane; //servo attached to the base servo rotates on the zy plane (around x axis)
Servo xyplane;
int pos = 90;
int pos2 = 90;

//PhotoResistors (these are all analog pins)
int photo1 = 0; 
int photo2 = 1;
int photo3 = 2;
int photo4 = 3;
int photo5 = 4;

//alignment indicator LED (this is a digital PWM pin)
int ledPin = 5;  

void setup()
{
  pinMode(ledPin, OUTPUT); //sets the led pin to output
  pinMode(photo1, INPUT);
  pinMode(photo2, INPUT);
  pinMode(photo3, INPUT);
  pinMode(photo4, INPUT);
  pinMode(photo5, INPUT);

  zyplane.attach(10);// attach the pin 10 servo to servo object
  xyplane.attach(9);
  Serial.begin(9600); // use the serial port
}

void loop()
{
 //--------------------gives a value for each photoresistor------------------------------
 int light1 = analogRead(photo1); //Read the lightlevel
 light1 = map(light1, 0, 900, 0, 1050); //adjust the value 0 to 900 to span 0 to 1050
 light1 = constrain(light1, 0, 1050);//make sure the value is between 0 and 1050
  
 int light2 = analogRead(photo2); //Read the lightlevel
 light2 = map(light2, 0, 900, 0, 1050); //adjust the value 0 to 900 to span 0 to 1050
 light2 = constrain(light2, 0, 1050);//make sure the value is between 0 and 1050


 int light3 = analogRead(photo3); //Read the lightlevel

 Serial.println(light3);

 int light4 = analogRead(photo4); //Read the lightlevel
 light4 = map(light4, 0, 900, 0, 1050); //adjust the value 0 to 900 to span 0 to 1050
 light4 = constrain(light4, 0, 1050);//make sure the value is between 0 and 255


 int light5 = analogRead(photo5); //Read the lightlevel
 light5 = map(light5, 0, 900, 0, 1050); //adjust the value 0 to 900 to span 0 to 1050
 light5 = constrain(light5, 0, 1050);//make sure the value is between 0 and 1050



//----------------------------------operates xyplane servo---------------------------------//

  if (light1>light3 && light1>light5  && light1>light4  && light1>light2 && pos!=180 ){
      xyplane.write(pos);
  delay(100);
  pos ++;
  }
    
  if (light3>light1 && light3>light5  && light3>light4  && light3>light2 && pos!= 0  ){
      xyplane.write(pos);
  delay(100);
  pos --;
}
//-------------------------------operates zyplane servo----------------------------------------
   //zyplane.attach(10);// attach the pin 10 servo to servo object
  
  if (light2>light4 && light2>light5  && light2>light3  && light2>light1 && pos2!=180 ){ 
  zyplane.write(pos2);
  delay(100);
  pos2 --;
  }
  
  if(light4>light2 && light4>light5  && light4>light1  && light4>light3 && pos2 != 0){
  zyplane.write(pos2); //goes to the position
  delay(100); //this gives the servo time to move
  pos2 ++;
}



//---------------------------operates LED alignment indicator--------------------------------------

 if (light5>light1 && light5>light2 && light5>light3 && light5>light4){

  digitalWrite(ledPin, HIGH);
 }
  else{ 
    digitalWrite(ledPin, LOW);
    
  }





Friday, October 8, 2010

Week 4

The requirements for this week were to create a 2 axis solar tracking biomimetic surface. The design that our group came up with was inspired by the window plant and an eye. The window plant has a relatively flat surface that focuses the light to a central column of oxylic acid where it is channeled downward (similar to fiber optics) to the base of the plant where photosynthesis takes place.


(http://www.asknature.org/strategy/6eb4107cbcdde41d35818191b29f60f5)

The eye works by acting as a spherical lens that focuses light to a single point. Our proposed design consisted of a hemispherical glass dome, which acts as a lens, that focuses light to a point where a solar panel would be placed. This allows for a higher efficiency solar panel to be used since the light would be concentrated. The solar panel would be located just past the center of the sphere as the focal point of a spherical lens is  approximately equal to the radius.  As the sun moves through the sky there will be a small variance in the position of the focus point (it moves over an arc throughout the day) so the solar panel would be located on a solar tracking device to optimize the alignment with the sun. This would be achieved by placing an array of photo resistors under a pinhole in the solar panel. The solar cell would then move in the direction of the light until the central photo resistor receives the most light, at which point the photovoltaic would be aligned and the movement would stop. 


Solar Tracking Code:


#include <Servo.h>
Servo xyplane; //base servo that rotates on the xy plane(around z axis)
int pos = 0;

Servo zyplane; //servo attached to the base servo rotates on the zy plane (around x axis)
int pos2 = 0;


//PhotoResistors (these are all analog pins)
int photo1 = 0;
int photo2 = 1;
int photo3 = 2;
int photo4 = 3;
int photo5 = 4;

//alignment indicator LED (this is a digital PWM pin)
int ledPin = 5;

void setup()
{
  pinMode(ledPin, OUTPUT); //sets the led pin to output
  pinMode(photo1, INPUT);
  pinMode(photo2, INPUT);
  pinMode(photo3, INPUT);
  pinMode(photo4, INPUT);
  pinMode(photo5, INPUT);
  xyplane.attach(9); // attach the pin 9 servo to servo object
  zyplane.attach(10);// attach the pin 10 servo to servo object
}

void loop()
{
 //--------------------gives a value for each photoresistor------------------------------
 int light1 = analogRead(photo1); //Read the lightlevel
 light1 = map(light1, 0, 900, 0, 255); //adjust the value 0 to 900 to span 0 to 255
light1 = constrain(light1, 0, 255);//make sure the value is between 0 and 255


 int light2 = analogRead(photo2); //Read the lightlevel
 light2 = map(light2, 0, 900, 0, 255); //adjust the value 0 to 900 to span 0 to 255
 light2 = constrain(light2, 0, 255);//make sure the value is between 0 and 255


 int light3 = analogRead(photo3); //Read the lightlevel
 light3 = map(light2, 0, 900, 0, 255); //adjust the value 0 to 900 to span 0 to 255
light3 = constrain(light3, 0, 255);//make sure the value is between 0 and 255


 int light4 = analogRead(photo4); //Read the lightlevel
 light4 = map(light4, 0, 900, 0, 255); //adjust the value 0 to 900 to span 0 to 255
 light4 = constrain(light4, 0, 255);//make sure the value is between 0 and 255


 int light5 = analogRead(photo5); //Read the lightlevel
 light5 = map(light5, 0, 900, 0, 255); //adjust the value 0 to 900 to span 0 to 255
 light5 = constrain(light5, 0, 255);//make sure the value is between 0 and 255


//----------------------------------operates xyplane servo---------------------------------//

while ( light5<light1 || light5<light3){

  if (light1>light3 && light1>light5){
  xyplane.write(pos);
  delay(30);
  pos ++;

  }

  if (light3>light1 && light3>light5){
    xyplane.write(pos);  //goes to the position
  delay(30); //this gives the servo time to move
  pos --;
}
light5= analogRead(photo5);
light1= analogRead(photo1);
light3= analogRead(photo3);
}
//-------------------------------operates zyplane servo----------------------------------------

while (light5<light2 || light5<light4){

  if (light2>light4 && light2>light5){
  zyplane.write(pos2);
  delay(30);
  pos2 ++;
  }

  if(light4>light2 && light4>light5){
  zyplane.write(pos2); //goes to the position
  delay(30); //this gives the servo time to move
  pos2 --;
}
light5= analogRead(photo5);
light4= analogRead(photo4);
light2= analogRead(photo3);
}

//---------------------------operates LED alignment indicator--------------------------------------

 if (light5>light1 && light5>light2 && light5>light3 && light5>light4){
  digitalWrite(ledPin, HIGH);
 }
}

Tuesday, October 5, 2010

Week 3

During the third week of the project our group had to take the acrylic and ping-pong ball model and make it into a functioning structure that was representative of an actual implementation of our design. After the initial criticism of our re-design it was determined that aside from the smartness gained from the plants being automatically watered when needed, the structure should interact with people in some way. The use of LEDs and motion sensors provided this (along with additional aesthetic appeal and an element of delight). In order to better visualize the design, we chose to implement it in the Duderstadt atrium (image below). 


For our model, the atrium was constructed out of acrylic and chipboard with the plant holding spheres represented by ping-pong balls. Red, blue, and green LEDs were incorporated within the ping-pong balls to provide the lighting effects. The blue lights were programmed to turn on and fade off in sequence to look like water flowing downward, the green lights lit and faded randomly, and the red lights respond to motion. All three LED sets would only come on when it was dark.  As it was difficult to connect the arduinos without the proper i2c, each set of lights and the pump ran on separate arduinos.  Below is an image of the final model as well as an image of  the wiring and arduinos.