

The L298N is a dual H-bridge motor driver IC designed to control the direction and speed of DC motors and stepper motors. It is capable of driving two motors simultaneously, making it a versatile choice for robotics, automation, and other motor control applications. The L298N can handle high currents and voltages, making it suitable for a wide range of projects, from small robots to industrial automation systems.








The L298N is a robust and reliable motor driver IC with the following key specifications:
| Parameter | Value |
|---|---|
| Operating Voltage | 5V to 46V |
| Maximum Output Current | 2A per channel (4A total) |
| Logic Voltage | 5V |
| Power Dissipation | 25W (with proper heat sinking) |
| Control Logic Levels | High: 2.3V to 5V, Low: 0V to 1.5V |
| Number of Channels | 2 (dual H-bridge) |
| Motor Types Supported | DC motors, stepper motors |
| Operating Temperature | -25°C to +130°C |
The L298N module typically comes with a breakout board for easier use. Below is the pin configuration for the module:
| Pin Name | Type | Description |
|---|---|---|
| IN1 | Input | Controls the direction of Motor A (High/Low). |
| IN2 | Input | Controls the direction of Motor A (High/Low). |
| IN3 | Input | Controls the direction of Motor B (High/Low). |
| IN4 | Input | Controls the direction of Motor B (High/Low). |
| ENA | Enable/Input | Enables or disables Motor A. Can be used for PWM speed control. |
| ENB | Enable/Input | Enables or disables Motor B. Can be used for PWM speed control. |
| OUT1 | Output | Motor A terminal 1. |
| OUT2 | Output | Motor A terminal 2. |
| OUT3 | Output | Motor B terminal 1. |
| OUT4 | Output | Motor B terminal 2. |
| VCC | Power Input | Motor power supply (5V to 46V). |
| GND | Ground | Common ground for the circuit. |
| 5V | Power Output | Provides 5V output (used when the onboard regulator is active). |
Power Connections:
VCC pin (ensure it matches the motor's voltage rating).GND pin to the ground of your power supply and microcontroller.5V pin to the microcontroller's 5V input.Motor Connections:
OUT1 and OUT2 pins for Motor A, and OUT3 and OUT4 pins for Motor B.Control Connections:
IN1 and IN2 pins to control the direction of Motor A, and IN3 and IN4 for Motor B.ENA and ENB pins for speed control via PWM signals.Logic Power:
Below is an example of how to control a DC motor using the L298N and an Arduino UNO:
// Define control pins for Motor A
const int IN1 = 9; // Direction control pin 1 for Motor A
const int IN2 = 8; // Direction control pin 2 for Motor A
const int ENA = 10; // Speed control (PWM) pin for Motor A
void setup() {
// Set motor control pins as outputs
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(ENA, OUTPUT);
}
void loop() {
// Rotate Motor A forward at 50% speed
digitalWrite(IN1, HIGH); // Set IN1 high
digitalWrite(IN2, LOW); // Set IN2 low
analogWrite(ENA, 128); // Set ENA to 50% duty cycle (128/255)
delay(2000); // Run motor for 2 seconds
// Rotate Motor A backward at 75% speed
digitalWrite(IN1, LOW); // Set IN1 low
digitalWrite(IN2, HIGH); // Set IN2 high
analogWrite(ENA, 192); // Set ENA to 75% duty cycle (192/255)
delay(2000); // Run motor for 2 seconds
// Stop Motor A
digitalWrite(IN1, LOW); // Set IN1 low
digitalWrite(IN2, LOW); // Set IN2 low
analogWrite(ENA, 0); // Set ENA to 0% duty cycle (motor off)
delay(2000); // Wait for 2 seconds before repeating
}
Motors Not Running:
ENA or ENB pins are enabled (HIGH or receiving a PWM signal).Overheating:
Erratic Motor Behavior:
No 5V Output:
Q: Can the L298N drive stepper motors?
A: Yes, the L298N can drive bipolar stepper motors by controlling the two H-bridges. You will need to sequence the control signals appropriately.
Q: Can I use the L298N with a 3.3V microcontroller?
A: The L298N is designed for 5V logic levels. You may need a level shifter to interface it with a 3.3V microcontroller.
Q: What is the maximum motor voltage the L298N can handle?
A: The L298N can handle motor voltages up to 46V.
Q: Can I control the speed of the motors?
A: Yes, you can control motor speed using PWM signals on the ENA and ENB pins.
By following this documentation, you can effectively use the L298N motor driver in your projects!