Roomba Commander
Roomba is cool. Not just because of the obvious (it cleans your house/appartment so you don't have too), but rather due to the fact that the designer thought that techies will also like to play with it.
They have added a SCI (Serial Command Interface) and documented it quite well: PDF. You can do lots of stuff with the interface: write on the 7-segment display, check the status, send commands and even play a song. There is a 9-pin connector on top of the Roomba and if you want to reach it, you need to remove the top plate.
As designed, if you want to control your Roomba with your own circuit, you should create a piggy back module and connect it to the top connector. Unfortunatelly, this has two main deficiencies:
- The connector only provides direct battery voltage (14,4V), which needs to be reduced to an appropriate level for the controller circuit (3,3V/5V)
- Sometimes Roomba needs to pass under a low passage, which could pull the circuit from the connector
When the Flyport module was introduced, I created a simple PCB and attached it to the top connector. Roomba displayed the word hi with a smiley (HI :]) and played the Ode To Joy. I also developed a simple web interface and did some testing. Due to the "Piggy back design", the circuit was soon ripped from the Roomba while cleaning. Then the Flyport PRO module was introduced and it seemed to be perfect to fit into the cleaner. The designers of the Roomba did not leave too much space for any additional modules, but it seemed that there is just enough space in one of the "pockets" for what I needed.
Power Supply
Since Roomba works on 5V and the Flyport needs a 3,3V power supply, I bought a module, based on AMS1117 on eBay and wrapped it in heat shrink to be able to supply 3,3V to the Flyport PRO.
Connecting the module to Roomba
Next, I needed to disassemble the Roomba. There are many guides on the internet on how to do this, so I will not focus on this part. Then I used a multimeter to find the pins from the SCI interface (RXD, TXD, DD) and for the power supply (+5V, GND). Luckily, they are quite close to each other (marked by me with a red marker).
The Flyport PRO module did not fit into the pocket first (just a mm short), so I melted of a short peace of plastic to fit the module. I have also trimmed a part of the screw, which is seen on the picture. After that, the fit was perfect. The voltage regulator is tucked to a small hole next to the module. Flyport has remappable pins, so I used the pins that are 5V tolerant, removing the need for a level converter (pin 5 => Roomba/DD, pin 13/RX => Roomba/TX, pin 15/TX => Roomba/RX).
Here are the connections from the Roomba PCB to the Flyport PRO.
Firmware
The firmware for the module can be found on GitHub.
Usage
After everything is connected and the Roomba is assembled, you should connect to an ad-hoc network, called ROOMBA_NET. Type the following address to the browser: http://192.168.1.250 and you will be presented with a screen on which you can set your network parameters to be able to use the Roomba in your home network. Roomba will reconnect to the newly defined network and you can access it via your browser (see the address in the image below, the IP address should be changed to what you have set in the previous step).
You can use the buttons in the bottom to issue commands, view the battery status in the rectangle near the top and best of all, all brushes and wheels are ANIMATED and move in your browser when they move on your Roomba. If the wheels drop, the exclamation mark indicated the error. The code was not tested in all browsers, but it works in most recent Chrome version (desktop and Android).
Beside the web interface, you can also directly issue commands and query state via HTTP GET.
Status info from Roomba
http://ipaddress/roomba_xml.cgi
http://ipaddress/roomba_json.cgi
will return the current status from Roomba in XML or JSON format:
Commands
http://ipaddress/cmd.cgi?command=clean (Clean command)
http://ipaddress/cmd.cgi?command=dock (Dock command)
http://ipaddress/cmd.cgi?command=power (Stop command)
Firmware upgrade Over The Air
Since the module is neetly stored in the Roomba, the firmware also supports update of the firmware from a FTP server (see the Flyport Wiki and the source code for more details). The network connections are stored in the external Flash, so your connection parameters don't get lost during firmware update.
You can also update the Firmware with an upgrade client, written in .NET, which should be quite easy to build. You can find the client on GitHub.