Lumos the Christmas Tree
Intro: 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".
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.
13 Comments
jdhildreth 3 years ago
bschwarzh 3 years ago
TerraG2 3 years ago
bschwarzh 3 years ago
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!
TerraG2 3 years ago
bschwarzh 3 years ago
TerraG2 3 years ago
bschwarzh 3 years ago
TerraG2 3 years ago
bschwarzh 3 years ago
bschwarzh 3 years ago
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?
audreyobscura 4 years ago
TerraG2 4 years ago