I once replaced the light switch in my room with a relay and hooked up an alarm clock I made with an Arduino to it. The Arduino would flash the lights until I got out of bed and walked across the room to press a button. It worked great!… for the first week or so. The problem is, you very quickly become immune to flashing lights. After a week or two, it didn't wake me up at all. So… word of warning.
About keeping time: if it does not have a timing chip, microcontrollers do not keep time well at all. I calibrated mine based on clock speed, and then left it running for a month to get the amount it went out of sync on average, and then used that value to correct it. Even after doing that, it still become out of sync again very fast; a couple of seconds each day. The problem is that temperature affects the clock speed more than I expected.
I eventually just went back to my regular sound-based alarm clock, but I haven't bothered to remove the relay and Arduino stuff so I just don't have a working light in my room anymore.
From what I've heard and read an external crystal will be significantly better than the internal oscillator. But I'll see.
I kind of figured I'd get used to the light. It's more of a sign I should get out of bed than a wake up right now. So it gradually turns on, stays full for half an hour then fades off. Seems to work so far.
Yeah, this didn't work. I have now ordered some RTC boards.