Astronomic Clock - Sunrise / Sunset Calculations

Status
Not open for further replies.

Mark_R

Member
Hi,
I'm looking to implement a astronomic Clock in a PIC to calculate sunrise and sunset times for a given LAT/LON. I have a timing application that requires switching loads relative to sunrise / sunset. There are plenty of algorithms around the 'net for this ( http://users.electromagnetic.net/bu/astro/sunrise-set.php for example) yet, surprisingly, I can't find much detail in implementing the function in a micro-controller.

Hoping not to re-invent the wheel here. I really haven't tackled complex math in a micro so I was wondering if solving these types of algorithms is straightforward or i'm going to end up over my head.

Any pointers?

P.S. No, a photocell will not work.

Thanks.
 
HI!, I dont think you will have a problem too much doing trig, which is mostly is what is in your algebra , and can be done by including math.h using MPLAB anyway, cant help too much with that since iv never used it b4, but there should be lots of examples out there,


Jdate = Julian date
lw = West Longitude (75W = 75, 45E = -45)
ln = North Latitude (35N = 35, 25S = -25)

all those equations there are all derived from these 3 values, now im not too sure about a Jdate, or where you get that value, but the LONG & LAT suggests you will need a gps device , which you can get online that uses serial data communication,
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…