Hacker News new | past | comments | ask | show | jobs | submit login

- LED Light alarm

- Living room music player & "radio" streamer -- I need to set this up as an A2DP audio receiver too

- octoprint server

- Stratum 1 NTP server (GPS referenced)

If I didn't also have a "big" linux system running 24/7, it would be doing things like DHCP, DNS, MQTT server, etc.




I'm interested in learning more about your LED light alarm set up—I had a similar idea a while back but am less familiar with the world of Raspberry Pi.


Thanks for asking! I haven't documented it anywhere, and the source code isn't suitable for consumption by others. But, I can tell you about the basics.

I bought a "12V" LED strip intended for automotive use, and created a simple circuit with a +12V DC supply and an NPN transistor. By hooking the NPN transistor to a PWM output on the Pi's I/O (via a resistor), I can control the LEDs from nearly full darkness to their maximum brightness. Here's a tutorial that covers the same ground: https://dordnung.de/raspberrypi-ledstrip/

There's also a switch for "disable alarm no matter what" and "turn light on/off right now". (I also use it as a nighttime reading lamp, with the added bonus that it starts ramping down the brightness after about 25 minutes and turns off after 30: a good reminder to go the f--- to bed)

This all hooks to some not very interesting software to listen to the buttons, carry out an alarm schedule, ramp the LED intensity up and down, and so forth. In my case, it's written all in Python in a sort of timer-and-event-driven style.

Since this pi has wifi, one part of a traditional alarm clock is missing: it sets the time from NTP and applies the standard DST rules to obey summer time; there are no controls to set the time, and even after a midnight power outage it'll generally alarm at the right time in the morning, as long as power came on at least a few minutes before the appointed minute.

I've had a number of variations on homebrew light alarm over the years, AVRs and arduinos, TRIACs switching standard incandescent lamps, RGB LEDs simulating the sunrise color sequence, etc. It's the sort of project you can always do again and explore more of the problem space and find what works best for you.


I appreciate the writeup! I had originally looked into using the Arduino for this project but the prospect of handling times and daylight savings seemed like more crunch than I wanted to dig into. NTP is a good solution.

Have you found waking up to light a good alternative to standard alarms?




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: