Instructables

LED Dawn / Sunrise Alarm Clock, Nightlight & Security Light - Arduino Compatible

Featured
Picture of LED Dawn / Sunrise Alarm Clock, Nightlight & Security Light - Arduino Compatible
As the nights gradually lengthened in autumn 2011, I discovered the joys of Arduino and thought that it would be a great way to implement something that I have wanted for a long while - a gentle way to wake up on a winter's morning.  Sadly, it has taken me over a year to find the time and understanding to put it all together, but here, in time for some of the shortest days of this winter, are the results!

The idea is that getting up when it's pitch-black is a wrench.  Equally, having a timed light that just switches on all of a sudden is a shock.  What you want is a gentle ramp of light from imperceptibly dim to ragingly bright and ideally going from a nice gentle red to blazing white so that your brain thinks it's time to start that melatonin level rising.  My solution is a full-function micro-controller, RTC alarm-clock with the following features, among others:

Arduino compatible ATMega328 controlled, open, hackable, reprogrammable.
Battery backed-up RTC
Brightness-controllable red LED display
Cool rotary encoder input
Up to 18W LED dawn light
8-channel PWM light control (2 x 3W RGB + 2 x 6 x 1W white)
Exponential brightness ramp on dawn light
7 independent dawn alarms stored permanently in EEPROM
Alarms setable for any day, for every day, for mon-fri or for sat-sun.
One-press "arm/disarm" with indicator (stored in battery-backed RTC RAM)
Each alarm has optional buzzer
Escalating buzzer tone
Snooze function on buzzer
Controllable "ramp" time (min to max brightness time)
Controllable "hold" time (time at max brightness)
Controllable "buzzer delay" (time between max brightness and buzzer)
Easily controlled "Night Light"
"Security Light" mode (mode stored in RTC battery-backed RAM so safe to blackouts etc).

A dawn clock aims to wake you up gently and you can buy them commercially, but they are expensive, generally just white, not very flexible, and just not much fun!  We'll aim to make a full-feature dawn alarm clock and add a buzzer too, just to be sure we actually get to work on time!  It's also something of a learning exercise for me so it has a whole bunch of different interface and control techniques for me (and perhaps you) to master along the way.  There's about 6 separate projects in here and I'll try to put some example code in so that you can try them separately if you wish.

Although you could do this project perfectly well on a "real" Arduino, and indeed it was prototyped with a "nano" on a breadboard, I'm making the dedicated installation on a minimal Ardu' compatible so that you don't need to commit your "real" Ardu' to the clock.  I have made this project both on bits of perf-board and on a dedicated PCB that I have designed & had fab'd.  We'll look at both ways to do it - the result is much the same but the PCB is much less time consuming.

There are several discrete "sub-projects" that I've called "modules" in this project, any of which could be made and used individually:

The Arduino clone & RTC
The Digital time display
The Rotary encoder & switch controls with de-bounce.
The "Shift PWM" LED driver board
The lamps themselves & a trivial "buzzer" alarm.
Controlling an ATX power supply for efficient powering of the device

I've tried to make this instructable modular so just skip over any modules you can handle yourself already or use just one or two parts for your own project.
 
Remove these adsRemove these ads by Signing Up
cvpages4 months ago

Hi, I woke this morning and had the same idea. I am an Australian Accountant so I searched for the idea on the internet and found you. I have some ideas I want to explore commercially with you. Lets discuss possible business ideas for this project. email me cvpages.buddy@gmail.com

samumar826 months ago

Hey Ugi looks awesome! I'm looking into buying one of those commercial sunrise lamps after failing several time building my own with the arduino (I'm a total noob).

Do you sell the kit or the finished product? :)

Please let me know!

Thanks a lot

Sam

Ugifer (author)  samumar825 months ago

Sorry for slow response Sam

I might have a board or two left but they are buried in my garage while we are having work done on our house. If you are still interested, PM me your address & I'll send you a board when I finally uncover them!

Ugi

emardee6 months ago
Do you still have any of the free pcbs and chips available? I was planning to make pretty much the same thing myself, but then thought, someone else is bound to have alreay already thought of this... and so did a quick search and found this page! Great work on this. It really looks well thought out and created. I'd love to put any spares you have to good use! If they are all already claimed, no problem. Thanks again for a great tutorial.
Ugifer (author)  emardee5 months ago

Thanks for the comment and sorry for the slow response.

I may have a couple of boards left, and in fact I owe a couple of people some, but we have been having work on our house for several months and I can't get at stuff in my garage - it's just buried! If you are still interested, PM me your address and I'll send you one when I uncover my parts!

Ugi

Onay9111 months ago
Fantastic Instructable, I really like the modular design and thorough detail you put into this!

Would you happen to have any "kits" or at least the PCB and a pre-flashed Mega328 for sale? I have been wanting to make a gradual sunrise alarm clock (and, hopefully, accompanying gentle alarm sounds) for some time now, but I haven't had the time to design a well thought out clock like yours. I would love to modify this to maybe include an MP3 trigger (or something similar) that can play some pleasant morning sounds too.
Ugifer (author) 1 year ago
Hi Labrie
If you read the very end of the very last step, there is a special offer - I offered the first two people to ask a free board and set of ICs. You are the second person to ask so I will happily send you a set for free (including pre-flashed '328). You'll have to provide the other components like the 1W LEDs, power supply and standard parts.

I'm just back from vacation today so it will take me a few days to sort myself out but send me a pm and I'll sort something out for you asap.

Maybe you could also let me know in your PM what issue you're having with the code and I'll see if there's been an cut/paste error or something somewhere.

Cheers

Ugi
Labrie1 year ago
HI Ugi
Im having issues verifying the final file in arduino 22. do u have a later version .ino file
Or do you have any boards and programmed atmel chips available for purchase?
could you make another of this without arduino.
i would like to make a nightlight with 25W CFL plus an alarmclock using LDR
Ugifer (author)  darkrayver0141 year ago
This specific project culd not really be done without a microcontroller. However, there are other dawn alarm clock projects that might help you more. Search for sunrise alarm clock in the search box and pick those aspect sfrom each that are most like the project you envisage.

Thanks for reading &commenting.

Ugi
Akkord641 year ago
Good job on documenting this project. I am also making a sunrise clock and it will be my first Arduino project. I selected 50W LED's, and wanted to ask how bright your setup is (9W or 18W depending on yours shipment) on the white led side. Do you wish you had more wattage?
Ugifer (author)  Akkord641 year ago
Thank you for your comment.

I have run this on both 9W and 18W and certainly with 18W it really lights up the room. It's maybe equivalent to having three 50W halogens pointed up at the ceiling so even though it's the other side of our bedroom, the whole room is bright.

My main aim with this was for it not to feel like the middle of the night when you wake and even at 9W that works pretty well. It's perhaps not blazingly bright on 9W but it's enough to make a real difference. You might argue that 9W is not quite enough but for me, 18W is plenty.

With 50W, you are going to have stacks of light. You might want to build yourself a programmable maximum brightness in the firmware, or perhaps ramp it up over slightly longer than I have because I reckon that much light will wake you before it gets to 50% intensity!

Would love to see some pics of your project when you get it finished.

Ugi
hilukasz1 year ago
this is genius. great work.
Ugifer (author)  hilukasz1 year ago
Thank you - it was certainly a considerable learning experience but there are lots of aspects that I have already found useful in other projects.

Ugi
yeah I really want to do it just because of the DIY arduino. looks like fun project.
Ugifer (author)  hilukasz1 year ago
Did you read right to the end? ;-) 
eyesee1 year ago
good
Ugifer (author)  eyesee1 year ago
Thanks