2‑Way DC Dual H‑Bridge Motor Driver Module – L298N – User’s Guide

1. Overview
- The L298N is a dual H‑bridge motor driver IC.
- Each module can control two DC motors or one stepper motor.
- It allows forward/reverse rotation and speed control via PWM.
- Pack of 2 means you can drive up to 4 DC motors or 2 stepper motors simultaneously.
2. Specifications
- Operating Voltage: 5V – 35V DC
- Logic Voltage: 5V (from onboard regulator or external supply)
- Output Current: Up to 2A per channel
- Control Inputs: IN1, IN2, IN3, IN4 (logic signals)
- Outputs: MOTOR‑A, MOTOR‑B (to motor terminals)
- Power Pins: + (VCC motor supply), – (GND)
3. Pin Connections
| Pin | Function | Connect To |
|---|---|---|
| + (VCC) | Motor power supply (5–35V) | External DC supply |
| – (GND) | Ground | Common ground with controller |
| IN1, IN2 | Control Motor A | Arduino digital pins |
| IN3, IN4 | Control Motor B | Arduino digital pins |
| MOTOR‑A | Motor A terminals | DC motor A |
| MOTOR‑B | Motor B terminals | DC motor B |
4. Example Wiring (Arduino UNO)
Arduino 5V → L298N + (logic supply)
Arduino GND → L298N –
D8 → IN1
D9 → IN2
D10 → IN3
D11 → IN4
Motor A → MOTOR‑A
Motor B → MOTOR‑B
External 12V → L298N + (motor supply)
5. Example Code (Arduino)
int IN1 = 8;
int IN2 = 9;
int IN3 = 10;
int IN4 = 11;
void setup() {
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
}
// Motor A forward, Motor B backward
void loop() {
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
delay(2000);
// Stop motors
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
delay(2000);
}
6. Operation
- Forward/Reverse: Controlled by IN1/IN2 (Motor A) and IN3/IN4 (Motor B).
- Speed Control: Apply PWM to IN1/IN2 or IN3/IN4 pins.
- Stop: Set both inputs LOW for a motor channel.
7. Applications
- Robotics (drive wheels, arms)
- CNC machines / 3D printers (stepper control)
- DIY kits for learning motor control
- Automated toys and small vehicles
8. Best Practices
- Use an external power supply for motors (not just Arduino 5V).
- Keep motor current ≤ 2A per channel.
- Always connect grounds together (Arduino + L298N + motor supply).
- Add heat sinks or cooling if driving motors near max current.