Go Down

Topic: Ultimate Smart Alarm Clock (Read 644 times) previous topic - next topic

Oscarko

May 23, 2016, 05:55 am Last Edit: May 23, 2016, 09:00 am by Oscarko
Here is my second build - an ultimate alarm clock that is build exactly to my specifications:

- multiple alarms, daily, weekly, on certain days, on certain dates, timer
- automatically dims LCD and LED in darkness (my wife always complains, even covers my clocks)
- multiple alarm sounds, each alarm can have its own sound
- automatic DST
- uses RTC with battery
- hourly chirp, but only in day hours and also automatically suppressed when it is dark
- easy way to enable/disable each alarm or all alrams
- lot of user settings, like the LCD/LED brightness under different light etc.

It is running on a bit modified TimeAlarms library (ingenious how it complements time library), DS1302 RTC, 1602 on I2C and LED 7 segment driven by MAX7219 (Store here was selling only common anode 7 segment so it took a bit convincing to work with 7219 -but works perfectly).
The light sensor is with a photo-resistor on voltage divider to analog input. And the sounds are through RTTTL melodies driven by a simple 1 transistor amp. The menu system is a non blocking interrupt based menu with rotary encoder - my own design, and quite happy about it.

All on ATM 328 - currently I have UNO inside, but I will replace it with my own DIY-duino as soon as I will have some time. I wanted to use originally ebay nano, but I found out it has busted A4 or A5 inputs so no I2C (I've got what I paid for)

I filled the uno to the brim, 98% PRGM and 90% memory - word of advice, don't fill the memory above 90% or you will see some strange things. My I2C display was all acting up, interrupts were random and other funky stuff, until I realized there may be some dynamic allocations in those libraries and if I fill up the memory then boom!
Total time - about a week.








Oscarko

I measured the drift of the ebay 1302 and it is about 7 sec a day which is about 90ppm. It is not that bad on those cheap crystals they put in. I added drift function to the menu that will compensate for this and it is adjustable if the drift changes over time.
Also I will probably change the crystal for the +/-10ppm citizen they have on digikey next time I do my order.

Go Up