In case it wasn’t clear from my recent cameo on some RadioShack fliers, I’ve been having a bunch of fun with LittleBits‘, more sophisticated modules recently. A few months ago, I posted a project showing how to use the CloudBit to connect your umbrella stand to the internet. This latest project leverages the LittleBits Arduino Bit, a small linux computer (like a BeagleBone, Raspberry Pi, or UDOO), and the Philips Hue Hub to easily control the state, brightness, and color of your Hue lightbulbs via a tactile interface.
Here’s a quick video showing this project in action:
This project is open source hardware and software. Read on to learn how to make it, and to learn more about how it works!
How it works…
The system architecture of the LittleBits Hue Lighting Controller is pretty simple, but I put a lot of thought into making the system robust, fast, and easy-to-setup. I’ve actually been using this controller daily for the last several months, but I completely rewrote most of the code in preparation for sharing it here – most notably, I built an automated setup routine, added serial device auto-connect logic, and made the system more robust against hardware state changes (like suddenly unplugging the controller from the attached linux computer).
Here’s a diagram that explains how the system is setup:
There are really only three components to the system – the control pad, the linux machine, and the Philips Hue network. When you press buttons or turn the dial on the control pad it sends serial commands to a script that’s running on the linux machine. The script interprets the commands and talks to the Hue hub over the local network to instruct it to change the lights. When you’re setting up the system, you’ll use a automatic setup mode that I’ve included in the Python software. The script handles configuring the linux machine to automatically launch the listening service on boot, it creates the secure connection with the Hue hub, and it allows you to select which lights on your Hue network you’d like to control with the control pad. The Python script also automatically identifies the right serial device and will automatically handle reconnecting the serial interface on USB disconnection events. You don’t have to know anything about configuring Linux serial devices to make this software work – it’s all automatic. It will even work on systems that have multiple USB serial devices attached (even multiple Arduino Leonardo boards – the LittleBits module identifies itself as an Arduino Leonardo).
Ready to make one for yourself? You need to gather materials, get everything assembled, wire it all up, and program the Arduino and the Linux machine. The GitHub ReadMe for this project has all the deatiled instructions that you should need. You’ll want to visit the GitHub page directly too, so you can download the source code and 3D designs! The detailed ReadMe instructions are embedded below:
Supporting Code and Designs
The LittleBits Hue Controller is released as entirely open source hardware and software. All materials are distributed under the GNU General Public (Open-Source) License. Please Attribute and Share-Alike. All files are hosted on GitHub.