# L298N driver takes too much current

I'm using L298N motor driver to spin stepper motor (42BYGHM809). When connecting it to batteries(2*9v), the batteries heats up after few minutes and stop working, and when connecting it to power source, the power source reach it's current limit. I think the driver has not enough resistance, but from searching the web I didn't see any tutorial that recommends using a resistor with the driver. I tried to connect 100ohm resistor and it burnt and tried 450ohm resistor and the motor vibrated but didn't spin.

I saw in the web that when using high voltage it is recommended to remove the 12v connector(as seen in picture), but when removing it the driver doesn't turn on (the led remain off), like it not powered on (All the things i've tried above are with the connector).

Schematic:

Arduino code:

#include <Stepper.h>
#include <SoftwareSerial.h>

// *** General ***
const bool DEBUG_MODE = true;
bool new_input = false;
bool use_bt = true;
int motorSpeed = 20;

// *** Stepper ***
const int stepsPerRevolution = 400;
Stepper myStepper(stepsPerRevolution, 4, 5, 6, 7);
float degCount = 0;

// *** communication ***
SoftwareSerial bt (11,12);
int usr_input = 0;
char sign;
const int BT_WAIT_TIME = 3, SER_WAIT_TIME = 1;

void setup() {
if (use_bt){
bt.begin(9600);
//bt.listen();
}
Serial.begin(9600);
myStepper.setSpeed(motorSpeed);
}

void loop() {

// *** Get usr_input from BT or serial ***
if (use_bt){
if (bt.available()){
Serial.println("BT");
delay(BT_WAIT_TIME);
if (sign == '-'){
usr_input = -usr_input;
}
new_input = true;
}
}else{
if (Serial.available() > 0) {
usr_input = (int)Serial.parseInt();
delay(SER_WAIT_TIME);
new_input = true;
}
}

if (new_input){
new_input = false;
if (DEBUG_MODE)
Serial.print("User input: ");Serial.println(usr_input);
rotate(usr_input);
}
}

// Rotate motor approximmatly x degrees and return how much degrees it really did.
float rotate(int degrees){
int steps = round(degrees / 360.0 * stepsPerRevolution);
if (DEBUG_MODE)
Serial.print("Steps: ");Serial.println(steps);
myStepper.step(steps);
float real_degrees = steps * 360.0 / stepsPerRevolution;
if (DEBUG_MODE)
Serial.print("Real deg: ");Serial.println(real_degrees);
degCount += real_degrees;
if (DEBUG_MODE)
Serial.print("Deg count: ");Serial.println(degCount);
return real_degrees;
}

• the module is probably defective .... it should not draw current from the batteries when it is not connected to the controller – jsotola Mar 21 '18 at 21:09
• Yeah I came to say essentially the same thing as @jsotola - This board, by itself, doesn't do anything. You need to step the stepper motors somehow. How are you (or were you) providing inputs to drive the ENA and IN1, IN2, etc. pins? How do you have your batteries connected to the board? How do you have the batteries arranged - in series or parallel? A picture of your actual setup would be very helpful. – Chuck Mar 21 '18 at 21:12
• I connected the power to Vcc and GND (4,5 in picture), I've shorted EN A and EN B (7, 12), connected 8-11 to the arduino and 1,2,13,14 to the motor. The motor spins, but draws to much current that overheat the batteries until they stop working. And as I said, I also short 3, because it doesn't work otherwise. – Ofri Wienner Mar 21 '18 at 22:36
• If the controller means the arduino that gives the signal, I've connected it. The motor spins, but it overheat. Pictures(sorry for the quality) (In the photo I used just one 9v battery, it works but I don't have enough power this way) ibb.co/fspphx ibb.co/fks9hx – Ofri Wienner Mar 21 '18 at 22:54
• i just checked to see if it's april 1st .... no it is not .... are you kidding? ... an aerial view? .... put on heavy boots and stomp on it to put it out of its misery! – jsotola Mar 21 '18 at 23:29