Irobot Create – Force Field Obstacle Avoidance

Posted in Projects by Bill
3 Feb 2010

While waiting for parts to come in for SAGAR, I decided I’d kill three birds with one stone. I wanted to adapt my Irobot command code to be compatible with Webbot’s Lib, I wanted to test Webbot’s new Project designer, and I wanted to try out a Force Field Obstacle Avoidance Algorithm. This is what I came up with.

It’s an Irobot Create, controlled by an Axon 2 running Webbot’s Lib, a Sharp IR and a standard servo. Theoretically, obstacles in front of the robot will ‘repel’ it while free space ‘attracts’ it. The closer and more directly in the way an obstacle is, the more it ‘repels’ it away.

With Webbot’s new hardware project designer, it was a breeze to setup all the hardware, and I was programming in minutes. All in all my algorithm is only about 50 lines long. Everything else is taken care of by Webbot Lib and project designer.

UPDATED: Source added. It’s not commented and messy, so be warned. Download Source

Video in action:

Click to enlarge

  1. 9 Comments.

    • Hello,can you tell me what type of capacitor did you use and how meny
      uf it is and for how many volt it is?

    • BillNo Gravatar says:

      I don’t know what I stuck in when i built this robot, but for a Sharp IR, anything over 10uF and over 5V will do fine.

    • AbrahamNo Gravatar says:

      Do you have the source code for this project???

    • BillNo Gravatar says:

      I do, but it is a bit messy. I’ll post the code in a day or two.

    • BillNo Gravatar says:

      Source added. It’s a mess though, not my best work.

    • Ahmed SarwatNo Gravatar says:

      Kindly can I know how you connected the iRobot to another microcontroller?
      I am currently working on a project where I would like to connect it to XMOS XC-1 development kit or an atmel 8052 microcontroller.

      Kindly can you send me a wiring digram and really any general info about the iRobot as well would be highly appreciated.

      Kindly advise.

      Thanks in advance.


    • rolland elliottNo Gravatar says:

      Thanks for providing the code. Is there anyway you can modify it so that the robot pauses for one minute every 10 so so feet it travels, or ever couple of minutes. I want to mount a sony part shot automatic camera on top and need the unit to pause so the camera can scan the room and take people pics. I’d be glad to pay you as well. 704-726-9788 or email me

    • Xender the better than best app for your file sharing needs. Share any type of files in any places at any time. Absolutely without mobile data

    • Amulyam app is India’s first and selective site with the expectation of complimentary versatile energize. with this application, our android clients appreciate the additional advantages of getting free energize rapidly to install apps..check around here for more points of interest.

Leave a Reply

Your email address will not be published. Required fields are marked *