# Algorithm for automated Vacuum Cleaner

1. ## Algorithm for automated Vacuum Cleaner

I am trying to make a fully autonomous robotic vacuum cleaner.
I am having a tough time, trying to figure out the best possible algorithm to do this.
The current algorithm that i have in mind , involves the bot going in spiral squares, until it sees an obstacle , and thereafter traversing the obstacle and then continuing the spiral routine.

I find this a bit too troublesome to code, and i am not sure if it would traverse the room fully.
Before i started coding , i wanted to know if there was any better , efficient way to navigate fully through a room and do the cleaning ??

My bot is rectangle shaped, with IR sensors on all sides, and an ultrasonic sensor on the top fitted on top of a servo motor.

What would be the best algorithm to do this ?

•

2. ## Re: Algorithm for automated Vacuum Cleaner

Unless you have a round room, I don't know why you would have the bot run in a spiral; do YOU vacuum the floor in spirals? Why not run it like a Zamboni or a lawn mower? Have it first find a corner and then just go back and forth in rows.

•

3. ## Re: Algorithm for automated Vacuum Cleaner

One advantage of a square spiral is only 90 degree + some off set* turns rather then 180 degrees + some off set as in a lawn mower.
My first stab :- ( imagine a room with 4 walls, North, East South, West. ), So start off in the SW corner - proc advance. When front is blocked, turn E until front is blocked (corner of room)- proc. NW corner OR Lh side is clear - proc. advance. I think this will get you so far, but when you get to the first corner, you will have to get you off set in, so you track the first wall BUT the width of the machine away from it - can you do this?
Frank
* off set :- if you do 180 or 90 degree turns you will just go over the path for ever, so you have to use a side step or a different angle to cover the whole area.

--[[ ]]--