iRobot Roomba voice control with Amazon Alexa

We can start the Roomba with a quick voice command before we leave the apartment to keep the floor clean by the time we get home. The implementation requires a working ioBroker server , an IoT Assistant adapter with the appropriate license, Amazon Echo or Echo Dot to control the robotic vacuum cleaner with Alexa.

Another solution, without an ioBroker server, is Roomba voice control with Belkin Wemo emulation.

iRobot Roomba voice control with Amazon Alexa
iRobot Roomba voice control with Amazon Alexa

Of course, the hardware is essential, an iRobot Roomba (I had a 531 victim) ESP8266-01 with Breadboard Adapter, AMS1117 Voltage Stabilizer.


Things used for the project:

ESP8266-Esp-01 Module

ESP-01S Breadboard Adapter

Programmer USB to ESP-01 Adapter ESP8266

AMS1117-3.3 DC-DC Step-Down Power Module

MP1584EN DC-DC Buck Converter Adjustable Power Supply


You can issue commands to Roomba via a serial port. This is the honest name for a mini DIN 7-pin connector, “iRobot Roomba® Open Interface”.

iRobot Roomba® Open Interface
iRobot Roomba® Open Interface

iRobotRoomba500-OpenInterfaceSpec.pdf

First, we dismantle the Roomba. Remove the dust container and brushes first. After removing the 4 screws, lift off the bottom cover and then remove the battery.

Disassembly of iRobot Roomba, lower part
Disassembly of iRobot Roomba, lower part

In the next step, remove the bumper, unscrew the top cover plate, and then unscrew the bolts below. The 2 screws on the handle are not required.

Disassembly of iRobot Room, upper part
Disassembly of iRobot Room, upper part

Remove the cover.

Roomba with the cover removed
Roomba with the cover removed

Build the hardware according to the drawing below.

Roomba and ESP8266 circuit
Roomba and ESP8266 circuit

Find a stable 5V source on the motherboard to power the circuit. I found it here on my Roomba 531 vacuum cleaner.

Stable 5V on the motherboard
Stable 5V on the motherboard

Then let’s install it. I found a seat for ESP8266-01 and AMS1117 at the bottom right, it just fit.


Update

I replaced the AMS1117 voltage stabilizer with MP1584EN so there is no need to solder on the motherboard. Simply wire it the battery voltage from the connector.

MP1584EN DC-DC Buck Converter Adjustable Power Supply

Roomba and ESP8266-01 circuit
Roomba and ESP8266-01 circuit

Remember to set the output voltage on the MP1584EN voltage stabilizer module using the potentiometer marked with an arrow. This is a small module (22 x 17mm) input voltage: 4.5 V to 28 V Output voltage: 0.8 V to 20 V adjustable.

MP1584EN DC-DC Buck Converter Adjustable Power Supply
MP1584EN DC-DC Buck Converter Adjustable Power Supply

Of course, the ESP8266 must be programmed before assembly. Open the Arduino program and load the code.

/**************************************/
//  https://myhomethings.eu           //
//  Generic ESP8266 module            //
//  Flash size: 1M (no SPIFFS)        //
/**************************************/

#include <ESP8266WiFi.h>
#include <PubSubClient.h>

const char* ssid = "SSID";
const char* password = "Password";
const char* mqtt_server = "192.168.x.xxx";

WiFiClient espClient;
PubSubClient client(espClient);

void setup_wifi() 
{
  delay(100);
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  
  while (WiFi.status() != WL_CONNECTED) 
  {
    delay(500);
  }
  randomSeed(micros());
}

void reconnect() 
{
  while (!client.connected()) 
  {
    String clientId = "ESP8266Client_Roomba";
    
    if (client.connect(clientId.c_str()))
    {
      client.subscribe("Roomba");
    } 
    else 
    {
      delay(6000);
    }
  }
}

void callback(char* topic, byte* payload, unsigned int length) 
{
  payload[length] = '
/**************************************/
//  https://myhomethings.eu           //
//  Generic ESP8266 module            //
//  Flash size: 1M (no SPIFFS)        //
/**************************************/
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
const char* ssid = "SSID";
const char* password = "Password";
const char* mqtt_server = "192.168.x.xxx";
WiFiClient espClient;
PubSubClient client(espClient);
void setup_wifi() 
{
delay(100);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) 
{
delay(500);
}
randomSeed(micros());
}
void reconnect() 
{
while (!client.connected()) 
{
String clientId = "ESP8266Client_Roomba";
if (client.connect(clientId.c_str()))
{
client.subscribe("Roomba");
} 
else 
{
delay(6000);
}
}
}
void callback(char* topic, byte* payload, unsigned int length) 
{
payload[length] = '\0';
String strTopic = String(topic);
String strPayload = String((char * ) payload);
if(strTopic == "Roomba") 
{
if(strPayload == "true") 
{
Serial.write(128);  // start command
delay(50);
Serial.write(131);  // safe mod
delay(50);
Serial.write(135);  // clean
}
if(strPayload == "false") 
{
Serial.write(128);  // start command
delay(50);
Serial.write(131);  // safe mod
delay(50);
Serial.write(143);  // dock
}
}
}
void setup() 
{
Serial.begin(115200);
setup_wifi();
delay(1000);
client.setServer(mqtt_server, 1883);
client.setCallback(callback);
}
void loop() 
{
if (!client.connected()) 
{
reconnect();
}
client.loop();
}
'; String strTopic = String(topic); String strPayload = String((char * ) payload); if(strTopic == "Roomba") { if(strPayload == "true") { Serial.write(128); // start command delay(50); Serial.write(131); // safe mod delay(50); Serial.write(135); // clean } if(strPayload == "false") { Serial.write(128); // start command delay(50); Serial.write(131); // safe mod delay(50); Serial.write(143); // dock } } } void setup() { Serial.begin(115200); setup_wifi(); delay(1000); client.setServer(mqtt_server, 1883); client.setCallback(callback); } void loop() { if (!client.connected()) { reconnect(); } client.loop(); }

If the circuit is assembled, ESP8266-01 is programmed, assemble the Roomba in the reverse order of disassembly. Pay attention to wires so that they do not get caught.

Put together in a room, nothing would have happened anyway
Putting it together in a room, as if nothing had happened

With this, the hardware is ready.


Let’s look at the new tool in ioBroker on the Object tab under MQTT.

blank

If set to “true” it will start cleaning, if “false” it will look for the dock.

I assume the “IoT Assistants” adapter is installed, configured, and properly licensed. On the Instances tab, select the iot.0 adapter and add the Roomba device as a switch to the Alexa devices.

Adding Roomba to Alexa devices on the IoT adapter
Adding Roomba to Alexa devices on the IoT adapter

This completes the ioBroker section.

Now open the Amazon Alexa app on your phone and add a new device.

Amazon Alexa, add device
Amazon Alexa, add device

Within the Amazon Alexa application, we can create routines and automate the process.

From now on, you can also control the roomba with your voice using Amazon Echo / Echo Dot

“Alexa, turn on Roomba”