A Kano Wand and a Raspberry Pi Zero W Puts Your Real-World Spellcasting Into Hogwarts Legacy

Using Kano's existing licensed Harry Potter wand and a Raspberry Pi Zero W, this project will have to accio'ing in no time.

Pseudonymous maker "That's So Mo," hereafter simply "Mo," has used a Raspberry Pi Zero W and tool from educational company Kano to put a little more magic into recently-released Hogwarts Legacy — with a real-world wand you can wave to cast in-game spells.

"The basic idea behind this project is to convert the gestures/movements of the wand into keyboard button presses with the help of a Raspberry Pi Zero W," Mo explains. "The wand connects to the [Raspberry Pi] Zero W via Bluetooth [and] then […] sends data to the PC with Hogwarts Legacy running on it via USB."

A wand with integrated IMU and Raspberry Pi Zero W will help you bridge the real world to the Wizarding World. (📹: That's So Mo)

Mo's project is aided by the fact that a Bluetooth-connected wizard's wand already exists, having been released as a tool to interest kids in coding by recently-split educational electronics firm Kano in partnership with the Wizarding World. With an internal inertial measurement unit (IMU), the Kano wand could be waved in various patterns to trigger actions in the user's own code — only now it's being used to trigger spells in a virtual version of fictional wizarding school Hogwards.

"You need to convert the RPI Zero W into a USB HID device," Mo explains of the project. "This is so that it makes it possible for the wand gestures to emulate keyboard button presses. When casting a spell, hold down the button on the wand.

"In the 'class GestureWand(Wand)' section […] is where you put in the gestures/spells you want to be able to perform," Mo continues. "Some have been pulled by GammaGames and put in, such as lumos, where as I put in the accio, reparo, revelio and etc. by using existing information available on their wand movements looking around online, on certain wikis or even on the Kano wand spell sheet — however for ancient spell and ancient throw spell, basic spell, etc., I just made it up."

The result is a wire-free wand which triggers in-game spells — if you perform the gestures right, adding an extra layer of difficulty to the game. While Mo's work targets the Microsoft Windows version of the game, it could in theory be extended to work with the console ports by having the Raspberry Pi Zero W act as a compatible USB gamepad instead of a USB keyboard.

Full project details and the Python source code required to get it running are available on GitHub under an unspecified open-source license.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles