Small Robot : 

9 Obstacle Avoider



An Obstacle Avoider is also a self controlled Robot, which will recognize obstacle (like wall) and avoids collision with the vertical surfaces. Many types of sensors may be used for finding obstacle, like IR distance sensor, Ultrasonic Distance sensor, pressure switches etc. But, using Ultrasonic sensor is simple and reasonable to recognize the obstacle. One Ultrasonic distance sensor is fitted on front side of the Small Robot to measure the distance of obstacle.

The distance is read from the ultrasonic sensor by the micro-controller (ATTINY84), then analyzed to take turn accordingly,
based on the 4 bit motor control data, through the motor driver IC (L293D) on base board.

(refer Small Robot Base Frame for motor control codes).

The concept of Obstacle Avoider Robot is to avoid flat vertical obstacles. Basically, the Obstacle Avoider periodically sends an ultrasonic wave and measures the distance of obstacle by the time taken to receive its reflected wave from the obstacle. If the distance measured is less than the set distance value, then takes turn accordingly.

Here, the Small Robot is programmed to take a right or left turn, when it founds any obstacle within its set distance, else moves forward continuously.


About Obstacle Sensing:

Here, the Obstacle Avoider uses one ultrasonic sensor module, HC-SR04 (readily available) to read the presence of obstacle in front of it. The ultrasonic sensor module, consists of a ultrasonic wave generator and ultrasonic wave receiver, with required on-board electronic circuit. The ultrasonic sensor module is available with four pinouts, i.e., Vcc, Ground, Trigger and Echo.

The ultrasonic sensor module is connected to 5VDC supply across Vcc and Ground pins. Whenever the Trigger pin goes HIGH ( logic 1 ), for 10 micro-seconds, the ultrasonic wave generator sends ultrasonic waves, about 40 KHz, which is not audible to human ears. Then the ultrasonic wave receiver starts listening for the reflected ultrasonic wave. Then, a high pulse is generated from Echo pin, proportional to the time taken to receive the reflected ultrasonic wave by the ultrasonic wave receiver.

The Echo pulse time ( or Time of Flight ) is measured by the micro-controller (ATTINY84) and converted to distance by using suitable formula. If the distance obtained by the formula is less than the set distance (means obstacle is near to the Obstacle Avoider or within critical distance), then, the Obstacle Avoider takes turn accordingly, else moves forward.

The Concept of working of Ultrasonic sensor is shown below. As the generated Ultrasonic wave moves in a narrow path, sometimes the ultrasonic sensor module may not recognize thin obstacles (like wires etc.) and obstacles above or below the ultrasonic wave path. The ultrasonic sensor module may not recognize the obstacle with inclined surfaces, as the ultrasonic wave may get diverted its path and the ultrasonic receiver may not receive the reflected ultrasonic wave.

To avoid such errors, multiple ultrasonic sensor modules are to be used at various directions.


Working of Obstacle Avoider:

Two versions of Obstacle Avoider are developed. The first version uses a bracket to hold the ultrasonic sensor module at fixed position. So, to check the obstacles at sides, the Small Robot takes right and left turns, at regular intervals.

In the first version, only the ultrasonic sensor module is connected to the control board, using jumper wires. The distance of obstacle is measured continuously by the micro-controller (ATTINY84), then takes turn, if the obstacle is found within the critical distance, else moves forward. In this version, the movement of Small Robot is slow, with intermittent brakes, since it takes small turn at regular intervals, to find obstacles at sides.

In the second version, a servo is fitted on the bracket and used to swing the ultrasonic sensor module on its horn. The servo motor is also controlled by the micro-controller (ATTINY84) and set to swing right and left side. So, the obstacle distance is read continuously from right, left and forward. The Small Robot takes turn according to the obstacle found, else moves forward. Here, the searching angle for obstacle is high and movement of the Small Robot is also improved.

On the control board, no shorting jumper should be used (existing shorting jumper should be removed, if any). Then, the RED LED glows, when the obstacle is found within critical distance, else YELLOW LED glows. This is simple and very useful indication, to know the working status of ultrasonic sensor module.

A button switch, SW1 on control board, is useful to start the Obstacle Avoider, after switching ON the power supply to the Control Board. The SW1 switch should be pressed twice in first version, to search the obstacle in both sides, else the Small Robot will search for obstacle in forward direction only.

The complete circuit diagram of Control Board with ATTINY84, is available below. Use separate jumper wires to connect ultrasonic sensor module and servo motor to Control board. Omit servo motor and its connections in first version.


Download file(s) from above link and remove .TXT extension.

Once Small Robot's Base Frame is made, then, various control systems for Small Robot are developed and available for selection, using 'Previous' and 'Next' buttons here.