loading
Like most people I was skeptical about getting a robotic vacuum cleaner, so as a trial run I thought I would buy the now obsolete iRobot Roomba 530 which was heavily discounted (they're still available in Australia, showing how behind the times we are). 

Of course, as soon as I got it home I fell in love with it and for once had clean carpets!   

Unfortunately, this model doesn't come with a remote (I ended up getting a Logitech Harmony which allows me to control my robot slave) or a scheduler to allow scheduled cleans during the day while I was out.  

I had to PRESS A BUTTON before I left the house to make it clean! Not hard but I generally forgot to do it.  

Rather than forking out money to buy a scheduler (which may or may not have worked with this model) I built my own. The black box in the picture. 

This bare bones, super simple scheduler allows me to leave the house without having to do anything and come back to clean floors. As long as the Roomba is charged and at the docking station.

It's cheap, takes less time to build  than writing this instructable. And best of all, powered by an Arduino Uno! 

I've been stalking instructables for several years now and this is the first time I've actually documented a project all the way through well enough to make into an instructable. I have tried to include as much detail as I could to help others. Feedback on both the project and the instructable are very welcome. 

 

Step 1: Requirements

What you'll need: 

Important: 
- A Roomba controllable by Infrared. Mine is a 530. I think most models below the 530 use similar IR codes so you might be in luck. Do a little research, there are a lot of great forums out there. 

Components: 
- 1 x 940nM Infrared LED 
- 1 x LED (whatever colour you like, I picked red, this is to just signal if the device is on or not)
- 2 x 330 Ohm resistors (One for each LED)
- 1 x Arduino Uno (or similar, I initially used  Arduino duemilanove, but the Uno works with the same script and set up perfectly) 
- 4 lengths of wire  (I used 2 wires with pins for my breadboard cut in half) 

The power supply and Timer
- A power supply ( I used a spare USB cable type A/B - the one that plugs into the Arduino, connected to a AC/USB adaptor)
- A 24 hr timer switch (Cheap one from IKEA)  - This is used to do all the scheduling, just set the timer to power up the arduino                which then sends the "Clean" command to the Roomba. 

Other stuff: 
- A project box to keep everything neat.
- A computer with the Arduino IDE (I'm using Arduino IDE 1.05)
- The Arduino IR library from https://github.com/shirriff/Arduino-IRremote
(installation instructions on the site)
- Soldering Iron to join everything together first (use a breadboard to test everything works first!)

Step 2: Wiring Everything Together


As you can see from the diagram, there isn't much to the system. 

Just 2 LEDs.

1 Infrared LED to control the Roomba.

And a optional LED (in this case red) to let you know the device is on.
       Unless you can see in infrared, once everything is inside a project box you can't tell if its working or not.  

Use a 330 Ohm resistor on both LEDs so they don't burn out.  

The library used to control the IR LED is hardcoded to Digital Pin 3 so make sure the IR LED is connected to D3. 

The signal LED (RED LED) is wired to digital pin 10. Both are grounded. 

Make sure you get the LEDs polarity around the right way!

Next to the Arduino script!

I used the java tool at http://www.mekanizmalar.com/arduino_and_breadboard.htm to make the circuit diagram. 

Step 3: Arduino Script

Now, the Arduino Script. 

You'll need a computer with the Arduino IDE installed (I've used Arduino 1.05) 

Next, install the IR library from (instructions on the site) this is needed to run the script. 
https://github.com/shirriff/Arduino-IRremote

I modified (i.e. stripped it back)  the script developed by probono available from https://gist.github.com/probonopd/5181021. It's much more detailed than the script I've used. WIth it, you can send every Roomba command via the arduino. Definitely worth checking out! 

Basically, all the script I've pasted below does is:
       - When the power is turned on
       - Arduino is initialised, turns on red LED to let you know it's on. 
       - Begins transmitting the "Clean" (136) command repeatedly with a 5 second delay in between each transmission.  
       -  Doesn't stop till the power is cut!

Below is the script.....   Upload it to the board as normal. 
If you're interested, you can open the serial monitor (9600) and see the Arduino's output, just transmitting the "Clean" command on repeat. 


#include <IRremote.h>

/*

Super Simple Arduino Powerd Roomba Scheduler
  by gowell2010@gmail.com
 
2013-08-03 Instructables release

Code adapted from: https://gist.github.com/probonopd/5181021

       Send infrared commands from the Arduino to the iRobot Roomba
by probono

2013-03-17 Initial release

Copyright (c) 2013 by probono
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

*/

IRsend irsend; // hardwired to pin 3; use a transistor to drive the IR LED for maximal range

int LED = 10;

void setup()
{
  Serial.begin(9600);
  pinMode(LED, OUTPUT); 
  digitalWrite(LED, HIGH);   // turn the LED on (HIGH is the voltage level)
 
}

void loop()
{
  roomba_send(136);  // Send "Clean"
  delay(5000);               //Wait 5 seconds
}

void roomba_send(int code)
{
  Serial.print("Sending Roomba code ");
  Serial.print(code);
  int length = 8;
  unsigned int raw[length*2];
  unsigned int one_pulse = 3000;
  unsigned int one_break = 1000;
  unsigned int zero_pulse = one_break;
  unsigned int zero_break = one_pulse;

  int arrayposition = 0;
  // Serial.println("");
  for (int counter = length-1; counter >= 0; --counter) {
    if(code & (1<<counter)) {
      // Serial.print("1");
      raw[arrayposition] = one_pulse;
      raw[arrayposition+1] = one_break;
    }
    else {
      // Serial.print("0");
      raw[arrayposition] = zero_pulse;
      raw[arrayposition+1] = zero_break;
    }
    arrayposition = arrayposition + 2;
  }
  for (int i = 0; i < 3; i++) {
    irsend.sendRaw(raw, 15, 38);
    delay(50);
  }
  Serial.println("");

  Serial.print("Raw timings:");
   for (int z=0; z<length*2; z++) {
   Serial.print(" ");
   Serial.print(raw[z]);
   }
   Serial.print("\n\n");
}









Step 4: Packing Everything Into a Project Box


So I don't risk my Roomba destroying the Arduino in it's mad cleaning frenzy, I've packed everything into a project box with the LEDs facing outwards. Unless you have a project box ready made, you'll need to drill a few holes to let the LEDs and the USB cable through. 

Go through the remaining steps and test the device with the Roomba before you solder anything. Breadboards are your friend!  

All in all, a minimalist look.

Step 5: Final Setup and Running


So, if everything has gone to plan (hopefully you've tested everything as you've gone along) you should be ready to set everything up and leave the Arduino in charge! 

In the picture below, you can see the 24hr timer switch set to turn on for 30 minutes at  9am. With this cheap timer you can only set it for half hour intervals, which is much longer than required to start the Roomba but does the job. 

This is connected  the AC/USB adaptor which is connected to the Arduino Uno inside the project box via the USB A/B cable. 
You could use a proper Arduino power adaptor but this is what I had on hand.  The box is placed near the Roomba's docking station, in line of sight helps. In my final setup, the box is fixed to the leg of the table where the Roomba is normally housed. 

Basically, when the timer switch turns on, the Arduino runs the script on Step 3, which beams out "Clean, Clean, Clean..." to the Roomba, with a 5 second delay between transmission. The red LED comes on so you can tell that the scheduler is working. 

If the Roomba is docked and charged this will start the Roomba's Clean cycle.

It can take a couple of moments for the Roomba to acknowledge the command (I think because the IR signal isn't that powerful or maybe just slightly off the correct frequency) but once the clean cycle is started the continued transmission of the "Clean" command doesn't seem to affect the roomba. After 30 minutes the Timer switch will turn off the Arduino allowing the roomba to dock and recharge after it's finished its clean (If it comes back and isn't stuck in the bathroom as mine has the habit of doing). 

In the future, I would like to incorporate the timer switch into the arduino/project box rather than rely on this bulky adaptor on the wall, but this works for now. 

Addition of  ethernet shield so I can turn it on from my computer would be great but that is much more complicated than required at the moment. If there is interest, I'll make it into my second instructable! 

Have fun! 

Feedback on both the project and the instructable are very welcome.  



To update you, I swapped out the IR bulb and swapped out the baud rate to 115200 as I have read on a few websites that the 530 defaults to that connection rate and it worked! Awesome design and thanks again for coming up with the walkthrough on this.
Great news and thanks for the kind comments :) I was going to suggest replacing the IR LED with just a standard LED just to make sure it flashes, then try a few different IR LEDs. I had to test a few as well before mine worked. It would be so much easier if I could see in IR! I think I was lucky defaulting on the 115200 baud rate. <br> <br>Post a picture of your setup :)
<p>I have the prototype working just fine with no modifications to the code on my Roomba 620. The only issue I'm having is that the Roomba 620 doesn't stay on when it's fully charged...is there a way to keep enable this within the open interface mode?</p>
<p>Long time since the last post, but i'll try anyway...</p><p>What do you guys mean with changing the baud rate? You mean Serial.begin(9600)? Isn't that for the Serial.Print()? How does that help sending the command through IR?</p><p>Anyway, I tried changing the Serial.begin() to 115200 like you guys said, but without success. </p><p>Setup</p><p>I'm using a Roomba 620 with can (according to youtube) understand remote commands. I've also got some 940nm IR LEDs along with a Arduino Uno and some other starting gear. I'm trying to send the clean (136) command to the Roomba.<br></p><p>What I did</p><p>To be sure the IR LEDs worked I watched them with an old camera I had laying around. <br>I also tried switching the IR LED to three different coloured LEDs (red, green yellow).<br>I tried different distances between the robot and the flashing LED. I tried holding it into the eye of the robot and various other places.</p><p>All this without success.</p><p>Any tips, suggestions or kinds words for me?</p>
<p>I have the exact same problem.<br><br>Here is what helped me.<br><br>I changed these three line of code:<br>for (int i = 0; i &lt; 3; i++) {</p><p> irsend.sendRaw(raw, 15, 38);</p><p> delay(50);</p><p>into this:</p><p> for (int i = 0; i &lt; 4; i++) {</p><p> irsend.sendRaw(raw, 15, 39);</p><p> delay(40);</p><p>and then it worked.<br>I got then numbers from another roomba example I found some other place, but sadly lost the link, but the code is here:<br><br>#include &lt;IRremote.h&gt;</p><p>IRsend irsend;</p><p>//unsigned int clean[] = {2650,1100,750,2900,750,2950,700,2950,2700,1100,700,2950,750,2900,750};</p><p>unsigned int manu2[32]= {2872,999,897,2872,897,2872,897,2872,2872,999,897,2872,897,2872,897};</p><p>void setup()</p><p>{</p><p> Serial.begin(9600);</p><p>}</p><p>void loop() {</p><p> for (int i = 0; i &lt; 4; i++) {</p><p> //irsend.sendRaw(clean, 15, 38);</p><p> irsend.sendRaw(manu2, 15, 39);</p><p> Serial.println(&quot;Roomba GO~~~~~~~~~~~~~~~~~&quot;);</p><p> delay(40);</p><p> }</p><p> delay(5000);</p><p>}</p>
You can Write a schedule to the roomba, thats what i did. I own the 534 PET without schedule Option. The scheduling Commands are described in the Open Interface Document (I will Look for a link), this is really quite straight foreward, some People have also attached bluetooth or wifi, in Order to get Constant Access to the roomba without cable.<br>However once you programmed it, theres no Need to use the cable anymore.<br>I will send you some more info later on...
Here#s the Interface doc: http://www.irobot.lv/uploaded_files/File/iRobot_Roomba_500_Open_Interface_Spec.pdf
I've just fixed the formatting on the link.&nbsp;<br> <a href="http://www.irobot.lv/uploaded_files/File/iRobot_Roomba_500_Open_Interface_Spec.pdf" rel="nofollow">http://www.irobot.lv/uploaded_files/File/iRobot_Roomba_500_Open_Interface_Spec.pdf</a><br> <br> Cheers for that. I've seen some of this info before when I was looking into it a while ago but could never be sure the scheduler worked for the 530 model. &nbsp;<br> <br> When I need my spare arduino, I'll have to give your method a go :)&nbsp;
Hey, nice instructable. i was only wondering why you were not just plugging in the interface cable to the irobot and triggering a schedule directly on the roomba. That is actually the cheapest and easiest solution for the 5xx series from my perspective. I did that with my 534, working great!
Hi nberndt, <br> <br>I looked into interfacing with my Roomba (Robbie). But that would have meant removing the cover, attaching a cable and sending a command every time I want the roomba to turn on. I don't think you can program a schedule into the 534 (I've never seen any reference to a clock in this model). Correct me if I'm wrong :) <br> <br>I wanted to keep everything factory standard and as compact as possible to make things cleaner. An interface cable might be cheaper (if you have one or can make one up easily), but a cable sticking out the top is asking for trouble, especially as it goes under furniture! <br> <br>Mine has been running using this system for a few months now with no dramas :) <br> <br>I would love to see what you have done with yours though!
Seeing your Ible is what I needed to get started with arduino. I decided to go with a small form factor and purchased the Teensey 3.0. After I got it I found out that it has a build in Real Time Clock. I'm still getting all the parts rounded up for this project but Ill let you know how it turns out. Thank you.
Sounds great. If you end up using the built in clock you should definitely write your own Ible.
Up and running with not tweaks needed. I just had to get it really close to the Roomba and it worked like a charm. I have the board pushed into a gutted virtual wall that is connected to a Belkin WeMo switch (wifi enabled and allows me to schedule everything remotely based on rules). Here is a picture of the set up. Thanks again for creating this set up.
What codes did you use for the Harmony Remote. I have the same Roomba (537 with same colour and everything) but didn't have any luck controlling it with the Harmony One.
Hi tbag, <br> <br>On the MyHarmony website I used: <br> <br>Manufacturer: iRobot <br>Model Number: Roomba 530 <br> <br>I tried entering 537, but the website (helpfully) says that this device is not recognised. <br>Try the 530 model number, from my reading it seems to be similar codes for almost all Roomba models. <br> <br>I'm making up an instructable now with how I did it.
Cool project! Even though it is claimed that the clock of the arduino is not very precise, I bet it is still better than the mechanical clock in these timers.
Thanks Carlos66ba. I was looking into implementing a software clock on the arduino (something like https://www.inkling.com/read/arduino-cookbook-michael-margolis-2nd/chapter-12/recipe-12-4) but I had a heap of these timers and thought it might be more energy efficient to turn the Arduino off rather than having it just waiting till the next scheduled time. I should put my power meter on it to see which uses more, the arduino or the timer switch.

About This Instructable

34,214views

93favorites

License:

More by ShaperG:Ikea 'Solvinden' - Solar USB Power Supply Super Simple Arduino Powered Roomba Scheduler 
Add instructable to: