workshop
living
food
play
outside
Table of Contents
Arduino Modules - L298N Dual H-Bridge Motor Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 1: Getting to know your L298N Dual H-Bridge Motor Controller module: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
http://www.instructables.com/id/Arduino-Modules-L298N-Dual-H-Bridge-Motor-Controll/
Step 1: Getting to know your L298N Dual H-Bridge Motor Controller module:
Usage:
H-Bridge's are typically used in controlling motors speed and direction, but can be used for other projects such as driving the brightness of certain lighting projects such
as high powered LED arrays.
How it works:
An H-Bridge is a circuit that can drive a current in either polarity and be controlled by *Pulse Width Modulation (PWM).
* Pulse Width Modulation is a means in controlling the duration of an electronic pulse. In motors try to imagine the brush as a water wheel and electrons as a the flowing
droplets of water. The voltage would be the water flowing over the wheel at a constant rate, the more water flowing the higher the voltage. Motors are rated at certain
voltages and can be damaged if the voltage is applied to heavily or if it is dropped quickly to slow the motor down. Thus PWM. Take the water wheel analogy and think of
the water hitting it in pulses but at a constant flow. The longer the pulses the faster the wheel will turn, the shorter the pulses, the slower the water wheel will turn. Motors
will last much longer and be more reliable if controlled through PWM.
Pins:
Out 1: Motor A lead out
Out 2: Motor A lead out
Out 3: Motor B lead out
Out 4: Mo (Can actually be from 5v-35v, just marked as 12v)
GND: Ground
5v: 5v input (unnecessary if your power source is 7v-35v, if the power source is 7v-35v then it can act as a 5v out)
EnA: Enables PWM signal for Motor A (Please see the "Arduino Sketch Considerations" section)
In1: Enable Motor A
In2: Enable Motor A
In3: Enable Motor B
In4: Enable Motor B
EnB: Enables PWM signal for Motor B (Please see the "Arduino Sketch Considerations" section)
Specifications:
Double H bridge Drive Chip: L298N
Logical voltage: 5V Drive voltage: 5V-35V
Logical current: 0-36mA Drive current: 2A (MAX single bridge)
Max power: 25W
Dimensions: 43 x 43 x 26mm
Weight: 26g
*Built-in 5v power supply, when the driving voltage is 7v-35v
http://www.instructables.com/id/Arduino-Modules-L298N-Dual-H-Bridge-Motor-Controll/
http://www.instructables.com/id/Arduino-Modules-L298N-Dual-H-Bridge-Motor-Controll/
File Downloads
L298N_Dual_H_Bridge_Keyboard_Control_Reichenstein7.ino (2 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'L298N_Dual_H_Bridge_Keyboard_Control_Reichenstein7.ino']
Related Instructables
Control DC and
stepper motors
with L298N Dual
Motor Controller
Modules and
Arduino by
tronixlabs
Toy to Obstacle
Avoider by
eberhard1
Dual Motor
Driver with
Arduino using a
SN754410NE
Quad Half HBridge by
ArduinoFun
How to Control
any R/C car with
an airplane
transmitter! by
vkarpuram
Getting Started
With The
MC33932 Dual
Motor Shield by
JayconSystems
Advertisements
Comments
32 comments Add Comment
Reichenstein7 says:
I have added a link to the .ino file via Mediafire for those who are still seeing formatting errors.
vjoshi14 says:
LeoZ1 says:
MadhusudanK says:
http://www.instructables.com/id/Arduino-Modules-L298N-Dual-H-Bridge-Motor-Controll/
nimz says:
killercatfish says:
Reichenstein7 says:
tintinmovie says:
Reichenstein7 says:
AlexanderR2 says:
AlexanderR2 says:
If its not what you meant, where would I connect the power source ground cable?
Thanks, and sorry if its a stupid question. Im CS student, this is for a robotics investigation Im doing with arduino :)
Reichenstein7 says:
inese.eglava says:
8401288342 says:
What is the maximum delivered voltage and current at the Motor end.
TahirK says:
AbdulM5 says:
if i am using pwm, so do i have to remove jumper from enable pins. Also which pin should be connected to arduino then.
Reichenstein7 says:
http://www.instructables.com/id/Arduino-Modules-L298N-Dual-H-Bridge-Motor-Controll/
Vova.Kuzmenkov0 says:
Hey Reichenstein7!
There is an error in your sketch: you've missed initialisation of serial port in void setup() {..} section
Please add the following:
void setup() {
...*your initialisations here*
Serial.begin(9600);
Serial.println("Enter Number 1 to 6 to control the motor");
}
Then the code will work! You'll be able to control motors via serial monitor.
All in all your guide was a great help to me! thanks!
Regards,
Vova
Reichenstein7 says:
Reichenstein7 says:
quadro123 says:
vsharma23 says:
Reichenstein7 says:
http://www.instructables.com/id/Arduino-Modules-L298N-Dual-H-Bridge-Motor-Controll/
vsharma23 says:
ok thanks.
Reichenstein7 says:
I realized a few days ago that I have used this controller in another instructables. Take a look here:
http://www.instructables.com/id/Project-Launch-Platform-Robot-Part-1-The-Head/
yakeen4u says:
Reichenstein7 says:
rafael.duarte.752 says:
Reichenstein7 says:
The sketch is attached. The formatting gets all messed up if I paste it.
carlos66ba says:
omnibot says:
Arman5592 says:
Great ! I wanted to buy one of these and I was confused with all the pins and how to connect to an arduino .
http://www.instructables.com/id/Arduino-Modules-L298N-Dual-H-Bridge-Motor-Controll/