Stufin
Home Quick Cart Profile

Arduino L293D Motor Driver shield

Buy Now on Stufin

Operating Voltage

5V to 24V

Motor Current

Up to 1A per channel (peak 2A)

L293D Driver ICTexas Instruments L293D

Arduino Compatibility

Uno, Duemilanove, Mega, and other Arduino boards

Dimensions

69.5mm x 53.3mm (2.73" x 2.1")

Applications

The Arduino L293D Motor Driver Shield is suitable for a wide range of applications, including

Robotics and robotic arms

Automated systems and IoT projects

Motorized wheelchairs and mobility aids

Industrial automation and control systems

Hobbyist projects, such as motorized platforms and camera systems

Overall, the Arduino L293D Motor Driver Shield is a reliable and versatile motor control solution, making it an ideal choice for anyone working with motors and Arduino boards.

Pin Configuration

  • Arduino L293D Motor Driver Shield Pinout Explanation
  • The Arduino L293D Motor Driver Shield is a popular and widely used shield for driving DC motors, stepper motors, and other inductive loads. The L293D chip is a dual H-bridge motor driver, allowing the shield to control two DC motors or one stepper motor. Here's a detailed explanation of each pin on the shield:
  • Motor Connections:
  • 1. M1A and M1B: These pins are connected to the first DC motor's terminals. M1A is the positive terminal, and M1B is the negative terminal.
  • 2. M2A and M2B: These pins are connected to the second DC motor's terminals. M2A is the positive terminal, and M2B is the negative terminal.
  • Logic Pins:
  • 1. IN1: This pin is connected to a digital output on the Arduino (e.g., pin 2). It controls the direction of the first motor. A high signal (5V) sets the motor to rotate clockwise, while a low signal (0V) sets the motor to rotate counterclockwise.
  • 2. IN2: This pin is connected to a digital output on the Arduino (e.g., pin 3). It controls the speed of the first motor. A high signal (5V) enables the motor, while a low signal (0V) disables the motor.
  • 3. IN3: This pin is connected to a digital output on the Arduino (e.g., pin 4). It controls the direction of the second motor. A high signal (5V) sets the motor to rotate clockwise, while a low signal (0V) sets the motor to rotate counterclockwise.
  • 4. IN4: This pin is connected to a digital output on the Arduino (e.g., pin 5). It controls the speed of the second motor. A high signal (5V) enables the motor, while a low signal (0V) disables the motor.
  • Power and Ground Pins:
  • 1. VIN: This pin is connected to the external power source (e.g., a battery or a power supply) that provides power to the motors. Typically, the voltage range is 4.5V to 25V.
  • 2. GND: This pin is the ground connection for the shield and should be connected to the ground pin on the Arduino.
  • Jumpers and LEDs:
  • 1. Enable Jumper: This jumper is used to enable or disable the motor drivers. When the jumper is connected, the motor drivers are enabled. When the jumper is disconnected, the motor drivers are disabled.
  • 2. LED Indicators: There are four LEDs on the shield:
  • LED1: Indicates the status of the first motor (on/off).
  • LED2: Indicates the status of the second motor (on/off).
  • LED3: Indicates the direction of the first motor (clockwise/counterclockwise).
  • LED4: Indicates the direction of the second motor (clockwise/counterclockwise).
  • Connecting the Pins:
  • To use the Arduino L293D Motor Driver Shield, follow these steps:
  • 1. Connect the VIN pin to an external power source (e.g., a battery or a power supply).
  • 2. Connect the GND pin to the ground pin on the Arduino.
  • 3. Connect the motor terminals to the M1A/M1B or M2A/M2B pins, depending on the motor configuration.
  • 4. Connect the IN1, IN2, IN3, and IN4 pins to digital output pins on the Arduino (e.g., pins 2, 3, 4, and 5).
  • 5. Connect the Enable Jumper to enable the motor drivers.
  • 6. Upload your motor control code to the Arduino, and the shield is ready to use.
  • Remember to use the correct voltage and current ratings for your motors and power supply to avoid damage to the shield or other components.

Code Examples

Arduino L293D Motor Driver Shield Documentation
The Arduino L293D Motor Driver Shield is a versatile and powerful component designed to control DC motors and stepper motors with ease. This shield is based on the L293D H-bridge motor driver IC, which allows for bidirectional motor control, making it an ideal choice for robotics, automation, and IoT projects.
Technical Specifications:
Motor Driver IC: L293D
 Operating Voltage: 5V
 Motor Voltage: 4.5V to 36V
 Peak Current: 1A per channel
 Continuous Current: 0.5A per channel
 Logic Input Voltage: 5V
Pinout:
The Arduino L293D Motor Driver Shield has the following pinout:
VIN: External power source for motors (4.5V to 36V)
 GND: Ground connection
 ENA: Enable pin for motor 1
 IN1: Input pin for motor 1 direction
 IN2: Input pin for motor 1 direction
 OUT1: Output pin for motor 1
 OUT2: Output pin for motor 1
 ENB: Enable pin for motor 2
 IN3: Input pin for motor 2 direction
 IN4: Input pin for motor 2 direction
 OUT3: Output pin for motor 2
 OUT4: Output pin for motor 2
 SCL: I2C clock line (not used by the motor driver)
 SDA: I2C data line (not used by the motor driver)
Code Examples:
### Example 1: Basic DC Motor Control
In this example, we'll demonstrate how to control a single DC motor using the L293D Motor Driver Shield.
```c
const int enablePin = 2;  // Enable pin for motor 1
const int in1Pin = 3;    // Input pin for motor 1 direction
const int in2Pin = 4;    // Input pin for motor 1 direction
void setup() {
  pinMode(enablePin, OUTPUT);
  pinMode(in1Pin, OUTPUT);
  pinMode(in2Pin, OUTPUT);
}
void loop() {
  // Set motor direction clockwise
  digitalWrite(in1Pin, HIGH);
  digitalWrite(in2Pin, LOW);
// Set motor speed to 50%
  analogWrite(enablePin, 128);
delay(2000);
// Set motor direction counterclockwise
  digitalWrite(in1Pin, LOW);
  digitalWrite(in2Pin, HIGH);
// Set motor speed to 50%
  analogWrite(enablePin, 128);
delay(2000);
}
```
### Example 2: Controlling Two DC Motors
In this example, we'll demonstrate how to control two DC motors using the L293D Motor Driver Shield.
```c
const int enablePin1 = 2;  // Enable pin for motor 1
const int in1Pin1 = 3;    // Input pin for motor 1 direction
const int in2Pin1 = 4;    // Input pin for motor 1 direction
const int enablePin2 = 5;  // Enable pin for motor 2
const int in1Pin2 = 6;    // Input pin for motor 2 direction
const int in2Pin2 = 7;    // Input pin for motor 2 direction
void setup() {
  pinMode(enablePin1, OUTPUT);
  pinMode(in1Pin1, OUTPUT);
  pinMode(in2Pin1, OUTPUT);
pinMode(enablePin2, OUTPUT);
  pinMode(in1Pin2, OUTPUT);
  pinMode(in2Pin2, OUTPUT);
}
void loop() {
  // Set motor 1 direction clockwise
  digitalWrite(in1Pin1, HIGH);
  digitalWrite(in2Pin1, LOW);
// Set motor 1 speed to 50%
  analogWrite(enablePin1, 128);
// Set motor 2 direction counterclockwise
  digitalWrite(in1Pin2, LOW);
  digitalWrite(in2Pin2, HIGH);
// Set motor 2 speed to 50%
  analogWrite(enablePin2, 128);
delay(2000);
// Change motor directions
  digitalWrite(in1Pin1, LOW);
  digitalWrite(in2Pin1, HIGH);
digitalWrite(in1Pin2, HIGH);
  digitalWrite(in2Pin2, LOW);
delay(2000);
}
```
These code examples demonstrate the basic usage of the Arduino L293D Motor Driver Shield. You can modify and extend these examples to suit your specific project requirements.