WARNING – this is a bit more dangerous than the usual stuff (higher voltage, expensive equipment, moving machine). I reject any responsibility for anything.
Once upon a time there was one of the first autonomic vacuum cleaners. It had a nice fancy feature, namely a serial interface to play around with the machine. I had buyed one such thing a while ago – a iRobot roomba 620 – and did not know there was such an interface. When I heard that there was an interface, I could not see it. So the first obstacle here was to find the hidden Mini-DIN 7 interface under the white front plastic cover of the roomba.
The second obstacle was, that the documentation of the producer didn’t match the more recent models any more.
Especially the default serial speed of the interfaces differed in the older docs. I got at least some things working with the interface specification document for the 500 Series.
And this spec mentioned the default baud rate of 115200.
Open Interface Spec:
From the spec you can also see the mapping of the pins.
But what would a autonomous device be useful when it’s cable bound to the “programmer”? So here the HC-06 Bluetooth / Serial module comes really handy.
My plan was to control the vacuum cleaner from a PC program – a python script in this case.
The arduino + HC-06 are just the relay for the serial commands that are send from the PC (using Bluetooth).
Kind of HC-06 Spec that was useful to me:
The HC-06 reveals itself after connection as a COM / Serial-Port on the PC. So it’s ultra convenient to access from most programming languages.
Ingredients:
– iRobot Roomba 620
– Level Shifter 3,3 <=> 5,0
– Transformer x V => 5,0 V
– (Transformer 5 V => 3,3 V, if using no arduino)
– Arduino Uno
– HC-06 Bluetooth to serial dongle, default speed 9600 Baud (if using no arduino this has to be set to the speed of the roomba => 115200 Baud)
– Bluetooth Dongle for the PC or a Laptop with integrated Bluetooth
– Python for scripting
The arduino does nothing more than to forward the signals it gets from the HC-06 to the serial interface of the vacuum cleaner and translate between the speeds.
It might look a little indirect but this was the version that finally did what it should. There were effects that data was lost if I directly forwarded without the “readSerial” flag stuff. Maybe it is a different serial speed issue. Don’t know. Just wanted a quick and dirty prototype to see if this stuff is possible in principle. There are also some risks that the serial commands you want to forward get interpreted by the HC-06, so this is really just for first experimenting.
In the end the arduino inclusive breadboard and co sat on the vaccuum cleaner fed by its voltage.
The following script established the Bluetooth / Serial bridge:
#include <SoftwareSerial.h> SoftwareSerial softSerial(2,3); byte dataSerial = 0; boolean readSerial = false; byte dataSoft = 0; boolean readSoft = false; void setup() { Serial.begin(115200); softSerial.begin(9600); } void loop() { if (softSerial.available()) { dataSerial = softSerial.read(); readSerial = true; } if (readSerial) { Serial.write(dataSerial); readSerial = false; } if (Serial.available()) { dataSoft = Serial.read(); readSoft = true; } if (readSoft) { softSerial.write(dataSoft); readSoft = false; } } A corresponding python script that I run on the PC part, that plays around with the LEDs:
from serial import Serial import time # COMx must be the right COM port that opens # after coupling the HD-06 # /UPDATE: use speed of 115200 instead of 9600 if using the "direct" configuration # without the arduino in the middle serOut = Serial('COM14', 9600, timeout=1) # start / wake up: serOut.write(chr(128)) # full control mode serOut.write(chr(132)) # mode 133 powers down for i in range(0,255): leds = i % 8 # cmd to access the LEDs 4 bytes, see spec serOut.write(chr(139)) serOut.write(chr(leds)) serOut.write(chr(i)) serOut.write(chr(255)) time.sleep(0.1) serOut.close()
Update:
All works better when not using the arduino indirection.
- Therefore an additional 5V => 3.3V Transformator is needed for adjusting the Level for the Levelshifter.
- The speed of the HC-06 has to be configured to the speed of the roomba serial interface (115200), the command is:
- AT+BAUD8










