Obstacle Avoider Robot

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

Obstacle Avoider Robot

Obstacle avoider robot is the important part of mobile robotics. Obstacle avoidance is task which is used for detecting the presence of object in a path of robot or any vehicle.

Obstacle avoiding robot is an intelligence device, which is used to protect the robot from any physical damages. It automatically sense and overcome the obstacles on its path.


Working:

In this project, we will study how to design and simulate an obstacle avoider robot using AVR ATmega16 microcontroller and Analog IR Sensor. This robot designed is an automatic robot i.e. no manual control is required for the operation of robot.

In obstacle avoider robot we use ADC of the ATmega16 microcontroller to convert analog signals to digital values. After converting the IR sensors signal into digital equivalent signal i.e. threshold value (3V in our project case). According to the output of above comparison, the microcontroller send the control signal to the DC motor driver Integrated Circuit (L293D) of robot to move the robot in forward, left or right direction. The above operation of sensors output comparison, ADC conversions and robot control continues till the power source is applied.


Hardware Required:

  • 12V, 1A DC Adapter-1 piece
  • Analog IR Sensor-3 piece
  • AVR Microcontroller Board-1 piece
  • DC Motor Driver-1 piece
  • AVR USB Programmer-1 piece
  • 1 to 1 Connector-15 piece
  • 10 to 10 FRC Female Connector-2 piece
  • Robot-1 piece

Software Required:

  • BASCOM-AVR Integrated Development Environment (IDE)
  • AVRDUDE-GUI
  • WinAVR-2010
  • USBasp Driver

Circuit diagram:

Consider the eagle software based circuit diagram of obstacle avoider robot is:-

Circuit diagram

Source Code:

  1. $regfile = "m16def.dat".  
  2. $crystal = 1000000  
  3. Config Lcd = 16 * 2  
  4. Config Lcdpin = Pin , Rs = Portb.2 , E = Portb.3 , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7  
  5. Config Adc = Single , Prescaler = Auto , Reference = Avcc  
  6. Start Adc  
  7. Config Timer1 = Pwm , Pwm = 8 , Prescale = 1 , Compare A Pwm = Clear Down , Compare B Pwm = Clear Down  
  8. Start Timer1  
  9.   Dim A As Integer  
  10.   Do  
  11.   Cls  
  12.   A = Getadc(0)  
  13.   Lcd A  
  14.   Lowerline  
  15.   If A < 750 Then  
  16.   Lcd "obstacle"                                            '  
  17.   Pwm1a = 200  
  18.   Portd.6 = 0  
  19.   Pwm1b = 200  
  20.   Portd.3 = 0  
  21.   Elseif A > 750 Then  
  22.   Lcd "no obstacle"  
  23.   
  24.   Pwm1a = 0  
  25.   Portd.6 = 0  
  26.   Pwm1b = 0  
  27.   Portd.3 = 0  
  28.   End If  
  29.   
  30.   Loop  
  31.   
  32. End  

Consider the screenshot of source code used in obstacle avoider robot using BASCOM-AVR Integrated Development Environment (IDE) is:-

Circuit diagram2