The L298N motor driver module is a highpower controller board that uses the L298N dual fullbridge driver IC to control two DC motors or one stepper motor . It allows independent speed and direction control for each motor, making it a staple for Arduino robotics projects .
The module pins are grouped into power, control, enable, and motor outputs .
| Pin Name | Function |
|---|---|
| -- | -- |
| VCC (12V) | Motor power input (5V-35V) |
| GND | Common ground for power and logic |
| 5V | Logic supply input OR output (jumper dependent) |
| IN1, IN2 | Direction control pins for Motor A |
| IN3, IN4 | Direction control pins for Motor B |
| ENA | Enable / PWM speed control for Motor A |
| ENB | Enable / PWM speed control for Motor B |
| OUT1, OUT2 | Terminals for connecting Motor A |
| OUT3, OUT4 | Terminals for connecting Motor B |
+High Current Capacity - Handles up to 2A per channel, with 3A peak current .
+Onboard 5V Regulator - Can supply power to an Arduino when motor voltage is ≤12V .
+Heat Sink for Better Performance Builtin heat sink for improved thermal management .
+PWM Speed Control - Use PWM signals for smooth speed variation .
+Simple Logic Interface - TTL compatible 5V logic inputs .
+Stepper Motor Support - Can drive a bipolar stepper motor .
The direction of the motor is controlled by the logic states of the IN pins .
| ENA | IN1 | IN2 | Motor A State |
|---|---|---|---|
| -- | -- | -- | -- |
| 0 | X | X | Stop |
| 1 | 0 | 0 | Brake |
| 1 | 0 | 1 | Rotate Forward |
| 1 | 1 | 0 | Rotate Reverse |
| 1 | 1 | 1 | Brake |
For speed control, send a PWM signal (e.g., using analogWrite()) to the ENA/ENB pin. This varies the motor's average voltage, controlling its speed .