Alarm clock project - Page 1
Forum section: electronics / projects

author: steaky1212
author_rank: Regular Contributor
timestamp: September 05, 2016, 02:04:50 pm
content: Hi,I have designed an alarm clock project, but am stuck on how best to implement some of the features... (Probably should've planned it a bit better).- It has 2x12 red LEDs on the front with an LED driver chip. The idea is to have the inner ring for hours and the other ring for minutes fading between the 5 minute increments for the others.- It's got a battery backed RTC with TCXO that will keep fairly accurate time.- It has 3 buttons labelled MODE, ADJUST, and SNOOZE.- Small 5V piezo- 6x white LEDs that will gradually light up as the alarm.My issue is how to make is usable though. I was thinking about having a wifi/bluetooth module to set the time (or an RF module that gets the MSF signal in the UK) but thought that this would add too much cost, so stuck with buttons instead.Setting the time and date are relatively simple (28th would be 2 on the hours, 40 in the minutes ), but it becomes cumbersome with the alarms as I want to have different times on each day.What features are useful and what am I making too configurable? i.e.:-- Is it acceptable to say that the ramp time for the white LEDs is always 30 minutes (for example).- How long does that alarm stay active for? If it ramps for 30 minutes then is 1hr too long or too short?- Do you need to set the alarm time in 1mins increments or is 5mins alright?- Do the LED alarm and piezo alarm count as different alarms that require different times being set?- Is it better to have the 2x12 red LEDs off at night unless a button is pressed (or would dim suffice)?- When the snooze button is pressed, does this snooze for 5/10/15 minutes?Who thought that a clock would raise so many questions??

author: Len
author_rank: Frequent Contributor
timestamp: September 05, 2016, 03:16:30 pm
content: Most of your questions (brightness ramp time, snooze time, etc.) are things that you probably want to experiment with, but not things that need to be changed after they’re set correctly. These things don’t need to be configurable via the clock’s buttons. They can be defined in your firmware so it’s easy to change them and re-compile the firmware as you test things until you have everything working how you like. This does mean you will have to re-compile and re-load the firmware a few times, but you’ll probably have to do that anyway, unless everything works right the first time!

author: uncle_bob
author_rank: Unknown
timestamp: September 05, 2016, 03:31:02 pm
content: HiAlso consider that the default times for tha alarms can be done in firmware. My guess is that you have a fairly predictable schedule over the week. I get up early for work and sleep in on the weekend.....At least around here, power interruption is the biggest issue a "normal" alarm clock fails at. Yes they have batteries. You only know the battery is a problem after it fails.....I would vote for putting the WiFi back in the project. That only really works if you have a "always on" server like device. Many people do these days. That makes it easy to save all the info outside the clock and just have it "phone home" every so often.Lots of choices...Bob

author: steaky1212
author_rank: Regular Contributor
timestamp: September 06, 2016, 08:10:04 am
content: Hmmm... I don't want to suffer scope creep, and I've done the PCB already so WiFi is out for now.As it's for a Christmas present I'll hit this in 3 stages:- MVP (minimum viable product - set time and single alarm using buttons. White lights increasing for 30mins, then 10mins full light, then 10mins buzzer)- Finished product (As above but birdsong through piezo, and separate alarm for each day)- Ultimate (Include ESP3212 as it's just been released. Get time from web, serve music as alarm [maybe just birdsong again], set alarms through web interface)

author: Len
author_rank: Frequent Contributor
timestamp: September 06, 2016, 03:40:17 pm
content: Quote from: steaky1212 on September 06, 2016, 08:10:04 amPlenty of time to fiddle with it and come up with something cool.

author: DaJMasta
author_rank: Super Contributor
timestamp: September 06, 2016, 04:24:11 pm
content: Not sure of the specifics of your design and if the PCB's made then it's a little late for some of this but:The TCXO is definitely overkill for a regular clock - not a terrible thing, but you can get very good accuracy on an RTC in a few ways - I've got a project with an I2C DS3232 RTC using whatever cheap crystal they threw on a fairly bargain-basement board that was time sync'd in November of last year which is less than a second of off my computer's clock which is sync'd with internet time. Though previous DS1307 based modules have gotten a second off in a month or so.Otherwise, I think the real test is going to be the piezo and getting the sound quality you want. If you've got a driving circuit with a volume adjust, you probably want to set the fixed resistors involved once you have it at least dry-fitted into its final case. I'd also recommend getting a couple different piezo elements and choosing the one that sounds best in your application - this is especially easy to do if they are not pcb mounted so you're just swapping wires - because if you want a good amount of alarm volume but still want reasonable fidelity for music or other sounds, piezos will probably need some tweaking. Again not sure of the hardware being used, but if you've got something capable of sound playback in your circuit, there may even be software options for equalization (bass boosting, in particular) that could also help, and you could experiment with where the piezo element is mounted relative to the sound holes to change the profile a bit. All probably adjustments to make in the final stage, but probably ones that are worth considering.Most of the rest of the options are software related, as mentioned, and probably aren't too different in their implementation - so take your best guess, implement it, and if doesn't work, you can fix it without rewriting too much. It may be worth considering a diffuser in front of your LED ring - depending on the brightness and the spotlight effect from the LEDs you're using, it could keep it bright but reduce the brightness head-on, which can be an issue with LEDs. If you drive them low enough and use wide angle LEDs, this probably won't be a big problem - but if you consider that your clock has to be looked at in the dark of night and not be too bright, but still be visible with sunlight in the room, it can be a more complicated balance to find that it seems.Good luck!

author: NivagSwerdna
author_rank: Super Contributor
timestamp: September 06, 2016, 07:40:43 pm
content: Adding radio sync is easy. Depending on where you are in the UK you might find DCF77 easier to receive than MSF60, however these sources don't cope well with interference from computers so you might find that sync at a time when nearby computers are asleep is a good idea.You don't state if you are using a microcontroller, but there is a great radio clock receiver decoder for atmel by Udo Klein.https://github.com/udoklein/dcf77PVElectronics sell modules or you could use the module from a £5 LIDL radio controlled clock or similar.