Monday, January 19, 2015

The Alarm Clock is Done (mostly)!!!

Wow, it has been a while since I last posted.... So, last semester was pretty crazy and prevented me from working on any projects, but I had plenty of time over break to make stuff. My main accomplishment was the completion (I will get to why I said "mostly" in a bit) of my alarm clock. Unfortunately, I forgot about pictures until I was done, so this post will be a bit light on the pictures, but at least its something, right?

When I last showed you the alarm clock, I had just gotten it to display the time and hadn't thought of a way to make a menu. However, that was last summer when I did not have the coding skills that I have now (go 15-112!!). With my new-found programming skills, I created a menu system using Model View Controller which made things much simpler.
The RTC ready to be soldered

Once I got the code working, I had to build an Arduino on a breadboard, upload the boot loader, and then upload the sketch. With the help of some well timed resets to the chip, I finally got the code onto a breadboard Arduino.

After that, I started moving the components over to some perfboard to figure out how to lay them out. I then started to solder everything together. This is where I ran into a continuing problem (why it is "mostly" done): the Arduino sometimes spazzes when it is plugged in. If I cycle the power a couple of times it usually works, but this is not ideal. I think it is a bad solder joint, possibly around the crystal, but re-soldering the joints on the crystal didn't help. Here I also ran into a second problem: my nice RGB LCD screen died. While unfortunate, I was lucky in that I had a spare one color LCD that fit as well. The LCD isn't soldered in, so eventually I will replace it with a new RGB one.
The Arduino and LCD prepared

Once everything was soldered, I had to mount it in the enclosure I had picked. This involved a trip to the hardware store to attempt to find thin enough screws that were also long enough. The only ones I could find were brass screws, but I think they made the alarm clock look cooler, so no complaints about that.


The final features are:

  • The RTC and the Arduino's EEPROM allow the alarm clock to be unplugged without loosing any settings, alarms, or time on the clock. Everything is ready to go when you plug it in again.
  • The LCD back light can be adjusted to any color (if I had the RGB LCD). 
  • Using a power switch tail connected to an old audio jack, the clock can control a light to turn on before the alarm goes off.
  • The snooze length is adjustable
  • When the alarm goes off it can be snoozed by clicking the rotary encoder, but to completely turn it off, you must line up the cursor on the LCD with a moving target (to hopefully prevent the alarm from being turned off in a half awake state).
  • Alarms can be set to only go off on certain days.

    The final project