DIY Miniature Solar Tracker

44,106

379

37

About: Awesome Electronics Tutorials, Projects and How To´s

In this project I will show you how to create a solar tracker which like the name implies can follow the movement of the sun throughout the day. And at the end I will show you the energy harvest difference between a solar tracker mounted solar panel and a flat mounted solar panel. Let's get started!

Step 1: Watch the Video!

The video gives you all mandatory information about the solar tracker. During the next steps though I will give you some additional information.

Step 2: Order Your Components!

Here you can find a parts list with example seller:

Amazon.com:

1x Arduino Nano: https://amzn.to/2MCkpI2

2x SG90 Servo: https://amzn.to/2lJDT24

4x Photoresistor: https://amzn.to/2tHYY1a

4x 1kohm Resistor: https://amzn.to/2KjGBds

Ebay:

1x Arduino Nano: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

2x SG90 Servo: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

4x Photoresistor: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

4x 1kohm Resistor: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

Amazon.de:

1x Arduino Nano: https://amzn.to/2KDRt5r

2x SG90 Servo: https://amzn.to/2lHKJoG

4x Photoresistor: https://amzn.to/2Kz7Gpb

4x 1kohm Resistor: https://amzn.to/2lIp1kD

Step 3: 3D Print the Solar Tracker Parts!

Here you can find the utilized model on thingiverse: https://www.thingiverse.com/thing:708819

And here you can also download the remaining part that I created by myself.

Step 4: Create the Circuit and Upload the Code!

Here you can find the schematic and code for the project. Feel free to use it to create your own solar tracker.

Step 5: Success!

You did it! You just created your own Solar Tracker!

Feel free to check out my YouTube channel for more awesome projects:

http://www.youtube.com/user/greatscottlab

You can also follow me on Facebook, Twitter and Google+ for news about upcoming projects and behind the scenes information:

https://twitter.com/GreatScottLab

https://www.facebook.com/greatscottlab

Share

    Recommendations

    • PCB Contest

      PCB Contest
    • Epilog X Contest

      Epilog X Contest
    • Safe and Secure Challenge

      Safe and Secure Challenge

    37 Discussions

    0
    None
    alecmaster

    Question 3 months ago

    It seems that the code he provided does not work, has it been changed since he uploaded this instruction?

    1 answer
    0
    None
    JaidA1alecmaster

    Answer 11 days ago

    check if u used arduino uno instead of nano

    0
    None
    efoster6

    12 days ago

    Great instructable. I saw one recently on youtube using 4 small solar panels and 4 small dc motors I think it works on the same principal

    0
    None
    DavyR1

    Question 6 months ago on Step 3

    How much of the extra energy achieved is used up by the extra circuitry of the servos etc? I suppose it would be more efficient the higher the rating of the panels!

    1 answer
    0
    None
    gmartin2000DavyR1

    Answer 25 days ago

    The system can be very efficient if the positioning loop is executed once about every 15 minutes and then put to sleep during the delay. The servos don't need to be run continuously (that really reduces their life). They only need to be run long enough to position the panel.

    And yes, it is very efficient since this circuit will use only about 100ma at 5v (.5watts) when driving the servos. If you execute the control loop every 15 minutes and turn off the servos and go to sleep between loops you can really increase the efficiency!

    Assume 10 seconds to position the panel each loop and do this only four times an hour. That's 100ma for 40 seconds out of an hour or about 1.1mah (5.5mWh). If you're using a small 100ma panel (12v nominal * 100ma = 1.2 Watts), that's a pretty high efficiency there alone 1.2W/.0055W = 218:1). Imagine what the efficiency will be with a 10 to 100watt panel!

    0
    None
    raphan

    6 months ago

    I think a system with only 3 sensors could work as well. Something cheaper.

    3 replies
    0
    None
    KISELINraphan

    Reply 6 months ago

    Why only three sensors? The sensors have a ”bulk” price,
    I guess you get them for $1,00/20pcs. Then there comes the mathematical issue.
    To divide a circle in 3 or to 4? Fair enough, divide it with 3 gives you 360dgr/3= 120dgr. each, make that on your scetch. Divide it with 4 gives you 360dgr/4= 90dgr. I guess it’s a bit easyer to find a 90dgr. angle on your plan.

    0
    None
    BrownDogGadgetsKISELIN

    Reply 6 months ago

    KISELIN has the right idea. The sensors are one of the cheapest parts of this project. There are not many ways to reduce the cost of this project, minus the obvious of not building the watt meter.

    0
    None
    gmartin2000BrownDogGadgets

    Reply 25 days ago

    I'm not sure cost reduction would be the actual target here. Complexity reduction in both hardware and firmware would be the real targets. I think three sensors would be the minimum number. Two for azimuth control and the third for altitude: Keep the two azimuth sensors fully lit then just dither the altitude sensor from fully lit to into shadow. Since the solar panels will be most efficient to within about plus or minus 5 degrees of center, you'll only need to go through the control loop about every 15 minutes or so (Number approximate - I leave it to the reader to determine efficiency angles and solar movement).

    Then again, if you REALLY want to get minimized, two sensors and one servo would be needed. Azimuth would be controlled by the two sensors and servo while the altitude would be manually reset about every two weeks.

    The divider between the sensors would be three walled forming an upside down "T" for the three sensor model and a simple vertical wall for the two sensor model.

    0
    None
    Eddybb3

    6 months ago

    Instead of using the photoresistor, why not use the PV cell itsef?

    1 reply
    0
    None
    gmartin2000Eddybb3

    Reply 25 days ago

    The PV cell doesn't have multiple outputs such that you can use the "Shadow on a sensor" method used here.

    0
    None
    atanvir1

    5 weeks ago

    void setup() {
    pinMode(9, OUTPUT);
    pinMode(10, OUTPUT);
    TCCR1A = 0;
    TCCR1A = (1 << COM1A1) | (1 << COM1B1) | (1 << WGM11);
    TCCR1B = 0;
    TCCR1B = (1 << WGM13) | (1 << WGM12) | (1 << CS11);
    ICR1 = 40000;
    OCR1A = 3000;
    OCR1B = 3600;



    can you please explain this part?

    1 reply
    0
    None
    gmartin2000atanvir1

    Reply 25 days ago

    Yeah, so there is a special place in wherever for people that don't comment their code ;)

    Having said that, it looks like the coder is trying to "BitBang" the servo positions (which considering the slow speed of apparent solar motion, isn't really needed here - but hey, people try to get "style points" with this type of coding - net result, negative points for posting uncommented cryptic code in an instructable).

    There's a whole Arduino library for servos that works just as good and is very well documented. What happens with servos is they position themselves based on pulse widths received at their input. I'm not really going to go into detail here. Plenty of documentation elsewhere on the web and in Arduino example code.

    Pins 9 & 10 can be used for PWM control of various things including servos. So that takes care of the "Pin 9/Pin 10" lines of code.

    Next up is the code that controls the internal registers that drive the PWM functions of Pin 9 & Pin 10. The names TCCR1A, TCCR1A, TCCR1B, ICR1, CR1A, OCR1B are built-in control registers that are manipulated to generate a pulse width that drives the servos to specific locations. You'll have to study the MicroChip Microcontroller manual to understand how these registers work and how they interact to create a pulse train sufficient to cause controllable operation of the servos.

    As for the constants COM1A1, COM1B1, WGM11, WGM13, WGM12, and CS11, I don't have a clue what they are. They are probably defined in some underlying Arduino module - The hunt is on!

    For the remainder of the code, it's just some kind of manipulation of values to write to the OCR registers to change the pulse width according to the photoresistor values. I have seen some caveats about using the DELAY function when driving Servos. It has to do with the base timer being used by both the internal clock and the PWM code. This would need to be looked into to make sure some kind of conflict isn't taking place.

    I'm also not much of a fan of using raw, unaveraged, noncalibrated values from photoresistors like this.

    It's a start for a "Proof of concept" but the code needs significant improvement for reliable, stand-alone long term operation.

    0
    None
    VishalA47

    Question 8 weeks ago on Introduction

    my solar tracker is not working . It is not responding to light and code is uploaded and circuit is also made properly please help me sir . I am making model for international science fair. Please help me

    0
    None
    lbettles01

    Question 3 months ago on Step 1

    My Solar tracker doesnt seem to respond to the light, i just constantly spins in cirlces, any suggestions?

    0
    None
    fmarzocca

    4 months ago

    Very good job! Thank you. Could you pls provide your .123dx file in STL format?

    0
    None
    Seacully

    Question 5 months ago on Step 3

    Do I need to own or purchase the .stl program in order to print those parts on a 3D printer. I have access to a 3D printer, but it isn't currently installed with that program.

    0
    None
    DIY Hacks and How Tos

    6 months ago

    Cool. I did a project like this in college. I always had issues with the photoresistors having different resistance curves and different saturation points.

    2 replies
    0
    None
    KISELINDIY Hacks and How Tos

    Reply 6 months ago

    You’r so right about them photores. They ”fluctuate” not by the manufacturers def’s, but the behavior of themselves. Often them photores. sensors are used in co.op. with prosessors and thereby it’s advisable to make a multiple reading of the analog and calculate the average of them, don’t make them samples to be within a millisec. Like in this Instr. a sample rate of a minute or so guess could be fair enough.
    To get long time delays DON’T USE THE delay() command; because the delay() function HALT*S you’r total program for the whole delay() time.
    Look at my instr, ”how to hack the delay”.

    1
    None
    DIY Hacks and How TosKISELIN

    Reply 6 months ago

    Another thing that we tried was to use a photodiode or a small solar cell instead of photo resistors. They are a lot more predictable and linear in their output.