Motor won't run when using driver

Hey yall,

I have a L29N Motor Driver.
the simplified version of the driver is:
2 inputs
2 outputs
the inputs are taken from the arduino digital pins with a combination of Low or High. if both are the same then the motor stops
the outputs are controlled by the driver. the motor GND and Vcc lines are connect to these.
I have confirmed the motor works. however, when I plug the 2 motor lines into the driver, and the 2 input lines into the arduino, it seems to stop functioning. I have tried different inputs (there are 2 sets on the driver) and different outputs (also 2 sets).
The driver has worked in the past. I only recently rewired it and now it isn't working.

Any advice would be helpful.

Thanks,
Ian

Always show us a good schematic of your proposed circuit.
Show us good images of your ‘actual’ wiring.
Give links to components.

Apologies
Here is a photo of my wiring. I am 100% certain this is the 2 lines that power the motor. assume the motor is the most typical 2 line DC motor.

Here is the link to the driver:

and the driver datasheet:
L298N-Motor-Driver-Datasheet.pdf (470.2 KB)

My connections are as follows (I do not know what people use to get a graphical picture of the wiring):

arduino:
5V (red) = 5V

GND (black) = GND

4 = IN1

5 = IN2

6 = IN3

7 = IN4

Driver:
OUT4 = Motor + (red)
OUT3 = Motor - (black)

The code is the one from the datasheet:

int IN1 = 4;
int IN2 = 5;
int IN3 = 6;
int IN4 = 7;

void setup()
{
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
}
void loop()
{
// Rotate the Motor B clockwise
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
}

The Arduino 5V output cannot be used to power a motor, and you can damage the Arduino (and a USB port connected to it) if you try. Use a separate motor power supply, 12V or higher, capable of providing around 2 Amperes.

The ancient L298N driver is extremely inefficient, and wastes a considerable portion of the motor power supply as heat. It is intended for small toy motors and may not be able to handle the start/stall current of the motor shown in the photo.

Pololu has a good selection of modern, efficient MOSFET motor drivers.

what people use to get a graphical picture of the wiring

Pencil and paper works very well.

If i may add to what @jremington wrote. The inefficiencies are in the Darlington bipolar output stage of the driver. That stage drops 2V to over 4V and dissipates that power as wasted heat (look at the size of those heat sinks). So best case, your motor is getting less than 3 V of the 5V motor power. Realistically could be as little as 1V.

When choosing a motor driver, choose one that will gracefully handle the motor rated voltage and stall current. The stall current should be listed on the motor data sheet or data plate.

if I were to connect a 6AA 12v power supply to the Vin pin of the arduino, would that suffice?

  • Do not connect the motor module’s 5v to the Arduino as the Arduino is connected to USB power.
  • Remove the 5v connection to the Arduino.
  • Use a properly rated motor power supply.
  • The motor module enable needs to be jumpered or driven.

also while this may be true, it doesn't solve the fact that the motor does not work. It has done before. I will buy the appropriate parts but theoretically if I was forced to use this, how would I make it work not considering loss of power etc etc?

just to be clear, use a 12v power supply instead for the drive and remove the arduino 5v pin's power on the driver?

6AA (9V) can be used to power the Arduino through Vin. Use a separate power supply for the motor. Be sure to connect the Arduino motor driver and Arduino GND terminals.

Please post a link to the data sheet or product page of the motor. You need to know the start/stall current draw.

if the power to the arduino is not a problem, would the 9V suffice for the drive only?

Thanks for posting the motor specs. It draws more current (the start/stall current is greater that 2 Amperes) than the L298 motor driver is designed to handle, but you might be able to get away with it. The L298 will internally waste 4V of a 12V power supply as heat.

Your setup will work MUCH better with a modern motor driver like this one.

  • DC motors can be run at the rated voltage and sometimes at a voltage less than.

  • A Enable and B Enable needs to be satisfied.

just to be clear, the driver is the L298N not the L298. I'm not sure if there is a big difference, but I've found a post using what I belive is the L298 and it seems different from the L298N.

No significant difference. It is not a good choice for that motor.

that is the post.

Thanks for letting me know. If possible, could you give me a link to a potential better driver?

See post #13.

back at it again,
I connected a 9v to the driver and USB to the arduino for power on both.
I cannot find anything relating to what or how those enable things are or do. Currently, all IN1-4 pins are wired the same way and the motor is also wired the same to the driver.

from what I see a those things are just metal across a bridge, fuse looking thing. I have all 3 in place. I assume this means A, B, and Jumper Enable are all on.