wall following/obstacle avoiding robot

Thread Starter


Joined Feb 20, 2011
basically this robot should follow the wall and avoid any obstacles that lie infront. The project should be simple enough using microcontrollers but the challenge is we have to do it using sequential logic. so the robot has three IR sensors; front, left and right(done that using 555 timers), will utilise two DC motors on the back wheels and have a free rotating front wheel, and will use a H-bridge to change directions and if we have time( we have like 2-3 months left) we want to use PWM for speed control.

the basic robot behaviour should be:
- when the robot is placed nowhere near a wall( i.e no sensor active) it should go straight
- then when its front sensor finds a wall, it should turn right and follow the wall( if possible, at a certain distance)
- then while following the wall, if the left and the front sensors detect a wall or an obstacle, the robot should turn right until the front sensor detects no more, and then it should move forward again
- then when the wall takes a left turn making the left and the front sensors to detect nothing,, then the robot should turn left and start following the wall again.
- now to the "do it if possible" zone; now the robot is in a tight situation like all its sensors are detecting a wall, then it reverses back and choosea appropriate direction to avoid the situation again.
now all these situations apply in the same way for the right IR sensor when the robot is following the wall in the left direction.

so basically what i'm asking is how do we start with building this control circuit with sequential logic and how to implement it to H-bridge and to the motors. And if there are any alternative ideas( except the microcontroller :( ) then please post,, every bit of help will be highly appreciated!
Not easy but then I guess thats the idea .... right.
I dont have an answer, it would take me ages just to work it all through but you might considder the following.

You won't get far using IR to detect distance, considder ultrasonioc modules.

Break your logic into functional blocks, manouvors, then activate an apropriate block with a central sequencer and logic based on sensor input. Each block should complete befoere the next one can be activated.

I know your not using a uP but if you build a sequenced loop that activates blocks that are valid and ignores invalid ones you can think in uP routiens but build with logic gates ....

Considder a washing machine timer as an anology, before uP's complex control pannels oftern used mechanical sequencers to activate sub circuits of timers and relays.

Also think about some positional feedback, accelaromiters or a gyro chip so you know how many degreese you have turned through or if you have hit anything that the sensors have missed, like an external corner.

Hope this gives you someting to think about ...