Single Machine Sun Tracking / Heliostat Electronics Set Up 12

Subscribe to my Feed!

UPDATE: Some of the information on this page in now horribly out of date. The most up to date information regarding the current electronics system can be found on this page on this site’s forums.


This page shows off a single machine sun tracking / heliostat electronics set up. You may have already found it, but, if not, there is a more elaborate electronics system here which includes things like shift registers for increasing the number of controllable machines, relays to allow multiple machines to be controlled with just one set of driver boards, and switches to change heliostat targets.

Not surprisingly more elaborate also means more complicated. To try and make life a little simpler, the system on this page leaves out some of the extra bells and whistles and instead keeps only the bare essentials. Should you ever wish to include some of the previously mentioned “extras” they can, of course, still be added later down the road.

There isn’t a whole lot of extraneous information on this page. Instead it focuses on an electronics system which is as “plug and play” as possible. The extraneous information, however, does exist on the Open Source Sun Tracking / Heliostat Electronics page. It wouldn’t be a bad idea for you to at least skim through it and focus on the parts which are only touched upon briefly here.


Please note that the electronic system on this page requires a slightly different version of the Sun Tracking / Heliostat Program. You can download it by clicking the link below.


Also, make sure you download and install the flash.h library before trying to upload this program. Here is the link.

The only noticeable difference between this program and the one on the Open Source Arduino Sun Tracking / Heliostat Program page is the way the stepper motor driver board code is set up inside it, so you can still refer to the documentation there for learning how to use it.

Arduino IDE 1.0 (or higher) Code

Note: Arduino IDE 1.0.1 is not yet supported. Use the Previous 1.0 IDE when using this program.

(Update: V0.9.7 can be downloaded on the forums at this link.)

If you have updated the Arduino IDE to 1.0, you will need to use this program instead of the one above. Arduino_SunTracker_V096_Simpler_Electronics_Arduino1 (Alternatively, you can also download an older version of the IDE and just use the above program)

Make sure you download and install the latest version of the flash.h library (which has now been made compatible with the Arduino 1.0 IDE) before trying to upload this program. Here is the link.


The first thing you will need is an Arduino microcontroller. There are a myriad of different types that will work, but I would recommend either the Arduino UNO or the Arduino Duemilanove.


The RTC (real time clock) is what allows your Arduino to keep accurate time. I’m using the one from Adafruit. The sun tracking / heliostat code given on this page is specifically set up so that the RTC can be easily plugged into the Arduino’s analog pins. The tutorial given on the Adafruit site for soldering the RTC together gives an example on how to connect the RTC in this manner. Below is a somewhat uglier picture that I took of the set up.


Limit Switches

The limit switches are used to allow the machine to reset its position. Here is a picture of the schematic. Note that they are wired normally open, or NO.

Here is a picture of a test circuit I built to make sure the limit switches were working before attaching them to my heliostat.

This picture shows a simple way of attaching the resistor in the above schematic to the Arduino.

Driver Board / Power Supply

Like the Arduino, there are also many different driver boards that will work with this system. You can check out the Wiring a Step/Dir Type Stepper Motor Driver Board to an Arduino page for more info on what I’m using and how to set it up. It is probably the most involved section of this system, which is why it has an entire page dedicated to it.

Stepper Motors

Most any type of stepper motor could probably be made to work with this system. Two things you should pay attention to when purchasing yours are holding torque, which is basically a measure of how powerful the motors are, and whether or not they are unipolar or bipolar stepper motors.

The amount of holding torque your stepper motors will require largely depends on the size of your solar machine. If you are building a mid sized machine (around one square meter of collection surface), I would say around 80 oz. inch of holding torque would probably be adequate. Of course, you might be able to get by with less if you can build an especially well balanced machine. On the flip side, having more holding torque means that you can get away with a machine that might not operate very smoothly. A lot of it depends on your building skills. Once you decide on how much holding torque you need, the next step is to decide on whether to get a bipolar or unipolar stepper motor / driver board.

If you buy a bipolar driver board, you can use bipolar and also unipolar stepper motors.

If you buy a unipolar driver board, however, you cannot use bipolar stepper motors because there is no way to wire a bipolar stepper to a unipolar driver board. Note: A bipolar stepper motor only has 4 wires while a unipolar stepper motor typically has 6 or 8 wires.

I recommend the bipolar driver boards because you can use both types of stepper motors with them. Also, bipolar driver boards only need four wires to hook up each stepper motor (stepper motors with more than four wires can typically be wired as a four wire stepper), which means that you will save on the cost of wire and also have a little less wiring to do.

Also take note that there is a ton of information on stepper motors available on the net. A quick Google search will give you more than you will know what to do with.

The End

That covers the bulk of the information for a single machine sun tracking / heliostat electronics system. Have a question? Did I leave something out? Go ahead and leave a comment below.


Subscribe to my Feed!

12 thoughts on “Single Machine Sun Tracking / Heliostat Electronics Set Up

  • RomanF

    At compile Aruino 1.0 I get several errors,
    Unfortunately, I do not find in Internet Flash.H.

    Please help!

    Arduino_SunTracker_V096_Arduino1.cpp:10:23: error: Flash.h: No such file or directory
    Arduino_SunTracker_V096_Arduino1:210: error: ‘HourAngleArray’ has not been declared
    Arduino_SunTracker_V096_Arduino1:211: error: expected identifier before ‘-‘ token
    Arduino_SunTracker_V096_Arduino1:211: error: expected ‘,’ or ‘…’ before ‘-‘ token
    Arduino_SunTracker_V096_Arduino1:218: error: expected constructor, destructor, or type conversion before ‘;’ token
    Arduino_SunTracker_V096_Arduino1.cpp: In function ‘void loop()’:
    Arduino_SunTracker_V096_Arduino1:320: error: ‘HourAngleArray’ was not declared in this scope

    • Gabriel Miller Post author

      I had the link to the flash.h library in the main documentation page for the program, but it looks like I forgot to put it on this page.
      Here is the link.

      Once you put the library in the Arduino Libraries folder, it should work.

  • JOHN


    • Gabriel Miller Post author

      No the power doesn’t run through the Arduino. The driver boards have their own power supply like you said. The the one I use came from an old printer that I had, so I don’t have a link. It has a 18V output and is capable of up to 2.23A, so something similar should work for you, but double check your board’s documentation to make sure 18V (or close to it if your power supply is different) is within your driver board’s range.

  • Bill K

    Wish to integrate this to my existing photocontrol setup. A schematic diagram would be helpful so we aren’t guessing what you have connected and why. My revisions to suit my application would be as follows:

    Steppers not needed, just a timed relay output pulse for each direction.

    Self calibration feature…manually enter elevation limit angles, and azimuth limit switch locations, and have the program move from axis to axis, count the time, and use that as a basis to determine motor movement duration required.

  • Bill Williams

    I had already commented out the code you referenced, so i will look into the pin conflicts to make sure all is in order. Also thanks for verifying the Limits SW are in a NO state.
    Will let you how things go
    Thanks again

    • Bill K

      Just a heads up, limit switches are typically designed in a “fail safe” mode such that they are normally closed when not at their limit-press. That way a break in the wire would end in a more safe mode than otherwise.
      This would mean they would be wired in series as well.
      Just thought you would like to know.

  • Bill Williams

    I guess the Email is not making the trip…
    Anyway been working the setup with a Adafruit shield and got… I believe all, but the steppers to run. Clock programable and clocking correctly.
    Kind of over whelming when all the code, but you have pretty well explain what to .
    Anyway thanks for responding and I hope we can get this figured.
    Oooo One more question relating to the Limits Sw. Are the NO or NC when not on the limit stop ? Appears to be NO when off the stop ????

    • Gabriel Miller Post author

      I know of a couple of other people who have been able to use the Adafruit shield with this program, so it should work for you too.

      You will have to modify the program slightly for it to work though.
      First, near the top of the Arduino_SunTracker tab, comment out this
      and then uncomment this
      ////Adafruit Motor shield: STEPPER MOTOR SETUP

      Once you have done that, go to the top of the “Functions” tab, and do the same thing.

      I think that should be all you have to do, but I’m unfamiliar with the Adafruit motor shield, so you may want to double check the pin assignments to make sure the motor shield’s pins aren’t using the same pins as anything else in the circuit. If it does, then it should just be a simple matter of reassigning the affected pins and doing a little bit of rewiring to get it working.

      Also, the limit switches are NO. I just added a note near the schematic to help clarify. Thanks for the heads up!

      Hope that helps,

Comments are closed.