Electronics · Websites

Raspberry Pi – Control by Magic Wand!

So a friend at work just pointed me to this awesome bit of tech called the Kymera Wand which is also available as Sonic Screwdriver.  Basically it is a Universal Remote, hidden in a wand, and controlled by gesture!


It’s really quite awesome.

Controlling a TV with a flick of the wrist is something magical, but SO much more is possible given the age of home automation.  So a coworker and I started researching what it would take to control EVERYTHING with this little marvel.

Enter the Raspberry PI and the LIRC library.


LIRC stands for: Linux Infrared Remote Control and has been around for long time.  It took me some work to figure out all the pieces so I’m hoping to simplify that a little for you here.

First, order yourself an IR receiver.  Adafruit is the most accessible at purchasing components here:



Then, check out these instructions for getting LIRC installed (Alex does a great job getting you going.)


Note: I had to reboot the PI before the *mode* stuff worked.

For our needs – we only need to wire up the “receiver” portion.  Since we’re going to have the Raspberry PI act based on wand flicks.

Note: When I first setup the receiver I got the pin out wrong and the test program didn’t work.

Ok, now assuming you saw pulses when you ran your test program (using a TV remote).  The next step is to program in a button from a “normal” remote control, into the LIRC config files.  This ensure that you haven’t introduced a problem with the wand.

Lirc contains and ingenious little program that allows you to train it to recognize any button from any IR remote.  I tracked down instructions for this here:




If you have difficulty – consider using a *clean* power supply.  The ones typically used in IOT devices are cheap and noisy.  Any noise from the power will make it difficult to detect the IR pulses.  You’ll see lots of spurious IR-receives – when none are being sent.  To fix it, consider running the PI from the USB ports on your computer… that should be clean.

With recognition working…

Now that you know your PI is recognizing your remote’s buttons.  It’s time to choose what those buttons will do!

That I found nicely explained here:


The magic bit is below.  Place this, in a file called: /etc/lirc/lircrc

 prog = irexec
 remote = /etc/lirc/own_remote.conf
 button = 
 config = echo "You just pressed 'OK'!" > /var/run/lircrcoutput

Note, the config line controls the magic place to hook things up.  Make sure you replace the line . 😉

Phew!  Now all you have to do is train your Kymera to emit the same buttons as those you’ve been using on your REAL remote, and voila – you have a Raspberry PI that reacts your magic wand.

So. Much. Fun.  Next up… see how to control your TP-LINK HS100 outlets with this rig. 🙂


7 thoughts on “Raspberry Pi – Control by Magic Wand!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.