/SolTrack-Arduino

A free, fast and accurate Arduino routine to compute the position of the Sun.

Primary LanguageC++GNU General Public License v3.0GPL-3.0

SolTrack for Arduino

SolTrack for Arduino is a free, fast and accurate Arduino routine to compute the position of the Sun. The code can be used to track the Sun on an Arduino Uno, using single-precision variables, and can be used for e.g. (highly) concentrated (photovoltaic) solar power or accurate solar-energy modelling.

SolTrack has been developed by Marc van der Sluys, Paul van Kan and Jurgen Reintjes, at the Sustainable Energy research group at the HAN University of Applied Sciences in Arnhem, the Netherlands. The code is based on the astronomical Fortran library libTheSky and can be used, modified and distributed under the conditions of version 3 of the GNU Lesser General Public Licence.

Description, speed and accuracy

See also the poster and conference proceedings we presented on CPV-11 in April 2015 for the C/C++ version of the code.

SolTrack for Arduino is a simple Arduino routine that can compute the position of the Sun in topocentric coordinates, both in a horizontal and in an equatorial system. The code is based on the Fortran library libTheSky and includes corrections for aberration and parallax, and a simple routine to correct for atmospheric refraction, taking into account local atmospheric conditions. We compared the performance of SolTrack to detailed calculations using the planetary theories VSOP 87 and an accurate model for atmospheric refraction.

We tested SolTrack for Arduino for 200,000 random moments between 2021 and 2030 when the Sun is above the horizon in the Netherlands (latitude ∼52°N). We find that the mean error in position is 0.0027 ± 0.0037° when using the single-precision Arduino UNO, which is sufficient for solar tracking of CPV systems under all conditions. The code can compute about 96 Sun positions per second on an Arduino UNO.

SolTrack pages

Example

This repository lists an example.ino program that can be linked against the SolTrack library (i.e. compiled and uploaded together with SolTrack.ino and SolTrack.h), and which computes data for a single instance.1 Example output is provided to verify the results.

SolTrack has been used by:

Contact

You can contact the authors (preferably through email) via this page.

Footnotes

Footnotes

  1. Note that some systems require you to use a directory of the same name as the script (see e.g. this page). If you use such a system, you should call the directory example/ for the example code.