Using just three switches, it is possible to program up to eight different sets of targets inside the Arduino Sun Tracker sketch.
The picture below shows the schematic for adding one switch. You will need to make three of these. The first switch goes to analog pin 0, the second switch goes to analog pin 1, and the third goes to analog pin 3.
![]()
Parts List
The parts list for the switches circuit is a short one. All you need is three 1K ohm resistors and three switches. Most any type of switch should be fine, so just use what you think looks the best. I think that the metal switches are the best as the plastic ones can be damaged easily be the heat of the soldering iron (a lesson I learned the hard way).
Box for Switches: You will also need something to mount the switches in. Since this will be mounted somewhere inside your house, you might want to find something that looks good.
Wire: The last thing you will need is five strands of wire that will span the distance between your house and the Arduino, which is located outside with the heliostat(s). Three strands are used for the switches, one is used as the 5v wire, and the final wire is used as gnd.
I used six strand telephone wire for mine, which should hopefully work without issue. This gives me one extra strand which I might use for something in the future. A temperature sensor perhaps? Or maybe a light sensor?
Pictures
Here is a picture of the switches after the wire leads were soldered on.
![]()
I added some hot glue to the mix so that the fragile leads coming from the resistors wouldn’t accidentally be pulled off.
![]()
A quick test with the Arduino to double check that the worked.
![]()
Here’s the finished switch box put together and ready to control my heliostats. It works well. Depending on the combination of on and off for the switches, I can switch between eight different target combinations.
![]()
Test Program
Here is a quick program for the Arduino which can be used to make sure the switches are working. Make sure all three switches are wired to the Arduino when testing as it won’t work correctly otherwise.
When running, the program will display “1″ in the serial monitor if switch 1 is turned on, “2″ for switch 2, and “3″ for switch 3.
Click here to download.

