loading

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>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>
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>hello, can you please help me. I have made project by Spellmal and get the some problems as you with the LCD screen. how u solved thoose problems ??</p>
<p>Try adjusting the LCD contrast by varying the voltage input to pin 3 (V0) of LCD using potentiometer.</p>
<p>got a screen myself, working on replicating this project.. thanks for the comment</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>
<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 I am Swarnadeep from India. I am using same as yours for my college project. Can you pls give me your code ??? I am using 360 servo for horizontal axis</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 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. ;-)
<p>Hey Tom, We are right now making a Solar sand sinter 3D printer. We have finished making the coordinate plate and are working on the tracking system now. Would like to get your inputs. Best,</p>
<p>hi dude ,</p><p>what is the rate and power of servo motor which u have used.. can u give me some details.. i have to do this as mini project</p>
Good luck with your project. I have not been able to pursue this one so not much more to add. Everything you need should be available online now. Except time and money. You'll have to come up with those. ;-)
cool! :p <br>can you show us some video's or pictures? <br> <br>thnx
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>
thnx!!
What are the results and conclusions
What are the results and conclusions
<p>*videos *thanks</p>
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>Great work, thank for sharing. Please, How can i do to increase the sensibility of LDRs and the speed of servo?</p>
<p>Great work, thank for sharing. Please, How can i do to increase the sensibility of LDRs and the speed of servo?</p>
<p>Great work, thank for sharing. Please, How can i do to increase the sensibility of LDRs and the speed of servo?</p>
sir can you help me to programme my arduino. I am planning to use only one servo. my plan is to set ldr's in different angles . solar panel is attached to servo . when sunlight falls on ldr . a ldr at specific angle gets higher rate of sun light .then servo will rotate solar panel to that angle.
<p>thank you</p>
<p>hello wht arduino u use? uno or uno r3</p><p>tq</p>
<p>saw this post probably a year ago, finally got to it.!! thanks for sharing this amazingly simple project, i've learned a lot. followed everything as listed above.<br><br><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/PCFxlu3Z67o" width="500"></iframe>3D printed base + arm. cables are pretty stiff. will switch to softer wiring for the updated version. the + shaped arm has to be wider and the sensors must be tucked into the corner more for better shadow creation.. also a heavy, tall &amp; skinny frame approach is the way to go, for better cable management especially.</p><p>.<br>also took me a while to get the potentiometer settings correct as i was using endless turn knob ones.. will post updates here, and will upload the updated 3D frame to thingiverse.<br><br></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>any updates on this, would love to see your results.?!</p>
<p>Hi Thanks for making this Bruce. I'm trying to make this for the arduino micro with a l298 dual h bridge dc motor driver. I'm trying to figure out why is it that my values are returning 0 on the serial monitor for delay time and tolerance? I used the same code as you for them and am printing these values right after the photocell analog values. I checked the wiring for the 10k potentiometers as well based on online images.</p>
<p>I figured it out.</p><p>Everything was right except I had put the println values in the void setup portion of the code and not the loop function. Now it is showing up on the serial monitor. </p>
<p>hello and hey , can you remove the horizontal rotation and just keep the vertical one for my project . could you help with the code??</p>
<p>Supercool project. i am also making it and trying to make it more stronger so that it can also hold some weight of the solar Plates.</p>
it's a cool project and i want to make it too..but i have a question..what potentiometers do? what if i just put resistors without potentiometer?
i would like to know that too
The potentiometers are used to set 2 control variables in the code<br>you could leave them out and use try and error to find what happens
it works!!.. thank you geo bruce?
<p>Neat. Your sun sensor is the same as the Wikoda Sunflower design. </p>

About This Instructable

287,264views

585favorites

License:

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:Dual axis solar tracker with online energy monitor High Speed Photography Arduino Internet Controlled Desk Lamp 
Add instructable to: