Interesting. I bet your model is one of the 650s manufactured before Feb 2015. I think that’s when the glitchy models that don’t stay awake came out
I do have to pulse the BRC pin, otherwise it does stop responding. Which means when it gets stuck in the middle of the night it reminds me constantly until I go unstick it.
That’s expected and documented in the Roomba docs. The weird thing is that on newer 650s it doesn’t actually work to keep the roomba awake.
I got a Roomba 621 and I’m wondering if it is possible to use your script with a NodeMCU ESP8266.
Is there any wiring diagram out there for connecting to this board? I just find it somehow complex understanding your wiring diagrams for Wemos D1 Mini and the blank ESP8266.
I was wondering if you can share the diagram for your ESP-01 setup.
i got it working with ESP8266 NodeMCU, my Roomba 621 and this repository: https://github.com/incmve/roomba-esp8266/
Here is my wiring diagram:
I just tried the repo from johnboiles (https://github.com/johnboiles/esp-roomba-mqtt) but got no luck.
(D) Failed to read sensor values from Roomba
I tried with the Hardware-Serial-Pins (GPIO1 & GPIO3). I read that they are used only when the board is connected via usb, so dunno what pins to use with this repo (which is using the HardwareSerial from Roomba.h library).
Some little update:
The reading of sensors isn’t working with my actual setup. I would like to test it with the PNP-Transistor. Anyone knows how to wire it to a 3,3V-Input of the ESP8266?
Yup! I been trying this code (johnboiles) in multiple ESP-01s, ESP-12Es, and NodeMCU ESP-12es without success. I guess I’m gonna give a try this one too. Thanks!
I wonder if it’s something about using the hardware serial port that’s not working. I see this repo uses SoftwareSerial. It would be interesting for someone to change my version to use Software Serial and see how it behaves.
The Roomba-Library from Mike McCauley is using the HardwareSerial. So i think u have to change the whole library!?
I really like your sleepIfNecessary() which is reading Battary-Voltage per ADC-Pin. How did you connect the ADC/A0 Pin? Unfortunateley it is not shown in your schematic
I spent some time last night hooking up a Wemos D1 Mini with a 3.3v-5v bidirectional level shifter so I would have true 5V logic levels to the Roomba. I was fairly certain this would work, and possibly even make things more reliable than my original setup (that uses 3.3v to drive the 5v UART on the Roomba). However, I could not get it to work at all. I’m at a loss as to why this would be. I was unable to send any commands to the Roomba or get it to respond at all. I used my oscilloscope to sanity check that I was sending serial commands to the Roomba and everything looked acceptable – the output of the level shifter wasn’t as clean as I would have liked it, but it was still at higher voltages than it would have been with the original 3.3v setup. There’s something weird happening that makes the Roomba’s serial port tricky to interface with, and I’m very curious what it is. Please keep posting your experiences. The more data points we have the more likely it is we can figure out what’s happening.
I also moved my code away from using query-ing for sensor values (opcode 149) and added a streaming (opcode 148) implementation. I’ll push it up to GitHub in the next couple days. The stream interface has its quirks (it will return the packets I ask it to stream, and also a bunch of other things, sometimes), but it seems to work much more consistently than the query interface.
I think you can probably just change the references in the code from
SoftwareSerial and it might just work.
Yeah this was one thing I wanted to do before putting it in the Roomba permanently. I don’t want to deep discharge the battery if I’m away for a few days and the Roomba gets stuck. I’m not sure about NiMH but I know this is really bad for lithium batteries. I use a voltage divider to bring the Roomba Vcc level (0-30V) down to a range from (0-1V). I had 2.2K resistors and 100k resistors, so I just used a 100k from VCC to the A0 pin and then a 2.2k from A0 pin to GND.
0-1v is represented by 0-1023 from
analogRead. So you can calculate that value with something like:
1000mv/V * (100k + 2.2k) / 2.2k / 1024 = 45.366. You can then multiply that value by the output of
analogRead to get the battery voltage in mV. My value was slightly different based on the measured resistance of my resistors (my 100k was more of a 97k resistor).
I’ll add this to the schematic and README at some point. Or you can submit a PR!
I got it working in the NodeMCU ESP-12E with your new stream implementation, SoftwareSerial and Blackmesa wiring diagram setup. However, the current value is negative, see below:
That’s expected while off the dock or cleaning. That means your roomba is using 1234mA of current to run. Based on the mAH in the charge field I would expect it to be able to run for ~2 hrs before totally dying. Usually roomba returns to dock before it’s totally spent though.
When you’re charging the current value will go positive
Also please share your code if you can. Ideally via a pull-request
I’ve finished a board targeting esp-roomba-wifi that fits behind the starboard wheel next to the charging plug. The sources and parts list are available here:
This is great. Any chance to get a PCB?
If you want the PCB files, they’re here: https://github.com/kg333/roomba_esp_wifi/releases
If you’re looking for a manufactured PCB, I’ve shared the design at OSH Park. They’ll build three copies and ship them to you for about $6 USD. Usually takes them 2-3 weeks to manufacture and ship.
I have an interesting issue now. I used a WEMOS D1 mini pro v1.0.0 and I had to put a capacitor so that the ESP does not crash all the time, but it is up and stable. Roomba 581.
I do get the sensor states through telnet and mqtt as long as the roomba is “awake” (=led of CLEAN button is ON).
But the roomba does not react to any commands. Wake-up, Cleaning, Return to base - nothing works!
What is going on here? How can it send commands to receive sensor values, but not commands to clean?
Got it working…
I used johnboiles code
in combination with only one PNP transistor an nothing else and now ist working perfectly stable
I was watching over an hour with Telnet while the Roomba was working and got all the values without any issue the whole time.
The only think that’s problematic is already mentioned here:
Removing the mentioned line worked for me.
Was thinking about getting the math done inside Home Assistant, if that’s possible but I guess it’s not since roombaState.charge and roombaState.capacity aren’t available to HA.