Harry Potter and the Raspberry Pi Powered Wand

We’ve no idea if Computer Science is taught at Hogwarts, but if it were then we’re sure that the Raspberry Pi would play a major part in it. Tired of casting spells at the press of a button, this project from Mo “That’s-so-Mo” uses the wand from a Harry Potter Coding Kit and a Raspberry Pi Zero W as a gesture controller for the recently released Hogwarts Legacy game.

i_used_a_rpi_zero_w_and_a_kano_wand_to_cast from r/raspberry_pi

Mo’s project is great. Sure we can mash buttons to cast spells, but the gesture controller adds a little more authenticity to the action. The wand itself is Kano’s officially licensed Harry Potter wand. If the name Kano sounds familiar it is because of its earlier kits which merged the original Raspberry Pi hardware bundled with its own orange keyboard and many computer science based projects. The wand is meant to be used as a means to learn coding, but Mo’s project uses it for something much more fun.

The project is built using a Python module from GammaGames, this handles scanning for wands and capturing gestures over a Bluetooth connection. Mo’s project uses this module to capture the gestures which are then converted into keypresses that are then sent to the PC running Hogwarts Legacy. The keypresses are transmitted to the PC by cleverly turning the Raspberry Pi Zero W (a Raspberry Pi Zero 2 W could also be used) into a USB HID device. Here is where Mo elevates the project from simple controller to a real wand. The Harry Potter community has carefully curated the movements required for each spell to be cast. Mo has incorporated these movements as gestures and now you’ll need to adapt your swishes to use “Lumos”, “Wingardium Leviosa” or if you’re ready for some time in Azkaban, “Avada Kedavra”.

This fun project is a credit to Mo. It is much more than a simple USB HID device, it is magic for those wishing to immerse themselves in the world of Harry Potter. 

Head over to Mo’s GitHub repository to learn how you can join the next Compute Science class at Hogwarts.