Wednesday, April 17, 2013

A Brief Interlude - the Arduino Insaninator


I've taken a break from messing with robots to messing with people using embedded technology. At work, we've had some practical joke success by plugging a second mouse into a co-worker S's workstation and putting it on the floor. Then, at random intervals, B, who sits adjacent to him, gently nudges the floor mouse. S then picks up his mouse (the only one he's aware of), looks at the bottom of it in a little bit of confusion, and proceeds to slowly go insane. This is, of course, highly amusing to those who are fortunate enough to witness it.

It's time to take things to the next level. The new Arduino Leonardo runs the USB host on the microcontroller itself (http://arduino.cc/en/Guide/ArduinoLeonardo#toc2) - this means it's easy to get a computer to recognize the Leonardo as a USB device. Once I realized this, it is only logical to make a faux USB "mouse" to replace B's fancy footwork. Enter the Arduino Insaninator!

So I ordered me one of these Leonardos here from Amazon and made sure I had a USB to USB-mini cable available. Once my Arduino was delivered, I downloaded the Arduino software, ran through a Hello World tutorial (http://www.ladyada.net/learn/arduino/lesson4.html), and got familiar with the mouse library documentation, then got cranking.

How does an Insaninator operate? I'm opting for simple based on random... lots and lots of random - random X motion and random Y motion at random intervals.

  • Action delay - delay for 1 minute to 60 minutes, then do a twitchy behavior
  • Twitchy behaviors - 2-10 motions, 50-1500 milliseconds apart
  • Motion selection - use only horizontal, use only vertical, or use both
  • X movement - 0-50 seems reasonable after a little experimentation
  • Y movement - 0-50 seems reasonable after a little experimentation


Check out the source code from github - try to make someone you know think they're going crazy.

Future options could include:

  • random mouse-button clicks
  • configurable behavior with DIP switches or jumpers to remove need for reprogramming
This list is by no means exhaustive - additional ideas welcome!