Instructables

Step 1: How it works

Picture of How it works
a boven.jpg
DSC01611.JPG
DSC01614.JPG
How it works:
I'd made a sensor of 4 LDRs with sheets between them

The withe stips are the LDRs 
 
When the stick on top is righted to the sun or the brightest point 
the four LDRs get the same amount of light on them.

Example1 when the light is left on top:
right-top, right-down, left-down are in the shadow
and left-top get the most light

Example2 when the light is on top
left and right down are in the shadow and top is in the light


 

Step 2: Parts List

  • 2 x servo's
  • 4 x lightdepending resistors (ldr)
  • 4 x resistors 10K
  • 1 x Arduino
  • 2 x potentiometers 10k (value doesn't matter)

Step 4: The circuitry

Picture of The circuitry
1-40 of 177Next »
TomDunlap1 year ago
Just finished it and got it debugged. Really cool. Now I'm going to try to use it to build a Solar Forge and or a Solar Sand Sinter 3D Printer. Should be a snap. ;-)
geo bruce (author)  TomDunlap1 year ago
cool! :p
can you show us some video's or pictures?

thnx

*videos *thanks

Another development, I used a Makerbot Replicator to print a replacement for the foam core sensor holder. Here is the Sketchup pic of it. The two pieces glue together. The center top hole is for a fifth sensor to shut the system down if clouds block the sun so it doesn't try to point at the brightest cloud.
Pyramid 3.png
geo bruce (author)  TomDunlap1 year ago
nice upload your design to http://www.thingiverse.com/
geo bruce (author)  TomDunlap1 year ago
thnx!!
Sure, here is the link to the YouTube clip I made: http://youtu.be/6GTVWdeKvzY
geo bruce (author)  TomDunlap1 year ago
Nice!!!

It's cool to see your instructable finished by someone else :D
it means i've helped someone ^^ or someone liked my project! :D
It's really helpful to get me started toward my other goals.
Next I want to modify the code to operate some 12V drill motors with a MotorShield or the like if I can find one that will handle the 3-4A current.
lheise3 days ago

Hi, I made my solar tracker, the first test, it worked (more or less), but in the second it just stopped working, I do not know why, can anyone give me an email or anything to help me ? thankss

my email is: lucas1_maluco@hotmail.com

Spellmal made it!1 month ago

Just finished up my take on this tracker. I used continuous rotation servos, so i had to modify the code a bit. Super fun project, thanks geo Bruce!

IMG_0525.JPG

Hi could you send me the schematic for the build and the codes... because i think im going to go with the continuous rotation servos too.... ty

My wiring and build was pretty much the same as GeoBruces, except for an LCD I added.

For your individual motors, the servohstop and servovstop values might need adjusting. If it doesnt work as is, try setting both of these values to 90 and go from there.

#include <LiquidCrystal.h> //include LCD Library

#include <Servo.h> // include Servo library

LiquidCrystal lcd (2, 3, 4, 5, 6, 7); //

Servo horizontal;

int servohStop = 95;

int servohLeft = 105; //move horizontal

int servohRight = 85;

Servo vertical; // vertical servo

int servovStop = 95;

int servovUp = 105 ;

int servovDown =87;// move vertical servo

// LDR pin connections

// name = analogpin;

int ldrLeftTop = 1; //LDR top left

int ldrRightTop = 0; //LDR top right

int ldrLeftBottom = 2; //LDR down left

int ldrRightBottom = 3; //ldr down right

int dtime = 25; //delay time in milliseconds

int tolerance = 100; //difference tolerance between ldr readings

int count = 0; //millis(); //start millisecond count

void setup()

{

lcd.begin(16, 2); //begin 16x2 LCD

Serial.begin(9600);

// servo connections

// name.attach(pin);

horizontal.attach(9);

vertical.attach(10);

}

void loop()

{

//int count = millis(); //start millisecond count

int leftTop = analogRead(ldrLeftTop); // top left

int rightTop = analogRead(ldrRightTop); // top right

int leftBottom = analogRead(ldrLeftBottom); // down left

int rightBottom = analogRead(ldrRightBottom); // down right

//print resistance values to serial monitor for debugging

Serial.println(leftTop );

Serial.println(rightTop );

Serial.println(leftBottom );

Serial.println(rightBottom );

Serial.println();

count++;

int avt = (leftTop + rightTop) / 2; // average value top

int avd = (leftBottom + rightBottom) / 2; // average value down

int avl = (leftTop + leftBottom) / 2; // average value left

int avr = (rightTop + rightBottom) / 2; // average value right

int avgTot = (rightTop+rightBottom+leftTop+leftBottom) / 4;

int dvert = avt - avd; // check the diffirence of up and down

int dhoriz = avl - avr;// check the diffirence og left and right

if (count%10 == 1) //mod the millis count so the lcd screen updates every 10 millis

{

lcd.clear(); //clear the screen and position cursor at top left

lcd.print("dvert: "); //difference in vertical resistances read from the LDRs

lcd.print(dvert);

lcd.setCursor(0,1); //set lcd cursor to bottom left

lcd.print("dhoriz: "); //difference in horizontal resistance read from the LDRs

lcd.print(dhoriz);

}

if (-1*tolerance > dvert || dvert > tolerance) // check if the difference is in the tolerance else change vertical angle

{

if (avt > avd) //if average resistance on top is greater than on bottom

{

vertical.write(servovUp);

}

else //avg resistance on bottom is greater than on top

{

vertical.write(servovDown);

}

}

else if (-1*tolerance < dvert || dvert < tolerance) //if difference is smaller than tolerance, stop vertical servo

{

vertical.write(servovStop);

}

if (-1*tolerance > dhoriz || dhoriz > tolerance) // check if the difference is in the tolerance else change horizontal angle

{

if (avl > avr)

{

horizontal.write(servohLeft);

}

else

{

horizontal.write(servohRight);

}

}

else if (-1*tolerance < dhoriz || dhoriz < tolerance) //if difference in horizontal

{

horizontal.write(servohStop);

}

delay(dtime);

}

WiringDiagramUPDATED_bb.jpg

Thank you for the answers... so i wounder if your servos are modifyed to make a full spinn... if i do that to my servos would the code you sent me work?

Hi could you send me the schematic for the build and the codes... because i think im going to go with the continuous rotation servos too.... ty

AlberA4 days ago

Hi so i wanted to build one for my school project.. but i have a mega controller card... are the codes here gonna work on the mega or do i have to modify them.

We have produced sensor and inclinometer for 15 years in Shanghai, China.


They can be well used in solar tracking system including single-axis and dual-axis.

sales5@vigordigital.com

IanPerkins6 days ago
This is really cool! Kudos

We are a manufactuer of sensor and inclinometer in Shanghai, China.
Also work in this field for around 15 years.
Our sensor can be well used in solar tracking solar system, including single-axis and dual-axis .
my email: sales5@vigordigital.com

70961615 days ago

It is quite three sensors

Рисунок1.jpg

Inspired by your work... I designed a 3D mounting structure for the LDR's that will mount on the upper edge of a solar panel. 3D print did a nice job of it.

Solar Tracker 2.jpgSolar Tracker 3.jpgSolar Tracker 1.jpg
geo bruce (author)  bryan.reid.5851 month ago

looks good, share the files! :D

There you go... uploaded. Thanks I am putting it together...

Will do if you answer my question... :-)

geo bruce (author)  bryan.reid.58521 days ago

done ;)

Hey Geo... how balanced were your LDR's... it appears critical in the accuracy of pointing...

geo bruce (author)  bryan.reid.58521 days ago

I didn't check them but you can adjust the accuracy by the sensitivity potmeter

and if your LDRs aren't balanced you could ad potentiometers in series with them to adjust them

hipatetik1 month ago

Here is my prototype design, I modified the code so I can use my 28BYJ48 Steppers...I'm going to modify this so I can align a dish that is part of a Stirling motor project.

prototipo_seguidor_solar.png
geo bruce (author)  hipatetik1 month ago

Hii there are a lot of people in the comments searching for the code to do this with stepper motors,So if you could make them public that'd be Awesome. I'm willing to ad a refference to you in my instructable description

Hi, this is the code modification that I'm using. I'm testing it, because it's a bit messy, but it works (trying to upload a video of my prototype...). Anyway, I prefer servos, but I decided to give a try to these motors. I'm using AccelStepper Library, and the settings (pins,steps per revolution, speed,etc.) must be modified according to the model of motor and the arduino board (Mega2560 in my case). Of course, everyone can modify this to his needs. Special attention is needed with the analog input pins and steppers pinout, because it might not work properly if there's a wrong connection.Btw, you have to use some type of linear buffer, like ULN2003 for each motor.

#include <AccelStepper.h>

AccelStepper stepperX (AccelStepper::FULL4WIRE, 40, 41, 42, 43); //Rotation on X

AccelStepper stepperY (AccelStepper::FULL4WIRE, 36,37,38,39); //Rotation on Y

void setup()

{

}

void loop()

{

int lt = analogRead(A0); // top left

int rt = analogRead(A1); // top right

int ld = analogRead(A2); // down left

int rd = analogRead(A3); // down rigth

//not used (prefixed while testing, but you can use the potentiometers)

int dtime = 10; //= analogRead(4)/20; // read potentiometers

int tol =10 ; //= analogRead(5)/4;

//

int avt = (lt + rt) / 2; // average value top

int avd = (ld + rd) / 2; // average value down

int avl = (lt + ld) / 2; // average value left

int avr = (rt + rd) / 2; // average value right

int dvert = avt - avd; // check the diffirence of up and down

int dhoriz = avl - avr;// check the diffirence og left and rigt

if (-1*tol > dvert || dvert > tol) // check if the diffirence is in the tolerance else change vertical angle

{

if (avt > avd)

{

//move the stepper X ccw

stepperX.setSpeed(-30);

stepperX.runSpeed();

}

else if (avt < avd)

{

stepperX.setSpeed(30);

stepperX.runSpeed();

}

else if (avt == avd)

{

stepperX.setSpeed(0);

}

}

if (-1*tol > dhoriz || dhoriz > tol) // check if the diffirence is in the tolerance else change horizontal angle

{

if (avl > avr)

{

stepperY.setSpeed(-30);

stepperY.runSpeed();

}

else if (avl < avr)

{

stepperY.setSpeed(30);

stepperY.runSpeed();

}

else if (avl == avr)

{

stepperY.setSpeed(0);

}

}

delay(dtime);

}

NicolaP1 month ago
hi, you have tried this project even on cloudy days? what happens? I have to use it for an industrial plant
jaykentchriss2 months ago

Hi there. Your project is cool. I think the servos that you used is not 360 degrees right? What if, a 360 degrees servos will be used? Is there any changes of the codes and schematic? Thanks :)

I just made one using continuous rotation servo motors. The wiring is the same but the motors cannot be sent to an exact location, so the code had to be tweaked.

http://arduino.cc/en/Reference/ServoWrite explains the differences between how the motors respond to commands. Hope this helps!

gcarlyle221 month ago

I have an eagle schematic and pcb if anyone is interested. I haven't been able to test it but try it.

jaykentchriss2 months ago

Hi there. Your project is cool. I think the servos that you used is not 360 degrees right? What if, a 360 degrees servos will be used? Is there any changes of the codes and schematic? Thanks :)

I have been trying to get this code compiled and have downloaded the file. It won't compile. When it gets to the part where it writes, if(-1tol>dvert-- it triggers an error. I have gone over and over this code in 2 seperate windows and looking for something that I may have done wrong but everything is exactly as it is published on this page. I am not a programmer and have had a lot trouble getting most prgms to function. there were some other errors, but those were from me not having done the code right. I got past that and now nothing I do will get me past this jam. I really want to get this code debugged so I can build one of these as I have a couple of larger solar arrays I wish to do tracking systems for. There may be other issues after the one I am addressing here but until I get past this one, I won't know if the published code is correct or there is something deliberlately left wrong. Like I said, I have spent 2 days trying to make this work and no luck yet.

irvlz2 months ago

hey, some help, my solar tracker works backwards, it gets away from light, how can I fix it??

Just finished it. Finally discovered that the pin assignments for LDRs in the program are different than the pin assignments in the wiring diagram. I changed wiring to agree with program and now it works.

Program:

int ldrlt = 0; //LDR top left
int ldrrt = 1; //LDR top rigt
int ldrld = 2; //LDR down left
int ldrrd = 3; //ldr down rigt

Diagram:

ldrlt = 0

ldrrt = 2

ldrld = 1

ldrrd = 3

Tim Detwiler

TDetwiler3@gmail.com

Hi Bruce, I am trying to have your project working, I am new whit this, I am using an ARDUINO atmega328 I connect al the components and load the code but I figured out that I bought a different motors stepper 360g and I believe need to change some value on code motors are https://www.sparkfun.com/products/9347, tks for help
1-40 of 177Next »