Problem With Circuitry and L298N Power Pin-Out

Hello!

I am trying to make a land rover type car with Arduino. I am new to using the motor driver and I am also not very familiar with how you make sure the voltage and current is correct. So I am going to attach the picture of what I have attached so far, which is just the DC motors, a 9V battery, L298N Motor Driver and Arduino Uno. I will have the a
Arduino plugged in and providing power through the 5V and then hooked into the 5V of the driver. Then the 9V batter I ran through the breadboard because the wires on the 9V supply are very short and thin. I don’t have the pins into the Arduino set up yet, but I just wanted to make sure that is ok before I coded it out. I have a picture attached of what I am having problems with. But my questions are...

1 - Is the 9V battery necessary or not and do I have it attached correctly?

2 - Why and how is the Arduino being powered through the 9V to the motor driver, and how do I stop it?

3 - Are there any other issues that I need to fix?

4 - Are there any errors that beginners make when using these that I can avoid?

Thanks to all for helping, I really appreciate anyone that can help. Thanks again!

You do need a separate motor power supply, but a 9V PP3 block battery won't work for more than a few minutes, if at all (they are for smoke alarms). Most people use a pack of 6x AA batteries.

Post links to the exact motors and L298 module you have. The L298 driver is ancient, weak, very inefficient and might not even work with the ones you have. It may also have a built in voltage regulator intended to power the Arduino.

Ok that sounds good! So I only need to hook it into the 5V from the Arduino Uno? And here is the link for the Amazon page I bought it from.

What else do I need to do, if anything?

According to the product page, the L298 module has a 5V voltage regulator on it, which explains why it was powering the Arduino. That may work for you, but it is not advisable, because electrical noise from the motors can cause the Arduino to reset or misbehave.

It is usually best to use a separate power supply for the Arduino, in which case you do not connect the Arduino 5V output to the L298 5V pin.

Don't forget to connect the Arduino and L298 ground, and the L298 IN and ENABLE pins to Arduino port pins as directed (I presume you have some sort of wiring guide and associated code).

So, I am not sure I am understanding right, I can power the Arduino which will also power the driver?

The L298 chip has two power inputs, one for the chip logic (5V) and one for the motor (greater than 5V).

On your L298 module, there is a 5V regulator which can optionally (jumper selected) be used to power the logic, from the motor power supply. The module manufacturer tells you not to use that option if the motor power supply voltage exceeds 12V.

The L298 5V pin can either provide 5V to an Arduino from the motor power supply, or if the motor power supply option is disconnected, you must provide 5V from the Arduino to the chip logic.

Ok Perfect! Thanks!