Proximity Glasses
For a long time I’d wanted to make an interactive LED accessory — something that didn’t just glow, but reacted. Halloween is the perfect excuse. My initial concept seemed straightforward and easy. Actual implementation was not.
The Goal
Build a few Halloween accessories that use LEDs with a real sense of interactivity. Specifically: use proximity to ramp up the activity — change the color, change the mode — on a set of LED armband “bumpers” and a pair of glasses. Or both, worn at once, because why not.
The Challenges
Frame & Skeleton
Every piece needed something to live on. For the arm bumpers, that meant a custom 3D-printed holder with slots in the back to thread through 1″ stretchy velcro — a little design work, but it came out very clean. (Sorry, no picture of those at the moment.) For the glasses, I didn’t want the frame fighting the lights for attention, so I went with a simple clear pair — which I happened to already own in the form of safety glasses.
LEDs
Easy call: the tried-and-true Adafruit NeoPixel rings. Big enough to ring my eyes, and they don’t break the bank. Being able to dial the brightness down in code turned out to be essential on Halloween night — both to avoid blinding everyone I talked to, and to keep power draw as low as possible.
Power
One of the more critical design criteria, but a pretty straightforward one. I wanted the rig to last the night — call it 2-3 hours — on at most one battery change. Since I already had them, the answer was RC car LiPo batteries (5000mAh class) feeding a 3-to-1 Deans splitter. The Deans isn’t my favorite RC connector, but it’s impossible to mis-orient, which makes for much easier plugging in the dark. An inline on/off switch and a push-button brightness control rounded it out.
Brains & Code
Another easy choice — I keep a healthy stock of Arduino Nano boards, recycled from old projects. Drivers are readily available for just about everything (NeoPixels included), and I already had libraries ready to go for the various modes.
The wiring is about as simple as it sounds. For the record:
- Red — 5V
- Black — ground
- Blue — NeoPixel rings (D5 / D6)
- Yellow — proximity trigger (D7)
- Green — I2C clock, SCL (A5)
- White — I2C data, SDA (A4)
The one real challenge was that this wanted a state machine. It wasn’t enough to just get faster as something approached — I also wanted a “searching” mode when nothing was detected, and I wanted the colors to cycle at a higher frequency the closer an object got. On top of that, the rangefinder itself needed its settings adjusted as objects moved through different distance bands, both for accuracy and for power. Managing all of those interdependent variables meant wrapping the whole thing in a proper state machine.
For what it’s worth, I haven’t published this code in a public repo yet — it still needs some cleanup. Maybe one day I’ll open it up and drop the link right here.
The Rangefinder
This is where the real development effort went. I wanted something small that could measure from a few centimeters out to a couple of meters — you know, the typical interaction range for human beings. I started with the standard Sharp IR rangefinders and found them completely unreliable outdoors and under changing light. A little more digging turned up the ST Microelectronics VL53L1X time-of-flight sensor, and I was hooked.
It checked every box:
- Tiny — barely bigger than a pencil eraser
- Fires a 940nm laser (yes, I’m shooting lasers at my friends — Class 1 and invisible, but still)
- Range from a few cm out to 400cm
- Measurement rate of 50Hz, more than fast enough
- Sips power, and you can cut that further with settings and polling rate
- Decent software and code examples to start from
It was the ideal sensor. A bit more searching turned up several breakout boards, and I settled on the one from DFRobot (SEN0245) — easy to mount and connect. If you want the full gory detail, here’s the datasheet:
The Result
I ended up building several of the bumpers (they were a blast) and one pair of glasses.
On Halloween night I loaded the batteries into a hip bag (fine, a fanny pack) and ran the wires up under my black turtleneck — and behind my ears for the glasses. Inline switch for power, a button to set the brightness, and all that battery budgeting paid off: it lasted the whole night.
The main problem? I never could come up with a good answer to the one question everyone asked: “Who — or what — are you?”