Thanks for the encouragement guys, I'm on the case.
What ever processor you use, make sure that is has floating point and maths libraries for sin/cos/sqrt etc.
Damn, I thought somebody might say that. I'm using a Microchip PIC, because I am familiar with them and have the dev tools, but I'd hoped to do it all in assembly simply because I enjoy it and the software is free. Microchip do offer a C Compiler, but there's licensed version and a (crippled) free version, not sure what exactly gets crippled. I'll need to find out if the free C compiler is up to the job....
Another problem with heavy maths libraries and high level languages might be the limited memory, the PIC I am playing with right now has just 512 bytes of RAM, and 7k bytes of program memory (Harvard architecture). I suppose as a last resort I could use a Pi or something, but I'd rather not.
Alternatively, I wonder if I could write a desktop App that provides the necessary maths, in the form of machine-written assembly lookup tables?
Re the sensor, I plan t use an LED as a photodiode simply because I haven't got any actual sensors to hand, but I have bags and bags of LEDs, looking for a purpose in life. Some PICs have on-chip operational amplifiers which offer a nice way, of interfacing to a photodiode(/LED), converting the photo current into a useful voltage scale. They also have ADCs, so you end up with a numeric representation of ambience. I can then play around with finding the right thresholds, add software filtering to ignore the odd cloud, etc. I've made all that work before, sensing ambience with LED and PIC, different project.
I also been thinking that, as an alternative to waiting for shortest/longest day, I ought to be able to make deductions about latitude based on rate of change of lighting levels combined with current hours of sunshine? Can't get my head around that - maybe I never will get my head around it, maybe I'm talking drivel, but it's on the "ideas" list.
Cool idea, personally I always wanted to make a nixie clock, they are super cool
That would be cool indeed. But for convenience of being portable to different window cills, I want my clock to self-contained and battery operated. It'll probably be about somewhere between cigarette box and paperback book in size. Getting a battery to drive Nixie tubes in such a portable device, to run uninterrupted for years or more, would be a whole different challenge. Next project, maybe?
Your idea fails at the first hurdle!
London today: Sunrise 07:22, sunset 16:07 (see https://www.timeanddate.com/sun/)
If you could persuade all the relevant authorities to make the earths orbit around the sun circular would be a start to your project.
Thanks for the tip. If it simplifies the maths, I'll start writing the letters requesting the changes.
I'll keep the thread up to date. This all came about after I purchased the LCD displays, simply because they looked cute and were cheap. Having wired up an LCD to a PIC and got it to display "Hello World", my next challenge was to justify the cost and time I'd spent, by thinking of a problem that they might solve. Combined with my previous application of a PIC involving an ambient lighting sensor, the clock sprang to mind.