Cast your spells

Book of Casting Rev1

So we decided to host a Harry Potter slash Halloween birthday party at the house.  My wife had some awesome ideas for activites for the kids (around 6yr olds), including getting wands and doing potions.

I had my eye on creating the Raspberry Potter project ever since we visited the Harry Potter theme park at the Universal theme park in Orlando.  In short that project details how to re-use the insanly expensive wands you purchase at the theme park.  Imagine using the wand to turn on lights in your house or otherwise control smart things in your home!

Anyway the birthday party was a perfect inspiration to get this project moving.  I had about 36 hours to get a fully functional "book of casting" where the kids would wave wands and say the spells to see a result.

At first I decided to do the full project of having the IR reading camera like they describe in the Raspberry Potter description (thanks Make:magazine) and there was also an improvement on that project by BloggerBrothers.  I soon realized that:

  1. I didn't have time to get IR setup and learn Python
  2. The kids would be a bit crazy and I didn't want to have any margin for fail
  3. I would be able to secretly push buttons while the kids were occupied with the book

So with that list, I came up with the following game plan.

Why don't I have a face?  Not sure, but carry on.  The idea is that I can use my phone to push buttons and have things appear on the Book of Casting.  Bonus with this is that I can personalize the messages!  I could have something like `That was a great spell Eli!` instead of just lame generic messages.

Here's a screenshot of the phone version of the app:

The "mobile" app

So my secret button pushing would allow me to select a child's name then push the spell button above.  Based on the spell cast it could produce a themed style message and use the child's name in the message.  The green buttons were intended to be the taught spells (by my wife) and were the ones with the best messages.

The bottom three buttons were the most fun however.  Lots of funny responses when I wanted to challenge the kids, like if they wouldn't say the words just right or wave wildly then I would push "fail" and it would say things like "That was close Eli, try again".

The "egg" button allowed us to spiral up to the climax of the Harry Potter adventure where we had to adventure into the Forbidden Forrest and attack a Dimentor.  The egg button spewed up a known order of messages like "Beware of the forrest" and "A wizard has gone missing in the woods", etc...  When the last message of egg appeard we had to "scramble" to get into the woods and save the wizard.

Constructing the Book

Building the book itself is pretty self explanitory with some images.  It was a huge mess since I had like an hour to get it all mounted and convincing looking.  The next revision will have a better looking book.T

The Code

The code behind the whole thing ended up being pretty simple.  I used the tutorial at to build a simple socket server.  I then also added a POST endpoint that allows the "mobile app" to describe what message to show.

This was slapped together super quick, so don't judge the code.  I'm not here to impress developers, I'm here to impress a pile of 6 year olds.  You can see the whole thing on github.

I used a linux laptop to serve as the server.  In theory that server could also be in the raspberry pi, that would be a future enhancement.


The kids had an absolutely great time.  At no point did they ever suspect I was pushing buttons, it helped that I was holding my phone behind our little spell cheat sheet we printed up and gave everyone.  They loved how the messages had their names and only after playing with it for 20 minutes did one kid ask about the odd wire hanging out the side.

If I had to do it again, with unlimited time, I would spend more time on the book itself and still not have the IR portion.  The kids just didn't have the patience to accurately create shapes into a camera.  The future revisions will have the camera but mostly for us adults who want to turn off the lights in the kitchen.

Next Revision

Notice the "Rev1" in the title?  Yeah this project is going to keep growing.  My next plan is to get the actual IR portion working.  Then other fun stuff like sound and better animations on the web app.