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


 

Advertisement

<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 would like to get this code.Now I research about dual axis solar tracker.So I need your help.I would like to know why you assign tolerance is 100.I must show the comparison of tracking and fixed system.I must prove that tracking get power more than fixed system.So how do measure power in this system?please give me advise.
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 was planning to make this for my recent college project but for some reason it doesnt work well. I followed the circuit and the code as well (changed it since at first it was moving away from the light) but then at times the servo dont work at all or sometimes only one works. I can't seem to figure out what the problem is. At first i thought its loose connection but even after changing the wires and checking everything it doesnt seem to work properly</p>
Can u me code?
<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>hi.Can i get the code used in the LCD. thanks.</p>
<p>Hi, I was planning to make this for my recent college project but for some reason it doesnt work well. I followed the circuit and the code as well (changed it since at first it was moving away from the light) but then at times the servo dont work at all or sometimes only one works. I can't seem to figure out what the problem is. At first i thought its loose connection but even after changing the wires and checking everything it doesnt seem to work properly </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>please can you help me i tried the project and the arm seems to run away<br> from light, and sometimes turning around light. Is it because of the <br>fact i used very small LDR? anyway i checked with the the serial monitor<br> the LDR are working. need your help please.</p>
<p>sounds like your servos are backwards. i've ran into this problem.. you can either manually try changing the data wires of each 2 sets, or you can reset them in the code.. try that and let me know..</p>
<p>thk you so much mr Akin for your great help. Please i'm a beginner, can you explain in details. i dont understand what you mean by saying ''you can either manually try changing the data wires of each 2 sets''. how can i reset the servo in the code? </p>
<iframe frameborder="0" src="https://codebender.cc/embed/sketch:274653" style="height: 510.0px;width: 100.0%;margin: 10.0px 0 10.0px;"></iframe><p>see line 13,14,15,16 those are Analog in 0, Analog in 1, Analog in 2, Analog in 3 physically on arduino board. you can either physically change those wires to other combinations, or in the code change it to;<br>int ldrlt = 1; //LDR top left</p><p>int ldrrt = 0; //LDR top rigt</p><p>int ldrld = 3; //LDR down left</p><p>int ldrrd = 2; //ldr down rigt</p><p>give it a try, you may have to change it again to smtg else. i remember running into the same &quot;running away from light&quot; problem. just had to rearrange the wires the correct way. hope it helps :)</p>
<p>thk you very much for your help, now it is working.</p>
<p>Now i understand very well, you have a talent of teacher Sir, thank you for the accuracy and precision in the explanations. Thank you so much Mr Akin, i'll do it as soon as possible, and give you feedback.</p>
<p>This is a small video</p>
<p>please can you help me i tried the project and the arm seems to run away from light, and sometimes turning around light. Is it because of the fact i used very small LDR? anyway i checked with the the serial monitor the LDR are working. need your help please.</p>
<p>Hello GeoBruce! I love the design on your solar panel. I've recently built your circuit and it's working wonderfully! I only have one question. I'm trying to add clock functionality to the code, but I'm getting an error with the Time library. DateTime.h is outdated and Time.h and TimeLib.h are both giving me &quot;can't be found&quot; errors, do you have any idea on how to help? Thanks!</p>
it works!!.. thank you geo bruce?

About This Instructable

306,571views

611favorites

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: