Butterfly Pin




This is the baby brother of the Neopixel Butterfly Brooch on hackster.io and thingiverse.

Smaller, cheaper, easier to assemble - better in every way! 

The magic is in the 3D printed case and the right components. And that was a journey. This project started out differently and took some twists and turns. 

Parts
Cost: Less than $20 USD, depending on what tools you have on hand
LilyPad Battery Holder: Sparkfun, $1.95
Slow Fade RGB LED: Adafruit, 10-Pack, $4.95
Magnetic Badge Holders: Amazon, 10-Pack, $7.99

Tools
3D Printer
Soldering Iron
Hot Glue Gun

Effort: Easy!
3D Printing, about 2.5 hours
Assembly: solder two joints, glue insert into case, glue battery holder into cover - about 30-45 minutes

Downloads:
STL files on thingiverse

Story
Originally, I wanted to make an LED "butterfly" bracelet, with either a round case for a main back-lit butterfly image, or individual links that lit up. And not just light up - actually DO something, even if just fading in and out. NeoPixels were my first thought. NeoPixels draw a lot of current, so a coin cell to power it is not a good choice. My naive thought was to have NeoPixels and either an Adafruit Gemma/Trinket with a small LiPo and charger in the case. Um... no. That's a lot of components in a small space, trying to fit 10 lbs in a 5 lbs sack. If I could fit all that into a "wrist wearable" case, the case would be huge - too tall, and too wide. Then, would still have to design a bracelet for it. 

How about individual links that look like butterflies? That would be a design nightmare! I'd have to figure out how to put NeoPixels in each link and route wires around. And, there would still be the problem of power and charging and.... see comments above about "a lot of components". I may yet do something like that... just don't know.

So, what could I do? 

  • Use a round case and make a pin, instead of a bracelet - an object worn on clothing can be a little larger than something on your wrist
  • I could "break the rules" and use a single NeoPixel powered by a coin cell (CR2032) and a dead-bug wired ATTINY85; would probably(?) be OK... -ish [I actually tried this, see photo below]
  • OR... I could KISS and just use an Adafruit Slow-Fade RGB 5MM LED, no MCU required as there would be for a NeoPixel

Prototype: ATTINY85 with single NeoPixel on LilyPad Battery Switch



Ended up with pin and slow-fade RGB LED. This was a good choice because it could run from a CR2032 battery, with an estimated 10 hours (or more) of battery life. The NeoPixel did have a height advantage (shorter/straight-on viewing angle) vs. the slow-fade LED. At 5mm diameter, the LED was wider and taller than I liked and, to keep the height of the case to a minimum, I'd have to mount it on its side on a Lilypad Battery Switch. LEDs have an optimal "angle of view" - I didn't know if turning the LED on its side would diminish its perceived light too much. Doing a prototype convinced me it would work just fine.

I already had a drawing of a butterfly that I could scale to an appropriate size. To diffuse the light properly, print a raised butterfly on White PLA. The design I eventually used has three parts:
  1. A case with a cut-out around the butterfly. That allowed printing of a case in an opaque color to enhance the contrast on the butterfly image
  2. An insert (into the cut-out) on White PLA to host the butterfly
  3. A cover/lid that snaps on to the case, holds the battery switch 
The LED would shine, diffused, through the white PLA into the wings of the butterfly. 

Insert and Case

I painted the outline of the butterfly with black acrylic; didn't even use a brush, just dabbed paint on with a toothpick.

To make it easy to replace the coin cell battery, I  used a snap-on lid/cover that would hold the battery switch. The instructions for how to design Circular Snap-fit Cases are in this video from Noe Ruiz @Adafruit, highly recommended!

Making a mount for the battery holder was more of a challenge than I had counted on - hidden "gotcha's". First, I designed screw mounts on the inside cover to fit through unused holes on the battery holder. Test fit showed the battery holder components blocked the mounts. Next, try screw-through holes on the cover. Nope! Ugly and unstable, because I could only use two of the four holes on the battery holder - the other two were used for their intended purpose, as power connections to the LED.

Finally, I decide on curved arcs as mount points that I could glue the battery holder onto. There was a little "surprise" when I tried those out. The Lilypad battery holders had tiny tabs on two sides, relics of the manufacturing process. I had to design-in minuscule recesses to allow for the tabs, about 7mm W x 1mm H.  

Detail of Battery Holder - Tab Shown

Lesson learned (I hope!): Clearances, clearances, clearances!

To attach the pin to clothing, I added small, round magnets to the cover. These are in two parts, 1) goes on the object to be worn, fixed with foam tape; and 2) the magnets themselves. I cobbled up a holder for the magnets (two required for stability) and 3D printed it. Makes it quick and easy to attach. 


Battery Holder glued to cover

Assembly
  • Print the 3D parts. If you want an overall "glow" effect on the case AND the insert, print both pieces in white PLA. For more contrast, print the insert in white and the case in a dark color. Just the butterfly will light up. 
  • Solder the LED flat against the battery holder on the side that says "Lilypad" in script - just two solder points, + for long LED leg, - for the short one. Bend/shape the LED so it covers all but the "L" in Lilypad - this positions the LED for best back-lighting on the butterfly. Test to make sure it works.
  • Insert the battery holder into the mounts, aligning the tabs on the holder with the small mount recesses. These tabs aren't snap-fits, they just sort of "rest" in the cut-outs. If you press down too hard, the holder will slip down past the mounts! 
  • Align the battery holder: make sure the tiny switch on the holder is aligned through the hole on the top of the cover.
  • With hot glue, glue the battery holder to the mounts. Don't add too much glue, or that will increase the height of the cover and it the cover won't fit correctly
  • Position the butterfly in the case cut-out. It's not a snap-fit, just loosely aligned with some edges showing. Glue the insert into the inside of the case with hot glue. 
  • Align the tabs on the top of the case with the recesses in the cover and slowly press down until the cover snaps into place.
  • Attach magnets/receiver to the cover and hot glue magnets into the 3D printed holder. The holder will take a 12mm neodymium magnet, if you don't use the magnets I did.
Done! You'll need a small pointed object, like a toothpick or pointed tweezers, to flip the switch on and off. An unfolded paper clip works great.

Comments

Popular Posts