Magic Wand With Lights

by TKelly in Circuits > Art

246 Views, 0 Favorites, 0 Comments

Magic Wand With Lights

20211122_172714.jpg
20211122_163123.jpg
20211122_152911.jpg

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!

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

Screenshot (21).png
Screenshot (23).png
Screenshot (24).png
  1. Go to https://makecode.adafruit.com/ and create a new project. Go to the Variables option and create the variables Strip and Strip 2.
  2. Then, click on Loop and select the On Start option. Drag it to the workspace.
  3. 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.
  4. 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.
  5. Place them inside the On Start Loop.
  6. Repeat the previous steps for Strip 2.
  7. 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.
  8. 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.
  9. Go to the Input option, and grab the On Shake option.
  10. Select Light and drag the Show Animation for # ms.
  11. Chose the desired animation for the desired amount of time.
  12. Go to NeoPixels and choose the Strip Show Animation for # ms. Select the same animation.
  13. Repeat steps 10-12 for Strip 2.
  14. If you feel more comfortable, you could choose to edit your code in the JavaScript option at the top.
  15. Once you are done, plug in your CPX to your computer. Press the restart button, and wait for the lights to turn off.
  16. Click the download button, and copy it to your CPX.



Plug in Your NeoPixels and Neopixel Strips to Your CPX and Battery

20211120_110815.jpg
IMG-20211122-WA0011.jpg
IMG-20211122-WA0012.jpg
20211122_135456.jpg
20211122_135505.jpg
  1. Grab three different colored alligator clips.
  2. Plug the black wire to the GND, the red to VOUT, and the white wire to A1.
  3. 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.
  4. Grab your individual NeoPixels and look for the arrows. Put it in an upright position.
  5. 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.
  6. Once you are sure that your circuit is working, you can go ahead and solder it.
  7. With the use of a wire stripper, regular wires, soldering iron, and solder, join all your pieces together.
  8. Unplug your CPX from your computer and remove the USB cable.
  9. 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"

20211122_141135.jpg
20211122_141145.jpg
20211122_221640.jpg
92ea12a5-d728-4437-9162-037dcd39a599_1.d17dcfe5681583ab76bbe8faa3bd45c8.jpeg

Using hot glue and electrical tape, attach your circuit to your stick of choice.

Create the Shell for Your Wand

20211122_142411.jpg
20211122_221616.jpg
F6RMD5CKWAOLAST.jpeg

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!!

FHECR15KWAOLASV.jpeg
FDF3JNMKWAOLBZW.jpeg

Now you can shake it and enjoy the light show.

For My Final Project

s-l640.jpg
Accelerometer_with_CircuitPython.png
CircuitPython_Repo_header_logo.png

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.