Roomba voice control with Alexa and Belkin-Wemo emulator

With Alexa, we can start an iRobot Roomba or send it back to its dock using a voice command. In this example, an ESP8266-01S module emulates a Belkin WeMo switch and connects directly to an Amazon Echo.

Created: March 2021

Reviewed: November 2026

Outdated content

On newer Echo devices and after firmware updates, local discovery of WeMo-based devices may be limited by changing network and security requirements.

There is no guarantee, but the example may still work with some older Amazon Echo or first- and second-generation Echo Dot devices.

We have kept this article for historical and reference purposes.

This example does not require an ioBroker server. In another article, I show how to send commands to the Roomba through an ioBroker server.

Turn your Roomba into a voice-controlled robot vacuum

We can send commands to the Roomba through its serial port. The seven-pin mini-DIN connector for the iRobot Roomba® Open Interface is located beneath the top cover.

iRobot Roomba® Open Interface
iRobot Roomba® Open Interface

Parts used in this project:

  • ESP8266-01S Wi-Fi module
  • ESP-01 breadboard adapter for the ESP8266
  • USB programming adapter for the ESP8266-01 module
  • MP1584EN 3 A step-down voltage regulator module

Disassemble the Roomba

Remove the dust bin and brushes. Undo the four screws, lift off the bottom cover, and remove the battery.

Disassembling the iRobot Roomba: bottom section
Disassembling the iRobot Roomba: bottom section

Next, remove the bumper, unclip the top cover, and remove the screws beneath it. The two screws on the handle can stay in place.

Disassembling the iRobot Roomba: top section
Disassembling the iRobot Roomba: top section

Remove the housing.

Roomba with the housing removed
Roomba with the housing removed

Build the Belkin WeMo emulator circuit

Connect the ESP8266-01S TXD pin to pin 3 (RXD) of the Roomba’s seven-pin mini-DIN connector, as shown below. The add-on circuit can be powered from Roomba pins 1 and 6 through the MP1584EN step-down module. Follow the diagram for the remaining connections.

Roomba and ESP8266-01 wiring, version 2
Roomba and ESP8266-01 wiring

Before connecting the ESP8266-01S module, set the MP1584EN regulator’s output to 3.3 V using the potentiometer marked by the arrow, and verify the voltage with a meter. The compact module measures about 22 × 17 mm; its specified input range is 4.5–28 V and its adjustable output range is 0.8–20 V.

MP1584EN step-down voltage regulator module
MP1584EN step-down voltage regulator module

Arduino sketch for the ESP8266-01S Belkin WeMo emulator

Upload the sketch to the ESP8266-01S and use the downloadable library below. Debug output in this Arduino sketch is commented out because serial messages could interfere with communication with the Roomba.

Open the Arduino IDE. Enter your Wi-Fi credentials in the sketch below. You can also change the Roomba’s friendly name; this is the name shown in the Alexa app.

/**************************************/
//  https://myhomethings.eu           //
/**************************************/

#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <WiFiUdp.h>
#include "Switch.h"
#include "UpnpBroadcastResponder.h"

const char* ssid = "SSID";
const char* password = "Password";
const char* RoombaFriendlyName = "iRobot Roomba";

Switch *switchRoomba = NULL;
UpnpBroadcastResponder upnpBroadcastResponder;

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

bool switchRoombaOn()
{
  Serial.write(128);  // start command
  delay(50);
  Serial.write(131);  // safe mod
  delay(50);
  Serial.write(135);  // clean
  return true;
}

bool switchRoombaOff()
{
  Serial.write(128);  // start command
  delay(50);
  Serial.write(131);  // safe mod
  delay(50);
  Serial.write(143);  // dock
  return false;
}

void setup()
{
  Serial.begin(115200);
  setup_wifi();
  
  upnpBroadcastResponder.beginUdpMulticast();
  switchRoomba = new Switch(RoombaFriendlyName, 80, switchRoombaOn, switchRoombaOff);
  upnpBroadcastResponder.addDevice(*switchRoomba);
}

void loop()
{
  upnpBroadcastResponder.serverLoop();
  switchRoomba -> serverLoop();
}

How does the code work?

The ESP8266 first connects to the configured Wi-Fi network. The library then emulates a Belkin WeMo switch and advertises a device named iRobot Roomba on the local network. Alexa looks for this name during device discovery.

The setup() function starts serial communication with the Roomba at 115200 baud. After connecting to Wi-Fi, it starts the service used for network discovery and creates the emulated switch. It assigns separate functions to the switch’s on and off commands.

When Alexa asks to turn the switch on, switchRoombaOn() sends three command bytes to the Roomba’s serial input. Byte 128 starts the Roomba Open Interface, 131 enters Safe mode, and 135 starts the normal cleaning cycle. There is a short delay between the commands.

Here, turning the switch off does not mean cutting power to the robot. switchRoombaOff() also sends bytes 128 and 131, then uses command 143 to tell the Roomba to seek its dock. In this example, the WeMo switch’s on and off states therefore represent two different Roomba commands: start cleaning and return to the dock.

The loop() function continuously handles network discovery and requests sent to the emulated switch. The true and false values returned by the functions set the emulated switch state. The program does not read the Roomba’s sensors, so it cannot confirm whether the robot actually started cleaning or reached the dock.

Reassemble the Roomba

Once everything is ready, find a secure place for the ESP8266-01S and the add-on circuit, then reassemble the Roomba in reverse order. Take care not to pinch any wires.

Roomba reassembled, as if nothing had happened
Roomba reassembled

Connect the Roomba to Alexa

Open the Amazon Alexa app on your phone and add the new device, iRobot Roomba, or ask Alexa to discover devices.

iRobot Roomba in the Alexa app
iRobot Roomba in the Alexa app

If discovery succeeds, you can then control the Roomba with your voice through Alexa.

If you would like another Roomba project, try building a virtual wall with an Arduino Nano.


← More Arduino and ESP examples and projects