WarSting: A Wi-Fi scanning sword for Hobbits.

Today, The Hobbit: The Battle of Five Armies hits the theaters. Bilbo, our favorite hairy-footed protagonist, will face formidable foes armed with his mythical sword, Sting.

Sting's particular magic is that it glows blue whenever orcs or goblins are nearby. This is useful for hobbits, but in today's day and age, a real Sting would be unfortunately boring.

But what if Sting could detect unsecured Wi-Fi networks?

To celebrate the launch of the new Hobbit flick, we made a version of Sting that turns blue near unsecured Wi-Fi networks. And when you slash the sword, Sting will jump on the network, and publish a message: "{YOUR WI-FI NETWORK} has been vanquished!"

This hack is inspired by one of our favorite recent projects, WarKitteh, in which a Siamese cat named Coco was enlisted to wardrive his owner's neighborhood. Hobbits are known to travel further than the typical housecat, and therefore make great wardrivers.

Step 1: The ingredients

To make your own WarSting, you'll need two things: a toy Sting, and a Spark Core.

A toy company named The Bridge Direct, Inc. sells (next to Power Rangers and Justin Bieber action figures) a $29.99 plastic replica Sting sword. WITH LIGHTS AND SOUND! This is a great hack because:

  • It has lights and sound. When you press a button, the sword lights up blue, and when you slash the sword, it makes fun slashing sounds. These functions are hackable.
  • It's pretty cheap.
  • It's a sword.
  • It's held together with screws, which gives us access to the internals.
  • There's a bit of extra space in the hilt that we can cram stuff into.

The other thing you'll need is a Spark Core, a Wi-Fi development kit - sort of like a Wi-Fi connected Arduino. It's a reprogrammable chip that has a Wi-Fi module on board and can interact with sensors and actuators, like the ones in the sword.

This is what we do, so we have a whole bunch of them sitting around. If you want a Core, you can get them on our website for $39 each.

Step 2: Disassemble the sword

All of the electronics in the sword are contained in the hilt, which can be accessed by unscrewing a couple of screws. Here's what you'll find inside:

There are basically four components that matter here:

  • Two AA batteries, which power the electronics. Every AA battery provides 1.5V, so when two are placed in serial, you've got 3V. If you use Energizer Ultimate Lithium batteries, which run at 1.7V out of the box, you've got 3.4V, which is enough to get a bright blue light from the LEDs (3V will work but the light will be quite dim).
  • A couple of blue LEDs that are pointed up into the sword to make it glow
  • A button on the front that turns on the sword
  • A "vibration switch" that detects when the sword is swung. This is basically a spring inside a metal tube; when you swing the sword, the spring bends and hits the tube around it, which completes a circuit
  • A tiny sound system that makes one of a few tinny SLASH and CLANG sounds when you swing the sword

Step 3: Splice in the Core

We want the Core to be in control of whether the LEDs are on and whether the little sound circuit is making a sound. We also want it to detect the signal from the vibration switch. Here's a diagram of our circuit:

This is an overly simplistic diagram, and isn't a totally accurate picture of what's going on here. We're not hooking up to a single LED; we're hooking into a pre-existing subsystem which actually includes multiple LEDs. And we're also not hooking up to a speaker; we're hooking up to a whole system for producing sounds where simply sending voltage to a black box of a circuit will create a SLASH sound.

This hack is pretty straightforward; it's simply a matter of cutting the wires in the sword and soldering the wires to the pins of the Spark Core.

Step 4: Reprogram the Core with network-vanquishing firmware

We've written a firmware application designed for the WarSting that scans for unsecured networks, makes sounds, blinks the LEDs, and publishes messages from the unsecured network. All in, it's about three hundred lines of code. Here's a sample in a gist:

In addition to this firmware application, you'll have to include the wifiscan.h library, which scans for networks. The complete firmware can be found on our Github repo for WarSting:

Step 5: Reassemble the sword

Put the sword back together. This is the opposite of step 2.

Step 6: Vanquish Wi-Fi networks

Power up your new WarSting, and when the sword turns blue, start slashing! If you have a few unsecured networks nearby, WarSting will vanquish them one at a time, until they've all been vanquished, after which the sword will no longer glow blue.

In conclusion

So there you have it! If you want to build your own WarSting or create your own wardriving product, fork our Github repo:

To get a Spark Core (or our recently announced Photon), visit our store here:

Buy a Core or Photon now

Enjoy your hobbit journey, and if you're interested in more fun projects, check out the Spark project site on Hackster for all kinds of inspiration!