Line follower robot

We've made a line follower robot using Arduino nano, drv 8833 and tcrt 5000l 5-channel sensor. All connections are correct, but the problem is that the wheels are showing no movement at all. What can be the issue?


I've uploaded

Your code? Please post it using code tags as described in How to get the best out of this forum
Insufficient power? What is the power supply for the motors?

You wouldn't be the first one who states that and eventually finds out that something was wrong. Please post a schematic / wiring diagram (photo of pencil/paper drawing is OK).

I'm not a specialist when it comes to motors so might not be able to help further.

Posted

Posted! Thanks

/* Define motor controll inputs */
const int motorRPin1 = 5; // signal pin 1 for the right motor, connect to IN1               
const int motorRPin2 = 6;  // signal pin 2 for the right motor, connect to IN2

const int motorLPin1 = 9; // signal pin 1 for the left motor, connect to IN3           
const int motorLPin2 = 10; // signal pin 2 for the left motor, connect to IN4

const int irPins[5] = { A0, A2, A3, A4, A5};
int irSensorDigital[5] = {0,0,0,0,0};
int i,j = 0;
int d = 1000;

int irSensors = B00000; 

int motorLSpeed = 255;
int motorRSpeed = 255;
int error = 140;   // 145 best 200  //  normal 255  // mad 0 
void setup() {
  
  
   Serial.begin(9600);
  
  
  pinMode(motorLPin1,OUTPUT);        
  pinMode(motorLPin2,OUTPUT);
  
  pinMode(motorRPin1,OUTPUT);        
  pinMode(motorRPin2,OUTPUT);
   
  /* Set-up IR sensor pins as input */
  for (int i = 0; i <= 4; i++) 
  {pinMode(irPins[i], INPUT);}
 

}

void loop() {
     scanD();
     check(); 
}     
     
void check( ) 
{    
     switch (irSensors) {
     
     case B00000: // on white paper 
     go();
     break;
     
     case B10000:
     rightS();
     break;
     
     case B11100:
     rightS();
     break;
     
     case B11001: 
     go();
     break;     

     case B11000: 
     rightS();
     break;         
     
     case B11110:
     rightS();
     break;
     
     case B00011: 
     leftS();
     break;   

     case B10011:
     go();
     break;

     case B10001:
     go();
     break;

     case B01111:
     leftS();
     break;
     
     case B00111:
     leftS();
     break;

     case B00001:
     leftS();
     break;
 
     default:

     go();
     
      
     
  }
 
}





void rightS() 

{
    
      digitalWrite(motorRPin1, HIGH);
     digitalWrite(motorRPin2, LOW);
     
      digitalWrite(motorLPin1, LOW);
     digitalWrite(motorLPin2,HIGH);
  
}


void leftS()  //turn left
{
     
      digitalWrite(motorRPin1, LOW);
     digitalWrite(motorRPin2, HIGH);
     
      digitalWrite(motorLPin1, HIGH);
     digitalWrite(motorLPin2, LOW);
  
}

void go()
{
   
      digitalWrite(motorRPin1, HIGH);
     digitalWrite(motorRPin2, LOW);
     
      digitalWrite(motorLPin1, HIGH);
     digitalWrite(motorLPin2, LOW);
  
}

void stopme()
{
     
      digitalWrite(motorRPin1, LOW);
     digitalWrite(motorRPin2, LOW);
     
      digitalWrite(motorLPin1, LOW);
     digitalWrite(motorLPin2, LOW);
  
}




void scanD()
{
  for ( byte count = 0; count < 5;count++ )
{
  bitWrite(irSensors, count, !digitalRead( irPins[count] ));
} 
}

Now we need LINKS to all your hardware. The drive motors, the power supply ..
And you arent trying to run motors from the Arduino supply, are you?
image

Connection between TCRT 5000L 5-channel sensor and Arduino Nano :
1)Out 1 to Out 5 - connected to A0,A2,A3,A4,A5,A6 of Arduino nano
2) 5V of sensor - connected to VIN
3) GND to GND

Connection between motor driver DRV 8833 and motors :
Out 1, Out 2 to right motor & Out 3, Out 4 to left motor

Link?

Have you configured the motor driver? (maybe current limit is set to zero)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.