Digital Sparkle Collar
2025-Apr-02, Wednesday 01:00 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
History
You may have seen me post this photo to twitter (rip) on New Year's Eve 2020. And you, figment of my imagination, may have thought, oh, there's the Colour Stealing Underskirt, the Colour Stealing+ Cyberpunk Headpiece, and the NeoPixel Flexible Grid. And I spy the (not even blogged yet) LilyPad and Protoboard Wrist Mounted Controller. But pray-tell, what is that around your neck?
That, my very favourite figment, is the collar we're going to talk about today. Kind of. See, in that photo all five items were wired up in one long circuit. The rainbow pattern would change, starting from my skirt, and change all the way up to my head. All hard-wired. No bluetooth. But I noticed that I couldn't get white on my grid. It's a power distribution problem. I know I have to deliver more power, but I don't control which technical problem my brain gets stuck into, so that mega-project has sat packed away until that blessed day arrives. In the meantime, all the pieces can be used separately. Except the collar. It doesn't have its own controller. Today we fix that.
Me, during a very locked down New Years Eve
Photo by chebe
Collar
The collar is a plain 3/4" (<2cm) wide black leather collar (rip x-tra-x.de), with a strip of 39 Digital Sparkle Swarovski crystal neopixels from Effulgent, glued on with E6000. Yes. That's neopixel-compatibles, with crystals stuck on top.
(This was my first exposure to E6000. It does stick things, and it is flexible, vital for this project, but it's quite unstable. Especially anywhere near a window. Every so often I have to wipe off liquid goo as it degrades. I hope there are better options out there.)
Luckily, I planned the mega-project to be entirely modular. I had soldered headers on to the strip ends; sockets on the Data-In side, and pins on the Data-Out side. To support the joints I added a bit of Sugru behind each. I simply removed the circuit boards that attached to each end, for a fresh start to a new project. So, what's the plan?
Basic collar with bejewelled NeoPixels
Photo by chebe
Power, Data, Ground, In side
Photo by chebe
Power, Data, Ground, Out side
Photo by chebe
Circuit
I'm going as simple as can be. A Gemma M0, and a 100mAh lipo battery. Connected to the collar. GND -> GND. Vout -> Power-In. A0 -> Data-In. But there's no room on the collar for a microcontroller.
Gemma + NeoPixel Circuit
Made with Fritzing
Attachment
How am I going to create a connection point for the microcontroller, but keep the whole thing modular and re-usable? With a trip to the local haberdashery. (Or sewing notions section of any suitable shop.) Pick up some 10mm metal snap fasteners. Test them to make sure they conduct electricity, clear coatings can really mess this up. Also grab some ~15mm wide ribbon while you're there. (And make sure this doesn't conduct electricity.)
First, cut two pin, and one socket, jumper wires short, and solder them to one half of the snap sets. Cut two lengths of ribbon, and hand sew the soldered snaps to them. Then hand sew the ribbons around the collar, near the strip ends. On one side I have snaps for Power and Data-In. On the other side I have snaps for Ground, and an unconnected fourth. (This is here to provide visual balance later on. But also can become a Data-Out attachment point if needed.) Plug the pins and socket jumper ends in to the NeoPixel strip as appropriate.
Snaps attached to in side
Photo by chebe
Snaps attached to out side
Photo by chebe
Putting it all together
I know I said in my last post that I don't use the new Gemmas often, but I am using one here. So let's print the Gemma M0 Case as provided.
(Remember, even though the case provides access to the USB port, the Gemma does not have on-board li-po charging. We still need to take this apart when the battery runs down.)
Using 26AWG silicone covered wire, solder one end of each wire to the necessary pins on the Gemma; GND, Vout, and A0. Feed all four wires (including the unconnected one) through some clear/transparent heat shrink tubing. Don't shrink it just yet. My wires are about 22cm long, but this is up to personal preference. Try on the collar with the loose wires, and try to figure out how long you want them. Solder the free ends of the wires to the matching snap sets. (Figure out which snap is which pin by pulling the wire and seeing what moves on the Gemma end.)
Plug in the lipo battery, place the Gemma in the case, and use a 6mm long M2.5 screw through A2 pin to secure it to the case. Have all the wires go through the hole in the case at the top. Now try it on, and figure out where you want the heat shrink to hug the wires. Take it off, and shrink that tubing.
Gemma M0 with wires soldered, in case base
Photo by chebe
Heat shrink controlling shape of the wires
Photo by chebe
Finishing touches
With the Gemma wires snapped in place, we want to add support to the connections. We also want to prevent shorts, as much as possible. First, cut a small piece of foam, and push the two free pins (Data-Out and Power) into it. This isolates them from the metal snaps.
Then hand sew more ribbon, snuggly, over the closed snap connections, which will take some of the strain. But also help isolate the metal collar buckle from the snaps.
In side of strip
Photo by chebe
Out side of strip
Photo by chebe
The back of the collar
Photo by chebe
Coding
With apologies to Adafruit, I'm sticking with Arduino over CircuitPython here. When I was making up my Gemma Jewel necklace I came across the FastLED library, as used in the Neopixel Cosmic Turtle Necklace tutorial, and have been using it ever since for a nice sparkle effect.
Starting with that code sample, and adapting the sketch for the M0, there is another complication. The M0 has a DotStar RGB LED on-board. This is not a NeoPixel. But I want it to work in tandem with the NeoPixels. Learning how to do this from the Examples in FastLED > Multiple > MultipleStripsInOneArray, the necessary changes are all in the setup.
#include "FastLED.h"
#define DOTSTAR_DATA_PIN 3
#define DOTSTAR_CLK_PIN 4
#define DOTSTAR_NUM_LEDS 1 // number of on-board dotstars
#define DOTSTAR_COLOR_ORDER BGR
#define LED_PIN 1
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
#define NUM_LEDS 39 // number of rhinestone collar neopixels
...
// add onboard dotstar into the array, array length 40, [0-39]
CRGB leds[NUM_LEDS + DOTSTAR_NUM_LEDS];
...
void setup() {
// dotstar, [0]
FastLED.addLeds<APA102, DOTSTAR_DATA_PIN, DOTSTAR_CLK_PIN, DOTSTAR_COLOR_ORDER, DATA_RATE_MHZ(1)>
(leds, 0, DOTSTAR_NUM_LEDS);
// neopixels, [1-39]
FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>
(leds, DOTSTAR_NUM_LEDS, NUM_LEDS).setCorrection(TypicalLEDStrip);
...
// turn off dotstar
leds[0] = CRGB::Black;
FastLED.show();
}
Warning: Do not mess with
STARTING_BRIGHTNESS
. Lowering it may make your pixels get stuck, i.e. seem to stop updating. And you could spend hours debugging your hardware, when it's actually a software issue.Upload and test. (The DotStar seems dimmer than the other LEDs, and I'm not sure why.)
Testing
Digital Sparkle Collar in action
Photo by chebe
Umm. One final thing. Towards the effort of trying to prevent shorts, I tried a lot of different case modifications. In the end I took the M0 case model, edited it to remove the holes in the lid, and all but one hole in the base. And I scaled it up to 42mm x 42mm x 17mm. This way I can put the original case inside this more closed version, for added safety when out dancing. With bonus extra diffusion. While still keeping the board and battery neatly together when accessing the on-board on/off switch. Next step is wear testing. I'll let you know how it goes, impressively persistent figment.
Digital Sparkle Collar, with more robust case situation
Photo by chebe