L298N to Arduino UNO

Hi I’m new to this I’ve built a full size K9 Dr Who and plan to run it with two motors with a remote control
I’m using an L298N connected to an Arduino UNO rev 3
When I power up and latch the relay using a momentary switch I get power on the L298N
One motor drives the other does not
Out 1 & 2 0V and Out 3 & 4 12v
The motor runs continuously
The ENA and ENB IN 1 to 4 are connected to the Arduino

Disconnect the motor from the L298 and briefly connect it directly to the 12 V supply. See if it spins or not.

Hi yes they run ok on one motor from out 3 & 4 if I swap the wiring to the other motor that then runs ok
I did upload a program to run them backwards and forwards that was also ok
I have noticed I don’t have a GND from the L298N to Arduino which I have to do
Thank you very much for your reply

If MOT2 works (directly to power or on the other motor connection), the problem could be 100% duty cycle sent by the program to one motor, and 0% duty cycle sent to the other motor. Or a short from input power to OUT3, OUT4, with OUT1, OUT2 open (not connected due to damage?). Show the program you are using.

That should be the center pin on the "12v/GND/5v" terminal.

Complete with USB port, hovering and teleportation (with Mark IV)?

@kevokev
If you are confused about connection and programming, then follow diagram (Fig-1) and truth table shown below:


Figure-1:

Thank you everyone I’ll check it out again tomorrow
I’ll get that GND connected and test it
I’ll let you know how it goes and come back to you

Checking variable forward motion of M1 (Motor1) only of Fig-1.

  1. Connect M1 (Motor1) and 9V Battery with UNOR3/L298N as per Fig-1.


    Figure-1:

  2. Upload the following sketch

byte d8 = 20;

void setup()
{
    pinMode(4, OUTPUT);
    pinMode(5, OUTPUT);

    digitalWrite(4, HIGH);
    digitalWrite(5, LOW);  
}

void loop()
{
     analogWrite(9, d8);
     delay(500);
     d8 = d8 + 20;
}
  1. Check that M1 is turning in the FRW direction with variable speed.

  2. Reference diagram for PWM pins of UNOR3.


    Figure-2:

Thank you for your reply I’m no where near your expertise I’m just a mechanical man out of my depth with this
I do have to do a few things today and will connect up and see where I am

Hi everyone I connected the L298n to Arduino as follows
Motor A
IN1 = 9
IN2 = 10
ENA = 3

Motor B
IN3 = 5
IN4 = 4
ENB = 6
I then added a GND from Arduino to L298n and powered up but when I latch the delay it blows an inline 5a fuse on the Com line from positive on battery to com on my Heschen switch
If I can sort the problem I’ll possibly order a standard fuse box with no relays

Try tutorial of #7.

Ok thanks I’ll have another go when it’s a bit warmer

I think the relay wiring may be the problem and I wish I had just got a fusebox and no relays
As I’m only looking to drive to small motors back and forward and turn I’m sure I didn’t need the relay
And when not in use I’ll disconnect the battery
I have a Haljia twin joystick connected to V2 card and another V2 card as a receiver connected to the Arduino so I can hopefully run K9 wirelessly

Is the L298N module on a non-conducting surface? Is the solder-side of the L298N module free of conductors or signs of bent pins causing short-circuits?

If both motors work when directly connected to a power source... and OUT3/OUT4 can drive either motor without failure... and OUT1/OUT2 either burns a fuse or does not drive either motor... then the L298N is dead, or half-dead and only "good" for one motor out.

You can connect BOTH motors to OUT3/OUT4 to drive both motors as long as you keep the motors from pulling too much current.

Maybe half dead the board is mounted to wood
I did a motor test through Arduino and both motors did run
I’ve now ordered a fusebox without the relays and will start again
Thank you for your advice
I have also ordered another L298N many thanks

I will removed the board tomorrow and check the underside

Pro


Probably a stupid question but why doesn’t Out 2 have a connection on the board

Look at the component side. The PCB must be a double-layered board. Please, post the componnet side of the borad.

Silkscreen is sideways.



I have ordered another board in case I’ve blown this one