Running 2 DVC 3V motors with Arduino Uno and L298N motor bridge


I have an Arduino Uno, and I want to connect up 2x 3v DC motors. So I got hold of a motor bridge, the cheap and cheerful L298N.

I read up on everything, connected it all together, and couldn't get the motors to turn at anywhere near the same rate. So I then bought a kit for another L298 based circuit, built this one myself, replaced the motors, swapped the Uno and lo and behold the exact same problem.

Can anyone help me please ?


One motor turns fine, in both directions (when I swap the high and lo) and with varying speeds (using a PWM pin from the Arduino - connected to ENB on the L298N). The other motor, will not change direction, runs at a constant speed (super slow), and has much less power.

My setup

I have software I have written (I am a software engineer), it sends HIGH to pin 0, and LOW to pin 1 on the arduino for forward, and the opposite for reverse (and I use the PWM pin for speed 0-255). Then I do the same for motor B (on the other pins). So the software is really simple (and works when I just send signals to one motor at a time). All the pins are set to output etc.

The Arudino is connected to the L298N like this

Arduino Pin L298N 0 IN1 - motor A pin in 1 IN2 - motor A second pin in 2 IN3 - motor B pin in 3 IN4 - motor B second pin in

DONT USE 4 as its not PWM

5 ENA - enable motor A - used for speed 0-255 from firmware 6 ENB - enable motor B - used for speed 0-255 from firmware

NOTE I also have the ground from the Arduino connected to the Ground pin on the L298N. And I have the following on the L298N :

L298N MOT A PIN 1 - Motor A MOT A PIN 2 - Motor A

MOT B PIN 1 - Motor B MOT B PIN 2 - Motor B

The L298N has a jumper, this is set to tell it that its using the same voltage as the motors, there is another mode that makes it think the power for the motors is seperate from its own power (and thus the built-in regulator is turned off). Again I have it in the first setting (telling it to share power with the motors).

Power Supply The first time I tried all this was connecting both the arduino and the L298N to seperate USB connectors on my PC (stripped the cables to give 5v).

The second time I put the L298N (and Motor power) on a 5V mobile phone battery pack, then Arduino on USB from the PC again.

The thrid time I put both the Arduino and the L298N (and motors) on the same USB 5v battery pack, then I tried to split things again so one 5v battery to the Arduino and the other to the L298N (and motors).

So any ideas on all this ? Thanks.

sketch code, wiring schematics would help you being helped.

till then, I noticed here saying:

On most Arduino boards (those with the ATmega168 or ATmega328), this function works on pins 3, 5, 6, 9, 10, and 11.

The PWM must go to one of the active IN pins on L298. The the enable pin is meant for start/stop command not PWM. You can skip that by keeping both enabled and put both IN1 and IN2 pins at the same voltage, HIGH or LOW.

Sorry I was wrong about that, the Enable pin works by puting the Motor Out pins in low or high impedance, that's why PWM signal should go to Enable.