Go Down

Topic: l298 motor drive and motor interface (Read 969 times) previous topic - next topic


I am using l298 motor drive and 300 rpm dual shaft dc gear motor

dc motor details


along with arduino uno for speed control but motor is not rotating.

When I connect the motor directly to 12v dc supply, It is taking 56mA to run at no load full speed.
but when I connect the motor through motor drive, It is not running and the current through it is found to be 26mA.
I am powering the motor with 12V dc from smps.

I found from the data sheet of l298 that the max current in the output channel is 2A

Can some one let me know what the problem is?

Thanks in advance:)


Apr 19, 2013, 11:37 am Last Edit: Apr 19, 2013, 11:39 am by Erdin Reason: 1
You could measure the stall current. Block the rotation at 12V and measure the current. But with such a small motor, the L298 should not have any trouble with it.

Can you post a link to the motor driver you are using ? Or did you build one yourself with the L298 ?

Can you upload a photo of your setup ? With wires, Arduino, motor driver and motor ?

Can you upload the whole sketch between [code] ... [/code] tags.


we bought a l298 ic . We did not make the h-bridge.
Here is the ic L298n datasheet

is the code we are using
Code: [Select]

//Define Pins
int enableA =7;
int pwm_pinA1=5;
int pinA2=6;

//Define Run variables
void setup()

pinMode(enableA, OUTPUT);
pinMode(pwm_pinA1, OUTPUT);
pinMode(pinA2, OUTPUT);

void loop() {

   digitalWrite(enableA, HIGH);
   analogWrite(pwm_pinA1, 255);
   digitalWrite(pinA2, LOW);
   digitalWrite(enableA, LOW);
   digitalWrite(enableA, HIGH);
   analogWrite(pwm_pinA1, 127);
   digitalWrite(enableA, LOW);

I have one more doubt sir. Is it necessary to ground the current sensor of a motor drive using resistor?
If we ground the current sensor pin directly, will it effect the motor drive


You might try a slightly different approach: put the PWM onto the enable pin with analogWrite, and set the other two pins high and low with digitalWrite. In fact for testing, maybe ignore PWM completely, and make the enable high with digitalWrite also.

Also post a schematic of your circuit.....
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0


Using the enable for PWM is the normal way to use th L298.
I think that one of the other signals should be high. In the datasheet is a table in figure 6, with 'C' and 'D' and how they are used.

The current through the motors is also going through the sense resistors.
You can tie it to ground (without resistors), but using sense resistors is a nice extra feature and it is safer.

Go Up