For the class I’m planning on controlling a few Roombas for art-related nefariousness. Harvey, a friend of mine, gave me two Roomba 562’s he found in a dumpster to complement the 532 and Elite Pro I already owned. The 562’s have a really neat feature that is not present on my 532: You can setup an automatic schedule for cleaning instead of having to manually start the Roomba. Currently I have two options: 1) turning on my Roomba when I leave for class and risk the possibility of waking my potentially still sleeping roommate or 2) Starting the Roomba when I get back from class and have it bump around while I’m trying to cook. Both of the Roomba’s Harvey gave me are inoperable as a daily vacuum, and I wanted the scheduling feature on my 532.
So, here’s how I did it. From top to bottom.
Step 1: Get the Roomba connected to your Arduino.
XBees, Cable-mods, Rootooth, BlueSMiRF… There are all kinds of guides on how to do this with some really cool technology. I decided to use simple wires.
Remove the top cover of your Roomba (Pull out the dust bin, then just pry the top off.) You’ll find a port that looks something like this:
On Your Arduino, you have a similar complement of ports.
Just take a wire, plug it into the Arduino, then jam it down into the corresponding hole on the Roomba.
Arduino: Rx Pin 0 ———> Roomba: Tx Pin 4
Arduino: Tx Pin 1 ———> Roomba: Rx Pin 3
Arduino: Pin 2 (Green In Above Pic) ———> Roomba: Device Detect Pin 5
Arduino: Vin ———> Roomba: +16V Pin 1 or 2 Just pick one
Arduino: Gnd ———> Roomba: Ground Pin 6 or 7 Just pick one
So now you’re saying OMG. +16V is going to fry my Arduino. It didn’t fry my Diecimila or Duemilanove boards.
So, now you’ve got all this connected, switch the jumper from USB power to EXT power. Your Arduino will now run off of the Roomba’s battery.
Launch your Arduino compiler and connect the USB Cable.
Here’s the code:
int rxPin = 0;
int ddPin = 2;
int ledPin = 13;
//Visual Confirmation that everything is OK so far.
//Setup ROI to recieve commands
Serial.print(128, BYTE); //START
Serial.print(130, BYTE); //CONTROL
//Set Current Time
//Send Scheduling Info
OK. So, make some changes depending on when you want the Roomba to run.
Under //Set Current Time
168 = Let Roomba know we want to setup the time
3 = The Day
22 = Hour (24-hour format)
0 = Minutes
Here’s how days work:
Next in the code is when you want the Roomba to run. Here is the sequence:
167 = Setup scheduling
127 = Days to run (will be explained)
Sunday Hours (24-hour format) then Sunday Minutes, two for each day, all the way until Monday. In the code, I’ve set my Roomba to run every day of the week at 3 PM.
Days to run is determined like this:
So, add up the value for each day you want your Roomba to run and put that into the code. (127 = Every day of the week)
Power down the Roomba, upload the code, hit reset on your Arduino, wait 30 seconds and your schedule has been set.
(Yeah, it’s a picture of a 562 with the scheduling interface, but it’s been tested and working on the 532.)