Änderungen

Zur Navigation springen Zur Suche springen
728 Bytes hinzugefügt ,  15:04, 9. Mär. 2015
Zeile 2: Zeile 2:     
=General considerations=
 
=General considerations=
For calculation the solar position with a microcontroller (on a fixed geographic place)  
+
For calculating the solar position with a microcontroller (on a fixed geographic place)  
 
you have to solve two problems:  
 
you have to solve two problems:  
 
The controller needs a time device (typically a battery buffered chip like in a PC)
 
The controller needs a time device (typically a battery buffered chip like in a PC)
Zeile 12: Zeile 12:     
==Get the Time==
 
==Get the Time==
[[Image:Arduino_DS1307.jpg|thumb|timer chip DS1307 with Arduino]]
+
[[Image:Arduino_DS1307_FritzingExport.jpg|thumb|timer chip DS1307 with Arduino]]
 
To get Greenwich Time (aka UT) I use a DS1307 chip.
 
To get Greenwich Time (aka UT) I use a DS1307 chip.
 
Following the description of http://www.glacialwanderer.com/hobbyrobotics/?p=12
 
Following the description of http://www.glacialwanderer.com/hobbyrobotics/?p=12
Zeile 18: Zeile 18:  
4.7K ones are just as fine.   
 
4.7K ones are just as fine.   
 
I have taken the code from that site and tucked the complexity
 
I have taken the code from that site and tucked the complexity
into an Arduino libary (DS1307.h)
+
into an Arduino libary (DS1307H.h)
    
==Calculate Azimuth and Elevation==
 
==Calculate Azimuth and Elevation==
Zeile 30: Zeile 30:  
and you can download it [http://www.psa.es/sdg/sunpos.htm here] as C++ code.  
 
and you can download it [http://www.psa.es/sdg/sunpos.htm here] as C++ code.  
 
There are adaptions neccessary for Arduino, though.  
 
There are adaptions neccessary for Arduino, though.  
The formulas for calculating the [http://en.wikipedia.org/wiki/Julian_day Juliand Day]  
+
The formulas for calculating the [http://en.wikipedia.org/wiki/Julian_day Julian Day]  
 
are not working properly on Arduino due to reduced double precision.
 
are not working properly on Arduino due to reduced double precision.
 
Therefore, I have adapted them, expecting only Julians dates starting from 1.Jan. 2000.
 
Therefore, I have adapted them, expecting only Julians dates starting from 1.Jan. 2000.
 
These calculations I have put into another library (Helios.h)
 
These calculations I have put into another library (Helios.h)
 +
 +
Use following program plus libraries for older Arduino IDE (0023 and older):
 +
{{zip|SolarTracker4Arduino.zip|14KB|Version from 09.03.2011}}
 +
 +
For newer Arduino IDE (1.0.1 and later) use instead the following package,
 +
{{zip|SolarTracker4Arduino1.0.1.zip|17KB|Version from 16.01.2015}}
 +
 +
Once you got it running, verify the calculated positions, for instance with
 +
[http://www.sunearthtools.com/dp/tools/pos_sun.php solar position calculator] from
 +
sunearthtools. (Attention: SolarTracker4Arduino does NOT account for daylight saving time (DST),
 +
you have to determine UT (when you set your timer chip) as if there was no DST at all. On the other hand, sunearthtools allow using DST,
 +
and this option is selected by default.
    
==SPA Algorithm==
 
==SPA Algorithm==
Zeile 42: Zeile 54:  
In this paper methods have been worked out according to the book from
 
In this paper methods have been worked out according to the book from
 
''Jean Meeus: Astronomical Algorithms, Willmann-Bell, Richmond 2000 (2nd ed., 2nd printing)''
 
''Jean Meeus: Astronomical Algorithms, Willmann-Bell, Richmond 2000 (2nd ed., 2nd printing)''
a widely accepted text book for astronomic calculations.  
+
a well known text book for astronomic calculations.  
 
The calculations are, however, very extensive; for Arduino I chose the simpler PSA.
 
The calculations are, however, very extensive; for Arduino I chose the simpler PSA.
 
Implementations and references for both algorithms I found thanks to the code from
 
Implementations and references for both algorithms I found thanks to the code from
 
[http://klaus.e175.net/solarpositioning Klaus Brunner]. It was also a valuable help for debugging
 
[http://klaus.e175.net/solarpositioning Klaus Brunner]. It was also a valuable help for debugging
 
the Arduino implementation.
 
the Arduino implementation.
 +
 
--[[User:Hannes.hassler|Hannes.hassler]] 13:36, 3 March 2011 (CET)
 
--[[User:Hannes.hassler|Hannes.hassler]] 13:36, 3 March 2011 (CET)
33

Bearbeitungen

Navigationsmenü