Close

JPL Horizon Solar Positioning Data Aquisition

A project log for PiCon One

PiCon One is a multi-function controller for home automation and industrial use cases.

frankFrank 06/09/2020 at 14:490 Comments

Since 2019 I work on motorizing solar PV panels, to let them track the sun. Because our sun is an extremely bright object, one method is self-orientation with directional light-sensors. Another approach is to calculate the suns position, based on the known mechanics of our planet and solar system.

Last year I have been working with NREL's solar position algorithm, writing the 'suncalc' program to create solar position datasets for suntrackers. Unfortunately, the SPA code from the US Department of Energy is not freely accessible. It is not Open Source, which hinders easy adoption and code sharing.

Thanks to the great community at Hackaday, @RichardCollins commented on the earlier project, and pointed me towards the JPL Horizon system. Richard, thanks for taking the time! It's these encouragements that lead to this years PiCon One project. 

JPL Horizon is an online solar system computation service for all kinds of celestial objects. And YES it works! I can just send a query to Horizon, which then returns the suns dataset specific for my geographic location. An example query for solar position azimuth and elevation data looks like this:

curl "https://ssd.jpl.nasa.gov/horizons_batch.cgi?batch=1&COMMAND='10'&CENTER='coord@399'&COORD_TYPE='GEODETIC'&SITE_COORD='139.628999,35.610381,0.005'&MAKE_EPHEM='YES'&TABLE_TYPE='OBSERVER'&START_TIME='2020-06-09'&STOP_TIME='2020-06-10'&STEP_SIZE='1 m'&QUANTITIES='4'&APPARENT='REFRACTED'&CSV_FORMAT='YES'&OBJ_DATA='NO'" > 20200609-jplh.csv
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 82264    0 82264    0     0  42935      0 --:--:--  0:00:01 --:--:-- 42912

The returned data is exactly what I hoped for. I am now working on a client program "jplh-client" that periodically fetches the data, with latest coordinates fresh from the GPS.

Still in early stages: solar position client program to JPL Horizon

If by chance someone from JPL is reading: Big Thanks to the team at Pasadena Jet Propulsion Laboratory for running the service.

Discussions