Stufin
Home Quick Cart Profile

L298 2A Dual Motor Driver Module with PWM Control

Buy Now on Stufin

Component Name

L298 2A Dual Motor Driver Module with PWM Control

Overview

The L298 2A Dual Motor Driver Module with PWM Control is a versatile and widely used motor driver module designed to control two DC motors simultaneously. This module is based on the L298N dual full-bridge driver IC, which provides an efficient and reliable way to drive inductive loads like DC motors. The module features built-in PWM (Pulse Width Modulation) control, allowing for precise speed regulation and direction control of the motors.

Key Features

  • Dual Motor Control: The module can control two DC motors independently, with each motor capable of handling a maximum current of 2A.
  • PWM Control: The module features built-in PWM control, enabling precise speed regulation and direction control of the motors.
  • L298N Dual Full-Bridge Driver IC: The module is based on the L298N IC, which is a monolithic integrated circuit in a 15-lead Multiwatt package. The L298N provides a high-voltage, high-current, dual full-bridge driver with a built-in overcurrent protection and thermal shutdown.
  • Enable Inputs: The module has two enable inputs (ENA and ENB) that can be used to enable or disable the motor drivers.
  • Direction Control: The module has four direction control inputs (IN1, IN2, IN3, and IN4) that determine the rotation direction of the motors.
  • Status LEDs: The module features status LEDs that indicate the operational status of the motor drivers.
  • Onboard Voltage Regulator: The module has an onboard 5V voltage regulator, which can be used to power external components, such as microcontrollers or sensors.
  • Compact Size: The module has a compact design, making it ideal for use in robotics, automation, and other space-constrained applications.

Technical Specifications

Motor Current

2A per motor

Voltage Range

5V to 35V

Maximum Power Dissipation

25W per motor

PWM Frequency

Up to 10 kHz

Enable Input Logic Level

2.5V to 5V

Direction Control Input Logic Level

2.5V to 5V

Operating Temperature

-20C to 85C

Dimensions

43.2 mm x 34.5 mm x 17.5 mm (1.7 in x 1.36 in x 0.69 in)

Applications

The L298 2A Dual Motor Driver Module with PWM Control is suitable for a wide range of applications, including

Robotics

Automation

CNC machines

3D printers

Electric vehicles

Home automation systems

IoT projects

Pinout

VIN

Input voltage (5V to 35V)

GND

Ground

Conclusion

The L298 2A Dual Motor Driver Module with PWM Control is a versatile and reliable motor driver module that provides precise speed regulation and direction control of two DC motors. Its compact design, onboard voltage regulator, and status LEDs make it an ideal choice for a wide range of applications, from robotics and automation to IoT projects and home automation systems.

ENA

Enable input for motor A

ENB

Enable input for motor B

IN1Direction control input for motor A
IN2Direction control input for motor A
IN3Direction control input for motor B
IN4Direction control input for motor B
OUT1Motor A output
OUT2Motor A output
OUT3Motor B output
OUT4Motor B output
5VOnboard 5V voltage regulator output

Pin Configuration

  • L298 2A Dual Motor Driver Module with PWM Control Pinout Explanation
  • The L298 2A Dual Motor Driver Module with PWM Control is a popular and versatile motor driver module used to control two DC motors simultaneously. It features PWM (Pulse Width Modulation) control for speed regulation and direction control for each motor. Here's a detailed explanation of each pin on the module:
  • Pinout Structure:
  • The L298 module has a total of 16 pins, arranged in two rows of 8 pins each. The pins are labeled on the module as follows:
  • Upper Row ( Pins 1-8 ):
  • 1. VIN (Input Voltage): This pin is connected to the positive terminal of the power supply (typically 5V to 24V). It provides power to the module.
  • 2. GND (Ground): This pin is connected to the negative terminal of the power supply and serves as a common ground for the module.
  • 3. ENA (Enable A): This pin is used to enable or disable Motor A. When set high (5V), Motor A is enabled. When set low (0V), Motor A is disabled.
  • 4. IN1 (Input 1): This pin controls the direction of Motor A. When set high (5V), Motor A rotates clockwise. When set low (0V), Motor A rotates counterclockwise.
  • 5. IN2 (Input 2): This pin controls the direction of Motor A. When set high (5V), Motor A rotates counterclockwise. When set low (0V), Motor A rotates clockwise.
  • 6. OUT1 (Output 1): This pin is connected to one terminal of Motor A.
  • 7. OUT2 (Output 2): This pin is connected to the other terminal of Motor A.
  • 8. PWMA (PWM A): This pin is used to control the speed of Motor A using PWM signals.
  • Lower Row (Pins 9-16):
  • 9. ENB (Enable B): This pin is used to enable or disable Motor B. When set high (5V), Motor B is enabled. When set low (0V), Motor B is disabled.
  • 10. IN3 (Input 3): This pin controls the direction of Motor B. When set high (5V), Motor B rotates clockwise. When set low (0V), Motor B rotates counterclockwise.
  • 11. IN4 (Input 4): This pin controls the direction of Motor B. When set high (5V), Motor B rotates counterclockwise. When set low (0V), Motor B rotates clockwise.
  • 12. OUT3 (Output 3): This pin is connected to one terminal of Motor B.
  • 13. OUT4 (Output 4): This pin is connected to the other terminal of Motor B.
  • 14. PWMB (PWM B): This pin is used to control the speed of Motor B using PWM signals.
  • 15. VCC (Logic Voltage): This pin is connected to the positive terminal of the logic voltage supply (typically 5V). It powers the module's internal logic.
  • 16. GND (Ground): This pin is connected to the negative terminal of the logic voltage supply and serves as a common ground for the module.
  • Connection Structure:
  • To connect the pins, follow this structure:
  • Connect the power supply to the VIN and GND pins.
  • Connect Motor A to the OUT1 and OUT2 pins.
  • Connect Motor B to the OUT3 and OUT4 pins.
  • Connect the enable pins (ENA and ENB) to a digital output on your microcontroller or a switch to enable or disable the motors.
  • Connect the direction control pins (IN1, IN2, IN3, and IN4) to digital outputs on your microcontroller to control the motor direction.
  • Connect the PWM control pins (PWMA and PWMB) to PWM-capable outputs on your microcontroller to control the motor speed using PWM signals.
  • Remember to consult the datasheet and specifications of the L298 module and your microcontroller for specific connection requirements and guidelines.

Code Examples

L298 2A Dual Motor Driver Module with PWM Control Documentation
Overview
The L298 2A Dual Motor Driver Module with PWM Control is a high-current, dual-channel motor driver module designed to operate two brushed DC motors simultaneously. It features two H-bridge driver ICs (L298N) and is capable of delivering up to 2A of continuous current per channel. The module also supports PWM (Pulse-Width Modulation) control, enabling precise speed control of the motors.
Pinout and Connections
The module has the following pins:
VIN: Input voltage (5V to 24V)
 GND: Ground
 ENA (Enable A) and ENB (Enable B): Enable inputs for motor channels A and B, respectively
 IN1 and IN2: Input pins for motor channel A
 IN3 and IN4: Input pins for motor channel B
 OUT1 and OUT2: Output pins for motor channel A
 OUT3 and OUT4: Output pins for motor channel B
Code Examples
### Example 1: Basic Motor Control using Arduino
This example demonstrates how to control two DC motors using the L298 2A Dual Motor Driver Module with PWM control using an Arduino board.
```c
const int enA = 2; // Enable pin for motor A
const int in1 = 3; // Input pin 1 for motor A
const int in2 = 4; // Input pin 2 for motor A
const int enB = 5; // Enable pin for motor B
const int in3 = 6; // Input pin 1 for motor B
const int in4 = 7; // Input pin 2 for motor B
void setup() {
  // Set the enable pins as output
  pinMode(enA, OUTPUT);
  pinMode(enB, OUTPUT);
  
  // Set the input pins as output
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
  pinMode(in3, OUTPUT);
  pinMode(in4, OUTPUT);
}
void loop() {
  // Set motor A to move forward at 50% speed
  digitalWrite(enA, HIGH);
  digitalWrite(in1, HIGH);
  digitalWrite(in2, LOW);
  analogWrite(enA, 128); // 50% duty cycle
// Set motor B to move backward at 75% speed
  digitalWrite(enB, HIGH);
  digitalWrite(in3, LOW);
  digitalWrite(in4, HIGH);
  analogWrite(enB, 192); // 75% duty cycle
delay(1000); // Wait for 1 second
// Stop both motors
  digitalWrite(enA, LOW);
  digitalWrite(enB, LOW);
  delay(1000); // Wait for 1 second
}
```
### Example 2: Robotics Application using Python and Raspberry Pi
This example demonstrates how to control two DC motors using the L298 2A Dual Motor Driver Module with PWM control using a Raspberry Pi and Python.
```python
import RPi.GPIO as GPIO
import time
# Set the GPIO mode
GPIO.setmode(GPIO.BCM)
# Define the pins
ena = 17
in1 = 23
in2 = 24
enb = 25
in3 = 12
in4 = 16
# Set the enable pins as output
GPIO.setup(ena, GPIO.OUT)
GPIO.setup(enb, GPIO.OUT)
# Set the input pins as output
GPIO.setup(in1, GPIO.OUT)
GPIO.setup(in2, GPIO.OUT)
GPIO.setup(in3, GPIO.OUT)
GPIO.setup(in4, GPIO.OUT)
while True:
  # Set motor A to move forward at 50% speed
  GPIO.output(ena, GPIO.HIGH)
  GPIO.output(in1, GPIO.HIGH)
  GPIO.output(in2, GPIO.LOW)
  GPIO.PWM(ena, 50) # 50% duty cycle
# Set motor B to move backward at 75% speed
  GPIO.output(enb, GPIO.HIGH)
  GPIO.output(in3, GPIO.LOW)
  GPIO.output(in4, GPIO.HIGH)
  GPIO.PWM(enb, 75) # 75% duty cycle
time.sleep(1) # Wait for 1 second
# Stop both motors
  GPIO.output(ena, GPIO.LOW)
  GPIO.output(enb, GPIO.LOW)
  time.sleep(1) # Wait for 1 second
```
Note: In both examples, the motor speeds can be adjusted by changing the PWM duty cycle values. Additionally, the direction of the motors can be reversed by swapping the input pins (IN1 and IN2 for motor A, and IN3 and IN4 for motor B).