Thursday, June 11, 2015

Sunrise Alarm Clock

THIS CONTENT HAS BEEN MOVED TO GITHUB: https://github.com/sweenig/Sunrise/


I know it's been a while since I've posted anything. Much longer since I've posted anything about the RaspberryPi. However, things worked out today and over the last few weeks that I was able to finish up a couple projects involving different Pi for different purposes. Today's is the Unicorn Sunrise.

I have a RaspberryPi powering my NAS. I should say, a RaspberryPi is my NAS since it's just an RPi with a USB HDD attached and Samba running. My NAS, along with most of my equipment is on a high shelf in my walk in closet, right next to an air conditioning vent. It stays cool and it's out of the way. Since I get up for work very early in the morning, I take on the role of ninja, trying to make my way out of the house without waking anyone up. I often use the light in the closet, but I'd rather not. It's bright and if I forget to close the closet door, it lights up the whole room.

A couple months ago, I bought a Unicorn Hat. They're very fun and I bought it because it was cheap, not because I had anything in mind. I had fun playing with the various demo scripts, then got to thinking about how I could actually use this thing. I thought about building something that could replace the LED based alarm clock for the kids, but the brightness of thing would make it like turning on flood lights in their room. That wouldn't do. That's when I had the idea of simulating a sunrise in my closet for when I'm getting ready for work. I could gradually increase the brightness by turning on one LED at a time. Then I had the idea of actually cycling through each of the colors between 0 and the color I picked for sunrise (Let the sunshine in!). That made for a longer cycle: 8 rows of 8 LEDs, for 100 different brightness percentage levels. That didn't end up being a problem though.

I ended up putting a static bag over the top to tone down the brightness even further. Anyway, after following the normal instructions for installing the Unicorn Hat, I wrote this script and set a cronjob to kick it off at 5am.


I just got it put up there, so we'll see how it goes tomorrow morning. I already had the idea of actually just switching between midnight blue and sunrise. That'll be the next version.

No comments:

Post a Comment