Tuesday, April 29, 2014

Daylight Alarm Clock - Proof of Concept

Have you heard of these daylight alarm clocks?  You set the alarm for your normal wake-up time and a the clock controls an attached light to gradually illuminate the room, reaching its full brightness at the alarm time.  Given that we Hardy's need to wake up early during the week, I've thought about giving the idea try to see if it can make the mornings less difficult.

I've decided to build a bare-bones system that will allow us to determine if there is any use in continuing down this path. If we like it, I expect to include a real-time clock module and a method of setting the time; for now, we're doing none of that.  I'll be using the not-necessarily-accurate internal oscillator on the Arduino to count the number of milliseconds from when the board get's powered up to when I want to light to start to ramp up.

The lamp I'll be using is a 12V LED lamp used in things like track lighting.  Control of the brightness is accomplished using the Arduino's pulse-width modulation for its analogWrite function.  The output from the Arduino pin runs through a 2 kohm resistor and into the base of a MPSA14 transistor. Since this is an NPN transistor, I'll be using low-side switching to pulse the ground leg of the lamp with the high side directly wired to 12V.

Based on my previous experience with LED lighting, I know that the relationship between input signal and output brightness is very non-linear.  Thankfully, somebody had already figured out a good sequence of input values that would a smooth change in brightness.  Take a look for yourself, it seems to work pretty well:




I'm going to move Arduino, lamp, and breadboard to an appropriate place in the bedroom tonight (after programming it so that it "goes off" at the correct time tomorrow morning) and we'll see how we like it. 

No comments:

Post a Comment