‘Tiny Wake-Up Light Is Hugely Bright

Let’s face it — waking up is rough no matter what time of year it is. But the darkness of fall and winter makes it so much worse. In the past, [Maarten] has used music with increasing volume, but depending on the setup, it can be dodgy if you want to hear a different song each day and don’t have all your files volume-leveled.


Wake Up Bright is the latest in a line of wake-up widgets [Maarten] has made to help rouse them in the morning. Their write-up covers all ideas they’ve had on the subject over the years, as well as the electronics, firmware, debugging, and all the upgrades made after using it for awhile.


Slowly brightening an LED doesn’t have to be difficult or expensive. [Maarten] originally used an Atmel 90S2313 AVR and later upgraded to an ATtiny 2313, which was easy because the two are pin-compatible. The 2313 outputs PWM, which duty-cycles the LED to create a nice fade-in of white light that is way more gentle than that classic 1980s alarm clock buzz-beep.


Over time, this project went from one IKEA enclosure to another. We really like the newer one, which looks like it was designed for people to hack into a wake-up light.


Our eyes perceive brightness increases logarithmically, but PWM is linear. We can get around this by multiplying the PWM value by some factor every so often, but the problem is that this AVR never learned its multiplication tables. So how, then? [Maarten]’s answer is byte shifting using a 16-bit register — one byte for PWM, and the other as a scr ..

Support the originator by clicking the read the rest link below.