The L298N Motor Driver is a dual H-bridge motor driver module that allows for the control of the speed and direction of two DC motors or one stepper motor. It can handle up to 2A per channel, making it suitable for a wide range of applications in robotics and automation projects. This versatile module is commonly used in projects involving Arduino, Raspberry Pi, and other microcontrollers.
Parameter | Value |
---|---|
Operating Voltage | 5V to 35V |
Output Current | 2A per channel (max) |
Peak Output Current | 3A per channel (non-repetitive) |
Control Logic Voltage | 5V |
Power Dissipation | 25W |
Operating Temperature | -25°C to +130°C |
Dimensions | 43mm x 43mm x 27mm |
Pin Name | Description |
---|---|
VCC | Motor power supply (5V to 35V) |
GND | Ground |
5V | Logic power supply (5V) |
OUT1 | Output to Motor A (Terminal 1) |
OUT2 | Output to Motor A (Terminal 2) |
OUT3 | Output to Motor B (Terminal 1) |
OUT4 | Output to Motor B (Terminal 2) |
Pin Name | Description |
---|---|
ENA | Enable pin for Motor A (PWM input) |
IN1 | Control input 1 for Motor A |
IN2 | Control input 2 for Motor A |
ENB | Enable pin for Motor B (PWM input) |
IN3 | Control input 1 for Motor B |
IN4 | Control input 2 for Motor B |
Power Connections:
Motor Connections:
Control Connections:
// Define motor control pins
#define ENA 9
#define IN1 8
#define IN2 7
#define ENB 10
#define IN3 12
#define IN4 11
void setup() {
// Set all the motor control pins to 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 full speed
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
analogWrite(ENA, 255); // Full speed
// Example: Rotate Motor B backward at half speed
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
analogWrite(ENB, 128); // Half speed
delay(2000); // Run motors for 2 seconds
// Stop both motors
analogWrite(ENA, 0);
analogWrite(ENB, 0);
delay(2000); // Wait for 2 seconds
}
Motor Not Running:
Overheating:
Erratic Motor Behavior:
Can I control more than two motors with a single L298N module?
What is the maximum voltage I can use with the L298N module?
Can I use the L298N module with a Raspberry Pi?
How do I control the speed of the motors?
By following this documentation, users should be able to effectively utilize the L298N Motor Driver in their projects, ensuring reliable and efficient motor control.