First-time Nano DC Motor 9V Battery?

Doing a total revamp, need new motor driver and battery, see last post please

I have an Arduino Nano.
I have an L298N Motor Driver, with one 1.5V-3.0V battery screwed into the two-part motor slots on one side.

I have the corresponding pins connected correctly to the L298N from the Arduino Nano for the single motor, and removed that little doohicky for adjustable speed before inserting that first pin.

So that’s just describing the project... my actual issue:

I have no idea what I’m doing. I had an external battery case with 2 AA batteries connected to the two left-most slots in the front of the L298N respectively...
and the ground port of the Arduino Nano connected to the ground port of the L298N jointly with one of the wires from the AA battery case.... my issue was the Arduino nano didn’t light up... I haven’t even began running any code into the Nano yet, I just want to get the connections going first....

Since it didn’t light up, I thought maybe the Arduino Nano wasn’t drawing enough power from the L298N ground port, so I just connected a 9V battery directly to the Arduino Nano, red wire to VIN, and black wire to GND, positive and negative.

The GND and VIN were located right next to each other in this case... whereas previously I used only the GND port on the opposite side in the first instance... without using the VIN with AA battery case.... I noticed right away there was heat exuding from the Arduino Nano and just unplugged the VIN and GND immediately... no lights had came on so I figured I must have done something wrong again, but worse, haha.

To humor myself, I plugged it in using a USB through my PC, and voila, light. But that doesn’t help me, I don’t want to have my project connected to my PC to work... my goal is to control it wireless eventually with an HC-05 which can be used via Bluetooth on most phones. I figured I’d start with a successful power-on with an external battery before anything else.

The motor works fine with JUST the battery connections, but I’m not sure where I’m going wrong with transferring all the power around. Does the 9V connect to the L298N or the Arduino Nano directly? Does it matter? Why did it heat up like that? Why did it heat up but the light didn’t come on? Shouldn’t the motors have turned on in either of the two situations with the AA or 9V batteries? Surely seemed to have electricity running through it. I have a breadboard but it’s still too complex for me and I feel it isn’t necessary for this quick small project.

I hope I gave enough answers to get any kind of insight. I’m using common MM, MF, FF cables as needed, and I’m sure the issue isn’t due to faulty connecting, it’s definitely wrong, but the wires are fine is what I’m saying. Hoping to get any insight when I get home from my shift tomorrow night. Thanks for any help and I hope I’m not in the wrong forum category or if these questions have been answered millions of times, but it’s easy to get lost in all these different versions of similar projects.

Thanks again!

One picture is worth a thousand words.
Show a photo of your complete setup and for future, any code and a pencil drawn circuit diagram.
Details of what motor and any other gear also helps. We are not mind readers here.
Not Fritzing.........
One further note, those little 216 style 9v batteries are for smoke alarms......they will get you into trouble with Arduino. Just don't use them.
Just use a simple 5 x AA battery for starters plugged into the RAW input.

I have the corresponding pins connected correctly to the L298N from the Arduino Nano for the single motor,

You can’t run a L298 from 5V you loose too much voltage.

thought maybe the Arduino Nano wasn't drawing enough power from the L298N ground port,

What? That makes no sense at all on many levels.

You need a higher voltage connected to the chips power rails and you need to connect the negative to the Arduino ground.

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks for writing your problem clearly, however a diagram of your project or even a picture would help.
Do you have a DMM to measure some circuit parameters?

Tom... :slight_smile:

HalilCosta:
I have an Arduino Nano.
I have an L298N Motor Driver, with one 1.5V-3.0V battery screwed into the two-part motor slots on one side.

You have a battery connected to the motor terminals. That's not a good start.

And you think you have all the right pins connected...then you say you have no idea what you're doing. And you're trying to make it work with no code in the Nano. And you're either using 2 x AA (3V) or 9V connected to somewhere.

  1. Provide a link to the exact L298N motor driver board you're using. Otherwise talk about doohickeys and left-most slots are even more meaningless.
  2. Post a simple connection diagram showing EXACTLY what pins are connected where and preferably a clear photo showing all connections including what is powering everything at the moment.

Steve

Just got home from work, quickly posting some photos to help you guys out, and sorry I knew that the wording wouldn’t help but I didn’t have a minute to get the pictures together at the time. Thanks for all the replies.

Shows the project, batteries I’m using as well as the two left-most ports I’m putting the ground and power supply to. Also where the motors are connected and the connections on the Arduino. The Arduino ground I have connected is going to that center port of the three ports shown where the batteries go into. I also showed the other GND and VIN ports on the Arduino nano I put the 9V into before it started heating up. Going to read over some replies before dinner.

Can’t figure out how to display the pictures within my post without redirecting. 6 photos.

Hi,
OPs pics.



Tom.... :slight_smile:

That just can't be right.

That 9V battery can't power motors for long (even without taking the 4V loss of that ancient L298N into account).

That 2xAA batteries just don't make any sense whatsoever.

Do look up some tutorials, read them, and start wiring when you have the feeling you have at least the idea of a clue of what you're doing.

Hi,
Please view this YouTube video;

Tom... :slight_smile:

wvmarle:
That just can't be right.

That 9V battery can't power motors for long (even without taking the 4V loss of that ancient L298N into account).

That 2xAA batteries just don't make any sense whatsoever.

Do look up some tutorials, read them, and start wiring when you have the feeling you have at least the idea of a clue of what you're doing.

So.. in the video Tom posted it shows a guy using 4 AA batteries... and he states that it’s 5.3V... 1.5V per AA battery minus whatever is lost in all the transferring or whatever.... so why wouldn’t a 9V battery be able to power the motor......

I’m not even planning on powering it for long I’m just testing things out. I plan on using way smaller motors once I find some.

Also thank you Tom for sharing my photos I was struggling for a minute there lol. I’m looking closely at this video to see where I’m going wrong.

My goal is to just to get the Arduino to turn on and test the motors without using a USB. I’m probably going to copy and paste some coding as needed to get a successful test run, but I just need this LED to light up by the on button on the nano first... without USB

Even with using the 9V on the L298N on it’s own in the ground and regular shouldn’t it light up?

Update!!

I got the L298N to light up, the 9V bolt and AA battery pack weren’t working, but when I used the second and third jacks instead of the first and second, it turned on. The other side of the third jack on the bottom of the L298N says “5V” so I’m assuming it’s for smaller voltages than the first one which is for DC? Not sure but it’s a start. Now I can try seeing if the nano will light up from that ground port.

Sorry about the watermark, but I guess all I have to do now is upload the code into the arduino

That 5V connection is probably the logic voltage input. Or maybe it's a voltage output, some L298N modules have a 5V regulator on board.

wvmarle:
That 5V connection is probably the logic voltage input.

Most probably is. I thought the OP said he had a L298N but what he actually has is a L298N breakout board, so this makes things different, he need to post a link to the board he has. It is still a rather poor way of driving a low voltage DC motor.

Can anyone tell me what's wrong with this? Or what I'm missing? I copy and pasted it for a quicker viewing.
It's just one DC motor with speed control.

// motor A
int enA = 3;
int in1 = 4;
int in2 = 5;
void setup()
{

// set all motor control pins to outputs
pinMode(enA, OUTPUT);
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
}
void(loop){

;if(Direction=="left") // Left direction command
{
digitalWrite(in1,HIGH);
digitalWrite(in2,LOW);
Serial.println("Motor run left direction");
}
;if(Direction=="right") // Right direction command
{
digitalWrite(in1,LOW);
digitalWrite(in2,HIGH);
Serial.println("Motor run right direction");

}
void runMotor()
{
//Run the first and only motor at a fixed speed
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
//Speed set ranging from 0 ~ 255
analogWrite(enA, 200);
delay(2000);
//Now the other direction
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
//speed for other direction
analogWrite(enA, 200);
//Disable Motor
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
}

Grumpy_Mike:
Most probably is. I thought the OP said he had a L298N but what he actually has is a L298N breakout board, so this makes things different, he need to post a link to the board he has. It is still a rather poor way of driving a low voltage DC motor.

https://www.amazon.com/dp/B01M29YK5U/ref=cm_sw_r_cp_awdb_t1_e-UqEb6NDM88S

I can't see where "Direction" is defined.(I assume it is a String)

Please remember to use code tags when posting code

void loop() {

See the difference?

There are too many things wrong to bother.

Start over and do your cutting and pasting from a decent tutorial.