The L293 is a dual H-bridge motor driver IC designed to control DC and stepper motors. It enables bidirectional control, allowing motors to rotate in both clockwise and counterclockwise directions. With the ability to drive two motors simultaneously, the L293 is a versatile component widely used in robotics, automation, and motor control applications. It can handle up to 600mA of current per channel and operates at a wide voltage range, making it suitable for a variety of projects.
Below are the key technical details of the L293 motor driver IC:
Parameter | Value |
---|---|
Operating Voltage | 4.5V to 36V |
Output Current (per channel) | 600mA (continuous), 1.2A (peak) |
Logic Input Voltage | 4.5V to 7V |
Number of Channels | 2 (dual H-bridge) |
Motor Types Supported | DC motors, stepper motors |
Enable Pins | 2 (one for each H-bridge) |
Thermal Shutdown | Yes |
Package Type | DIP16, SOIC16 |
The L293 IC has 16 pins, as described in the table below:
Pin Number | Pin Name | Description |
---|---|---|
1 | Enable 1,2 | Enables H-bridge 1 (controls motor 1). High = Enabled, Low = Disabled. |
2 | Input 1 | Logic input for H-bridge 1. Controls the direction of motor 1. |
3 | Output 1 | Output for H-bridge 1. Connect to one terminal of motor 1. |
4 | GND | Ground connection. |
5 | GND | Ground connection. |
6 | Output 2 | Output for H-bridge 1. Connect to the other terminal of motor 1. |
7 | Input 2 | Logic input for H-bridge 1. Controls the direction of motor 1. |
8 | Vcc2 (Motor) | Supply voltage for motors (4.5V to 36V). |
9 | Enable 3,4 | Enables H-bridge 2 (controls motor 2). High = Enabled, Low = Disabled. |
10 | Input 3 | Logic input for H-bridge 2. Controls the direction of motor 2. |
11 | Output 3 | Output for H-bridge 2. Connect to one terminal of motor 2. |
12 | GND | Ground connection. |
13 | GND | Ground connection. |
14 | Output 4 | Output for H-bridge 2. Connect to the other terminal of motor 2. |
15 | Input 4 | Logic input for H-bridge 2. Controls the direction of motor 2. |
16 | Vcc1 (Logic) | Supply voltage for logic circuitry (4.5V to 7V). |
Power Connections:
Vcc1
(pin 16) to a 5V power supply for the logic circuitry.Vcc2
(pin 8) to the motor power supply (4.5V to 36V, depending on the motor).GND
pins (pins 4, 5, 12, 13) to the ground of the power supply.Motor Connections:
Output 1
(pin 3) and Output 2
(pin 6).Output 3
(pin 11) and Output 4
(pin 14).Control Logic:
Input
pins (2, 7 for motor 1; 10, 15 for motor 2) to control the direction of the motors.Enable
pins (1 for motor 1; 9 for motor 2) high to enable the respective H-bridge.Direction Control:
Input
pin high and the other low.Input
pins.Enable/Disable Motors:
Enable
pin low to disable the motor (outputs will be in high-impedance state).Below is an example Arduino sketch to control a DC motor using the L293:
// Define L293 pins connected to Arduino
const int enablePin = 9; // Enable pin for motor 1
const int input1 = 7; // Input 1 for motor 1
const int input2 = 8; // Input 2 for motor 1
void setup() {
// Set pin modes
pinMode(enablePin, OUTPUT);
pinMode(input1, OUTPUT);
pinMode(input2, OUTPUT);
// Initialize motor in stopped state
digitalWrite(enablePin, LOW); // Disable motor
digitalWrite(input1, LOW); // Set input1 low
digitalWrite(input2, LOW); // Set input2 low
}
void loop() {
// Rotate motor clockwise
digitalWrite(enablePin, HIGH); // Enable motor
digitalWrite(input1, HIGH); // Set input1 high
digitalWrite(input2, LOW); // Set input2 low
delay(2000); // Run motor for 2 seconds
// Rotate motor counterclockwise
digitalWrite(input1, LOW); // Set input1 low
digitalWrite(input2, HIGH); // Set input2 high
delay(2000); // Run motor for 2 seconds
// Stop motor
digitalWrite(enablePin, LOW); // Disable motor
delay(2000); // Wait for 2 seconds
}
Motor Not Spinning:
Enable
pin is set high.Vcc1
and Vcc2
.Input
pins are receiving the correct logic levels.Motor Spins in Only One Direction:
Input
pins.Input
pins is stuck at a fixed logic level.IC Overheating:
No Output Voltage on Motor Terminals:
Enable
pin is high.Q: Can the L293 drive stepper motors?
A: Yes, the L293 can drive stepper motors by controlling the sequence of the Input
pins. Each H-bridge can control one coil of the stepper motor.
Q: What is the difference between Vcc1
and Vcc2
?
A: Vcc1
powers the logic circuitry (4.5V to 7V), while Vcc2
powers the motors (4.5V to 36V).
Q: Can I use the L293 with a 3.3V microcontroller?
A: The L293 requires a minimum logic voltage of 4.5V, so it is not directly compatible with 3.3V logic. Use a level shifter or a 5V microcontroller.
Q: How many motors can the L293 control?
A: The L293 can control two DC motors or one stepper motor.