Step 1: How it works

Picture of How it works
a boven.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 199Next »
Spellmal made it!2 months 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!

AlberA Spellmal1 month ago

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

sali58 AlberA10 days ago

hi can you please send me same stuff (he schematic for the build and the codes for display ..)to build a solar tracker

Thank you

AlberA Spellmal1 month ago

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

Spellmal AlberA1 month ago

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


// servo connections

// name.attach(pin);




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



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.setCursor(0,1); //set lcd cursor to bottom left

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



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




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





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




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


if (avl > avr)









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






I followed your schematic and used your code but I can't get info to display on LCD.. lcd back light lights up and white squares are there when I turn potentiometer... do the 4 resistors have to be a certain ohm to work correctly...
this is all I get :-(
AlberA Spellmal1 month ago

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?

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?


*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
geo bruce (author)  TomDunlap1 year ago
Sure, here is the link to the YouTube clip I made:
geo bruce (author)  TomDunlap1 year ago

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.
JoshuaZimmerman made it!2 days ago

This is my solution. Even added on a little volt meter. I removed the potentiometers and just set the sensitivity via the software. I used a sensor shield in order to remove a bunch of power wires for the servos. I used two terminal blocks to wire everything up, making it non soldering. I'll eventually make up an Arduino shield and a sensor PCB with ribbon cable, which will make the entire thing just plug together.


here ya go GEO BRUCE.....I noticed you like Fritzing so i finished out your design and applied it to a Arduino micro. And for anyone who is into DIY electronics, Fritzing is a FREE!!! circuit program crammed full of AWESOME STUFF.


solor tracker_pcb.jpgsolor tracker_schem.jpg
AlberA11 days ago

Hi im done with the build but it seem like the tracker actually gets away from the light.. i really need help because this is a project that is going to get graded somehow. TY

DLM8716 days ago

Here's a thought on simplifying the wiring. You could hook up TopLeft LDR and BottomRight LDR in series, and BottomLeft and TopRight LDR in series. have one end connection going to Positive, the other end connection going to negative, the middle connections going to two analog pins. Doing it this way, you: a) dont need any pull up resistors or matching connections on a breadboard for resistors, b) only need two analog inputs and c) only need 4 wires going to the LDR arrangement (Two for power to it, two for analog signals back from it). I love solar tracked projects :D

what causes solar tracker that I made insensitive to light ?

but when in dark conditions , and given light , solar tracker work ?

mjones22217 days ago
Can you do this without the breadboard??
rdraycott21 days ago
anyone else followed the schematic for solar tracker with LCD... iv done the same as schematic and loaded code to board but all I get on my lcd is white squares when I adjust the potentiometer.... ldrs are working as I can see number changes when I put my hand over the ldrs when I view serial data on my pc.... I'm thinking It might be connections or is there a error in the code anyone can see...
MahiraECE22 days ago

Will you please give Codings for this project

MahiraECE22 days ago

Sir IS this the circuit for the process

mjones22228 days ago

do you need to use the potentiometers?

I made this version up. Still have some tweaks to make before it's finished. It's going to hold a 6V 320mA solar cell and eventually have a little LED Volt Meter attached to it. I may even make it self powering... which would be interesting...

<iframe width="560" height="315" src="" frameborder="0" allowfullscreen></iframe>

geo bruce (author)  JoshuaZimmerman1 month ago
Wow that's awesome!
I'd love to get one!

And off course it needs to be self powered.
Charge a large capacitor while the arduino is in sleep
and when it's charged wake up the arduino and let it adjust it's position
That'd be cool.

This is a version I'm working on.

<iframe width="280" height="158" src="" frameborder="0" allowfullscreen></iframe>

what resistance value was your LDR? Can a larger Servo that can handle more torque be applied without changing the circuit diagram or code?

geo bruce (author) 1 month ago
take a look at the code of Spellmal who posted his code in the comments
AlberA1 month ago

What is the distance between the cardbord top and the sensors...

geo bruce (author)  AlberA1 month ago
that doesn't matter a lot as long as there can be shade on the sensors

the longer the arm the more accurate it will be

Thank you for the quick answer.... one thing i need help with because im new to arduino is the programing, i want to servos to spin 360 degress, ive moded the serveos and they spin 360 degress, but i dont know how and what to change in the code to make it work, could you point out which row of codes that needs to be changed to get the thing working... Thank you in advanced.

AlberA1 month ago

What is the distance between the cardbord top and the sensors...

lheise1 month 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:

AlberA1 month 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.

1-40 of 199Next »