What is does:
It searches for the brightest light source like the sun.

Step 1: How it works

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


<p>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!</p>
<p>Hello ,which IC have u used ???</p>
<p>Hellowhich IC have u used ???</p>
<p>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</p>
<p>My wiring and build was pretty much the same as GeoBruces, except for an LCD I added.</p><p>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.</p><p>#include &lt;LiquidCrystal.h&gt; //include LCD Library</p><p>#include &lt;Servo.h&gt; // include Servo library </p><p>LiquidCrystal lcd (2, 3, 4, 5, 6, 7); //</p><p>Servo horizontal;</p><p>int servohStop = 95; </p><p>int servohLeft = 105; //move horizontal </p><p>int servohRight = 85;</p><p>Servo vertical; // vertical servo </p><p>int servovStop = 95;</p><p>int servovUp = 105 ;</p><p>int servovDown =87;// move vertical servo</p><p>// LDR pin connections</p><p>// name = analogpin;</p><p>int ldrLeftTop = 1; //LDR top left</p><p>int ldrRightTop = 0; //LDR top right</p><p>int ldrLeftBottom = 2; //LDR down left</p><p>int ldrRightBottom = 3; //ldr down right</p><p>int dtime = 25; //delay time in milliseconds</p><p>int tolerance = 100; //difference tolerance between ldr readings</p><p>int count = 0; //millis(); //start millisecond count</p><p>void setup()</p><p>{</p><p> lcd.begin(16, 2); //begin 16x2 LCD </p><p>Serial.begin(9600);</p><p>// servo connections</p><p>// name.attach(pin);</p><p> horizontal.attach(9); </p><p> vertical.attach(10);</p><p>}</p><p>void loop() </p><p>{</p><p> //int count = millis(); //start millisecond count</p><p> int leftTop = analogRead(ldrLeftTop); // top left</p><p> int rightTop = analogRead(ldrRightTop); // top right</p><p> int leftBottom = analogRead(ldrLeftBottom); // down left</p><p> int rightBottom = analogRead(ldrRightBottom); // down right</p><p>//print resistance values to serial monitor for debugging</p><p> Serial.println(leftTop );</p><p> Serial.println(rightTop );</p><p> Serial.println(leftBottom );</p><p>Serial.println(rightBottom );</p><p> Serial.println();</p><p> count++;</p><p> int avt = (leftTop + rightTop) / 2; // average value top</p><p> int avd = (leftBottom + rightBottom) / 2; // average value down</p><p> int avl = (leftTop + leftBottom) / 2; // average value left</p><p> int avr = (rightTop + rightBottom) / 2; // average value right</p><p> int avgTot = (rightTop+rightBottom+leftTop+leftBottom) / 4;</p><p> int dvert = avt - avd; // check the diffirence of up and down</p><p> int dhoriz = avl - avr;// check the diffirence og left and right</p><p> if (count%10 == 1) //mod the millis count so the lcd screen updates every 10 millis</p><p> {</p><p> lcd.clear(); //clear the screen and position cursor at top left</p><p> lcd.print(&quot;dvert: &quot;); //difference in vertical resistances read from the LDRs</p><p> lcd.print(dvert);</p><p> lcd.setCursor(0,1); //set lcd cursor to bottom left</p><p> lcd.print(&quot;dhoriz: &quot;); //difference in horizontal resistance read from the LDRs</p><p> lcd.print(dhoriz);</p><p> }</p><p> if (-1*tolerance &gt; dvert || dvert &gt; tolerance) // check if the difference is in the tolerance else change vertical angle</p><p> {</p><p> if (avt &gt; avd) //if average resistance on top is greater than on bottom</p><p> {</p><p> vertical.write(servovUp);</p><p> }</p><p> else //avg resistance on bottom is greater than on top</p><p> {</p><p> vertical.write(servovDown);</p><p> }</p><p> }</p><p> else if (-1*tolerance &lt; dvert || dvert &lt; tolerance) //if difference is smaller than tolerance, stop vertical servo </p><p> {</p><p> vertical.write(servovStop);</p><p> }</p><p> if (-1*tolerance &gt; dhoriz || dhoriz &gt; tolerance) // check if the difference is in the tolerance else change horizontal angle</p><p> {</p><p> if (avl &gt; avr)</p><p> {</p><p> horizontal.write(servohLeft);</p><p> }</p><p> else</p><p> {</p><p> horizontal.write(servohRight);</p><p> }</p><p> }</p><p> else if (-1*tolerance &lt; dhoriz || dhoriz &lt; tolerance) //if difference in horizontal </p><p> {</p><p> horizontal.write(servohStop);</p><p> }</p><p>delay(dtime); </p><p>}</p>
<p>can i know what is the function of the LCD?and can i get the full image of your model solat tracker?</p>
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 :-(
<p>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?</p>
<p>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 toceers</p>
<p>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</p>
<p>Hello is there any chance you could send me the schematic for the build and the codes... because i think im going to go with the continuous rotation servos too.... thank you </p>
<p>hi can you please send me same stuff (he schematic for the build and the codes for display ..)to build a solar tracker</p><p>Thank you</p>
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. ;-)
cool! :p <br>can you show us some video's or pictures? <br> <br>thnx
<p>*videos *thanks</p>
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. <br>
nice upload your design to http://www.thingiverse.com/
OK, Here it is. <a href="http://www.thingiverse.com/thing:120526" rel="nofollow">Heliostat Solar Sensor support structure</a>
Sure, here is the link to the YouTube clip I made: http://youtu.be/6GTVWdeKvzY<br> <div> <iframe frameborder="0" height="315" src="http://www.youtube.com/embed/6GTVWdeKvzY" width="420"></iframe></div>
Nice!!!<br><br>It's cool to see your instructable finished by someone else :D<br>it means i've helped someone ^^ or someone liked my project! :D
It's really helpful to get me started toward my other goals. <br>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.
<p>please can you modify the code by using stepper library instead servo library. i really need it</p>
<p>Hi, can i use this for my project in school?...thank you</p>
<p>I incorporated the solar tracker into a solar concentrator I am working on (eventually it will have 12 mirrors). Works pretty well, but I am still trying to figure out how to tighten up the distribution of the reflected sunlight. I will let you know what I come up with. Thanks loads Bruce for helping me get started.. </p>
<p>The above code is given for which IC??</p>
<p>please geo bruce can you write the arduino program you used</p><p>thanks alot</p>
<p>Hello,after I upload the code into my arduino uno, my vertical servo motor keep rotating, it just rotate and rotate non stop. I have no idea what is the problem, can anyone give me some idea</p>
Works smoooth! :D <br>And failsafe! :)<br>I had to make a few adjustments to the code to cope up with the extra sensitivity. :)
What have you used to connect the two servos, the top servo and the sheets together? <br>
<p>Hello geo bruce. My name is Jos&eacute; Lun&eacute; i'm from Manaus, in Brazil. </p><p>I have just found your site on the internet a few days ago and that Project you showed up is the same Project of my article. That i made on my own.</p><p>In my Project i made with 2 ldrs, a h-bridge, a Windshield Wiper Motor from Fusca, and Ardu&iacute;no.</p><p>Please search on a net: <em>SISTEMA AUTOMATIZADO PARA O AUMENTO DA EFICI&Ecirc;NCIA DA CAPTA&Ccedil;&Atilde;O SOLAR DE PLACAS FOTOVOLTAICAS NA<br>GERA&Ccedil;&Atilde;O DE ENERGIA EL&Eacute;TRICA</em></p>
<p>This concept is genius. I love it. Thanks. This will work well with my honeycomb wax melter.</p>
<p>Do I need 2 x potentiometers ?</p>
<p>i just dont know where to put the ldr`s, when i put in one way (LD in one side, RD in other side, etc), he works just one motor, sometimes just run of the sun, sometimes just works 2 ldr`s. Someone can help me??</p>
<p>I was so.:-(</p>
thanx for the great project ..explain it in detail help me alot to finish it with excellent results
Can you help me please?? Email: lucas1_maluco@hotmail.com<br>please, i really need someone help
<p>what is the job of potentiometers ?</p>
Speed and tolerance.
<p>Hello :) i made this very cool solar tracker, implement a big solar cell and load wit it my cellphones! really really great!!!! big thank you!!</p><p>now i have a little question: is it possible to take one other LDR to shut down the servos at night? if its too dark, my tracker moves very wired.. :( so i think its a good idea to shut down at night... what did you think? :)</p>
good idea but you don't need an extra LDR for that just take the average of the 4 ldr's and If the value drops below a certain minValueShutDown then don't move the servos anymore<br>and when it's above a certain maxValueShutdown then let it start again<br><br>can you post some of your results (photo's videos)
Can you help me please?? I need to make one of these but it is not working, sometimes the ldr's follow a little, but most of the time they just move if a put my finger in one of them...<br>Can you help me? <br>Thanks
<p>@geo bruce. cool, so no need for more <br>hardware and electronics... could you progamm this? im a really bad <br>programmer in arduino... :( mine is more the hardware :) </p><p>look@franconiarobotix.com</p>
<p>thanks! I'm trying to build it, this is my first stage </p><p><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/vLfGZL-0laA" width="500"></iframe></p>
Ola, voc&ecirc; fala portugues? Eu estou tentando fazer um desses mas eu ja montei e remontei 4 vezes mas n funciona, eu nao tenho idea do que fazer... voce pode me ajudar???<br><br>Obrigado
<p>Hey, can someone help me? i did everthing the same way that you, but mine is not working, the ldr`s does not follow the sun, can someone help me please??/</p><p>Thanks</p>
Wow excellent ible!! I will use this in conjunction with my new hydroponics project and also a map of the sunlit parts of my backyard medicinal herbs garden! It will help me decide where to place specific plants!!! I have a few questions though. What are the model of the servos you used? If I use 6 mini solar panels to provide around 12v to power the servos, atmega328 and the pump for my hydroponics, 2 1kg of torque servos should be more than enough right? <br>Thank you in advance for the answers and for the great ible.
<p>Hi, so i'm trying to run this with and LCD display. i followed <a href="http://www.instructables.com/member/Spellmal/" rel="nofollow">Spellmal</a>-&gt;<a href="http://www.instructables.com/id/Arduino-Solar-Tracker/#CAQ22W5I58IBSUL" rel="nofollow">AlberA</a> 's instructions and i've gotten each part to work individually, but when i throw two servos an lcd and the ldr's on the board at the same time, nothing works. LCD display non-sence, servos vibrate. i've tried extra capacitors but got the same. any advice anyone?</p>

About This Instructable


525 favorites


Bio: Hello, I'm Bruce. I'm a student in Belgium. I have a wide variety of interests: electronics, computers, technology, ... In my spare time I ... More »
More by geo bruce: High Speed Photography Arduino Internet Controlled Desk Lamp Nyan Cat on Arduino
Add instructable to: