On Sat, Feb 14, 2009 at 03:14:27AM -0500, Forrest W. Christian wrote: > I need a new alarm clock. So do I. > I won't go into the details but let's just > say it isn't as reliable at waking me up as an alarm clock should be, > for quite a few reasons. My current alarm clock is an RCA CD model that will play music from the CD for the alarm. It's a good starting point by I'd like to see some more features: 1. Instead of a CD use a USB memory drive or an SD card to store the music. I'm close to completely ditching CD as a format as I've gotten rid of the CDs in the car, replacing with SD. 2. Waking up to the same song everyday is lame. With all the music available random song selection (or playlist selection) would be better. 3. The current clock has dual alarms which works well. But with the current clock both alarms play the same song. Just another aspect of point #2 above. > I would really like to end up with an alarm clock which is controlled by > a PIC, so I can tweak on the code, but I really don't want to do the > mechanicals, and would prefer not to do the circuit either. I have > looked around and there doesn't seem to be a good, bedside-friendly kit > (meaning it will survive my pounding to get the thing to snooze in the > morning when I need a few more minutes. Or put differently, I want > something which *looks* like an alarm clock. That sounds like user error! The correct solution is to put the clock out of reach from the bed so that you have to get up to turn it off. Or as an alternative wire in a big red emergency button next to the bed. It can take the pounding. > If I can't find something, I'll scavenge my selection of old alarm > clocks which have failed me in some way (usually by me learning how to > shut them off in my sleep), and hack them to run off a PIC instead of > whatever chip they are using. > > So, did I miss a kit somewhere? Probably not. The electronics for a clock isn't too difficult. The toughest problem with a clock is getting it to keep the right time. You have to either integrate an RTC chip that uses temp controlled crystal oscillators to keep right time. Or you have to count cycles from the wall. My sunrise/sunset outdoor light controller, which is fundamentally an alarm clock, keeps absolutely awful time using a 32 kHz watch crystal. I end up having to reset the time at least once every two months or so because it drifts so badly. Not a real problem because the control application is just dusk to dawn and so doesn't need to be very precise. But would be problematic for an alarm clock. If you like you can take a look at the code for my sunrise/sunset controller here: http://www.finitesite.com/d3jsys/clock.asm Written in absolutely assembly for the 16F877A. Has all of the LED and clock routines to drive a clock and uses an ADC pot/switch based interface for setting the time. It would need an addition for setting the alarm time and some type of snooze function. The mechanicals are nothing more than an LED driver, the pot/switch interface and a mechanism for getting in time pulses to count. Like I said in my opening, adding a SD card/MP3 player would be my target. The VMusic2 would be the fastest way to pull this off, though not the cheapest (about $40 USD in singles). BAJ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist