Assembling the Sun Tracking / Heliostat Control Circuit


Subscribe to my Feed!

This page explains how to wire together the control circuit that is used with the Arduino Sun Tracking / Heliostat Program.

Before you start reading this documentation, I recommend you download these files first. They are essentially just large, zoomable images that open in a PDF reader.
Sun Harvester Shield Single Machine Wiring.pdf
Sun Harvester Shield-16 Machine Wiring.pdf

To a certain extent, these two files might be all of the documentation you need, but it would be a good idea to at least skim through the rest as it does contain important information.

Component List

Note that the complete electronics system is still technically being developed, so this list might seem vague in some places as I am still searching for the best parts. If you have a question, you can let me know by leaving a comment at the bottom of this page.

The following components are required for this system. *

  • Sun Harvester Shield
  • Arduino Microcontroller
  • Power Supply for Arduino
  • Two Stepper Motor Driver Boards
  • Power Supply for Driver Boards
  • Two Stepper Motors per Sun Tracker or Heliostat
  • Stepper Motor Power Control Board (One for each machine, but none are required if you only wish to control one machine.)
  • 2 Limit Switches (Normally Open) per Sun Tracker or Heliostat
  • Potentiometer
  • Switch
  • Stepper motor wires and misc signal wires

*One day I hope to have all of these components available for purchase through my site to make it easier for people who aren’t comfortable navigating through online electronics catalogs in search of the correct part. If this is you, hold tight! I’m working as fast as I can, but it is still going to be quite some time before all of this stuff is available.

Sun Harvester Shield / Stepper Power Control Boards

The Sun Harvester Shield and the Stepper Power Control Boards can only be obtained through me at the moment. I have set up a small online shop where you can purchase them if you are interested.  Here is the link. www.cerebralmeltdown.com/shop

Arduino Microcontroller

The Sun Harvester Shield has been tested with the Arduino Uno and the Arduino Mega 2560. I would recommend that you stick with one of these two boards for now. Note that the Mega has considerably more program space than the Uno. This extra space allows for a much more accurate sun position algorithm to fit on it. It also gives a lot more breathing room for future developments to the Sun Tracking / Heliostat Program.

If you are only interested in controlling a few machines, aren’t overly concerned about their accuracy, and don’t care if they have all of the current and future bells and whistles, then the Uno should be fine for you. If these things appeal to you though, then you should use the Arduino Mega.

Also note that there is a bug with some of the older Arduino Unos that keeps them from uploading programs over 30kb. This is a pain since the Uno version of the Sun Tracking / Heliostat Program is larger than this. The problem can be fixed by using the method described on this post on the Arduino forum, but you will need another Arduino to do it. This is perhaps another reason to use the Arduino Mega.

Other Arduinos: The Arduino Due has not be tested with this system. For the most part, it might work fine, but the Due doesn’t have built in EEPROM which is required for saving heliostat targets. There may be another way to do it, but I don’t have a Due for testing.

The Arduino Leonardo has 32KB of flash memory but 4KB of it is used by the boot loader. Basically, this means that the default Arduino Sun Tracking / Heliostat Program will not fit on it unless you are able to comment out some of the code that you might not need for your project.

The older Arduino Duemilanova should work; however, if you are using the Sun Harvester Shield you will have to run a wire from the extra SDA output in the upper left hand corner of the shield to analog pin output A4 on the shield. You will also have to run a wire from SCL to A5.

Similarly, the older Arduino Mega should work; however, if you are using the Sun Harvester Shield you will have to run a wire from the extra SDA output in the upper left hand corner of the shield to pin 20 on the Arduino. You will also have to run a wire from SCL to pin 21.

The older Arduino’s do not have the extra SDA and SCL outputs in the upper left hand corner, thus you have to make the connections yourself.

Arduino Power Supply

You will need a 9V power supply to power the Arduino board. Take a look at this one from Adafruit.com as an example.

Two Stepper Driver Boards

You will need two stepper motor driver boards to drive your machine’s stepper motors. I have been using the AE-MDL-STPR8811 with great success (Update: This driver board is no longer available. An alternative is the EasyDriver stepper motor driver. A wiring diagram for it is on this page. Go to reply #49 if you aren’t automatically taken there).

When choosing driver boards, make sure they have the “enable” feature, which basically allows you to turn the stepper motors off. This feature both saves electricity and also allows you to control multiple machines by adding the cheaper Stepper Power Control Boards instead of driver boards. Note that you must make sure you use a driver board that’s for bipolar stepper motors. Also, you’ll want to make sure to get step/dir type driver boards if don’t want to have to edit the code to make it work.

Note: I hope to eventually have a list of driver boards that will work well with this project along with diagrams for how to wire them. If you have tried one that works without having to make modifications to the Sun Tracking / Heliostat Program, please let me know about it.

Power Supply for Driver Boards

The data sheet for the drv881 (the chip used in the previously mentioned driver board) says that it will accept as low as 8-V to as high as 38-V, so a power supply within these values is what you will need. 24-V is a common output for power supplies, so an internet search for one should yield plenty of results. If you are using a different driver board than I am, check its documentation for its required input voltage.

For choosing amperage when using a 24-V power supply, I would say that an output of at least 2A should be fine (mine is 2.23A). Anything over 4A is probably overkill, but wouldn’t hurt anything. It is however possible to accidentally overpower your stepper motors / driver boards when using power supplies with higher amperage simply because they are capable of providing it.

2 Stepper Motors per Machine

There are many different types of stepper motors. I’m sure that all of them could technically be made to drive a sun tracker or heliostat, but for the sake of simplicity, I recommend bipolar (i.e. 4-wire) stepper motors. I also recommend stepper motors that make at least 200 steps per revolution, which may also be described as having 1.8 degrees per step. More steps allow for better acceleration than the stepper motors that move say 7.5 degrees per step.

It’s not always obvious what order you must put the stepper motor wires in when wiring them to a bipolar stepper motor driver board. You can take some solace in the fact that wiring the stepper motor incorrectly will not damage anything. It just won’t work. What you definitely do not want to do though is to try rewiring the stepper motor while the driver board is powered on. Doing so could possibly damage the driver board.

It is actually rather easy to figure out how to wire bipolar stepper motors even if it isn’t immediately obvious.

1. Start first by laying out the four wires so that the ends are not touching each other.

2. Turn the shaft of the stepper motor and make a note of how much physical effort it takes to do it.

3. Connect the ends of two of the wires and turn the shaft of the motor again. If it is harder to turn it than it was before, then put these two wires on connections A+ and A- on one of the driver boards. If it is not harder to turn, they try again with another combination of two wires.

4. Once you have determined the A+ and A- wires, the remaining two wires go on connections B+ and B- on the driver board.

You will need two stepper motors for every machine that you want to control.

2 Limit Switches (Normally Open) per Machine

You will need two normally open, N.O., limit switches for every machine that you want to control.

Keep in mind that these limit switches are used as homing switches, not as physical limits. Thus, these switches are only used to determine the angle of the machine when it resets. They are not used to stop the machine should it try to move beyond its physical capabilities.

Note that the Sun Tracking / Heliostat program has software limits to keep the machine from moving outside of its boundaries during normal operation.

If you are building a machine that has stepper motors which are powerful enough to damage it should something go wrong, then you should add 4 additional limit switches as physical limits to restrict the machine’s range of motion. In all practicality, you would have to have very large stepper motors relative to the size of the machine to worry about anything being damaged, so I personally don’t bother with them.

Potentiometer

You will need one  linear (as opposed to logarithmic) 10K ohm potentiometer if you are using heliostats and want to be able to switch between multiple targets. If you are only using sun trackers or if you only need to reflect the light at one target when using heliostats, then this component isn’t necessary.

Switch

Any switch should do the job really, so there isn’t anything else to mention here.

 Attaching the Shield to the Arduino

When attaching the shield to the Arduino, line up the header pin on the shield indicated in the picture below so that plugs into pin 0 on the Arduino. If you are using the Arduino Uno two of the pins, A6, A7, will hang over the end as they are only available on the Arduino Mega.

Wiring the Driver Boards to the Sun Harvester Shield

Wiring the Sun Harvester Shield to the driver board is a straight forward process. The image below probably makes it look more complicated than it actually is. You’ll notice that everything is labeled  so it should be easy to figure out what goes where. Note: 5V on the Sun Harvester Shield goes to VCC on the Driver Boards. Your wiring will of course differ if you are using a different driver board.

Wiring the “Target Changer” Potentiometer and Wind Protection Mode Switch to the Sun Harvester Shield

The image below shows how to wire the 10K ohm potentiometer and switch to the Shield. If the image is hard for you to see, remember that you are able to download a higher quality one as a pdf at the top of this page.

How to Wire a Single Machine to The Sun Harvester Shield

The way you wire the rest of the system will differ slightly depending on whether you wish to control a single machine or multiple machines. We’ll look at the single machine wiring first and then move on to multiple machine wiring further down this page.

Limit Switches

The image below shows how the homing switches should be wired to the Sun Harvester Shield when only wiring a single machine to it. One wire goes to “Limit” on the Sun Harvester Shield, and the other goes to “5v”. It doesn’t matter which wire goes to limit and which goes to 5v, so you can’t wire them backwards.

WARNING! Do not mix up these connections! If you aren’t careful, you might accidently use 5V and Gnd instead of 5V and Limit and fry your Arduino when the limit switch is triggered.

Stepper Motors

The stepper motors are wired directly to the driver boards when using single machine wiring, which is shown in the image below.

 

Wiring Multiple Machines

If you want to control more than one machine, you will need one Stepper Power Control Board for every machine. So if you want to control two machines, you will need two Stepper Power Control Boards, if you want to control three machines, you will need three boards, etc.

Wiring the Driver Boards and Sun Harvester Shield to the First Stepper Power Control Board

When controlling multiple machines, the driver boards are wired to the Stepper Power Control Board that controls the first machine in the sun tracker/heliostat array. It should be easy to tell which wire goes where since the connections are all labeled. Just make sure not to get the altitude and azimuth driver boards mixed up though since it will inevitably lead to confusion if you do.

You will also need to wire “limit”, “5V”, and “gnd” on the Sun Harvester Shield to “Limit In”, “5V In”, and “Gnd In” on the Stepper Power Control Board.

WARNING! Do not mix up these connections! If you aren’t careful, you might accidently use 5V and Gnd instead of 5V and Limit and fry your Arduino when the limit switch is triggered.

Also, make certain that the A+, A-, B+, B- connections are secure on both the driver boards and the Stepper Power Control Boards. Having one disconnect while the driver board is power on might damage it!

Wiring the Second Stepper Power Control Board to the First

It is easy to wire each successive Stepper Power Control Board to the previous one. Simply wire the connections labeled with “Out” on the first board to the connections labeled with “In” on the next board. Although the image below only shows two wired together, you can continue to chain together Stepper Power Control Boards like this indefinitely (or at least until you run out of enable outputs on the Sun Harvester Shield).

WARNING! Do not mix up the “5V”, “gnd”, and “Limit” connections! If you aren’t careful, you might accidently put them in the wrong order and fry your Arduino when the limit switch is triggered.

Also, make certain that the A+, A-, B+, B- connections are secure on both Stepper Power Control Boards. Having one disconnect while the driver board is power on might damage it!

 

Wiring the Enable Wire to the Stepper Power Control Boards

Every Stepper Power Control Board requires a unique “enable wire” from the Sun Harvester Shield. This wire essentially just tells the Stepper Power Control Board when it’s time to turn its set of stepper motors on.

The next image below has all the other wires removed to make it easier to see how the enable wires should be connected.

For the Stepper Power Control Board that controls the first machine in the array, you must connect a wire from the screw terminal located at the upper left hand corner of the Sun Harvester Shield to the Enb Steppers screw terminal on the Stepper Power Control Board. This is the yellow wire shown in the below image.

For the second Stepper Power Control Board, you connect a wire to the screw terminal located just below the yellow wire’s screw terminal to the Enb Steppers screw terminal on the second board. This is the purple wire shown in the below image.

This example only shows two connected Stepper Power Control Boards. If you are using more, you would simply continue on in this fashion until you have used up all 16 outputs on the Sun Harvester Shield.

 

Stepper Motors and Limit Switches

As is shown in the image below, the stepper motors and limit switches are wired directly to the Stepper Power Control Board. The board is labeled so it is easy to see which stepper motor goes where, altitude or azimuth. It doesn’t matter where the limit switches go (left side or right side of the terminal) since they are wired in parallel, which basically means that the Arduino can’t tell the difference between them regardless.

Relevant Forum Link

If you’re curious, the history of this circuit along with information on how it works is available at the following page on this site’s forum. Note that the topic drifts around a bit since it is just a forum thread. Also, the more recent posts are more accurate than the earliest ones.

http://cerebralmeltdown.com/forum/index.php?topic=335.0

 

This documentation is part of the Open Sun Harvesting Project. Click the link for more information.

Subscribe to my Feed!