Arduino Sun Tracker Turret




About: The RobotGeek team is a 6-man operation that wants to make it even easier to use Arduino to make electronics and robots. Check out our instructables and for all of our awesome kits.

Follow the sun with Arduino! In this tutorial, we'll be building an Arduino based Solar Tracking Turret. Most commonly, these are used in Photovoltaic systems to maximize the surface area of sun exposure on solar panels. This is an easy build, so let's get started!

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Project Parts List

You can use any variety of light sensor, potentiometer, or hobby servo, but for this guide, we recommend the following parts for ease of use.

Step 2: Assemble the Turret

Follow the Desktop RoboTurret Assembly Guide. Once your turret is built, there are many ways to build the top portion of the tracker. General advice for building the top portion: Attach your sensors to the top plates as close to center as possible. Shown in the first picture is the simplest way to get all of your sensors near center. Notice the wiring through the plate, kept loose so that there aren't any snags as the turret aims itself. The fins are 8 inches tall, which should be plenty to cast shadow on the sensors. I've used scrap cardboard for the fins, but you can use whatever material suits you best, so long as it is opaque and can throw a shadow. At the back of the turret base, there is plenty of room to mount your two potentiometers. one controls speed, the other controls the sensitivity threshold for the light sensors. Mounting them to the base allows you to fiddle with them to easily dial in your settings once you have it running.

Step 3: Wiring

Follow the Wiring Diagram carefully to hook up your electronics. Mind the position of your Light Sensors, as putting them in the wrong spot will cause strange behavior. Also mind that your jumper for the servo pins 9, 10, and 11 is set to VIN, so that your servos function properly. (note: a 6V power supply will work just fine, and is included in the RoboTurret Kit)

Device Sensor Shield Port
Top Left Light Sensor RobotGeek Light SensorAnalog 0
Top Right Light Sensor RobotGeek Light SensorAnalog 1
Bottom Left Light Sensor RobotGeek Light SensorAnalog 2
Bottom Right Light Sensor RobotGeek Light SensorAnalog 3
Turret Speed RobotGeek Rotation KnobAnalog 4
Light Sensor Sensitivity RobotGeek Rotation KnobAnalog 5
Pan RobotGeek 180 Degree ServoDigital 9
Tilt RobotGeek 180 Degree ServoDigital 10

Step 4: Programming

Download the desktopRoboTurretV3 sketches from Github if you haven't already, and extract it to your arduino folder. Open up:

File → Sketchbook → desktopRoboTurretV3 → roboTurret3_solarTracker

and upload it to your arduino.

Power up your turret, get a lamp ready, and start fiddling with the knobs! You'll notice as you adjust one of the knobs, the turret will turn faster or slower. As you adjust the other, the light sensitivity will rise and fall, giving you different behavior. Adjust these knobs until your turret tracks the light smoothly, and you're ready to get some sunburn!

Step 5: Let There Be Light!

You've made a robot that just can't help but stare directly at the sun! What will you do now? We'd suggest looking into making your own solar panel to throw on it so you can reclaim the energy lost by the servos and maybe charge a cell phone while you're at it? What would happen if you swapped out the Light Sensors for something like a Flame Sensor or UV Sensor? Let us know what you come up with, we'd love to see it!

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    19 Discussions


    2 years ago

    Is there a cheaper alternative to the Roboturret because I do not really want to spend 99 dollars?

    3 replies

    Reply 1 year ago

    1. El código seria el mismo para el Mini Kit Pan-Tilt? Muchas gracias!


    2 years ago

    Thank for all the ieda.


    Reply 2 years ago

    That'd be neat, but I wonder if the sun would damage the camera's sensor. We'll look into it!


    Reply 2 years ago

    This is perfect for mounting on a movable base such as a vehicle. The suggested astronomical / mathematical positioning approach is fine for a known and fixed base but anything more interesting and it wouldn't know what to do or where to point.


    Reply 2 years ago

    We hadn't thought of this, but that's an absolutely amazing idea! Maybe we'll throw this on one of our rovers and see how it turns out! :D


    2 years ago

    I would like to give you some food for thought, why do you need to "track" the sun with such a system?

    The sun is at the same horizontal angle to any particular spot on the earth, every day of the year, at the same time, if you ignore summer and winter time.......That is say at midday (forgetting slight differences due to countrywide time), the sun will be at its highest, but at the same horizontal angle, each and every day!

    The only difference is the height (elevation) of the sun, higher in summer and lower in winter generally, with slight differences for the equator.....

    Converting a 24 hour clock time to an angle of 360° , will always find the sun's direction, even when its thick cloud and even at night!!! (Think about it!) 12 midday, will usually be 180° for those living in the northern or southern hemisphere, if 360° is taken as being midnight!

    Even adjusting the elevation about 4 times a year by hand, will still achieve a similar efficiency to a complicated sun tracker's it will still point at the sun, even with cloud!

    Sun trackers often have problems when there is cloud, or an eclipse or even someone standing in the way!!!

    I hope that I have explained it enough for you to understand fully, that tracking the sun is really a series of "knowns"......therefore "K.I.S.S!

    Sorry to be so boring...... :-)

    You did a good job, but I feel too complicated! But do have a great day.

    Best regards


    2 replies

    Hey Andy! That is a wonderful suggestion. With a bit of maths and a few less sensors, the whole thing would run quite a bit more efficiently! We have all these robot parts laying around here that we're always itching to use, so it turns out we don't always land on the simplest solution to any given problem. Sure was fun though!

    I am glad that you took my suggestions on board in such a Friendly manner, many thanks.
    You obviously understand my "direction" completely, well done!
    The time you spent getting your version made and running, will stand you in good stead for some other project and I am sure, nothing will get wasted!!
    I have been guilty of over thinking a fix myself from time to time.
    Have a great day.



    2 years ago

    This is a very brilliant application of exsisting technology! Many solar energy reclamation projects come to mind. Could you tell me roughly what the cost is for these parts?


    2 years ago

    Regarding the end of the video it seems to be lost when the sun moves too fast. How do you persuade the system to move from west-looking to east-looking each and every morning?

    3 replies

    Reply 2 years ago

    DrummerD23 has a more efficient solution to the problem than I was going to suggest! It wouldn't take much code to move this to a set position in low light. I was going to suggest adding an RTC so you could keep track of the time and reset the position at dawn.


    Reply 2 years ago

    Perhaps it can default to a few degrees above the eastern horizon if very very low light.


    Reply 2 years ago

    this can be done easily by simply adding in sunset/sunrise time checking. At worst, it can simply reset to east after midnight.