As promised, here is a rundown of how the synchronized LED rings from our Halloween costumes came together. When we initially designed these Roomba costumes, we knew they would look great in daylight but needed some flair to make them more visible after dark. LEDs to the rescue!
As all three costumes had a similar cylindrical shape, we decided to build an ‘LED ring’ that we could then mount to the top of each cylinder. An LED ring would allow for many interesting animations and could light our way in the dark. Here is the original sketchup design:
Of course, one of the first questions with any portable electronics project is battery life vs. weight. With RGB LEDs, current consumption varies widely based on the color displayed. Adafruit has a nice document with some good general rules for estimating LED power consumption. This gave me confidence that 4 x AA could last through ~3 hrs of trick-or-treating, but to be safe I setup a quick battery life test (which confirmed the estimate). I’ll detail this test in another post.
Finally – blinking LEDs is really cool, but we wanted a little more flair. Why not synchronize the animations on the 3 rings wirelessly? We will update the rings every 50 ms, so we would want < 10 ms synchronization, ideally < 2 ms. Many people may not notice, but it’s a fun challenge. With about 3.5 weeks before Halloween, we started hacking.
There are a lot of cheap RF modules and ICs from TI and others that allow for wireless communication. Here is a fun project that uses a TI radio: Wireless Friend Finder . However, with 3 weeks to work we had to keep it simple – so I thought it would be fun to try to communicate & synchronize via Infrared (IR) .
IR LEDs and receivers are cheap, easy to use, and surprisingly effective for communicating at little data over 10-25′ (like your TV remote, or the famous TV-B-Gone), and we could hook them right up to the Arduino UART (handy for synchronization). Of course, like your remote, the IR transmission can easily be blocked by objects between the transmitter and receiver. Given our low data bandwidth requirements, we felt we could adjust our protocol to tolerate lossy communication.
We whipped up a simple IR TX/RX PCB, sent it off to OSHPark, and crossed our fingers. The general idea was to allow the 3 rings to share time and LED animation status via IR communication. The PCB design is shown below, I’ll detail this in a future post.
The next step was gathering the materials to build the ring, here is what we used:
- Ring structure = $5 Metal wreath frame, 24″ diameter (from Joann)
- 1000 4″ zip ties
- 12mm RGB LED Pixel Strand of 25 (from Adafruit)
- 4-pin JST receptacle cable (from Adafruit)
- 2-pin JST In line power wire, male & female (from Adafruit)
- 4x AA Battery Holder (from Adafruit)
- 1N4001 Diode (from Adafruit)
- 6-wire Ribbon Cable (from Sparkfun)
- Pro Micro 5V Arduino compatible ATmega32U4 (from Sparkfun)
- 4 Custom IR TX/RX PCBs (detailed below)
- Various batteries, hot glue, solder, header pins, etc.
- Velcro-attached fabric sheath
Amazingly, the 25 LED strand was the exact length to fit the wreath frame circumference, LEDs even lined up with the cross members of the frame! Pure luck, but it made assembly go quickly – I zip tied the 25 LEDs around the ring, making sure to wrap in the same direction for all three rings, and leaving a space for the Pro Micro at the back.
Once the LEDs were attached, I soldered connector cables to the battery and Pro Micro SPI pins. Pro tip: When soldering headers onto a small PCB, use a foam backing to keep the headers straight without burning your fingers:
If we didn’t care about synchronization, we could attach the Pro Micro and battery pack to the ring and be done. Unfortunately, we had only just begun.
IR PCB Assembly
The IR PCBs arrived from OSHPark on 10/22. With a box full of components from Mouser, we soldered them up in a few hours (4 PCBs/ring = 12 boards to solder), and quickly tested the frequency, IR TX and RX functionality.
Now it was back to the rings – after soldering wires to each IR PCB, I used even more zip ties to attach 4 IR PCBs to each ring (~90 degrees apart). Then can the fun part of soldering these 4 wire-clusters to the Pro Micro headers. It’s not pretty, but it did the job:
I added in a 9V to power the Pro Micro – wired right in to the ‘RAW’ pin (just in case LED current caused the 4AA output to droop) – and the assembly was good to go. Then it was a healthy amount of hot glue and more zip ties to secure everything to the frame.
My wife insisted on sewing black covers for each ring, with holes for the LEDs and IR, and a velcro seam at the back. In the end it looks pretty nice:
Check out the video below for synchronized LED ring action!
This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Terms and conditions beyond the scope of this license may be available at rhb.me.