April 10, 2022
Sunrise Alarm Clock
A sunrise alarm clock using a Raspberry Pi Pico and a NeoPixel block.
I bought my first Raspberry Pi, a Model B, way back in 2012. I didn't know what I was going to do with it, but for $35, I figured I'd check it out. I learn best by problem-solving, so I needed a project to work through. I had heard about sunrise alarm clocks and really hated my traditional alarm clock, so I decided to build a sunrise alarm clock using the Pi. I ordered a strip of LEDs from Adafruit and, since we were living in Portland at the time, went to Hippo Hardware and Trading Post to find a lamp. Now, I'm not sure if Hippo Hardware is still around, but if you are in the market for an odd drawer pull, or random doorknob, fancy light fixture, or really just about anything that you could attach to or put in your house or business, Hippo Hardware has it. I found an old ceiling lamp that I figured I could use for the sunrise alarm clock and away we went.
Dawn simulation is a technique that involves timing lights, often called wake up lights, sunrise alarm clock or natural light alarm clocks, in the bedroom to come on gradually, over a period of 30 minutes to 2 hours, before awakening to simulate dawn.
I programmed the sunrise alarm clock using Python, which at the time I was fairly new to, but it was pretty straightforward and that lamp gently woke us for years. When we moved back to Colorado, I refactored the lamp, getting rid of the old ceiling fixture and just stringing the LEDs up the corner of our bedroom. I tweaked the code so that it stared lighting at the bottom of the strip and worked its way for a half-assed attempt at simulating a sunrise, and it was okay. Good enough for government work, as they say.
After a few years, I purchased a NeoPixel FeatherWing from Adafruit with the intention of refactoring the sunrise alarm clock... again. I built a housing for the Pi which fit a small Ball jar over the Featherwing. The jar diffuses the light from the NeoPixels and gives it a nice warm glow. This worked great and I would still be using it today if it weren't for my War on Electricity Vampires. I figured that there was no need to have the Pi running 24/7 just to turn on the sunrise alarm clock in the morning.
So, I refactored the code to run on a Raspberry Pi Pico W 2 running MicroPython. The Pico uses considerably
less power than the Pi, and I can put it to sleep when it's not in use. The Pico doesn't have a true
real-time clock, so I use the time module to keep track of time and wake up the Pico at the appropriate
time to start the sun risin'.
If you are still waking up to blaring music or a buzzing alarm clock, give me a ping. I'd be happy to hook you up.
← Back to Projectss