1

I am relatively new to Arduino, and I am trying to power a DC motor with the L298N dual H-Bridge. I have done as follows: I am powering everything with the Arduino that is connected to the PC. (I know this isn't ideal, but I don't have a better power supply yet) I connected the 5V output from Arduino to the 12V terminal of the L298N, and connected it to the Arduino ground. The red light from the L298N shines brightly. Then, I connected the IN3 and IN4 pins to the Arduino digital pins 7 and 8, respectively. Finally, I connected the Out 3 and Out 4 to my DC motor, but it doesn't turn at all. I use the following code:

int In3=7; 
int In4=8; //idem para In2

void setup() {
  pinMode(In3,OUTPUT); //avisa que nuestros pines son todos outputs
  pinMode(In4,OUTPUT);

  digitalWrite(In3,HIGH);
  digitalWrite(In4,LOW); 
}

void loop() {

}

For the time being I decided to not use the PWM, so that I can start simple. I tried changing all cables and even the motor, but it just won't rotate. The L298N is brand new, so it's unlikely that it is damaged. What could I try next?

  • Welcome to Arduino! Please take the tour and visit the helpcenter to see how things work here. Note that (SOLVED) tags should not be edited into the question's title, please "accept" the correct answer instead. – Ghanima May 28 at 14:21
0

I realized that I had the jumper disconnected from the ENB pins, which immediately solved the problem when I reconnected it, so it is now fixed!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.