

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








The L298N motor driver module has the following key specifications:
| Parameter | Value | 
|---|---|
| Operating Voltage | 5V to 35V | 
| Output Current | Up to 2A per channel | 
| Logic Voltage | 5V | 
| Power Dissipation | 25W (with proper heat sinking) | 
| Control Logic Levels | High (1) and Low (0) | 
| 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 | Logic voltage output (used when VCC > 7V) | 
| OUT1 | Output for Motor A (connect to one motor terminal) | 
| OUT2 | Output for Motor A (connect to the other terminal) | 
| OUT3 | Output for Motor B (connect to one motor terminal) | 
| OUT4 | Output for Motor B (connect to the other 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) | 
Below is an example of how to control a single motor using the L298N and an Arduino UNO:
// Define control pins for Motor A
const int ENA = 9;  // PWM pin for speed control
const int IN1 = 8;  // Direction control pin 1
const int 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
  digitalWrite(IN1, HIGH);  // Set IN1 high
  digitalWrite(IN2, LOW);   // Set IN2 low
  analogWrite(ENA, 150);    // Set speed (0-255)
  delay(2000);              // Run for 2 seconds
  // Rotate motor backward
  digitalWrite(IN1, LOW);   // Set IN1 low
  digitalWrite(IN2, HIGH);  // Set IN2 high
  analogWrite(ENA, 150);    // Set speed (0-255)
  delay(2000);              // Run for 2 seconds
  // Stop motor
  digitalWrite(IN1, LOW);   // Set IN1 low
  digitalWrite(IN2, LOW);   // Set IN2 low
  analogWrite(ENA, 0);      // Set speed to 0
  delay(2000);              // Wait for 2 seconds
}
Motor Not Spinning
Motor Spins in the Wrong Direction
Module Overheating
No Output Voltage on Motor Terminals
Can I control stepper motors with the L298N? Yes, the L298N can control stepper motors by using both H-bridge channels. However, additional logic may be required.
What happens if I exceed the current rating? Exceeding the 2A per channel limit can damage the module. Use motors within the specified current range.
Can I use the 5V output to power my Arduino? Yes, but only if the motor power supply (VCC) is greater than 7V. Ensure the current draw of the Arduino and other components does not exceed the module's capacity.