I am thrilled to announce that Hacking Roomba, my book about how to turn your Roomba into your own singing, dancing, art making robot is available for pre-order on Amazon and will be shipping in mid-November, just in time for the holidays!
Ever since Bluetooth adapters for Roombas appeared, I’ve wanted to control my Roomba with a cell phone. All my recent phones have had Bluetooth. But getting a devkit for a phone was expensive and phone-specific. Trying to develop J2ME (aka “JavaME”) applications for cell phones has been a mess, especially for non-Windows users. Thankfully, Mobile Processing wraps up the ugly details, like Processing does for normal Java. It makes writing little programs for your phone pretty easy, and makes whipping up a program to control a Roomba possible.
So here’s “RoombaCtrl”, a small Java program for your Bluetooth- and J2ME-compatible phone that works with the build-your-own Bluetooth adapter shown in the book “Hacking Roomba” or the pre-built RooTooth.
Now you can drive your Roomba with your cellphone like so:
But if you want to hack together something similar and you don’t want to build a huge honking Roomba serial tether, you could build the Roombongle!
So I’ve written a tool that can turn any parametric equation into a series of Roomba movement commands. Mostly, anyway. The parametric equations I’m predominately focusing on are the hypotrochoid series of equations used in a Spirograph.
To explore the space of hypotrochoid curves I created SpiroExplorer, a simple Processing applet that lets you to adjust the equation parameters in real-time. You can do the following things while it’s drawing:
- left/right arrows change “r”, the radius of the inner moving circle
- up/down arrows change “d”, the pen’s distance from center of the moving circle
- ,/. changes “R”, the radius of the big fixed outer circle
- +/- changes scale
- [/] changes “dtheta”, the increment size (resolution, essentially)
- space bar randomizes parameters
- return key clears the screen
Click the below to play with SpiroExplorer:
RoombaComm is Java library for communicating and controlling the Roomba. It works on any operating system that RXTX supports. This includes Mac OS X, Linux, and Windows. It also works with Processing. It will soon work with Flash and Max/MSP.
It’s been a work in progress for several months and has gotten a little better as I work through improving it for the book.
Several bugs have been fixed, particularly with respect to Bluetooth on Windows. See the README for some info on that.
- Mac OS X 10.4 (Tiger) : usb serial & bluetooth
- Mac OS X 10.3 (Panther) : usb serial & bluetooth
- Windows 2000 : usb serial & bluetooth
- Gumstix Linux : built-in serial
Demo command-line programs include:
- DriveRealTime — Drive your Roomba with cursor keys
- RTTTLPlay — Play monophonic ringtones on your Roomba
- Spiral — Roomba drives in ever expanding spiral
- Waggle — Roomba wags like a dog
- BumpTurn — Roomba drives around by itself, avoiding things
- Spy — Read your Roomba’s mind while it works
- Tribble — Roomba purrs and sometimes barks
- RoombaCommTest — Roomba GUI remote control panel (not command-line)
Processing demos include:
- RoombaTune — Play your Roomba like a musical instrument
- RoombaRing — Play RTTTL ringtones on a Roomba
- RoombaView — Full instrument panel and remote control
This is what RoombaView looks like:
- RoombaMidi / Roombas making music
- Roomba Spirographs / Roombas making art
- Roomba as robotics experimentation platform
- What’s needed to hack a Roomba
The RooStick is a USB-to-Serial adapter with a Mini DIN 7-pin socket on it that matches the SCI connector on the Roomba. It is an unencased circuit board with a USB connector soldered on one end and the Mini DIN on the other. The circuit consists of a CP2103 USB-to-UART chip and a couple of LEDs.
Here’s what it looks like plugged into my Powerbook:
While RoombaDevTools doesn’t advertise it because they are focusing on the Windows crowd, the CP2103 has drivers for other OSes. You have to hunt around the Silicon Labs site, but under the
USB-to-UART Virtual COM Port (VCP) drivers page you can find drivers for all the other OSes. Of course, like all USB-to-serial drivers, they require a reboot.
[update: The SiLabs site doesn't have a link to Linux drivers because the driver is already in the Linux kernel. It's called "cp2101" and should auto-load if you have USB hotplug correctly configured (like Ubuntu does)]
Since it appears as a serial port to your OS, you can use any program that can talk to serial ports to control the Roomba. My RoombaComm API library and any of the apps built on it, like RoombaMidi work with the RooStick.
While the RooStick works great, there are a few things to be aware of.
Use their cable
You must use their 7-pin to 7-pin cable. Using a standard Mac serial Mini DIN 8-pin to Mini DIN 8-pin cable from Jameco or wherever will blow out the SCI port on your Roomba. Trust me on this, as I have a dead Roomba to show for it. You could build your own cable, but RoombaDevTools doesn’t yet publish the pinout. From my own experimentation, the pinout appears to be a left-right mirror of the standard Mac pinout. This configuation isn’t guaranteed to stay the same, as RoombaDevTools could change it at any point. Use their cable. Doing so adds $17 to the $29 price of the RooStick but it’s cheaper than replacing your Roomba.
The Vpwr LED showing Roomba power gets very (dangerously?) hot. Be careful when grasping the RooStick or you’ll burn your finger. I’ve not measured how much power that LED is drawing. It’s probably not a power concern for the Roomba, but I’m sure the LED’s life is being shortened.
Cable too short
The optional 7-pin cable for the RooStick is only 6 feet long. Even a 10 foot cable is too short if you’re actually driving the Roomba around. I recommend at least a 15 foot cable. The 6 foot cable is only good for stationary Roomba projects, or when the laptop sits on the Roomba.
Other than those issues, the RooStick is a great way of getting into Roomba hacking.