What I Learned

In order to complete the project, it was necessary to know and understand certain bits of information (pardon the pun) about basic communications systems, computer “language,” and the Roomba itself.


        We began with learning about bits, bytes, and binary numbers. A bit is a basic unit of information in telecommunications, and it is the amount of data that can be stored in a system. They exist in two different states (like “on” or “off”, “voltage” or “no voltage”). This was especially important in understanding the Boolean operations and buttons used in the LabVIEW computer program. A byte is a collection of bits, in which the bits describe a value of either 1 or 0 (binary numbers). The typical byte consists of 8 bits. This was essential to know in order to send commands to the Roomba. For example, the motor commands are made of 3 bits: 2 (main brush), 1 (vacuum), and 0 (side brush), while the remaining bits (3-7) contain no information. However, in order for the command to be sent, they have to be in a language the Roomba can understand. This is where knowledge of the binary, decimal, and hexadecimal systems came in handy. In the binary system, there are only 1 and 0. One reads binary numbers from right to left, and the position of each 1 or 0 corresponds to a power of 2. These binary numbers are converted to decimal numbers by summing the specific multiples of the different powers of 2. For example, starting from the right, 10101101 represents (1 x 2
0) + (0 x 21) + (1 x 22) + (1 x 23) + (0 x 24) + (1 x 25) + (0 x 26) + (1 x 27) = 173. Therefore, using the information given about the motor commands, to turn on the main brush, one would use the binary number 100 (only bit 3 is “on”), which in decimal is 4. However, the conversions do not stop there. The Roomba only recognizes hexadecimal code, which utilizes the numbers 0-9 and the letters A-F (10-15).the same rules apply for Hexadecimal numbers as they do for decimal numbers, just with a couple extra “numbers”. Addition is like the following: 4+1=5 and 6+3=9 and 9+3=C and C+5=11 and Hex 11+3C=4D. Once in hexadecimal form, the Roomba will recognize the command. 


Once I understood these concepts, we began to discuss basic communications systems. The main point I needed to know was the role of transmitters and receivers. We used a Bluetooth USB device in this project, mainly due its wireless capabilities. A Bluetooth device can only receive information from one transmitter and one receiver. The Bluetooth USB device plugged into the computer is the transmitter, while the receiver was a piece actually plugged into the Roomba itself, into what is called the ROI connector. It was therefore possible to send opcodes and data from the computer to the Roomba by way of Bluetooth technologies.


It was necessary that I learn about ROI, the Roomba Open Interface, which makes it possible to hack and control the Roomba. By using this interface, it is possible to control various aspects of the Roomba, such as driving, LEDs, various motors, and “singing.” The ROI protocol is very simple and operates at 8 bits. A protocol describes the formats of the messages and the way in which those messages are received.

For each function of the Roomba, there is an opcode, and then data. The opcode is considered the general command the Roomba receives, while the data is the specifics of that command. For instance, to turn on a motor, the opcode (in decimal) is 138. The data would then be another number corresponding to the motors desired to turn on (based off the different bits). To turn on the vacuum motor, the decimal number sent with the opcode would be 2. This is the case for each command sent to the Roomba.  The song command is the most complex command of the Roomba because it requires an opcode, song number, song length, note 1 number, note 1 duration, note 2 number, note 2 duration, etc… and then to trigger the song, a different opcode with the song number is sent. It must be remembered though, that Roomba recognizes hexadecimal numbers, so the decimal numbers must be converted.


        We also had a quick lesson and demonstration in frequency and amplitude using an oscilloscope in order to better understand the sounds that Roomba can produce. Frequency is the number of oscillations during a given period of time, and is measured in hertz. The higher the frequency, the higher the pitch of the sound; the lower the frequency, the lower the pitch of the sound. The amplitude is the size/height of the oscillation in a period. The effects of changing the properties of sound waves were demonstrated by using an oscilloscope.


        We decided to add on to the project by designing a functional arm that would open and close. In a flashback to my childhood, I spent many hours determining the best way to create an arm of LEGOs that would be able to lift an object. This process was rather tenuous, yet it allowed me to delve into another area of science and mathematics: mechanical engineering. There were many factors that played into the creation of the arm, including utilizing the pieces provided and making sure that the structure was stable. I was able to gain a better understanding of gears, and how the radius and power provided can affect the speed and strength of the arm.