Introduction: ROOMBA Driven by ARDUINO YUN Via Wifi App by STEFANO DALL'OLIO
With this guide I share the code to connect ARDUINO YUN to Roomba in order to drive Roomba via Wifi.
The code and the app is fully created and developed by myself Stefano Dall'Olio.
My Roomba is Roomba 620 but you can use the same code for other Roomba models.
Arduino YUN is powered by a simple USB power bank.
The commands are sent to Arduino YUN using BLYNK android app.
You can drive the Roomba using the app joystick or imposing the speed and the angle and pushing drive button.
Otherwise via app you can switch-on the motors, check the sensors status, start the cleaning or the spot process,...
The app also receives back the sensors signals from Roomba.
It is also possible to force ROOMBA scheduling via app on Roomba 620 even if it is not provided with scheduling buttons.
I also added the possibility to log the sensors in a file saved on the microSD inserted in the Arduino YUN.
Step 1: Set Up ARDUINO YUN
Install SimpleTimer library to Arduino unzipping the attached archive to:
C:\Program Files (x86)\Arduino\libraries\SimpleTimer
Restart Arduino software.
Load the attached sketch to Arduino YUN. Please note the authorization code auth should be replaced after the BLYNK app will be created. Than the sketch should be uploaded again to Arduino YUN. This step is explained later.
Step 2: Connect ARDUINO YUN to ROOMBA
Find an old mouse and cut the wire. Connect only 3 wires as reported in the Arduino sketch. Refer to Roomba pins as in the attached image.
Arduino YUN PIN 2 to Roomba pin 5
Arduino YUN PIN 10 to Roomba pin 4
Arduino YUN PIN 11 to Roomba pin 3
Remove from your ROOMBA 620 the plastic cover (mine is white plastic cover) just pulling up. You will see a connector as per attached photo.
Power the Arduino YUN with a simple power bank.
Step 3: Create BLYNK App to Drive Arduino YUN
Download Android BLYNK app and create a new interface.
I attach the shared QRCODE of my interface that you can use instead of create a new interface.
Substitute in the Arduino sketch the AUTH CODE retrieved from the BLYNK interface and upload again the sketch to your Arduino YUN. Below where the AUTH CODE should be substituted:
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth = "e70879f362a34d9fb213475a4389fcef";
If the Auth.code is wrong, the BLYNK app cannot connect to Arduino YUN and send commands.
Step 4: Drive the Roomba
1) Connect Arduino YUN to the Roomba
2) Power on Arduino YUN [after few seconds Roomba green button become red]
3) Open and start the Android BLYNK interface
Enjoy your Roomba driven by Arduino YUN.
In case the commands sent by Arduino YUN to Roomba are mis-interpeted by Roomba, probably the baudrate of Roomba is wrong. In order to set the corret baudrate simply when powering on Roomba, hold down the Clean/Power button. After about 10 seconds, Roomba plays a tune of descending pitches. Roomba will communicate at 19200 baud until the power is turned off, the battery is removed and reinserted, the battery voltage falls below the minimum required for processor operation, or the baud rate is explicitly changed by way of the OI.
We have a be nice policy.
Please be positive and constructive.