Controling Roomba 520 with a PIC

Inside the Roomba and Scooba and more, Cool mods, Repair and Upgrades - including the all new iRobot Create Kit. Let's void that warranty baby!
Post Reply
Henrik11
Posts: 3
Joined: July 8th, 2010, 7:19 am

Controling Roomba 520 with a PIC

Post by Henrik11 »

Hey guys,

I'm new at this forum, I'm working in my university with a Roomba 520 and I need to control it with a PIC18f2550.
I have found in the net a .pdf with the SCI protocol that allows you to control the roomba (http://www.irobot.com/images/consumer/h ... Manual.pdf) so I have made a program for my PIC that puts the DD line from 1 to 0, to wake it up, and then it returns to 1. (TTL levels).
Then I send 3 bytes with half a second between them (I've tried different times). These bytes are [128], [130] and [135]. I use the USART that this PIC has.
If I had done everything correct, the roomba should start cleaning as if I push the CLEAN button after these 3 bytes. The roomba does nothing.
The baudrate I use is 57600 so here it's not the problem and I connect directly the TX pin from the PIC to the RX pin from the roomba.

I would be really greatful if any of you have any idea of what I am doing wrong.

Thanks to all of you!
User avatar
mfortuna
Robot Master
Posts: 5853
Joined: February 5th, 2006, 9:35 am
Location: NH

Re: Controling Roomba 520 with a PIC

Post by mfortuna »

The 500 series baud rate is 115200. There is a seperate SCI doc for the 500 series. Search with google and you will find it.
Mike
Reds x 3, Dirt Dog, Disco (now a parts bot), Create, Scooba 350, and Security Dawg
Evolution Mint
Neato XV-11
Shark Ion 750
User avatar
vic7767
Robot Master
Posts: 15556
Joined: January 14th, 2006, 7:31 pm
Location: Haughton Louisiana - USA

Re: Controling Roomba 520 with a PIC

Post by vic7767 »

Here's a link to the 500 Open Interface pdf document.

http://www.robotreviews.com/chat/viewto ... f=4&t=7126
Henrik11
Posts: 3
Joined: July 8th, 2010, 7:19 am

Re: Controling Roomba 520 with a PIC

Post by Henrik11 »

Thank you for your response. Now I'm controlling my roomba perfectly!

I have a doubt, my boss asked me to reprogram the roomba, not control it with an external microcontroller. Is it possible to reprogram the roomba's microcontroller or i have to keep working with my PIC???

Thank you again, you saved my butt !!!

Moderator's Note:
Edited profanity.
User avatar
mfortuna
Robot Master
Posts: 5853
Joined: February 5th, 2006, 9:35 am
Location: NH

Re: Controling Roomba 520 with a PIC

Post by mfortuna »

It may be possible. You would have to gain access to the internal jtag connector and completely erase the target MCU flash and start from scratch. Not an easy job.
Mike
Reds x 3, Dirt Dog, Disco (now a parts bot), Create, Scooba 350, and Security Dawg
Evolution Mint
Neato XV-11
Shark Ion 750
Henrik11
Posts: 3
Joined: July 8th, 2010, 7:19 am

Re: Controling Roomba 520 with a PIC

Post by Henrik11 »

I thought I did everything too early.
Now, I can control roomba, but only the orders that are made of only one byte (clean, spot, dock, switch off).
When I try one of the others, made, for example, of 5 bytes, the roomba does anything.
I have button conected to my PIC that makes the PIC send the switch off byte every time I press it. Using this button I have looked that roomba is really waiting for 4 bytes if I send the command of a 5 bytes order.
If I only send 1 byte, I press the button 4 times and nothing happens, and then if I press it again it switches off.
If I send the 5 bytes correctly, and then I press the button the roomba switches off, but before, it does nothing...

Another strange thing is that I can send the clean/dock/spot byte, before a start and a full/save bytes and it starts to clean, I don't understand.

Thank you for your help again!
User avatar
mfortuna
Robot Master
Posts: 5853
Joined: February 5th, 2006, 9:35 am
Location: NH

Re: Controling Roomba 520 with a PIC

Post by mfortuna »

That is normal behavior. Sending a spot/clean/dock command or a start command puts the robot in passive mode. Your issue does sound mode related. Any multi-byte comand except song and sensors (there may be others) requires the roomba to be in safe or full mode. If it is in passive mode it will ignore most commands related to motors and LEDs.
Mike
Reds x 3, Dirt Dog, Disco (now a parts bot), Create, Scooba 350, and Security Dawg
Evolution Mint
Neato XV-11
Shark Ion 750
Post Reply