This is not yet ready for prime time, but someone in another thread wanted to see it so here it is half-baked. It probably contains bugs. Also, this is my first major Arduino sketch that I started writing over a year ago. Since then, I've learned a few things and if I had to do it over, would probably do things a little differently. But it works and I don't want to do it over. ;)
I chose to use a RTC and calculate sunrise/sunset times every day. This avoids any false activations as may happen with a photocell (cloudy day etc).
One thing I want to point out is that the state of the door is never stored in a variable. This is important for safety -- any time I want to check if the door is open/closed, I read the limit switches directly.
A hacked up cordless drill is activated via a twin-relay module wired as a H-bridge. The whole thing is powered with a motorcycle lead acid wet cell battery charged by a small solar panel. It's charged more than it's discharged, so I chose a wet cell to be able to water the cells from time to time.
The heartbeat LEDs are aimed at the (human) house so I can see the status just by looking out a window.
JeeLabs RTCLib: https://github.com/jcw/rtclib
Alternate DS3231 required for setting the time on my cheap import RTC: https://github.com/trunet/DS3231RTC (use the Example sketch provided with this library)