« Back to “Projects”

LED wakeup light

Winter is coming again, and it tends to ruin my sleeping habits. I have previously used a store-bought wakeup light, but it has a bunch of problems, such as annoying alarm sound that cannot be turned off. For the new apartment, I made a much better wakeup light by changing the controller on some cheap RGB led strips bought from eBay.


The original controller board had some pretty weird features. For example, it remembered the brightness for each color separately, so that if you changed the color, the brightness also changed. It did however have a nice small plastic box and a fine remote controller, so I just made a new PCB that fit in the same box. I was able to reuse the connectors and IR receiver for the build.

The most important function for me was a nice, smooth light sequence in the morning. Of secondary importance is the ability to easily key in the alarm time with the remote controller, and to have different times for weekdays and weekends.

Because the human vision is logarithmic, the steps at low brightnesses have to be very small in order to appear smooth. Even steps of 1:4096 PWM duty were noticeable, so I went for 1:65536 ratio. However, at higher brightnesses, the flicker of low PWM frequency gets annoying so the code automatically increases the frequency from 500 Hz up to 30 kHz as the brightness increases. By using gamma correction, the fade speed is uniform when changing between colors.


Another very typical microcontroller circuit: processor, crystal, FETs for the leds, USB connector for testing, IR receiver for the remote.


The PCB had to fit in the same space as the original, so I decided to omit any extraneous features, like debug USART. Fortunately I didn't have any need for them either.



Here is a video of the simulated sunrise color sequence. The length of the sequence is adjustable, I usually have it set to 30 minutes or 1 hour.

If your browser does not support WebM for video, you can either watch on YouTube or download the video.

The source code and PCB layout files are available here.

– Petteri Aimonen on 2.10.2013

Comment on this page (2 comments so far)