Each Christmas, I like to participate in Cheerlights, an Internet of Things system for synchronizing the colors of multicolor Christmas tree lighting. To command the trees of the Cheerlights service, all you have to do is send a tweet with “@Cheerlights” and the name of a color. In the past, I built and modified a tiny desktop tree display. This year, I went all out, not only outfitting my big Christmas tree with color-changing lights, but also building a robot to roam the house and hunt for colors.
I chose the BeagleBone Black as the brains of the robot, because it is able process the camera with OpenCV (computer vision) while reading the analog voltage from the distance sensors and controlling the motors. It runs one Python script to process the video looking for colors, and another to avoid obstacles. When the color-finding script finds a big enough blob of one of the approved colors, the robot stops, records a higher resolution image of the scene, and tweets it along with the name of the color to its CheerBotBBB Twitter account. Every hour, it adds “@Cheerlights” to a tweet so the Cheerlights service picks up the color and commands the participating lighting displays around the world to do the bidding of the CheerBot. Check out the code on GitHub.
Since the CheerBot is such a prolific color-finder, I have it set to send a color to the Cheerlights service no more than once an hour. Colors found before the next “@Cheerlights” tweet is allowed are still tweeted and reflected immediately by the tree in my living room. My tree’s lights are connected to an Arduino that uses an XBee radio to get colors from the Raspberry Pi in my workshop. This could be done by the CheerBot by adding an XBee radio, but I already had the Pi in the workshop set up for Cheerlights. The Pi monitors the CheerBot’s twitter account and also the Cheerlights service and passes colors as they change, so my Christmas tree reflects the most recent color, whether it’s from the CheerBot’s Twitter stream or the Cheerlights service.
Be sure to engage your own maker skills when decorating for the holidays. Learn some new things and make yourself some fun!
See the entire series here.
ADVERTISEMENT