

The L298N is a dual H-bridge motor driver that allows control of the direction and speed of DC motors. It is capable of driving two DC motors simultaneously, making it an essential component in robotics and automation projects. The module can handle motors with operating voltages between 5V and 35V and currents up to 2A per channel. Its versatility and ease of use make it a popular choice for hobbyists and professionals alike.








Below are the key technical details of the L298N motor driver module:
| Parameter | Value |
|---|---|
| Operating Voltage | 5V to 35V |
| Output Current | Up to 2A per channel |
| Logic Voltage | 5V |
| Logic Current | 0-36mA |
| Power Dissipation | 25W (with proper heat sinking) |
| Control Signal Voltage | 4.5V to 7V (high logic level) |
| Number of Channels | 2 (dual H-bridge) |
| Dimensions | 43mm x 43mm x 27mm |
The L298N module has several pins and terminals for motor control and power input. Below is a detailed description:
| Pin/Terminal | Description |
|---|---|
| VCC | Power supply for motors (5V to 35V) |
| GND | Ground connection |
| 5V | Regulated 5V output (used if onboard regulator is active) |
| OUT1 | Output for Motor A (positive terminal) |
| OUT2 | Output for Motor A (negative terminal) |
| OUT3 | Output for Motor B (positive terminal) |
| OUT4 | Output for Motor B (negative terminal) |
| Pin | Description |
|---|---|
| ENA | Enable pin for Motor A (PWM input for speed control) |
| IN1 | Input 1 for Motor A (direction control) |
| IN2 | Input 2 for Motor A (direction control) |
| ENB | Enable pin for Motor B (PWM input for speed control) |
| IN3 | Input 3 for Motor B (direction control) |
| IN4 | Input 4 for Motor B (direction control) |
VCC terminal and ground to the GND terminal. If the motor voltage exceeds 12V, ensure the onboard 5V regulator is enabled by removing the jumper on the 5V pin.OUT1, OUT2, OUT3, and OUT4 terminals. Each motor requires two terminals.ENA, ENB, IN1, IN2, IN3, IN4) to a microcontroller or other control circuit. Use PWM signals on ENA and ENB for speed control.IN1/IN2 pair for Motor A and IN3/IN4 pair for Motor B to set the direction of rotation.Below is an example of how to control a single DC motor using the L298N and an Arduino UNO:
ENA to Arduino pin 9 (PWM output).IN1 to Arduino pin 8.IN2 to Arduino pin 7.OUT1 and OUT2.VCC and GND.// Define control pins for Motor A
#define ENA 9 // PWM pin for speed control
#define IN1 8 // Direction control pin 1
#define IN2 7 // Direction control pin 2
void setup() {
// Set motor control pins as outputs
pinMode(ENA, OUTPUT);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
}
void loop() {
// Rotate motor forward at 50% speed
analogWrite(ENA, 128); // Set speed (0-255)
digitalWrite(IN1, HIGH); // Set direction
digitalWrite(IN2, LOW);
delay(2000); // Run for 2 seconds
// Rotate motor backward at 75% speed
analogWrite(ENA, 192); // Set speed (0-255)
digitalWrite(IN1, LOW); // Set direction
digitalWrite(IN2, HIGH);
delay(2000); // Run for 2 seconds
// Stop the motor
analogWrite(ENA, 0); // Set speed to 0
delay(2000); // Wait for 2 seconds
}
Motor Not Spinning
Overheating
Motor Spins in One Direction Only
IN1, IN2, IN3, and IN4 pins.PWM Speed Control Not Working
ENA/ENB pins.Can the L298N drive stepper motors? Yes, the L298N can control stepper motors by using both H-bridge channels. However, additional logic is required to sequence the motor phases.
What is the maximum motor voltage the L298N can handle? The module supports motor voltages up to 35V.
Can I use the L298N with a 3.3V microcontroller? The L298N requires 5V logic levels. Use a level shifter to interface with 3.3V systems.