Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use L293D Motor Driver: Examples, Pinouts, and Specs

Image of L293D Motor DriverDesign with L293D Motor Driver in Cirkit Designer

Introduction

The L293D Motor Driver is an essential component for robotics and automation projects. It is designed to drive inductive loads such as relays, solenoids, DC, and stepping motors by allowing current to flow in both directions. This integrated circuit can control two DC motors simultaneously, making it a popular choice for dual-motor applications.

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!
Image of Arduino-Controlled Dual DC Motor Driver with Hall Effect Sensors and Indicator LEDs: A project utilizing L293D Motor Driver in a practical application
Arduino-Controlled Dual DC Motor Driver with Hall Effect Sensors and Indicator LEDs

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.

Open Project in Cirkit Designer
Image of Arduino UNO Controlled Obstacle Avoiding Robot with L293D Motor Driver and Ultrasonic Sensor: A project utilizing L293D Motor Driver in a practical application
Arduino UNO Controlled Obstacle Avoiding Robot with L293D Motor Driver and Ultrasonic Sensor

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.

Open Project in Cirkit Designer
Image of Arduino-Controlled Robotics Platform with Dual L298N Motor Drivers and QMC5883L Magnetometer: A project utilizing L293D Motor Driver in a practical application
Arduino-Controlled Robotics Platform with Dual L298N Motor Drivers and QMC5883L Magnetometer

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.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Name Description
1 1,2EN Enable pin for Motor 1 and 2; active high
2 1A Input 1 for Motor 1
3 1Y Output 1 for Motor 1
4 GND Ground
5 GND Ground
6 2Y Output 2 for Motor 1
7 2A Input 2 for Motor 1
8 Vcc2 Motor supply voltage
9 3,4EN Enable pin for Motor 2; active high
10 3A Input 1 for Motor 2
11 3Y Output 1 for Motor 2
12 GND Ground
13 GND Ground
14 4Y Output 2 for Motor 2
15 4A Input 2 for Motor 2
16 Vcc1 Logic supply voltage

Usage Instructions

How to Use the L293D in a Circuit

  1. Connect Vcc1 to a 5V supply for the internal logic.
  2. Connect Vcc2 to the motor power supply, which can range from 4.5V to 36V.
  3. Connect the ground pins to the common ground of the circuit.
  4. Connect the enable pins (1,2EN and 3,4EN) to the logic level signals that will control the motor's operation.
  5. Connect the input pins (1A, 2A, 3A, 4A) to the microcontroller or digital logic circuit outputs.
  6. Connect the output pins (1Y, 2Y, 3Y, 4Y) to the motor terminals.

Important Considerations and Best Practices

Example Code for Arduino UNO

#include <Arduino.h>

// Define motor control pins
const int motor1Pin1 = 2; // Input 1 for Motor 1
const int motor1Pin2 = 3; // Input 2 for Motor 1
const int enableMotor1 = 9; // Enable pin for Motor 1

void setup() {
  // Set motor control pins as outputs
  pinMode(motor1Pin1, OUTPUT);
  pinMode(motor1Pin2, OUTPUT);
  pinMode(enableMotor1, OUTPUT);
  
  // Enable the motor
  digitalWrite(enableMotor1, HIGH);
}

void loop() {
  // Spin motor in one direction
  digitalWrite(motor1Pin1, HIGH);
  digitalWrite(motor1Pin2, LOW);
  delay(2000); // Run for 2 seconds
  
  // Stop the motor
  digitalWrite(motor1Pin1, LOW);
  digitalWrite(motor1Pin2, LOW);
  delay(1000); // Stop for 1 second
  
  // Spin motor in the opposite direction
  digitalWrite(motor1Pin1, LOW);
  digitalWrite(motor1Pin2, HIGH);
  delay(2000); // Run for 2 seconds
  
  // Stop the motor
  digitalWrite(motor1Pin1, LOW);
  digitalWrite(motor1Pin2, LOW);
  delay(1000); // Stop for 1 second
}

Troubleshooting and FAQs

Common Issues Users Might Face

Solutions and Tips for Troubleshooting

FAQs

Q: Can the L293D drive stepper motors? A: Yes, the L293D can drive a bipolar stepper motor by controlling the current in each coil in a sequence.

Q: What is the function of the enable pins? A: The enable pins turn the motor driver channels on or off. When high, the corresponding motor channel is active.

Q: Can I use the L293D with a 3.3V logic level microcontroller? A: While the L293D is designed for 5V logic levels, it may work with 3.3V logic; however, performance is not guaranteed. Consider using a level shifter for reliable operation.