L298N DUAL-H Motor Driver

L298N DUAL-H Motor Driver

Description

The L298N Dual-H Motor Driver Motor is a high power motor driver module for driving DC motors and stepper motors. This module has an L289N driver IC, 5V regulator, 5V jumper, a power LED, and a heat sink. This module can control a single DC motor, 2 DC motor, and 4 DC motor. This driver is used to control the speed and direction of the motor.

The voltage regulator will be enabled only when the jumper is placed when the DC supply is less than or equal to 12V, the internal circuitry will be powered by the voltage regulator and the 5V pin can be used as an output pin to power your microcontroller or development board. The jumper should not be placed when the voltage is greater than 12V and separate 5V should be given through the 5V terminal to power the internal circuitry.

L289N Motor Driver with Two Motors
Credit: HowToMechatronics

The jumper should not be placed when the voltage is greater than 12V and separate 5V should be given through the 5V terminal to power the internal circuitry.

L289N Pinouts

  • ENA: Enables PWM signal for motorA which controls the speed of the motorA
  • ENB: Enables PWM signal for motorB which controls the speed of the motorB
  • IN1 & IN2: MotorA input pins used to control the direction of rotation of MotorA
  • IN3 & IN4: MotorB input pins used to control the direction of rotation of MotorB
  • OUT1 & OUT2: Output pins for motorA
  • OUT3 & OUT4: Output pins for motorB
  • GND: Ground pin
  • 5V: Supplies power for switching Logic circuitry inside the motor driver
List of Pins for L298N
Credit: Last Minute Engineer

The Working

Now I am going to show you how the L289N motor driver controls the dc motors. The L289N controls the direction of the motor by reversing the direction of the current flow through the motor, The motor driver has an H-bridge containing four switching elements, transistors and the motor at the center forming an H-like configuration.

By activating two particular switches at the same time we can change the direction of current flow thus changing the direction of rotation of the motor.

H-Bridge

We can control the speed of the motor by controlling the input voltage to the motor and one of the methods of doing so is by using the PWM signal. Combining the H-bridge manipulation and the PWM signal you can have complete control of the motor

Usage

Follow the steps below to configure the motor controller board to work as a basic motor driver for a robot that is using two DC motors.

  1. Attach your robot’s motors to the green Motor A and Motor B screw terminals.
  2. Connect the ENA and ENB to PWM capable digital outputs on your robot’s microcontroller.
  3. Connect the IN1, 2, 3, and 4 pins to any digital outputs your robot’s microcontroller.
  4. Apply 5-16V to the board by connecting positive (+) to the blue VMS screw terminal and ground (-) to the blue GND screw terminal.
  5. See below for details on controlling the motors with your robot’s microcontroller.

All inputs are TTL compatible. If you plan to supply more than 16V to your motors do not enable the onboard 5V regulator.

Speed Control

You can control the speed of the motors by connecting PWM outputs from your robot’s microcontroller to the ENA and ENB input pins on the motor driver board. The ENA pin controls the Motor A and the ENB pin controls the Motor B. At the point when these pins are HIGH i.e receive power, the motor also gets powered.

By using the PWM, we are turning the power on and off to adjust the speed of the motor and the longer the PWM duty cycle is, the faster the motor will turn. It’s recommended you always use a PWM duty cycle of 90% or less.

Direction Control

By using the IN1, IN2, IN3, and IN4 input pins on the motor driver board, we can control the direction that the motors turn. Connect these pins to digital outputs on your robot microcontroller. To make the Motor A move forward, set IN1 = HIGH and IN2 = LOW. To make the Motor A move backward set IN1 = LOW and IN2 = HIGH. The same method is used to control the Motor B, set IN3=HIGH and IN4 = LOW to move forward and set IN3 = LOW and IN4 = HIGH to move backward.

Note that the “forward” and “backward” movement refer to the direction of the motors themselves. If the robot does not move in the expected direction, you can reverse the motor polarity by swapping the green screw terminals for the Motor A + and – and/or Motor B + and –.

Stopping

To remove power from the motors, just set ENA = LOW for your Motor A and ENB = LOW for the Motor B. This will make the motors to stop slowly and naturally from the friction. To perform a quick braking operation, simply set the ENA = LOW, IN1 = LOW, and IN2 = LOW for the Motor A and ENB = LOW, IN3 = LOW, and IN4 = LOW for Motor B and the motors will come to an instant stop.

Enjoyed reading about this component see our other posts here

2 Comments

  • I am 6 feet tall and 220 lbs. This shirt fit me perfectly in the chest and shoulders. My only complaint is that it is so long! I like to wear polo shirts untucked. This shirt goes completely past my rear end

  • My husband always says that the Lauren polos fit better and last longer than any other brand.I love the new “heathered” color and the price is always excellent through shop

Leave a Reply

Your email address will not be published. Required fields are makes.