Let's Make Robots!

RK Education L293D board

Hi All

I am a beginner to robotics and have purchased a arduino uno and a RK Education L293D Motor Drive board. (http://www.rkeducation.co.uk/documents/instructions/L293DpcbComponentListandInstructions.pdf). I am curious to know if i am driving two motors with this board do i need to have just the enable pins connected to the arduino or all 6 pins (4 input pins and 2 enable pins)?

Regards

CJGAUS

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Are you sharing grounds?

sorry im not sure what you mean by that question?

That transistor is not a transistor. Its a voltage regulator. Ok, I am seeing how this board is put together.

Ok, forget what I said above, let me ask you this instead: How much power are you giving this board? Is it a 4AA battery pack? I need to know how much voltage you are using here.

Hi Chris

I am supplying the board with 9 volts, the voltage is enough for the board as when i am using the second loop in my code both motors spin in the opposite direction.

Cheers

In addition to the enable pins and the power for the motors themselves, do you also have a 5v supply going in for some thinkin' power?

Hey guys I still have no solutions, any others got any idea what im doing wrong?

Need more infos. How about some pictures or schematic of your hardware setup. What power supply? GND connected on UNO and L293 board?

Hi Birdman

The first loop does completely nothing (no motors spinning), the second loop when uploaded will turn both motors in the opposite direction.

Dear Chuck

I have done what you said and have connected the enable pins to the 5v on the arduino.

I coded it as follows:

int motor1Pin1 = 8;    // pin 8 on L293D
int motor1Pin2 = 9;    // pin 9 on L293D
int motor2Pin1 = 12;    // pin 12 on L293D
int motor2Pin2 = 13;    // pin 13 on L293D

void setup() {

  // set all the other pins you're using as outputs:
  pinMode(motor1Pin1, OUTPUT);
  pinMode(motor1Pin2, OUTPUT);
  pinMode(motor2Pin1, OUTPUT);
  pinMode(motor2Pin2, OUTPUT);
}

void loop() {
  // turn motors one direction
    digitalWrite(motor1Pin1, LOW);   // set pin 8 on L293D low
    digitalWrite(motor1Pin2, HIGH);  // set pin 9 on L293D high
    digitalWrite(motor2Pin1, LOW);   // set pin 12 on L293D low
    digitalWrite(motor2Pin2, HIGH);  // set pin 13 on L293D high
  }

This code will not work but if i change the following code it will work but with each motor going in a different direction

}

void loop() {
  // turn motors one direction
    digitalWrite(motor1Pin1, HIGH);   // set pin 8 on L293D low
    digitalWrite(motor1Pin2, LOW);  // set pin 9 on L293D high
    digitalWrite(motor2Pin1, LOW);   // set pin 12 on L293D low
    digitalWrite(motor2Pin2, HIGH);  // set pin 13 on L293D high
  }

 

would you happen to know what i am doing wrong?

doesn't work, what do you mean? The second loop() does as it should and cause the motors to turn in opposite directions. Does the first loop() not do anything or does only one motor turn?