The L298N DC Motor Driver Module is a robust and versatile component designed to control the speed and direction of two DC motors. It features a dual H-bridge configuration, allowing it to handle high current and voltage, making it ideal for various robotics and automation projects. This module is widely used in applications such as robotic arms, conveyor belts, and automated vehicles.
Parameter | Value |
---|---|
Operating Voltage | 5V to 35V |
Output Current | 2A per channel (max 3A peak) |
Power Dissipation | 25W |
Control Logic | Standard TTL logic levels |
Dimensions | 43mm x 43mm x 27mm |
Pin Number | Pin Name | Description |
---|---|---|
1 | ENA | Enable pin for Motor A (active high) |
2 | IN1 | Input 1 for Motor A |
3 | IN2 | Input 2 for Motor A |
4 | OUT1 | Output 1 for Motor A |
5 | OUT2 | Output 2 for Motor A |
6 | GND | Ground |
7 | VCC | Supply voltage for the motor (5V to 35V) |
8 | ENB | Enable pin for Motor B (active high) |
9 | IN3 | Input 1 for Motor B |
10 | IN4 | Input 2 for Motor B |
11 | OUT3 | Output 1 for Motor B |
12 | OUT4 | Output 2 for Motor B |
13 | 5V | 5V logic supply (optional, if not using onboard 5V regulator) |
14 | GND | Ground |
Power Supply:
Motor Connections:
Control Pins:
// Define motor control pins
const int ENA = 9; // PWM pin for Motor A speed control
const int IN1 = 8; // Direction control pin for Motor A
const int IN2 = 7; // Direction control pin for Motor A
const int ENB = 10; // PWM pin for Motor B speed control
const int IN3 = 6; // Direction control pin for Motor B
const int IN4 = 5; // Direction control pin for Motor B
void setup() {
// Set all the motor control pins as outputs
pinMode(ENA, OUTPUT);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(ENB, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
}
void loop() {
// Example: Rotate Motor A forward at half speed
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
analogWrite(ENA, 128); // 128 is 50% duty cycle
// Example: Rotate Motor B backward at full speed
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
analogWrite(ENB, 255); // 255 is 100% duty cycle
delay(2000); // Run motors for 2 seconds
// Stop both motors
analogWrite(ENA, 0);
analogWrite(ENB, 0);
delay(2000); // Wait for 2 seconds before repeating
}
Motors Not Running:
Overheating:
Erratic Motor Behavior:
By following this documentation, users should be able to effectively utilize the L298N DC Motor Driver Module in their projects, ensuring reliable and efficient motor control.