When a Roomba vacuum has reached the end of life, it can be repurposed into a useful experimental robotics platform. This post will provide the necessary information for to anyone to get started making an autonomous robot from a used Roomba. There are many different ways to send commands to the Roomba. This post will describe the use of the low cost and very popular Arduino microcontroller.
The specific Roomba in this example is a Roomba 4000, manufactured by iRobot in 2007, shown below.
Step 1 – Operations Check
The machine was very dirty due to years of service as a vacuum cleaner. It took at least two hours to fully disassemble the machine and perform a thorough cleaning with a ShopVac, air compressor and brushes. The battery was removed from the device and connected directly to the charger for one hour (warning, this can overheat the battery). This was accomplished because the internal charging circuit of the Roomba was inoperative, a common problem for this model.
After installing the battery, the Roomba powered up and performed a normal cleaning. It did a great job and the dogs were mildly interested in it while the robot performed a cleaning operation. A photo of a puppy investigating the robot is shown below. Note that the Power LED is red, indicating a low battery charge.
Subsequent testing revealed the machine required a replacement battery, filters, brushes and brush bearings. The trade off analysis resulted in the decision to hack the device as a robot development platform, when compared to the cost of a new Roomba.
Roombas manufactured after October 2005 can be given commands via the serial port using the iRobot Roomba SCI. This makes it ideal for a platform to experiment with robotics. Roombas with firmware that predates this date cannot be controlled using the SCI. This would result in a large amount of extra work to build the required circuitry and logic to interface with the motors, encoders and sensors.
The firmware date version was determined in accordance with the information provided in a robotreviews.com post (reference link):
1. Disconnect the roomba from the charger.
2. Hold down the power button for about 10 seconds.
3. Count the dits and dahs
Note: Each short beep equals 1 and each long beep equals 5. The format is year month day.
During this check, it was discovered that the speaker was inoperative. The wiring to the existing speaker was disconnected and reconnected to a used 8 Ohm speaker from a discarded desktop computer. The wiring was routed through a new hole drilled in the cover and the speaker was secured with double-sided tape. The video below shows the results of the firmware check. The first series of beeps indicate a firmware year of 2006 (one long and 2 short). This indicates this machine is compatible with the iRobot Roomba SCI.
Step 2 – Interim Battery Installation
No direct replacement battery was available (for free). As a result, a 12VDC AGM (Advanced Glass Mat) battery was installed on the top cover with double-sided tape. The working battery was salvaged from a discarded UPS (Uninterruptible Power Supply). See the wiring diagram and photos shown below. The blue pen indicates the position of the connector described in the photo caption and listed on the wiring diagram.
Note: the battery is charged with an automotive battery charger (not shown), bypassing the Roomba charging circuit.
Step 3 – Interface Roomba Serial Port to Arduino Uno with Jumper Harness
The Roomba has a Mini-DIN connector in which the serial port can be accessed with an interface cable that has the correct mating connector. The location of the serial port is shown in the diagram below, from page 6 of the iRobot Discovery/400 Series Owners Manual. According to page 2 of the SCI, the serial port is a 5V logic level with a default baud rate of 57600, 8 data bits, no parity, one stop bit. This is compatible with the Arduino serial default of 8 data bits, no parity, one stop bit and an adjustable baud rate that includes 57600.
For reasons of convenience, the Mini-DIN connector was cut away and a jumper harness was spliced in place. The external charger jack was also removed and the wiring was capped and stowed. This is shown in the photo below. Referencing the diagram from the SCI Spec Manual page 2, DD (Device Detect or Wake Up) connects to a black wire, TXD (Roomba Transmit Data) connects to an orange wire and RXD (Roomba Receive Data) connects to a yellow wire in the Roomba chassis wiring. The other side of the jumper harness was terminated to #22 pins that can connect to the Arduino’s headers.
Finally, a Arduino Uno Rev 2 was installed with velcro and the serial cable connected as shown in the photo below. The dust bin and all vacuum related components have been removed.
Wiring to the Arduino is as follows:
Arduino Uno Digital IO 5 RX to Roomba pin 4 TXD (yellow wire)
Arduino Uno Digital IO 6 TX to Roomba pin 3 RXD (orange wire)
Arduino Uno Digital IO 7 DD to Roomba pin 5 DD (black wire)
Step 4 – Wake Up
The Device Detect (DD) pin is not part of the serial communication, per se. According to page 2 of the SCI, sending an active low pulse on this pin will wake up the Roomba from the initial power on default sleep mode.
Shown below is an image of the program that is loaded on the Arduino to wake up the Roomba. Once it is run, the Roomba makes a sound and the clean light illuminates green. Here is a link to the code: http://pastebin.com/4MrSgkNQ
Step 5 – Blink the LED
A popular first program to run on a microcontroller is to blink an LED. This program blinks the Roomba Power and Status LEDs between the colors green and red.
Here is a link to the full code: http://pastebin.com/hTAEAmzz
Blink Roomba LED – How does it work?
The Roomba SCI describes how to control the Roomba LEDs on page 4. When the Roomba computer receives the command opcode 139 over its serial connection, it expects 3 more bytes of data. These describe what LEDs to turn on, the color (the Roomba uses Tri-Color LEDs) and the intensity (The Roomba can brighten or dim the LED intensity).
The Arduino sends the following command sequence to the Roomba through the serial connection:
 enable the SCI
pause for 100 milliseconds
 enable user control of the Roomba
pause for 100 milliseconds
 enable unrestricted control and turn off safety features
pause for 100 milliseconds
    illuminate status and power LEDs green at full intensity
pause for 2000 milliseconds
    illuminate status and power LEDs red at full intensity
pause for 1000 milliseconds
repeat the last two commands and pauses
This post described how to transform an Arduino Uno and a used Roomba with a bad battery into a functional experimental robot development platform. The first program woke up the Roomba by sending an active low pulse to the device detect pin. The second program flashed the Roomba power and status LEDs green and red. The second program verified proper communication between the Arduino and Roomba.
Once Roomba Blink is successfully completed, try out these challenges and take these concepts to the next level!
1. Blink the Roomba power LED blink red, orange then green with the status always light off. Answer Link.
2. Write a new program that slowly changes the power led color from green  through red . Answer Link.
3. Play a song! Follow this link for a sketch that will have your Roomba play the Star Wars theme song for the Imperial Army.