The Mini L293D Motor Driver is a compact dual H-bridge motor driver designed to control the direction and speed of DC motors and stepper motors. It is widely used in robotics, automation, and other motor control applications due to its small size, ease of use, and versatility. This component is ideal for projects requiring precise motor control, such as robotic arms, wheeled robots, and conveyor systems.
The Mini L293D Motor Driver is based on the L293D IC, which is capable of driving two DC motors or one stepper motor. Below are the key technical details:
The Mini L293D Motor Driver typically has the following pin layout:
Pin Name | Pin Number | Description |
---|---|---|
IN1 | 1 | Input 1 for Motor A (controls direction) |
IN2 | 2 | Input 2 for Motor A (controls direction) |
IN3 | 7 | Input 1 for Motor B (controls direction) |
IN4 | 8 | Input 2 for Motor B (controls direction) |
ENA | 9 | Enable pin for Motor A (PWM for speed control) |
ENB | 10 | Enable pin for Motor B (PWM for speed control) |
Pin Name | Pin Number | Description |
---|---|---|
VCC | 16 | Motor power supply (4.5V to 36V) |
GND | 4, 5, 12, 13 | Ground |
VS | 8 | Logic voltage supply (typically 5V) |
OUT1 | 3 | Output 1 for Motor A |
OUT2 | 6 | Output 2 for Motor A |
OUT3 | 11 | Output 1 for Motor B |
OUT4 | 14 | Output 2 for Motor B |
Power Connections:
VCC
pin (4.5V to 36V).VS
pin.GND
pins to the ground of your circuit.Motor Connections:
OUT1
and OUT2
.OUT3
and OUT4
.Control Connections:
IN1
and IN2
pins to control the direction of Motor A.IN3
and IN4
pins to control the direction of Motor B.ENA
and ENB
pins to enable/disable the motors and control their speed using PWM signals.Logic Control:
IN1
, IN2
, IN3
, IN4
) and PWM signals to the enable pins (ENA
, ENB
).Below is an example of how to control two DC motors using the Mini L293D Motor Driver and an Arduino UNO:
// Define motor control pins
#define IN1 2 // Motor A direction control pin 1
#define IN2 3 // Motor A direction control pin 2
#define ENA 9 // Motor A speed control (PWM pin)
#define IN3 4 // Motor B direction control pin 1
#define IN4 5 // Motor B direction control pin 2
#define ENB 10 // Motor B speed control (PWM pin)
void setup() {
// Set motor control pins as outputs
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(ENA, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
pinMode(ENB, OUTPUT);
}
void loop() {
// Motor A: Forward at 50% speed
digitalWrite(IN1, HIGH); // Set IN1 high
digitalWrite(IN2, LOW); // Set IN2 low
analogWrite(ENA, 128); // Set ENA to 50% duty cycle (128/255)
// Motor B: Reverse at 75% speed
digitalWrite(IN3, LOW); // Set IN3 low
digitalWrite(IN4, HIGH); // Set IN4 high
analogWrite(ENB, 192); // Set ENB to 75% duty cycle (192/255)
delay(2000); // Run motors for 2 seconds
// Stop both motors
analogWrite(ENA, 0); // Set ENA to 0% duty cycle (stop motor A)
analogWrite(ENB, 0); // Set ENB to 0% duty cycle (stop motor B)
delay(2000); // Wait for 2 seconds
}
Motors Not Running:
VCC
, VS
, and GND
).ENA
, ENB
) are receiving a valid PWM signal or are set high.Motors Running in the Wrong Direction:
IN1
, IN2
, IN3
, IN4
) or swap the motor terminals.Overheating:
Erratic Motor Behavior:
Can I control stepper motors with this driver? Yes, the Mini L293D can control stepper motors by driving the coils in sequence. Refer to your stepper motor's datasheet for the correct sequence.
What happens if I exceed the current rating? The driver may overheat and shut down due to thermal protection. Prolonged overcurrent may damage the IC.
Can I use this driver with a 3.3V microcontroller? The L293D requires 5V logic levels. Use a level shifter if your microcontroller operates at 3.3V.
This concludes the documentation for the Mini L293D Motor Driver.