Pistreaming Roomba

This project will allow you to convert your Roomba into a mobile camera bot, controllable from a web browser. 


The final product: Raspberry Pi mounted on Roomba



Screenshot from web browser, displaying Pistreaming Roomba's video and control buttons

Hardware


Talking with Roomba

iRobot, the maker of Roomba, seem to be very open to the idea of their products being used for academic or "hacker" projects.  They provide a serial API, the Open Interface, which makes it very easy to control from your own microcontroller.  And the DIN connector used to interface with the Roomba is present on nearly all models.


The DIN connector spec

Some key notes about the DIN connector, with respect to connecting a Raspberry Pi:

Once you have the TX and RX wired up, there are several easy-to-use libraries available on github (and probably elsewhere) for communicating using the Open Interface.  I found a Python based library called PyRoombaAdapter which worked out well for me, and so is used in this project.


Remote Power-On

One thing I noticed in my initial testing with controlling Roomba with the Open Interface is that it's possible for Roomba to be in a Power Off state.  In this state, it isn't listening on the Open Interface and so won't respond to any commands from the Pi.  It enters this state after a period of time doing nothing (probably to save battery life) or it can be manually triggered over the Open Interface.  (It doesn't appear to enter this state while sitting at its charging dock, however.)  The only way to power Roomba back on is to press its "Clean" button.

For my project, I wanted to be able to fully control Roomba, including power on.  So, I added some extra wiring to trigger the "Clean" button push.  After i pulled off my Roomba' cover, I noted that the button in question, marked "SW5", functioned by momentarily connecting the contact points on either side.  One side is battery voltage (13V) and the other side is usually ground.


Roomba under the hood

Fortunately, I found that the SW5 button will trigger even if momentarily hit with a voltage much smaller than 13V -- in fact 3.3V from one of the Pi's GPIO pins will work.  So, I soldered a wire from the SW5 button to a JST-PH female connector which I hot-glued just above the DIN connector.  (It would have been much slicker to utilize one of the other port on the DIN connector for this - for instance, there are two power outs and two grounds, where you only really need one of each.  But this would require desoldering the DIN connector from the Roomba board ... I didn't have a spare and was concerned about screwing it up, so did it with a new connector all together.)



Roomba "Clean" button trigger wire
Before putting Roomba' cover back on, I cut out a hole for the connectors.  I drilled a 1/2" hole for the DIN connector, then carved out a hole for the JST-PH with a Dremel.



Hole in Roomba cover
The only other Roomba modification I made was to add a strip of velcro to attach the Pi.  The modifications I did don't prevent Roomba from being used normally.


Wiring closeup

The only other thing to note is the extra, short green wire I added to the unused port of the JST-PH connector.  I added this just to help when pushing it in and pulling it out.  It's kind of far down there!

Pi Connections

Connecting to the Pi is fairly straightforward. 

Power the pi via the Micro USB cable (which you'll need to attach to the 5V output and ground of the 5V voltage regulator). 

Plug in the USB-to-TTL adapter to the Pi's USB port.  My USB-to-TTL adapter had a jumper to select either 3.3V or 5V logic; set it to 5V.  Make sure you connect the adapter's RX to Roomba's TX, and adapter's TX to Roomba's RX.

For the "Clean" button trigger, connect to a GPIO pin which is normally low.  I believe you can set this up for any GPIO pin, but I just checked one that was already low by default, GPIO 18.  The software will momentarily set this pin high (3.3V) and then low again, which triggers a button push response from Roomba.

Software

See the github's Readme for a full description of the software.  I started with the Pistreaming project, then added on Roomba control stuff.

For extra credit, sign up for a dynamic DNS service (like No-ip) and set up port forwarding on your router for ssh (usually port 22) and pistreaming's http server and websocket server (8082 and 8084 in the default code).  Now you have a Roomba equipped with streaming video which you can control over the internet!  Go ahead and have some strangers vacuum up your house!