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

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

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

Introduction

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.

Explore Projects Built with Mini 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 Mini 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 Nano Controlled Dual DC Motor Driver Circuit: A project utilizing Mini L293D Motor Driver in a practical application
Arduino Nano Controlled Dual DC Motor Driver Circuit

This circuit is designed to control two DC Mini Metal Gear Motors using an Arduino Nano microcontroller and an L298N DC motor driver. The Arduino Nano's digital pins D3, D4, D5, and D6 are connected to the L298N's IN1, IN2, IN3, and IN4 inputs respectively, allowing the microcontroller to control the speed and direction of the motors. Power is supplied by a lipo battery connected to the L298N, which also provides 5V back to the Arduino's VIN pin, and the motors are connected to the L298N's output pins.

Open Project in Cirkit Designer

Common Applications:

Technical Specifications

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:

Key Specifications:

Pin Configuration and Descriptions:

The Mini L293D Motor Driver typically has the following pin layout:

Input/Control Pins:

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)

Power and Output Pins:

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

Usage Instructions

How to Use the Mini L293D Motor Driver in a Circuit:

  1. Power Connections:

    • Connect the motor power supply to the VCC pin (4.5V to 36V).
    • Connect the logic voltage (5V) to the VS pin.
    • Connect all GND pins to the ground of your circuit.
  2. Motor Connections:

    • Connect the terminals of Motor A to OUT1 and OUT2.
    • Connect the terminals of Motor B to OUT3 and OUT4.
  3. Control Connections:

    • Use the IN1 and IN2 pins to control the direction of Motor A.
    • Use the IN3 and IN4 pins to control the direction of Motor B.
    • Use the ENA and ENB pins to enable/disable the motors and control their speed using PWM signals.
  4. Logic Control:

    • Use a microcontroller (e.g., Arduino UNO) to send control signals to the input pins (IN1, IN2, IN3, IN4) and PWM signals to the enable pins (ENA, ENB).

Example Arduino Code:

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
}

Important Considerations:

Troubleshooting and FAQs

Common Issues and Solutions:

  1. Motors Not Running:

    • Check all power connections (VCC, VS, and GND).
    • Ensure the enable pins (ENA, ENB) are receiving a valid PWM signal or are set high.
  2. Motors Running in the Wrong Direction:

    • Reverse the connections to the input pins (IN1, IN2, IN3, IN4) or swap the motor terminals.
  3. Overheating:

    • Ensure the current draw of the motors does not exceed the driver’s maximum rating.
    • Add a heat sink or cooling fan if necessary.
  4. Erratic Motor Behavior:

    • Verify that all ground connections are properly connected.
    • Check for noise or interference in the control signals.

FAQs:

This concludes the documentation for the Mini L293D Motor Driver.