Skip to main content

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




Comments

  1. Funny, my digikey order for a similar project should get here tomorrow. I'm making an AC dimmer that adapts our reading light into a sunrise alarm. If the project goes well, I will make one that fits in a wall switch box for the overhead light.

    what length of time is the final sequence?

    ReplyDelete
  2. You can set the final sequence time in the code, I picked a minute per LED, so 24 minutes. I figured I'd leave it easily adjustable, so if you look at "alarm_duration" that's the number of minutes it will take. It then does some math to figure out the number of millis between brightness changes. In the video I hardcoded to 1 milli between brightness stage... so 255 millis per led.

    The sequence I used goes something like +UV, +blue, +red, -blue, +yellow, -red, +white. Which gives you a color shift and gradual brightening that seems to work pretty well.

    We've used it most of this week and it seems to at least get you started before the clock radio kicks on ;)

    ReplyDelete
  3. Oh, I'm also writing a little UI app to allow you to plug the USB into a computer and set the time/alarm without having to type in the secret codes ;) I'll attach that when it's done as well.

    ReplyDelete
  4. You guys should get one of these for the final stage of the alarm while they are on sale: http://www.goldmine-elec-products.com/prodinfo.asp?number=G18538

    ReplyDelete
  5. I know this is years later, but I was trying to make this (it seems awesome!) after constructing everything on a breadboard I've run into a bit of a snag. My lights will light up if I use the ShiftPWM examples, and while my clock will keep the time and store an alarm, the alarm itself (lights and stuff) won't go off at the set time.

    My guess is that because you made the code before arduino went all 1.0 and changed some of their libraries, it's having some trouble. If you're still around and could give me some clues on how to update your code to match the new libraries, that would be sweet.

    ReplyDelete

Post a Comment

Popular posts from this blog

A Capacitive-Touch Janko Keyboard: What I Did at the 2017 Georgia Tech Moog Hackathon

Last weekend (February 10-12, 2017) I made a Janko-layout capacitive-touch keyboard for the Moog Werkstatt at the Georgia Tech Moog Hackathon. The day after (Monday the 13th), I made this short video of the keyboard being played: "Capacitive Touch Janko Keyboard for Moog Werkstatt" (Text from the video doobly doo) This is a Janko-layout touch keyboard I made at the 2017 Moog Hackathon at Georgia Tech, February 10-12. I'm playing a few classic bass and melody lines from popular and classic tunes. I only have one octave (13 notes) connected so far. The capacitive touch sensors use MPR121 capacitive-touch chips, on breakout boards from Adafruit (Moog Hackathon sponsor Sparkfun makes a similar board for the same chip). The example code from Adafruit was modified to read four boards (using the Adafruit library and making four sensor objects and initializing each to one of the four I2C addresses is remarkably easy for anyone with moderate familiarity with C++), and

Building an enclosure for the LulzBot AO 100

As the cold weather season arrives in Atlanta, with it comes issues with our 3D printers. Specifically problems with temperatures and print stability. Freeside is essentially a big warehouse, and our 3D printing station is setup in the large open area in the front of the space. What this means is that when it is cold in the space, this will affect the printing quality because the ambient temperature is far lower than what is optimal for thermoplastics. The cold ambient air will cause parts to rapidly cool during the middle of a print. And with materials like ABS which can shrink dramatically during cooling, this causes prints to warp, deform, and delaminate during and after printing is finished. The print on the left is showing signs of delamination from plastic cooling mid print. To remedy this, we built an acrylic enclosure for our LulzBot AO-100, which is our dedicated ABS printer. We tested the proof of concept of whether an enclosure would help mitigate printing problem

Build-Out Recap!

A bunch of great stuff got done at the build-out yesterday. A huge thanks to everyone that came out to pitch in! Here are some pictures to recap the projects... Randy's team hung the curtain to the workshop to create more of a barrier between the front of the house and back of the house and to control dust levels a bit more. We'll be finishing the top of the wall soon, but the hard part's already done. Karen, Donald, Tom, Violet, and James framed the doorway to the Media Lab and Bio Lab and hung the door for that area. Next step is AC! Michelle and Mary's team cleaned out project storage and moved the shelves over so that Neils could put the flammability cabinets in that area. That allowed all of us with the help of Adam and Nathan to clean up the workshop and really tidy up. They also sorted out all of the laser cutter raw materials and cut them down to a usable size on the table saw.  For the portal clouds, JW, Nathan, and Kat rolled an aw