This project is based on a Lua program which uses a relay to control a lamp. The lamp is intended to turn on at sunset and turn off at sunrise, but the lamp can be configured with any desired on/off time once per day.
The current date and time are fetched every minute from google.com.
A text file (lamptimes.txt) contains a list of the turn-on and turn-off times for each day of the year. The user must edit this file to configure the required turn-on and turn-off times. A service such as aa.usno.navy.mil/data/docs/RS_OneYear.php can be used to find the sunset and sunrise times for your location.
All times are based on internet time (GMT). There is no attempt to convert the time to local time. Therefore all times in lamptimes.txt should be in GMT.
Note: The circuit diagram is capable of driving 2 relays, but I only used 1 relay for this project.