Maker.io main logo

Sword & Wand Prop Effects with Circuit Playground

2016-12-16 | By Adafruit Industries

License: See Original Project

Courtesy of Adafruit

Guide by John Park

Overview

Sword & Wand Prop Effects with Circuit Playground

Want to upgrade your prop sword/battle axe/light saber/magic wand with motion reactive light animation and sound effects? You can do just that with this simple project! All you'll need is a Circuit Playground, a battery pack, and zip ties to attach it all to any prop or toy.

 

 

Sword & Wand Prop Effects with Circuit Playground

Sword and Wand Prop Effects with Circuit Playground

Or, you can go a bit further and fabricate your own wand with embedded Circuit Playground from scratch using a 3D printer. This more advanced build will require a LiPoly battery and JST switch cable, plus a LiPoly charger, and the use of a 3D printer.

Sword & Wand Prop Effects with Circuit Playground

Prep the Circuit Playground

Using the Circuit Playground to make lights and sounds when shaken is pretty straightforward. If this is your first Circuit Playground project, you'll first need to make sure you've installed the Arduino IDE, added the Circuit Playground library to the Arduino software, and and been through the basic tutorials on its use. This excellent guide, Introducing Circuit Playground and Circuit Playground lesson #0 will show you how to do all of that and get you going.

Sword & Wand Prop Effects with Circuit Playground

Plug your Circuit Playground into your computer now, and launch the Arduino IDE. Double check that you've selected the board and port as in the Lesson #0 tutorial and are ready to upload code.

The Arduino sketch Circuit Playground Make Believe sketch does the following:

  • Plays one light pattern and sound file while the Circuit Playground (and the prop weapon to which it has been affixed) is idle
  • Plays a second light pattern and sounds file when swung
  • Plays a third light pattern and sound file when tapped

Download the file below, then unzip it and place it in your Arduino sketch directory.

CircuitPlaygroundMakeBelieve.zip

Open the CircuitPlaygroundMakeBelieve sketch in Arduino, you'll notice that there are also three other tabs that open -- knight.h, laser.h, and wand.h. These are three different theme sets, which are combinations of light animations and sound files that are triggered at different motion thresholds on the Circuit Playground's accelerometer.

Upload the sketch to your Circuit Playground and then try it out. The NeoPixels will play their idle animation and you'll hear the idle sound coming from the piezo speaker.

Swing the Circuit Playground around a bit to trigger the swing animation and sounds. This works because the code is checking the built-in accelerometer for sudden changes above a certain threshold. When the change is great enough, the swing is triggered.

The code also checks for even larger changes in acceleration, which indicates that there has been a tap on the Circuit Playground, or that your prop foam sword has hit its target! In this case, it will play the tap animation and sound.

The sketch uses pre-made theme sets of effects for use with different props. You can try them out to see which one works best for you.

If you look at the top of the Arduino sketch you'll see the theme choices. By uncommenting one (and commenting out the other -- there can only be one uncommented at a time) that theme set of lights and sounds will be used the next time you upload the sketch to your Circuit Playground.

For example:

Copy Code
// Enable ONE of these lines to select a theme:
//#include "knight.h" // Swoosh & clank metal sword
#include "laser.h" // MWAAAW! "laser" sword
//#include "wand.h" // Magic wand

will use the laser.h theme set. To switch to the wand.h theme set, do this:

Copy Code
// Enable ONE of these lines to select a theme:
//#include "knight.h" // Swoosh & clank metal sword
//#include "laser.h" // MWAAAW! "laser" sword
#include "wand.h" // Magic wand

Upgrade a Prop Sword

Sword & Wand Prop Effects with Circuit Playground

Here we have a very nice, off the shelf foam sword. It sure looks like it could use some light and sound effects!

Sword & Wand Prop Effects with Circuit Playground

There's a flat part on the sword guard that looks perfect for attaching the Circuit Playground.

Once you've uploaded your code to the Circuit Playground, it's time to connect it to the AAA battery pack and attach it all to your prop weapon.

Sword & Wand Prop Effects with Circuit Playground

Depending on your prop, you can choose different methods to attach it. Small zip ties are great because the are sturdy, fit through the holes on the Circuit Playground, and can be customized to different lengths by adding one zip tie to the end of another.

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

Here, you can see the Circuit Playground zip tied to a foam sword.

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

After pulling the zip ties tight, use diagonal cutters or scissors to clip the exess length from the ends.

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

Next, feed the battery cable under the backside of the Circuit Playground, under the zip ties, then plug it in.

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

The battery pack fits nicely on the backside of the sword guard, also using zip ties. Create a zip tie harness for the battery pack by threading two through the back of the existing ones, double them with two more zip ties, then secure the battery pack. You can create an additional point of security with a set of three zip ties running around the battery pack horizontally.

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

Tighten the zip ties and clip the excess ends.

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

Swing it to try it out!

Next, we'll look at a more customized approch to building a prop magic wand from scratch to fit the Circuit Playground.

3D Printed Magic Wand

Sword & Wand Prop Effects with Circuit Playground

This magic wand was designed specially to use the Circuit Playground as its centerpiece effect. It is 3D printed with a mix of translucent and opaque materials, has a mounting plate onto which you can secure the Circuit Playground, as well as an integrated LiPoly battery and on/off switch.

Sword & Wand Prop Effects with Circuit Playground

In addition to the Circuit Playground, LiPoly battery, and switch, you'll also need four M3 x 6mm screws and nuts, two M3 x 16mm screws and nuts, and four M2 x 6mm screws and nuts.

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

Here are the files you'll use to print it.

starWand_stl.zip

Print the star parts in a translucent material, such as a natural PLA. The rest of the parts can be printed in any material you choose, and even painted for a more finished look.

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

Next you'll assemble the wand. Make sure you've uploaded the Make Believe sketch to the Circuit Playground, then mount it to the mount plate using 2.5mm screws and nuts.

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

Next, place the switch into the handle cutout, feeding the plug ends through their respective holes for the battery and the Circuit Playground board. Plug the battery into the switch and the switch into the Circuit Playground's JST connector. Test the switch to make sure the Circuit Playground turns on.

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

Place the battery in its place inside the lower handle bottom, then fasten the bottom with an M3 x 16mm screw and nut.

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

Note how the lower switch wire and battery wire are tucked into the handle with the connectors accessible through the handle opening. This is so you can pull them out and dissconnect them for battery charging without unscrewing the wand.

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

Sandwich the Circuit Playground and mount between the two star halves, feeding the switch wire through the wire channel at the base of the star top half.

Sword & Wand Prop Effects with Circuit Playground

Sword & Wand Prop Effects with Circuit Playground

Begin the assembly in this order:

  • Top half of handle
  • Trim piece
  • Star top
  • Circuit Playground and mount
  • Star bottom
  • Bottom half of handle

Sword & Wand Prop Effects with Circuit Playground

Screw the handle top parts together with the other M3 x 16mm screw, placing the nut on the opposite side.

Add the remaining trim pieces on the top and bottom of the stars and screw them together with M2 x 8mm screws and nuts.

Sword & Wand Prop Effects with Circuit Playground

Now, you can turn on the wand and wave and flick it to maximum magical effect. Should the battery ever require charging, you can pull the charging plug through the port in the handle and plug it into a LiPoly USB charger.

Sword & Wand Prop Effects with Circuit Playground

Remember, this guide is just a leaping off point for using the Circuit Playground to add motion triggered effects to any prop you like!

制造商零件编号 3000
CIRC PLAYGROUND CLASS ATMEGA32U4
Adafruit Industries LLC
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum