The L298N DC Motor Driver Module, manufactured by STM32 with part ID Uno, is a versatile and robust dual H-bridge motor driver. It allows for the control of the speed and direction of two DC motors independently. With a current handling capacity of up to 2A per channel, it is widely used in robotics, automation projects, and other applications requiring precise motor control.
Parameter | Value |
---|---|
Manufacturer | STM32 |
Part ID | Uno |
Motor Channels | 2 |
Maximum Current | 2A per channel |
Operating Voltage | 5V to 35V |
Logic Voltage | 5V |
Control Interface | TTL logic |
Dimensions | 43mm x 43mm x 27mm |
Pin Number | Pin Name | Description |
---|---|---|
1 | ENA | Enable pin for Motor A (High to enable) |
2 | IN1 | Input 1 for Motor A (controls direction) |
3 | IN2 | Input 2 for Motor A (controls direction) |
4 | OUT1 | Output 1 for Motor A |
5 | OUT2 | Output 2 for Motor A |
6 | GND | Ground |
7 | VCC | Supply voltage for motors (5V to 35V) |
8 | 5V | 5V logic supply |
9 | ENB | Enable pin for Motor B (High to enable) |
10 | IN3 | Input 1 for Motor B (controls direction) |
11 | IN4 | Input 2 for Motor B (controls direction) |
12 | OUT3 | Output 1 for Motor B |
13 | OUT4 | Output 2 for Motor B |
Power Connections:
VCC
pin to the power supply for the motors (5V to 35V).GND
pin to the ground of the power supply.5V
pin to the 5V logic supply (e.g., from an Arduino).Motor Connections:
OUT1
and OUT2
for Motor A.OUT3
and OUT4
for Motor B.Control Connections:
ENA
to a PWM-capable pin on the microcontroller to control the speed of Motor A.IN1
and IN2
to digital pins on the microcontroller to control the direction of Motor A.ENB
to a PWM-capable pin on the microcontroller to control the speed of Motor B.IN3
and IN4
to digital pins on the microcontroller to control the direction of Motor B.// 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); // 50% duty cycle
// Example: Rotate Motor B backward at full speed
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
analogWrite(ENB, 255); // 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:
ENA
and ENB
) are set high or receiving a PWM signal.Motors Running in the Wrong Direction:
IN1
and IN2
(or IN3
and IN4
) to change the direction.Overheating:
By following this documentation, users can effectively utilize the L298N DC Motor Driver Module in their projects, ensuring reliable and efficient motor control.