The L293D is a dual H-bridge motor driver IC designed to control the direction and speed of DC motors and stepper motors. It is capable of driving two motors simultaneously, making it an essential component in robotics, automation, and motor control projects. The IC can handle bidirectional control of motors, allowing for forward and reverse motion, and supports PWM (Pulse Width Modulation) for speed control.
Explore Projects Built with L293D Motor Driver
Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
This circuit controls two DC motors using an L293D motor driver, with an Arduino UNO as the microcontroller. The Arduino reads inputs from three Hall sensors and controls the motors' direction based on the sensors' states, while also indicating the sensors' status through three LEDs. Each LED and Hall sensor is connected to the Arduino with a current-limiting resistor, and the motors' operation is dependent on the Hall sensors' signals.
This circuit is designed to control a robot with four DC motors for movement, an ultrasonic sensor for distance measurement, and a servo motor to direct the sensor. The L293D driver shield interfaces with the motors, while the Arduino UNO microcontroller runs the embedded code to process sensor data and control motor speeds and directions. An LCD display is included for output, and power is supplied by a 4 x AAA battery mount.
This circuit is a motor control system that uses an L293D driver shield to control four hobby gearmotors, with each motor connected to an LED and a resistor for status indication. The system is powered by a 2x 18650 battery pack and includes an HC-05 Bluetooth module for wireless communication.
This circuit is designed to control multiple DC motors and a servomotor using an Arduino UNO microcontroller. The L298N motor drivers are used to drive the DC motors, with control signals provided by the Arduino. Additionally, the circuit includes a QMC5883L magnetometer for magnetic field measurement, interfaced with the Arduino via I2C, and a servomotor controlled directly by an Arduino PWM output.
Logic input for H-bridge 2 (controls motor direction)
11
Output 3
Output for H-bridge 2 (connect to motor terminal)
12
GND
Ground (common ground for logic and motor power)
13
GND
Ground (common ground for logic and motor power)
14
Output 4
Output for H-bridge 2 (connect to motor terminal)
15
Input 4
Logic input for H-bridge 2 (controls motor direction)
16
Vcc1 (Logic V+)
Logic supply voltage (4.5V to 7V)
Usage Instructions
How to Use the L293D in a Circuit
Power Connections:
Connect Vcc1 (Pin 16) to the logic voltage (e.g., 5V for Arduino).
Connect Vcc2 (Pin 8) to the motor supply voltage (e.g., 9V or 12V, depending on the motor).
Connect all GND pins (Pins 4, 5, 12, 13) to the ground of the power supply.
Motor Connections:
Connect the motor terminals to the output pins (Output 1 and Output 2 for Motor 1, Output 3 and Output 4 for Motor 2).
Control Logic:
Use the input pins (Input 1, Input 2, Input 3, Input 4) to control the direction of the motors.
Enable the H-bridges using the Enable pins (Enable 1,2 for Motor 1, Enable 3,4 for Motor 2).
PWM for Speed Control:
Apply a PWM signal to the Enable pins to control motor speed.
Example: Connecting L293D to Arduino UNO
Below is an example of how to control a single DC motor using the L293D and Arduino UNO:
Circuit Connections
Connect Vcc1 to the Arduino's 5V pin.
Connect Vcc2 to an external 9V power supply.
Connect GND to the Arduino's GND pin.
Connect Input 1 to Arduino pin 9.
Connect Input 2 to Arduino pin 10.
Connect Enable 1,2 to Arduino pin 11.
Connect the motor terminals to Output 1 and Output 2.
Arduino Code
// Define motor control pins
const int enablePin = 11; // Enable pin for Motor 1
const int input1Pin = 9; // Input 1 for Motor 1
const int input2Pin = 10; // Input 2 for Motor 1
void setup() {
// Set motor control pins as outputs
pinMode(enablePin, OUTPUT);
pinMode(input1Pin, OUTPUT);
pinMode(input2Pin, OUTPUT);
// Initialize motor to stop
digitalWrite(input1Pin, LOW);
digitalWrite(input2Pin, LOW);
analogWrite(enablePin, 0); // Set speed to 0
}
void loop() {
// Rotate motor forward at 50% speed
digitalWrite(input1Pin, HIGH);
digitalWrite(input2Pin, LOW);
analogWrite(enablePin, 128); // PWM value for 50% speed
delay(2000); // Run for 2 seconds
// Rotate motor backward at full speed
digitalWrite(input1Pin, LOW);
digitalWrite(input2Pin, HIGH);
analogWrite(enablePin, 255); // PWM value for 100% speed
delay(2000); // Run for 2 seconds
// Stop the motor
digitalWrite(input1Pin, LOW);
digitalWrite(input2Pin, LOW);
analogWrite(enablePin, 0); // Set speed to 0
delay(2000); // Wait for 2 seconds
}
Important Considerations
Ensure the motor voltage (Vcc2) matches the motor's rated voltage.
Do not exceed the maximum current rating of 600mA per channel.
Use a heat sink if the IC becomes too hot during operation.
Always connect all ground pins to a common ground.
Troubleshooting and FAQs
Common Issues
Motor Not Running:
Check if the Enable pin is set to HIGH.
Verify the power supply connections (Vcc1, Vcc2, and GND).
Ensure the input pins are receiving the correct logic signals.
Motor Running in the Wrong Direction:
Swap the logic levels on the input pins (e.g., HIGH on Input 1 and LOW on Input 2).
IC Overheating:
Ensure the motor's current draw does not exceed 600mA.
Use a heat sink or reduce the load on the motor.
PWM Not Controlling Speed:
Verify that the PWM signal is applied to the Enable pin.
Check the PWM frequency and duty cycle settings in your code.
FAQs
Q: Can the L293D drive stepper motors?
A: Yes, the L293D can drive stepper motors by controlling the sequence of inputs to the H-bridges.
Q: Can I use the L293D with a 3.3V microcontroller?
A: Yes, but ensure that the logic voltage (Vcc1) is compatible with the microcontroller's output levels.
Q: What is the difference between L293 and L293D?
A: The L293D includes internal flyback diodes for protection, while the L293 does not.
Q: Can I control more than two motors with one L293D?
A: No, the L293D can control only two motors. For more motors, use additional L293D ICs.