What is Freeside?

Freeside is a Georgia nonprofit corporation, organized to develop a community of coders, makers, artists, and researchers in order to promote collaboration and community outreach. Learn more »
Showing posts with label clock. Show all posts
Showing posts with label clock. Show all posts

Sunrise Alarm Clock

Now that winter is coming to the northern hemisphere, getting up for work means getting out of bed before the sun comes up. In order to help the natural waking mechanism of light, I've decided to hack together a sunrise alarm clock on a shoestring budget.

Part List:

  1. Arduino
  2. Real Time Clock Module (http://www.sparkfun.com/products/99)
  3. 24xAssorted LEDs (In my case: 3UV, 2 Blue, 4 Red, 3 Yellow, 12 White)
  4. 24xResistors, 220ohm
  5. Solderless Breadboard
  6. Assorted wires
  7. 3x74HC595 shift registers
  8. A Shadow Display Box
  9. Frosting Spray

To put this thing together I used Elco's ShiftPWM Library to control the 24 LEDs. You could go bigger, but I wanted this to all fit into the box.

Personally, I had some PCBs from a previous project that I could fashion to make the LEDs easier to mount.

Everything is hooked up like in the schematic:

The "To SCL" and "To SDA" lines go to the Real Time Clock Module.

The parts are all mounted to the backing board of the shadow display box like so:



Load the program below in and you can set the time on the clock with the following command in serial monitor:

T(00-59)(00-59)(00-23)(1-7)(01-31)(01-12)(00-99)

T(sec)(min)(hour)(dayOfWeek)(dayOfMonth)(month)(year)

You can then set the alarm with a command:

A(00-59)(00-23)(0-1)(0-1)(0-1)(0-1)(0-1)(0-1)(0-1)

A(min)(hour)(sun)(mon)(tue)(wed)(the)(fri)(sat)

The alarm will attempt to be done with the cycle at the appropriate time set, so it will start with the UV LEDs and move through the progression fading the LEDs in and out as indicated in the arrays at the top of the program.

Frost both sides of the glass for good distribution of light, then cut away the side of the box so that you can power the Arduino with it mounted inside the box.

This is a very sped up version of the alarm sequence looks like this... the lights at the beginning are part of the power up sequence of the Arduino.


Arduino Code... fast and dirty, I'm going to clean it up so that it works with alarm times at the borders of the day eventually...

Thanks to Freeside for a access to some of the parts and some soldering space and time.
Thanks to John Vaughters for the Clock Tutorial
Thanks to Elco for the ShiftPWM library