Tuesday, June 12, 2012

Specifications and features of line following robots:

  • The robot can follow both black and white lines.
  • It has uses an LDR (light depending resistor) sensor array to follow the line.
  • It is controlled by an Atmega32 running at 1 MHz.
  • The program is written in C using WinAVR as given below for two sensors arrangement.
Figure :- Logic development process


Figure :- Simulation Circuit in Protious
 #define F_CPU 1000000UL
#include<avr/io.h>
#include<util/delay.h>
 void main()
 {
 DDRA=0B00000000;
 DDRB=0B11111111;
 unsigned char a;
 while(1)
   {
     a=PINA & 0B00000011;
     if (a==0B00000000)

         {
       
            PORTB=0B00000101;//robot is at correct position & go forward

   
        }
      else if(a==0B00000001)
         {

      
        PORTB=0B00000110;)//robot at left direction so turn right


  
      
        }       
    else if(a==0B00000010)
        {
      

        PORTB=0B00001001;//robot at right direction so turn left
  
        }
    else
      
        PORTB=0B00000101;
//at correct position & go forward
  
     }
 } 

1 comment: