I bought my wife an iRobot Roomba 540 over 2 years ago and it’s been wonderful. However, we sometimes have a challenge finding a good time for it to run due to our varying schedules. This is not unlike our challenges with setting the thermostat which ultimately lead me to integrate the thermostat into the home automation system so it could be adjusted when the house is unoccupied. So, I’ve been doing a lot of research to see how I could integrate the Roomba into the home automation system also.
Ultimately, I want the Roomba to do what it does best – clean. So, I don’t want to write any software to tell it how to drive, I just want to tell it when to start cleaning. Also, I’d like to be able to tell it to seek the dock if I arrive home while it is in the middle of its cleaning cycle. There are some interesting applications for using the Roomba as a platform for other things, but that’s not my primary interest at the time.
I started by buying a Rootooth device which provides a Roving Network bluetooth dongle that connects to the DIN serial port on the Roomba. I drilled a hole in the top plate to expose the serial port and used hook & loop connectors to attach the Rootooth onto the back. I downloaded an Android app for my smartphone and had the thing scooting around my house in no time! Ideally, I would have liked to have found a WiFi version so I could get better range, but the only one’s I’ve seen are DIY, unsupported, and quite large.
Next, I found an excellent .NET API for controlling the Rootooth from Solid Code. I was a bit frustrated to learn that the iRobot chose to only provide acknowledgement of some of the commands, so I’m forced to just transmit the command and hope it is received. I added some retry logic into my app for insurance. The challenge is that the Bluetooth signal is only good for 30 feel line-of-site (less through walls) and my cleaning area is slightly greater than that, so there is a risk the Roomba could be out of range when I sent the command and not receive it.
During the writing/testing of this software, my Roomba started to act very strangely. After much research, I discovered that there was a problem with the baud rate I was using to communicate. What seems to work for me is to reset the Roomba to factory default (press and hold the Spot & Dock buttons for about 10 seconds), then force the baud rate to 19,200 (press and hold the Clean button for about 10 seconds). This lets me communicate via the PC, but breaks my Android app. To get the Android app to work, I have to use the higher baud rate.
I decided to run the control software directly from the Watchdog1 server in my basement. That left the challenge of getting the Bluetooth signal up to the Roomba on the main level. For this, I bought a shielded, amplified 50′ USB cable and an inexpensive Bluetooth USB dongle. I pulled the wire through my dropped ceiling in the basement and used hook & loop connector to attach it to the underside of the kitchen floor where the Roomba cleans. After some experimentation, I found an optimal spot to affix the Bluetooth transmitter to get maximum coverage for the floor above.
Finally, I integrated the Roomba control software into the Watchdog system. When the house becomes unoccupied, it sends the Roomba the “Clean” command. It monitors the Roomba during the clean cycle and records the time when it finishes. If the geofence car proximity sensor is activated or, if someone comes home early while the Roomba is still running, the Watchdog system sends the “Find Dock” command. It sometimes takes a while for Roomba to find the dock, but this should minimize if not eliminate the time Roomba is running while the house is occupied. If the house is occupied all day, then Roomba does not run. The software also ensures that Roomba only runs once per day in the event that we are in-and-out of the house multiple times (which is very typical). I adjusted the Watchdog “welcome home” greeting to include a status of the Roomba: “While you were gone, the mail was delivered and the floor was cleaned”. I also added the Roomba status to the daily status emails and the Daily Aggregate table in the Watchdog database.