0

Magic Staff Project Using Trinket M0
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Magic Staff Project Using Trinket M0

by autonym on Sun Nov 18, 2018 4:08 am

Hey folks,

You may have seen some of my question posts in the last month or so as I worked though a special project I was trying (and did!) complete on time for Halloween.

You see... my girlfriend made me this awesome terry cloth cloak, and it just begged to be worn during Halloween. So I had to go as a mage. And no self-respecting mage would be seen in public without their magic staff.

So I needed a magic staff, pronto.

My Project-Specific AdaFruit parts:

Adafruit Trinket M0 - for use with CircuitPython & Arduino IDE
NeoPixel Stick - 8 x 5050 RGBW LEDs - Warm White - ~3000K
NeoPixel Jewel - 7 x 5050 RGBW LED w/ Integrated Drivers - Warm White - ~3000K
FLORA Accelerometer/Compass Sensor - LSM303 - v1.0
(NOTE: I should have gotten the Adafruit Triple-Axis Accelerometer - ±2/4/8g @ 14-bit - MMA845 instead!)
JST-PH 2-Pin SMT Right Angle Connector
JST 2-pin Extension Cable with On/Off Switch - JST PH2
Lithium Ion Cylindrical Battery - 3.7v 2200mAh

My AdaFruit Support parts:

Bakelite Universal Perfboard Plates - Pack of 10
Hook-up Wire Spool Set - 22AWG Solid Core - 6 x 25 ft
Heat Shrink Pack
Break-away 0.1" 36-pin strip right-angle male header (10 pack)
Adafruit Mini Lipo w/Mini-B USB Jack - USB LiIon/LiPoly charger - v1 (to charge the battery, as the Trinket wouldn't)

My Other parts:

Selenite Crystal "Tower" (4") (Note: I failed to follow the "cleansing protocol" when I received my crystal, but it turned out okay - YMMV)
10' of 1" PVC pipe (recommend Schedule 40, I did not use that, and it's a wobbly mess)
Various PVC pipe fittings (step-up union, large union, end cap, threaded pair)
PVC glue
Pool noodle (or similar hot water insulation foam tube)
64-strand Fiber Optic cable ($1.45/foot!)
Wood putty
Spray paint (one brown for wood, one gold for the fitting)
Gorilla Glue

Tools:

Dremel
Soldering Iron station
Flux
Desoldering tool (don't ask)
Hot glue gun
Hot air gun (~$15 from Harbor Freight)
Sanding Block
Woodworking files
Wire cutters
Pliers
Box Knife

Simple beginnings:

Image

I wasn't very organized, and this being my first CircuitPython project (and first Arduino project in a long time), several other things were purchased, but did not add materially to the end product. If you have a good set-up already going, this should be an easy project to bounce out.

The PVC pipe is used for the body, the fittings for putting things together and making the holder for the crystal, the pool noodle was for a wood-like texture, the NeoPixel Jewel was to light up the crystal, while the NeoPixel Stick was to light up special effects around the crystal, all powered by a Trinket M0 with a FLORA motion sensor.

I used the PVC fittings and the wood putty to make a crystal holder for the Selenite crystal tower, and then did some filing to get it to fit in the socket.

Image
Image
Image

I used a dremel and some of the Bakelite with the right-angle header pins to make a harness for the light pipes (later the fiber optics, as I broke the light pipes through overheating with the heat gun).

Image
Image
Image
Image

I then hot-glued the light pipes (and later the fiber optics) to the harness. I globbed hot glue right onto the NeoPixel itself.

Light Pipes:

Image

Later, with the Fiber Optics:

Image

I had to strip the cladding from the fiber optic cable, as I wanted to make 3 groups of cables from each of the 8 lights, one group for each of the three 'claws' of foam I'd be putting up around the crystal. That was a pain.

Image
Image

The fiber optics took up all the space in the head piece - space I'd hoped I'd be using for the microcontroller as well. That ended up being shoved down into the handle a bit. You can see the DotStar light glowing through in the videos below that show off the animation sequences.

Image

Here's the Trinket M0 + LSM303 CPU/Sensor Pack I made to go down the handle:

Image

Meanwhile, I need to work up the top part of the staff, and cut a hole to hide the JST PH2 toggle switch I'm going to use for the battery on/off switch to the rest of the controller. I've also soldered the JST PH2 connector to the bottom of the Trinket.

Image
Image

The pipe was dremeled out to make a hole for the switch that was snug-tight, and then hot-glued into place. It was later covered in a pool noodle so you can't see it, but feel it through the foam.

I used Gorilla Glue to glue the pool noodle around the PVC pipe, as well as to close the gap made in it when I was putting the noodle on over the pipe. Once it had dried/hardened, I used a box knife with a variable-depth blade and set the depth so that I would not cut all the way through the outer foam. I then made long slashes in the pool noodle, up and down the staff. I then went at it with the hot air gun, melting the foam and shriveling it down. It would spread away from the slashes, and make it look like bark. I learned these techniques from Oak Lane Cemetery's YouTube channel. After melting it, I spray-painted it brown with some good Krylon paint specifically designed to stick to plastics.

Image
Image
Image

I think it kind of looked like a baguette before painting. ;)

Similar treatment for the top part of the staff. Kitty helped with the slashes...

Image
Image
Image

Then paint:

Image
Image

Finally, I had to put the crystal on and start threading the fiber optics. Originally, I was going to have just a single light pipe from each of the 8 lights on the NeoPixel Stick go up the three sides of the claw around the crystal, but with those broken, the fibers would have to do.

Image

I was having a devil of a time getting the fibers to go the way I wanted, and spent countless wasted hours fighting before trying a different technique. At 11:30 on Halloween Eve (sadly, few pictures were taken of the night's progress), I ended up simply using a leather punch to poke the bundles through the foam at intervals up the claws. The resulting "Hairbrush" look really wasn't what I was going for, but it was there, and it was done.

The staff has three modes - White, Fire, and Magenta. The modes are changed with a touch sensor I have built into the headpiece using a metal scale. The "idle" animations are different for each one. It uses the FLORA motion sensor to detect impact in any direction, which activates a second "attack" animation. The attack animation is the same for each, but a different color. I wanted to also make a "drowsing" mode where I would have it detect when you were holding the staff horizontal, and get brighter as your "aligned with the mystical ley lines" by using the tilt sensor and the magnetic sensor to pick a heading. Sadly... I ran out of RAM and was randomly failing malloc, so I had to cut back to make it stable.

The White mode uses the W channel and then pulses green, with a "fairy" light picked at random (one of the 8) to do a fade in/fade out glow animation. The impact is a classic "You Shall Not Pass!" sort of thing where it's a white pulse and race-lights up the fiber optics.

Image

Fire mode was going to be more interesting that it became, but I kept it anyway. It uses a random red/orange flicker method I came up with to look like a burning ember, and the fibers race up the sides like embers on the wind. The impact event is trying to look like shooting a fireball.

Image

The final mode was Magenta/Rainbow mode. Where I work, Magenta is our company color, so no office Halloween party would be complete without it. The rainbow mode looked so pretty, I didn't mind leaving it on. It does a RGB cycle along the fibers, and looks even better in person than on the video. The impact event just throws a Magenta trace.

Image

I've learned a lot doing this, and already have ideas for Staff V2, as well as other prop ideas. As i need more RAM, I'll probably use a Adafruit ItsyBitsy M4 Express featuring ATSAMD51 next time as my primary controller, and also might have to add sound with the Adafruit Audio FX Sound Board - WAV/OGG Trigger with 16MB Flash.

I have the code available if anyone wants to take a look.

Image

My Flickr Album
Last edited by autonym on Sun Nov 18, 2018 3:53 pm, edited 2 times in total.

autonym
 
Posts: 24
Joined: Thu Oct 31, 2013 12:42 pm

Re: Magic Staff Project Using Trinket M0

by autonym on Sun Nov 18, 2018 4:23 am

Fixed Images, but need to add the video links. Any good Animated Gif hosting?

autonym
 
Posts: 24
Joined: Thu Oct 31, 2013 12:42 pm

Re: Magic Staff Project Using Trinket M0

by slight on Mon Nov 19, 2018 11:16 am

nice result and great writeup!
and the trick with the heatgun and the foam is really cool!!
thanks for sharing!

slight
 
Posts: 29
Joined: Wed Sep 12, 2012 2:23 am

Re: Magic Staff Project Using Trinket M0

by jerryocrow on Thu Feb 21, 2019 10:15 pm

May your strength and virtue continue to be lit by your staff as you walk through life with courage, power, and virtue.

jerryocrow
 
Posts: 1
Joined: Thu Feb 21, 2019 10:07 pm

Please be positive and constructive with your questions and comments.