L298N Motor Module with Arduino Mega doesn't work.

Thread Starter

Ravdev

Joined Feb 7, 2020
18
Hi, I have a project which uses an Arduino Mega board, L298N Motor Module, 2x 12-volt DC Motor and 3x 18650 Li-ion Battery. I uploaded the code to the Mega board, connect the wires and place the battery, but the 2 DC Motors seems to not rotate. Does anyone have any idea how to solve the problem?
 

Attachments

bertus

Joined Apr 5, 2008
22,270
Hello,

As drawn the 3 batteries are parallel, giving about 4 volts
For 12 volts you want them in series.

Bertus
 

Thread Starter

Ravdev

Joined Feb 7, 2020
18
Hello,

As drawn the 3 batteries are parallel, giving about 4 volts
For 12 volts you want them in series.

Bertus
Hi, I think it is in parallel, I am using a 3x 18650 battery holder. But do I need more? Do I need 8x 18650 batteries overall?
Edit: I used 3 1x 18650 battery holder because I couldn't find a 3x battery holder for fritzing.
 

Alec_t

Joined Sep 17, 2013
14,280
I don't know the details of your motor driver board, but I'm guessing the ENA and ENB inputs need to be jumpered to +5V?
 

Thread Starter

Ravdev

Joined Feb 7, 2020
18
I don't know the details of your motor driver board, but I'm guessing the ENA and ENB inputs need to be jumpered to +5V?
It is the L298N Motor Driver, I don't have any wires connected to the ENA and ENB. Do you mean by connecting it to the 5V of the Arduino Mega?
 

shortbus

Joined Sep 30, 2009
10,045
It is the L298N Motor Driver, I don't have any wires connected to the ENA and ENB. Do you mean by connecting it to the 5V of the Arduino Mega?
Like Alec said - "Next are the logic control inputs. The Enable A and Enable B pins are used for enabling and controlling the speed of the motor. If a jumper is present on this pin, the motor will be enabled and work at maximum speed, and if we remove the jumper we can connect a PWM input to this pin and in that way control the speed of the motor. If we connect this pin to a Ground the motor will be disabled" From - https://howtomechatronics.com/tutor...dc-motor-control-tutorial-l298n-pwm-h-bridge/
 

dendad

Joined Feb 20, 2016
4,451
The supply for the motors needs to be VinHI + 2.5V according to the data sheet. So it will not work on 3.7V. Put the batteries in series.
 

Thread Starter

Ravdev

Joined Feb 7, 2020
18
Like Alec said - "Next are the logic control inputs. The Enable A and Enable B pins are used for enabling and controlling the speed of the motor. If a jumper is present on this pin, the motor will be enabled and work at maximum speed, and if we remove the jumper we can connect a PWM input to this pin and in that way control the speed of the motor. If we connect this pin to a Ground the motor will be disabled" From - https://howtomechatronics.com/tutor...dc-motor-control-tutorial-l298n-pwm-h-bridge/
I need to make them rotate. I don't need to control them.
 

AlbertHall

Joined Jun 4, 2014
12,343
Ok, that sure looks like they would be in series.
But your original picture shows them connected in parallel so we were confused.
 

ebeowulf17

Joined Aug 12, 2014
3,307
Sorry, I'm confused. But to make it short and not confusing, I'm using a 3x 18650 battery holder.
Edit: The picture of the battery holder is in the attachment.
Do you have 11-12V, or something in that general range at the output of the red and black wires? If so, you're in good shape there.

You still haven't answered earlier questions about the enable pins. Do you have jumpers in place, connecting the enable pins to their neighboring 5V pins? I don't know this driver board myself, but based on comments and documentation above, you need to make those connections.
 

Thread Starter

Ravdev

Joined Feb 7, 2020
18
Do you have 11-12V, or something in that general range at the output of the red and black wires? If so, you're in good shape there.

You still haven't answered earlier questions about the enable pins. Do you have jumpers in place, connecting the enable pins to their neighboring 5V pins? I don't know this driver board myself, but based on comments and documentation above, you need to make those connections.
Do I need to connect them to a PWM pin?
 
Top