

The L298N is a dual H-bridge motor driver module designed to control the direction and speed of two DC motors or one stepper motor. It is widely used in robotics, automation, and other motor control applications due to its versatility and ease of use. The module can handle motor supply voltages ranging from 5V to 35V and supports a maximum current of 2A per channel. Its compact design and onboard features make it a popular choice for hobbyists and professionals alike.








The L298N module is built around the L298N IC, which is a high-power dual H-bridge driver. Below are the key technical details:
| Parameter | Value |
|---|---|
| Motor Supply Voltage | 5V to 35V |
| Logic Voltage | 5V |
| Maximum Current (per channel) | 2A |
| Number of Channels | 2 |
| Control Logic Levels | High (5V), Low (0V) |
| Power Dissipation | 25W (with proper heat sink) |
| Dimensions | ~43mm x 43mm x 27mm |
The L298N module has several pins and terminals for motor control and power supply. Below is a detailed description:
| Pin/Terminal | Description |
|---|---|
| VCC | Motor power supply (5V to 35V) |
| GND | Ground connection |
| 5V | Logic power supply (optional, if jumper removed) |
| OUT1 | Output for Motor 1 (positive terminal) |
| OUT2 | Output for Motor 1 (negative terminal) |
| OUT3 | Output for Motor 2 (positive terminal) |
| OUT4 | Output for Motor 2 (negative terminal) |
| Pin | Description |
|---|---|
| ENA | Enable pin for Motor 1 (PWM input for speed control) |
| IN1 | Input 1 for Motor 1 (direction control) |
| IN2 | Input 2 for Motor 1 (direction control) |
| ENB | Enable pin for Motor 2 (PWM input for speed control) |
| IN3 | Input 3 for Motor 2 (direction control) |
| IN4 | Input 4 for Motor 2 (direction control) |
Power Connections:
VCC terminal (5V to 35V).GND terminal.5V pin.Motor Connections:
OUT1 and OUT2.OUT3 and OUT4.Control Connections:
ENA and ENB pins to PWM-capable pins of a microcontroller (e.g., Arduino) for speed control.IN1, IN2, IN3, and IN4 to digital pins of the microcontroller for direction control.Programming:
ENA and ENB for speed control.IN1/IN2 and IN3/IN4 to control the direction of the motors.Below is an example of how to control two DC motors using an Arduino UNO and the L298N module:
// Define control pins for Motor 1
#define ENA 9 // PWM pin for speed control
#define IN1 8 // Direction control pin 1
#define IN2 7 // Direction control pin 2
// Define control pins for Motor 2
#define ENB 10 // PWM pin for speed control
#define IN3 6 // Direction control pin 1
#define IN4 5 // Direction control pin 2
void setup() {
// Set motor control pins as outputs
pinMode(ENA, OUTPUT);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(ENB, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
}
void loop() {
// Motor 1: Forward at 50% speed
analogWrite(ENA, 128); // Set speed (0-255)
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
// Motor 2: Reverse at 75% speed
analogWrite(ENB, 192); // Set speed (0-255)
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
delay(2000); // Run motors for 2 seconds
// Stop both motors
analogWrite(ENA, 0);
analogWrite(ENB, 0);
delay(2000); // Wait for 2 seconds
}
Motors Not Running:
ENA and ENB pins are receiving PWM signals.Overheating:
Erratic Motor Behavior:
IN1, IN2, IN3, and IN4.No Output on 5V Pin:
Q: Can the L298N drive stepper motors?
A: Yes, the L298N can drive a bipolar stepper motor by controlling the two H-bridge channels.
Q: Can I use the L298N with a 3.3V microcontroller?
A: The L298N is designed for 5V logic levels. Use a level shifter or ensure the control signals are compatible.
Q: What is the maximum motor voltage I can use?
A: The maximum motor supply voltage is 35V. Ensure your motor is rated for this voltage.
Q: How do I control motor speed?
A: Use PWM signals on the ENA and ENB pins to control the speed of the motors.