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);
 }
}

No comments:

Post a Comment