I am working on a project for school, and my arduino mega 2560 seems to be pulling power from the l298n it is controlling, via the 5v and Gnd pins. As I understand it, this is not great, what is the best way to prevent this?
Sounds indeed like you have to correct your wiring. Now maybe if you had posted more info on your project we could give you pointers on how to correct this...
Post a complete schematic of all your wiring, including interconnections, power, and ground. Links to your hardwqre parts would be a big help as would your code. From my vantage point it appears you are powering with the Arduino, a Power Supply the Arduino is NOT! I assume all grounds are connected.
Hi,
Welcome to the forum.
Please read the post at the start of any forum , entitled "How to use this Forum".
OR
https://forum.arduino.cc/index.php?topic=712198.0
Then look down to "code problems" about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Thanks.. Tom... ![]()
Sounds like the motor supply is not connected to the L298N, in which case it will attempt to
pull current from the 5V supply instead, which is bad news...
Sounds like you connected the arduino 5v to the motor power pin on the L298 .
Look at the datasheet
As you can see from a breakout board pinout, there are two supply inputs