Let's Make Robots!

Using Arduino and L298N to control Tamiya Twin Motor Gearbox

I've connected the L298N to one of the motors of the Tamiya Twin Gearbox as per the circuit diagram in the L298N data sheet. But when I set pin 10 and pin 12 to go forward or reverse, nothing happens. The voltage at pin 13 and pin 14 seems to be equal to each other regardless of what I set for pin 10 and pin 12 (with the enable pin on high). This is the Arduino code I have. The diodes I am using are IN4007. I've also tried it with the other H-Bridge and I get the same result. I'm powering the L298N (Vss) through the Arduino 5V output and the motor (Vs) through 4 Ni-MH 1.2V batteries in series. Does anyone know what I am doing wrong?


int pin_11 = 2;
int pin_12 = 3;
int pin_10 = 4;

void setup()
  pinMode(pin_11, OUTPUT);
  pinMode(pin_12, OUTPUT);
  pinMode(pin_10, OUTPUT);

void loop()
  digitalWrite(pin_11, HIGH);
  digitalWrite(pin_10, HIGH);
  digitalWrite(pin_12, LOW);






Comment viewing options

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

You named the pins pin_10, pin_11, pin_12, but they are initialised as pins 2,3,4. Where is the L298 connected: at Pins 10,11,12 or 2,3,4?


It appears that pins 2,3,and 4 of the Arduino are being used to drive pins 10,11,and 12 of the L298.
Yes you're right, I didn't see that
Are you connected to digital pins 2,3,4 or analog 2,3,4?
I'm using the digital pins on the Arduino. But for testing purposes right now I'm connecting the pins from the motor driver directly to Vss on the breadboard.

hi. i'm having trouble with this. i have the exact same problem as jchang. have connected pin 1,8,and 15 to ground but still no response. hoping you guys can help me. perhaps its a problem with the wiring. would appreciate if anyone could help. im just starting out in these electronic stuff (:

sorry its a bit messy




white wires are connected to 5v and gnd on arduino, brown wires are connected to pin 2,3,and 4 exactly like the program code jchang posted.