Page 41 - Hacking Roomba
P. 41
22 Part I — Interfacing
The physical interface allows two-way serial communication through 0–5V binary levels. This
serial communication is identical to normal RS-232-style PC serial port communication,
except that it is at different voltage levels. RS-232 uses +12V to represent a zero bit and -12V
to represent a one bit. This is sometimes called negative logic because it is opposite of what
might logically be expected (which would be using a positive value to represent a one bit). The
ROI uses 0–5V positive logic, where 0V indicates a zero bit and 5V indicates a one bit. This
is the same standard used in most microcontrollers like the Basic Stamp and Arduino (see
Chapter 13), allowing direct connection of these devices to the Roomba.
Do not directly connect a PC’s RS-232 port to the Roomba ROI port. A converter circuit must be
inserted between the two.
The available signals are:
Vpwr: A direct unregulated tap off the Roomba’s main battery. This is normally around
+16 VDC but fluctuates as the battery is charged and discharged.
RXD: Serial data into Roomba. This is a 5V signal referenced to GND. This will nor-
mally be connected to the TX line of an external microcontroller or transceiver. Must be
used to send commands and data to the Roomba.
TXD: Serial data out of the Roomba. This is a 5V signal referenced to GND. This will
normally be connected to the RX line of an external microcontroller or transceiver.
DD: Device detection into Roomba. This is a 5V signal that, when held to GND for at
least 500 ms, will wake Roomba from sleep. It’s an optional signal and most of this book
will not use it and assume Roomba is already powered on.
GND: The ground reference for all of the above signals. Must be used. This is also the
negative terminal of the Roomba main battery.
For basic communication with Roomba, only three connections are absolutely required: RXD,
TXD, and GND. If only commands are to be sent and sensor data isn’t going to be received,
then even the TXD connection can be left off, leaving only a two-wire connection.
In all the hardware projects in this book, the DD line will be included if possible, but the software
presented never assumes it is connected. Therefore, be sure to turn on the Roomba with the
Power button before trying any of the software.
Alternatives to the 7-pin Mini DIN
The 7-pin variant of the Mini DIN connector is fairly uncommon and hard to find. The parts
distributors that do carry it often charge a premium for it.