Add wifi to an older roomba

Hi @Real-Time-Kodi ,

Thank you so much I’m now able to control my old roomba!!!

This is awesome i will try this as soon as i have my esp

Do you have the pinout for the roomba side ?

The pinout for the Roomba is rather easy and is mentioned in the create2 reference document.
But you can also see it up in this topic: (click)
In my schema’s I’m using a lot of labels to decouple the different components of the hardware design, but these four pictures should add some clarity:

image image
image

I’m using a 2N3906 transistor for the Roomba to ESP communication.
I couldn’t get it to work with a simple voltage divider.

I’m also planning to upload the gerber files and a parts list into my repo, but didn’t get around to it just yet.
So feel free to ask more questions.

2 Likes

I confirm I was able to get data from the Roomba using a 2N3906 transistor and your great ESPHome UART integration.

1 Like

Hi,

this is mine (awaiting shipment), I’m using 2n3906 PNP

Well, for some reason my Roomba serial port died.
I have no clue why.
After removing my chip and re-inserting it again a few minutes later (was working on a cover for the roomba), I think it short-circuited.
During the next day, somehow the Roomba battery got drained as it was still on the base station.
The ESP chip got hot, as well as the switching voltage regulator (TSR-1-2433) that supplies the 3.3V to my ESP.

After taking the custom PCB out of the Roomba again and placing the Roomba back on the base station, it began a battery recovery with a fast orange flashing clean button.

Then I put the custom PCB back into the serial port, but I can no longer send commands or receive data.
I also tried to put my prototype on the breadboard back in, but that doesn’t work either.
So it’s not the custom PCB, but the Roomba serial port that is broken.
I think the only way to resolve this is to repair the motherboard of the Roomba, or get a used one from a donor Roomba.
If anyone has any tips or advice, I’d like to hear it.

Furthermore, I added the schema and gerber files to my repo.
Check out the schema and gerber folders.

I am a noob… but I’d try with an oscilloscope (no experience though).
Or leveraging another UART - like the raspi one - in order to check if the serial still works.

1 Like

I don’t own an oscilloscope, but I should probably get one if I want to take this hobby any further indeed.
Thanks for the tip :slight_smile:

I want to share back the (almost) final step (i need now a small box to place the pcb)

thank you to all of you for the support!!!

2 Likes

Which model Roomba is that?
I never knew there were Roomba models with the serial port over on the top left :sweat_smile:.
(Seen from the top).
My serial port is on the right of the clean button.

Anyway…
Looks good! Well done.
Which voltage regulator did you choose eventually?

I’ve merged both UART support and some black magic from good old johnboiles’ repo to avoid BRC pin issues on Roomba 650 (in order to prevent this model to fall into a deep sleep that can be interrupted only manually pressing the CLEAN button or with an ugly relay).
So far so good: after two weeks no issues.

1 Like

I don’t know how to check the model, i saw 601 on the bottom label
I used this step down MP1584EN

image

Hi @davidecavestro, I’m testing the latest version with UART refactor;
I can’t wake up the Roomba any more :frowning:

this is my EPSHome code:

 init: 'RoombaComponent::instance(D4, id(uart_bus), 10000, true);'
....
uart:
  id: uart_bus
  tx_pin: TX
  rx_pin: RX
  baud_rate: 115200
  
# Enable logging
logger:
  hardware_uart: UART1

Once I wake up the Roomba with physical button and the serial communication is initialized, I have all the telemetry

but when it goes in deep sleep

Do you have any suggestions?

I also would like to understand how to use the buttons. Can you explain to me how the commands are supposed to work? I see the code, but I don’t understand how to use it

I checked the fork by @Real-Time-Kodi

https://github.com/Real-Time-Kodi/ESPHomeRoombaComponent

and after swapping from private to public I’m able to send commands, but I’m not sure that’s the way to go

image

Thank you for your support
Regards

I use them this way …basically for fun :wink:


passing the command name to the service. i.e. the following example is for using the paper-buttons widget (please note I renamed the roomba component to vacuum here so the service name became esphome.vacuum_command)

type: entities
entities:
  - type: custom:paper-buttons-row
    buttons:
      - icon: mdi:chevron-up
        tap_action:
          action: call-service
          service: esphome.vacuum_command
          service_data:
            command: go_faster
  - type: custom:paper-buttons-row
    buttons:
      - icon: mdi:chevron-left
        tap_action:
          action: call-service
          service: esphome.vacuum_command
          service_data:
            command: go_left
      - icon: mdi:checkbox-blank-circle-outline
        tap_action:
          action: call-service
          service: esphome.vacuum_command
          service_data:
            command: halt
        hold_action:
          action: call-service
          service: esphome.vacuum_command
          service_data:
            command: drive
      - icon: mdi:chevron-right
        tap_action:
          action: call-service
          service: esphome.vacuum_command
          service_data:
            command: go_right
  - type: custom:paper-buttons-row
    buttons:
      - icon: mdi:chevron-down
        tap_action:
          action: call-service
          service: esphome.vacuum_command
          service_data:
            command: go_slower
        hold_action:
          action: call-service
          service: esphome.vacuum_command
          service_data:
            command: halt

My Roomba model is 650, please check your.

I’ve experimented a bit and seen that this way - passing true to the 4th param just added - the controller actually prevents the Roomba to fall asleep, so the CLEAN button light is always on, the serial port active and all registers available. I must admit I’ve not tested it yet passing false as I was interested in the logic to prevent the deep sleep.
Probably this is not the best solution, though I’ve noticed no performance nor battery degradation so far (only 2 weeks testing as of now).
The original code comes from johnboiles repo, and for my vacuum it works, provided that the Roomba is awake at ESP boot time or you wake it up manually in order to let the ESP take control and prevent the deep sleep.
I must say most of the time my Roomba is on the dock - so I should test it more exhaustively - but at least the gathered data is consistent and it always reacts to commands.


PS: As of now I’ve put a 2N3906 transistor between the Roomba WRITE pin and the logical level shifter, as per Add wifi to an older roomba - #77 by Ecam315 and https://www.irobotweb.com/~/media/MainSite/PDFs/About/STEM/Create/Create_2_to_5V_Logic.pdf
So far it works fine thought I’m curious to check if I can completely skip the logic level shifter.

Thank you so much @davidecavestro,

I got it :smiley:

just in case if anyone would like to use it
as far I understood probably, I can remove the wakeup buttons (the first row)

type: vertical-stack
title: roomba-control
cards:
  - type: horizontal-stack
    cards:
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.roomba_control_command
          data:
            command: wakeup
          target: {}
        icon: mdi:gesture-swipe-up
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.roomba_control_command
          data:
            command: wake_on_dock
          target: {}
        icon: mdi:eject-circle
  - type: horizontal-stack
    cards:
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.roomba_control_command
          data:
            command: start
          target: {}
        icon: mdi:arrow-right-drop-circle
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.roomba_control_command
          data:
            command: stop
          target: {}
        icon: mdi:stop-circle
  - type: horizontal-stack
    cards:
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.roomba_control_command
          data:
            command: spot
          target: {}
        icon: mdi:refresh-circle
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.roomba_control_command
          data:
            command: dock
          target: {}
        icon: mdi:home-circle
  - type: horizontal-stack
    cards:
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.roomba_control_command
          data:
            command: locate
          target: {}
        icon: mdi:bell-circle
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.roomba_control_command
          data:
            command: sleep
          target: {}
        icon: mdi:pause-circle

1 Like

Copy that. I see the same behavior

When the Roomba is on the dock, the CLEAN button light is always on, and the serial port is active
I don’t see the same once the Roomba IS NOT on the dock, the CLEAN button light is off, and the serial port goes passive (I guess)

I used the same schema

1 Like

Thanks for sharing, this is way easier than how I organized buttons before

1 Like

@davidecavestro , do you think that I can remove the wakeup and wake-on-dock buttons? I think that if the Roomba is in deep sleep, they don’t work at all. correct?

If you want to configure the icon directly in the esp

  - platform: custom
    lambda: |-
      auto r = ${init}
      return {r->voltageSensor, r->currentSensor, r->batteryChargeSensor, r->batteryCapacitySensor, r->batteryPercentSensor, r->batteryTemperatureSensor, r->driveSpeedSensor};

    sensors:
      - name: "${friendly_name} distance"
        unit_of_measurement: "mm"
        icon: mdi:map-marker-distance
        accuracy_decimals: 0

      - name: "${friendly_name} voltage"
        unit_of_measurement: "V"
        icon: mdi:sine-wave
        accuracy_decimals: 2

      - name: "${friendly_name} current"
        unit_of_measurement: "A"
        icon: mdi:lightning-bolt
        accuracy_decimals: 3
      
      - name: "${friendly_name} charge"
        unit_of_measurement: "Ah"
        icon: mdi:battery-charging
        accuracy_decimals: 2
      
      - name: "${friendly_name} capacity"
        unit_of_measurement: "Ah"
        icon: mdi:battery
        accuracy_decimals: 2
      
      - name: "${friendly_name} battery"
        unit_of_measurement: "%"
        state_class: "measurement"
        device_class: battery
        icon: mdi:battery-outline
        accuracy_decimals: 0
      
      - name: "${friendly_name} temperature"
        unit_of_measurement: "°C"
        icon: mdi:thermometer
        accuracy_decimals: 0

text_sensor:
  - platform: custom
    lambda: |-
      auto r = ${init}
      return {r->chargingSensor, r->activitySensor, r->oiModeSensor};
    text_sensors:
        - name: "${friendly_name} charging state"
          icon: mdi:battery-charging-high 
        - name: "${friendly_name} activity"
          icon: mdi:robot-vacuum-variant
        - name: "${friendly_name} OI mode"
          icon: mdi:steering