Lumos the Christmas Tree

Introduction: Lumos the Christmas Tree

My children and I built this project to bring a little bit of magic from Universal Studios home with us. We recently visited the theme park and bought wands from Ollivander's wand shop and had so much fun going around the park activating different spell stations. I am always curious as to how things work, so of course I got to googling how to recreate this at home. I found several wonderful Instructables re-creating the magic in their own special ways, but Christmas was right around the corner and I thought it would be amazing if I could merge the magic of Christmas and the magic of Hogwarts and maybe inspire some of the kids in my extended family to think about how programming and engineering is like performing magic in real life. Thus "Lumos the Christmas Tree" was born. This tree is programmed to read 8 different spells and perform light and sound animation that match the kind of spell that was "drawn".

Supplies

You may configure this to work with other setups, but here is what I've tested with:
1. I-VOM Wireless Mini Speaker with 3.5mm Aux Input Jack, 3W Loud Portable Speaker for iPhone iPod iPad Cellphone Tablet Laptop, with USB Rechargeable Ba https://www.amazon.com/gp/product/B07KQ44VGQ

2. AmazonBasics USB 2.0 Cable - A-Male to Mini-B Cord - 6 Feet (1.8 Meters https://www.amazon.com/gp/product/B00NH11N5A

3. Infrared Night Vision IR Camera for Raspberry Pi 4, Pi 3b+ Video Webcam with Case Suits for 3D Priter https://www.amazon.com/gp/product/B07T22X3PQ

4. Adafruit FadeCandy - Dithering USB-Controlled Driver for RGB NeoPixels [ADA1689] https://www.amazon.com/gp/product/B00K9M3VLE

5. ALITOVE 50pcs DC 12V WS2811 Led Pixel Black 12mm Diffused Digital RGB Addressable Dream Color Round LED Pixels Module IP68 Waterproof https://www.amazon.com/gp/product/B06XN66ZY6

6. CanaKit Raspberry Pi 4 4GB Starter Kit - 4GB RAM https://www.amazon.com/gp/product/B07V5JTMV9

7. Harry Potter wand from Universal Studios (or make your own https://www.hackster.io/news/build-your-own-magic..)

8. 12V wall adapter power supply for the LED Pixels https://www.amazon.com/inShareplus-Mounted-Switching-Connector-Adapter/dp/B01GD4ZQRS/ref=sr_1_8?crid=X2O2PHIZMUYN&dchild=1&keywords=12v+wall+adapter&qid=1601237915&sprefix=12v+wall%2Caps%2C163&sr=8-8

Optional materials to build the tree:

1. Tomato Cage frame for tree: https://www.lowes.com/pd/33-in-Galvanized-Steel-Wi...

2. Garland (I used 2.5 of these): https://www.walmart.com/ip/12ft-Branch-Garland/577...

3. Twist Ties (I used 2 of these): https://www.walmart.com/ip/Bond-1160-60-Twist-Tie-...

Step 1: Wiring

For this project I have used a tomato cage and some cardboard to construct my Christmas tree and keep my light arrangement fairly uniform. This isn't a requirement, although I think it makes the animation look nicer. The important part of this step is that the night vision camera must have a clear view of the wand-holder,and all the mechanics inside must have sufficient air flow. I used twist-ties to attach everything together. I have attached the tomato cage to the cardboard and the raspberry pi, speaker, and night vision camera are attached to the cardboard base. Garland is wound around the tomato cage to cover the insides, being mindful of keeping it out of the camera view, some trimming may be necessary to do this. I ended up using about 30 feet of garland to wrap my 33" tall, 12" diameter tomato cage tree.

Step 2: Install Software

This project was tested with the latest version of Raspian Buster with desktop version:4.19. You can download the latest version at https://www.raspberrypi.org/downloads/raspbian/

1. OpenCV: Follow the instructions on this blog post to install OpenCv and a virtual environment: https://www.learnopencv.com/install-opencv-4-on-ra...

2. Processing: Follow the instructions in this blog post to install processing software on raspberry pi: https://www.raspberrypi.org/blog/now-available-for...

3. FadeCandy: Follow the directions on the fadecandy github readme https://github.com/scanlime/fadecandy to clone fadecandy and install a fadecandy server. You'll be ready to move on when you're able to control your lights by accessing the fcserver at http://localhost:7890/

4. Clone "Lumos the Christmas Tree" source from: https://github.com/terra819/lumos-the-christmas-tr...

5. Build the light animation executables: I have included the files necessary to create the processing light animations, but because the java executables are so large, you will need to compile them separately. Below are the commands to do so (replace /home/pi/repos/ to wherever you clone this project):

exec /usr/local/bin/processing-java --sketch=/home/pi/repos/lumos-the-christmas-tree/strip50_flames --output=/home/pi/repos/lumos-the-christmas-tree/incendio --platform=linux --export
exec /usr/local/bin/processing-java --sketch=/home/pi/repos/lumos-the-christmas-tree/strip50_water --output=/home/pi/repos/lumos-the-christmas-tree/aguamenti --platform=linux --export
exec /usr/local/bin/processing-java --sketch=/home/pi/repos/lumos-the-christmas-tree/strip50_light --output=/home/pi/repos/lumos-the-christmas-tree/lumos --platform=linux --export
exec /usr/local/bin/processing-java --sketch=/home/pi/repos/lumos-the-christmas-tree/strip50_spazzy --output=/home/pi/repos/lumos-the-christmas-tree/broken --platform=linux --export

Step 3: Run the Program

The github source includes spell recognition for the spells listed on the flyer above. There are instructions on the github readme if you would like to try training your own spells. run lumos.py to start the program The spell recognition works best in low light, if you have trouble with the wandtracing image bouncing all over the screen, check the debug window to see if it is picking up any errant light sources, these will be shown with red circles on the screen.

Make it Glow Contest

Participated in the
Make it Glow Contest

Be the First to Share

    Recommendations

    • DIY Summer Camp Contest

      DIY Summer Camp Contest
    • Pets Challenge

      Pets Challenge
    • Backyard Contest

      Backyard Contest

    13 Comments

    0
    jdhildreth
    jdhildreth

    4 months ago

    Have been working on this off and on for a few months. Got everything working, but seem to have issues with spell tracing catching the light reflection in my glasses, etc. I'm strong with Linux but weak on coding... is there a setting on lumos.py that can adjust this for testing? Would I be better off with a more powerful camera?

    0
    bschwarzh
    bschwarzh

    Question 10 months ago

    This is so great, thank you so much for taking the time to put together the instructions! I ordered all of the parts and am writing to you from my new Rasp Pi :) I'm a programmer by profession, but new in this world. I was wondering if you could post a picture of how the Fadecandy is wired to the LED lights? And it looks like the LED lights might need a separate power supply, is that correct? If so, could you post a link to the power supply that is needed? Thank you so much!

    1
    TerraG2
    TerraG2

    Answer 10 months ago

    Hi thanks I hope you have fun making it! I'm sorry I didn't include the power supply. You can use one like the one below and here is a pic of the fadecandy connection. The fadecandy is then plugged into the pi via USB port. Let me know if you have any other questions. https://www.amazon.com/inShareplus-Mounted-Switching-Connector-Adapter/dp/B01GD4ZQRS/ref=sr_1_8?crid=X2O2PHIZMUYN&dchild=1&keywords=12v+wall+adapter&qid=1601237915&sprefix=12v+wall%2Caps%2C163&sr=8-8

    PXL_20200927_201231865.jpg
    0
    bschwarzh
    bschwarzh

    Reply 10 months ago

    Perfect, thank you! I have it up and running! I love what you built in to start, and am looking forward to customizing it further.

    Question - have you noticed that the tracing jumps around more after a couple spells have been cast? If I then close the script and re-open, it appears to work better again.

    I'm planning to create a couple of these setups as gifts, and will comment back here with any notes/ideas I come up with that may help anyone else get up and running.

    Thanks again!

    0
    TerraG2
    TerraG2

    Reply 9 months ago

    Great! I'm glad you got it running. I hadn't noticed that but if you get it working better please open a pull request on the GitHub repo. Thanks!

    0
    bschwarzh
    bschwarzh

    Reply 9 months ago

    I think I've made a couple minor improvements, and I'm doing some more testing and playing around with it/learning more about OpenCV. Will definitely open a pull request if I can make improvements. Quick question (I think) - did you do something in the incendio spell to convert the orange color fire image to green (for Christmas, I'm assuming?) If so, where would I look for that code? I looked around a bit for this, but have yet to find it. Thanks!

    0
    TerraG2
    TerraG2

    Reply 9 months ago

    Sounds great! Please do open a pr when you're ready. No I didn't convert it to green, it's orange to me?

    0
    bschwarzh
    bschwarzh

    Reply 9 months ago

    Oh, that's weird - I just noticed that it's orange in one of the images in the instructable. For me, the LED lights glow green instead of orange with incendio - no idea how this happened.

    0
    TerraG2
    TerraG2

    Reply 9 months ago

    Hmm. Might be a setting on fadecandy? Or maybe my set of LEDs are wired backwards. Some cheap strands are backwards.

    0
    bschwarzh
    bschwarzh

    Reply 9 months ago

    Good ideas - I'll check those out. Thanks!

    0
    bschwarzh
    bschwarzh

    Reply 7 months ago

    Turns out I had to setup the fadecandy config file to map to "grb" (instead of "rgb".) I got a second set of the "ALITOVE" lights from Amazon and they had the same issue, where red and green were swapped... sounds like this is a relatively common issue.

    I made some other tweaks and added an animation in a fork of your Github repo. I'll make a couple more changes and modify the readme before doing a pull request. I had trouble training a new spell, so I ended up using the "reparo" pattern for the new animation (with "broken" disabled because it was driving me nuts ;) .)

    Last thing, I tried to get the program to start up automatically when the Pi is turned on, but was unsuccessful. I tried every method for autostarting on linux that I could find, and ended up just added a shortcut to the desktop. Were you able to auto-start the program? If so, how?

    1
    audreyobscura
    audreyobscura

    1 year ago

    This is an awesome idea! I also have a wand from Universal kicking around, definitely favoriting this to hopefully try later!

    0
    TerraG2
    TerraG2

    Reply 1 year ago

    Thanks! Loved making it, need some way to use those wands, they are too cool to just collect dust.