Summary of Alarm Clock Overkill Using Arduino
This Arduino-based alarm clock displays time, date, day, temperature, and manages seven independent alarms with customized days and times. It automatically adjusts for leap years and daylight saving time and retains time and settings during power loss. Additionally, it shows over 150 special events with custom messages. The project uses an ATMega328 Boarduino microcontroller, a DS1307 real-time clock with EEPROM for storing alarms, a piezo buzzer alarm, and an LM35 temperature sensor, operated via a pushbutton/quadrature knob for user input.
Parts used in the Arduino Alarm Clock Overkill:
- ATMega328 Boarduino (Arduino clone)
- DS1307 real-time-clock chip
- Piezo buzzer (from Radio Shack)
- 2N3904 NPN transistor
- LM35 temperature-sensitive Zener diode
- Pushbutton/quadrature knob
- 9V power supply
I don’t get up at the same time every day, so I thought it’d be nice to have an alarm clock that would drag me out of bed at different times on different days. That was the initial idea: things got out of hand, of course, and this is the result.
What it does:
1) It displays the time, day, and date. It also keeps track of the year, leap years, and adjusts automatically for daylight savings time.
2) It displays the temperature.
3) It has seven independent alarms, each of which can be set for different days of the week. For example, one alarm can go off at 5am on Tuesday, Wednesday, and Friday while another can go at 6am Monday and Thursday and a third can allow me to sleep until 7 on weekends.
4) In the event of power failure, the clock keeps time anyway. The alarms and display don’t work when the power’s off of course, but when power comes back on the time will be correct and it remembers the alarm settings.
5) It announces special events. Today is New Year’s Day, so the bottom line of the display alternates between day/date (shown above) and the message shown below.
Here’s a cut-down version of the code. I trimmed the getMessage() function in this sample code to just show an example of how the “special events” code works — you’ll have to put in the special events of your own choosing. (Or you can email me and I’ll send the uncut version.)
For more detail: Alarm Clock Overkill Using Arduino