Any “normal” person would look at a project like this and wonder why you would go to such lengths for something seemingly trivial, to which the hacker would simply reply, “because I could.” With that mentality, I give you a physical desk indicator for new Reddit messages.
I scavenged some potential project boxes at a thrift store for under $10 USD and ended up liking the clock best, so I landed on using it for the body. I hollowed the clock body out in order to make room for my parts & took care when removing the glass plate and gold lip.
This was the primary reason for this project, as I’ve recently gotten into microcontrollers and low voltage electronics. I figured you can do almost anything with an Arduino, so long as you can picture it in your head what you want to accomplish. I used an Arduino Uno, three LED lights with inline resistors & a 1/4 watt speaker for sound. I used some sandpaper to rough up the LED surfaces and diffuse the light better inside the envelope. You can find the source code below as well as a pinout diagram.
The computer is really the engine driving this, because without the ability to poll Reddit for new messages, this desk trinket is little better than a paper weight. Using curl and wget I was able to log into Reddit & pull the JSON info from the specified user’s page. This contains their unread messages variable, which was simple enough to sort through using a REGEX command (all hail Perl — king of the pattern match!) If you know even a little Perl you should have no trouble at all understanding this simple scraper. If it finds the right stuff from the JSON data, it sends a specific set of commands via serial to the Arduino, flipping the switch to activate its “melody” and start looping its “glow” function. This will repeat every time the number of unread messages changes (essentially, increments since you have to read all new messages at once.)
I had a lot of fun putting this together. My plans to improve on it are detailed in the video, but essentially I’d like to add an ethernet shield to the Arduino so that it isn’t dependent on being connected to a computer via serial. Perhaps you could put this in your living room next to your photos & run ethernet (PoE hack?!) to it & you can always tell if someone is trying to get your attention on Reddit! Happy hacking!
Files, Source Code, and Notes
This was compiled on the Arduino ALPHA 0023 binaries, so if you have trouble compiling the sketch, try using that version instead. Sorry, I know I should be using up to date software.