L298n ena/enb pins problem

I am am trying to use a L298n motor driver to control a motor. The L298n comes with two caps that connect the two pins for each ENA and ENB, and from what I've understood the motor is supposed to run at maximum speed when the cap is on. My program works just fine when the caps are on, but when I take them of and connect the ENA/ENB pins to the arduino to control the speed of the motor, nothing happens (the motor doesn't turn at all).
What could be causing this problem ?

Hmmm. Maybe it's something in your code. Or the connections you made.

I don't think so because I'm using a code from a tutorial, and I have the same connections.. from the comments I'm not the only one to have this problem and it seems to have something to do with the power supply ? I'm using the arduino 5V output to power the l298n..

When you say you connect the pins to the Arduino, presumably you then do a digitalWrite() or analogWrite() to them?

1 Like

yes, this is the tutorial (code at the end of the page) In-Depth: Interface L298N DC Motor Driver Module with Arduino

You should have mentioned this in the first post. Along with the link to the tutorial.

And what about powering the motors? Obviously you have a 298 module, not a bare 298 chip, so you should give details thereof.

Well nobody knows what the tutorial says you're supposed to do until you post some details.

just posted it in post 5, sorry. and the motors are powered with the outputs of the L298n

yep, just did sorry

How much error checking did you do? Do you have exactly the same hardware? Please post detailed and complete images of your actual hardware, and also the code that you have, verbatim, and in code tags.

Please don't go back and edit previous posts. It creates confusion for people reading the thread.

I didn't edit anything I said, I just added quotations so that it would be more clear as to what post I was responding.. I didn't know I could quote (also just edited this because I mistranslated the word quotation)

Okay, never mind. Please just provide the full details of your project, as I outlined. It will highlight any differences from the tutorial that might cause a unique problem in your case.

Well I have 2 differences from the tutorial : I am only using one motor, and I am not using a battery but the arduino 5V output, and the arduino gnd. Apart from this, I have done exactly the same thing (same hardware and connections and code)

Are you trying to excuse yourself from the due diligence of providing project information?

If you did exactly the same thing as the tutorial, it would work!

I don't know what you mean, I described everything I did ?

yes like I said I didn't do exactly the same thing because I am not using an external power source.. And that seems to be the cause of the problem.. You are kind of aggressive, I'm going to look for a solution myself. I'll post the solution when I find it.

Boo hoo. Good luck.

If you know before you even post that the power supply is the problem, why even ask?

I was just typing to say that the tutorial shows an external supply but you had said you were using 5V, which you just confirmed.

With the 2 or more volts lost in the 298 that leaves very little to power the motor.

But you said it worked with the en jumpers in place which is odd: I'm surprised it works at all with 5V which is really closer to 3V.

edit: in fact when there's any real current flowing, like there might be at start up of the motor, the 298 voltage drop is almost 5V (4.8 iir) so there's bugger all left. The 298 is a crap driver at low voltages: if you use higher voltage input, the losses are the same in absolute terms but of course relatively lower and the effect is less noticeable. Do yourself a favour and use 12V as the tut says.

...but not until after 15 posts. Including some begging for info...

Just in case it got missed, I edited this into post 18 and repeating it here. Bottom line: do as the tut suggests instructs and use 12V.