Magic Wand With Lights



Want to learn how to make a magic wand that lights up when you shake it? Well, look no further and follow this simple tutorial!
Downloads
Supplies
- CPX (Circuit Playground Express).
- USB Cable.
- Individual NeoPixels.
- NeoPixel Strip.
- Alligator Clip Jumper Wires.
- Regular Wires.
- Wire Stripper.
- Soldering Iron.
- Solder.
- Batteries.
- Battery Pack.
- 2 Pin JST Connector.
- Hot Glue.
- Glue Gun.
- Electric Tape.
- Stick.
- Air Dry Clay.
Program the CPX to Light Up When You Shake It
.png)
.png)
.png)
- Go to https://makecode.adafruit.com/ and create a new project. Go to the Variables option and create the variables Strip and Strip 2.
- Then, click on Loop and select the On Start option. Drag it to the workspace.
- Click on Light, and right after you do that, an option called NeoPixels is going to appear right under it. Select it and drag the Select Strip To Create Strip On A1 With # Pixels. It should be the second option.
- Go back to NeoPixels and scroll all the way down. Drag the second to last option. This one should be Set Strip Mode To RGB(GBR Format). Change the RGB(GBR Format) to RGB + W.
- Place them inside the On Start Loop.
- Repeat the previous steps for Strip 2.
- Adjust your amount of pixels according to the size of your NeoPixel Strip. The amount of lights in your strip equals the number of pixels in your Strip variable.
- For the Strip 2 variable, change the number of pixels to the number of individual Neopixels you have. Make sure to change the A1 for a different location.
- Go to the Input option, and grab the On Shake option.
- Select Light and drag the Show Animation for # ms.
- Chose the desired animation for the desired amount of time.
- Go to NeoPixels and choose the Strip Show Animation for # ms. Select the same animation.
- Repeat steps 10-12 for Strip 2.
- If you feel more comfortable, you could choose to edit your code in the JavaScript option at the top.
- Once you are done, plug in your CPX to your computer. Press the restart button, and wait for the lights to turn off.
- Click the download button, and copy it to your CPX.
Plug in Your NeoPixels and Neopixel Strips to Your CPX and Battery





- Grab three different colored alligator clips.
- Plug the black wire to the GND, the red to VOUT, and the white wire to A1.
- Reach for your NeoPixel Strip and look for the arrows. If the arrows are going up, you would plug the wires at the bottom. From bottom to top, the other end of the black alligator clip would go to the left side, the white to the middle, and the red to the right. You could use some electrical tape to enforce.
- Grab your individual NeoPixels and look for the arrows. Put it in an upright position.
- Grab another set of alligator clips. This time plug the black to GND, the red to 3.3V, and the white to A5 or the chosen location for Strip 2. The other end of the wires would be clipped to the NeoPixel. The red to the + side, the black to the - side, and the white to the bottom of the NeoPixel.
- Once you are sure that your circuit is working, you can go ahead and solder it.
- With the use of a wire stripper, regular wires, soldering iron, and solder, join all your pieces together.
- Unplug your CPX from your computer and remove the USB cable.
- Take the 2 Pin JST Connector and connect it to your CPX. use the wire stripper to strip the wire from the 2 Pin and the battery pack. Using the soldering iron and solder, join your CPX and battery together. Depending on the battery pack of your choosing, unscrew the lid and put in the batteries. Turn on the battery to try it out.
Attach Your Circuit to Your "wand"




Using hot glue and electrical tape, attach your circuit to your stick of choice.
Create the Shell for Your Wand



In a well-protected space, grab the air-dry clay and start to make a "shell" for your wand. The design and texture are up to you. If you want to make a less bulky wand, choose a smaller battery pack. If you would like to reuse your CPX, do not cover it with clay. Be careful to not cover the lights and the switch with clay. Make sure to cover all the cables.
Let It Dry and (optional) Paint It to Your Like!
You should allow it to dry for at least 24 hours. If you want to paint it, make sure it is completely dry.
Enjoy!!


Now you can shake it and enjoy the light show.
Downloads
For My Final Project



For my final project, I plan to re-code my wand. I would likely be using CircuitPython to program my wand as a control remote. To create the illusion of magic, I would like to program my wand so when I press a button, a cr car moves.