L293D Motor Driver Board
1. Motor Driver IC: Dual L293D H-Bridge
2. Current per Channel: 0.6A
3. Motor Outputs: 4 DC motors or 2 steppers
4. Servo Ports: 2 (pins 9 & 10)
5. Logic Control Voltage: 4.5V–5.5V
6. Motor Input Voltage: 7V–12V DC
The L293D Motor Driver/Servo Shield for Arduino is probably one of the most versatile on the market and features 2 servo and 4 motor connectors for DC or stepper motors. That makes it a great shield for any robotic project.
This Arduino compatible motor Driver shield is a full-featured product that it can be used to drive 4 DC motor or two 4-wire steppers and two 5v servos. It drives the DC motor and stepper with the L293D, and it drives the servo with Arduino pin9 and pin10.
The shield contains two L293D motor drivers and one 74HC595 shift register. The shift register expands 3 pins of the Arduino to 8 pins to control the direction of the motor drivers. The output enables the L293D is directly connected to the PWM outputs of the Arduino.
AccelStepper library with AFMotor support. This library allows for advanced stepper control including acceleration and deceleration, and concurrent stepper control! To install, click on Download in the top right corner, select zip and uncompress the folder. Rename the folder to AF-motor (check that the renamed folder contains the .cpp and .h files) and install it into the Arduino sketches/libraries folder.
Note:
Power for the motors can be supplied from the Arduino boards DC Jack (normally 9V) or from the 2-pin EXT-PWR terminal block. If you are supplying power from the EXT_PWR terminal block you should remove the PWR jumper or you could damage the shield and the Arduino board.
<>
Features :
2 connections for 5V ‘hobby’ servos connected to the Arduino’s high-resolution dedicated timer
4 H-Bridges: L293D chipset provides 0.6A per bridge (1.2A peak) with thermal shutdown protection, internal kickback protection diodes. Can run motors on 4.5VDC to 25VDC.
Up to 4 bi-directional DC motors with individual 8-bit speed selection (so, about 0.5% resolution)
Up to 2 stepper motors (unipolar or bipolar) with single coil, double coil, or interleaved stepping.
Pull-down resistors keep motors disabled during power-up
Big terminal block connectors to easily hook up wires (18-26AWG) and power
Arduino reset button brought up top
2-pin terminal block and jumper to connect external power, for separate logic/motor supplies
Tested compatible with Arduino Mega 1280 & 2560, Diecimila, Duemilanove, and UNO
Download the easy-to-use Arduino software library, check out the examples and you’re ready to go!
📄 File: l293d_motor_driver_board_-_arduino_uno.inoArduino Uno
867 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// L293D: IN1=8, IN2=9, ENA(PWM speed)=10 on Arduino Uno. Motor's own power (up to several amps) comes from a separate supply into the driver board, never from the microcontroller pin.
5// L293D: IN1=8, IN2=9, ENA(PWM speed)=10 on Arduino Nano. Motor's own power (up to several amps) comes from a separate supply into the driver board, never from the microcontroller pin.
6#define IN1 8
7#define IN2 9
8#define ENA 10
9
10voidsetup() {
11Serial.begin(115200);
12pinMode(IN1, OUTPUT);
13pinMode(IN2, OUTPUT);
14pinMode(ENA, OUTPUT);
15}
16
17void driveForward(int speed) { // speed 0-255
18digitalWrite(IN1, HIGH);
19digitalWrite(IN2, LOW);
20 analogWrite(ENA, speed);
21}
22
23void driveReverse(int speed) {
24digitalWrite(IN1, LOW);
25digitalWrite(IN2, HIGH);
26 analogWrite(ENA, speed);
27}
28
29void stopMotor() {
30digitalWrite(IN1, LOW);
31digitalWrite(IN2, LOW);
32}
33
34voidloop() {
35 driveForward(200);
36delay(2000);
37 stopMotor();
38delay(500);
39 driveReverse(200);
40delay(2000);
41 stopMotor();
42delay(500);
43}
📄 File: l293d_motor_driver_board_-_arduino_mega.inoArduino Mega
868 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// L293D: IN1=8, IN2=9, ENA(PWM speed)=10 on Arduino Mega. Motor's own power (up to several amps) comes from a separate supply into the driver board, never from the microcontroller pin.
6#define IN1 8
7#define IN2 9
8#define ENA 10
9
10voidsetup() {
11Serial.begin(115200);
12pinMode(IN1, OUTPUT);
13pinMode(IN2, OUTPUT);
14pinMode(ENA, OUTPUT);
15}
16
17void driveForward(int speed) { // speed 0-255
18digitalWrite(IN1, HIGH);
19digitalWrite(IN2, LOW);
20 analogWrite(ENA, speed);
21}
22
23void driveReverse(int speed) {
24digitalWrite(IN1, LOW);
25digitalWrite(IN2, HIGH);
26 analogWrite(ENA, speed);
27}
28
29void stopMotor() {
30digitalWrite(IN1, LOW);
31digitalWrite(IN2, LOW);
32}
33
34voidloop() {
35 driveForward(200);
36delay(2000);
37 stopMotor();
38delay(500);
39 driveReverse(200);
40delay(2000);
41 stopMotor();
42delay(500);
43}
📄 File: l293d_motor_driver_board_-_esp32.inoESP32
865 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// L293D: IN1=26, IN2=27, ENA(PWM speed)=25 on ESP32. Motor's own power (up to several amps) comes from a separate supply into the driver board, never from the microcontroller pin.
5// L293D: IN1=D5, IN2=D6, ENA(PWM speed)=D7 on ESP8266. Motor's own power (up to several amps) comes from a separate supply into the driver board, never from the microcontroller pin.
6#define IN1 D5
7#define IN2 D6
8#define ENA D7
9
10voidsetup() {
11Serial.begin(115200);
12pinMode(IN1, OUTPUT);
13pinMode(IN2, OUTPUT);
14pinMode(ENA, OUTPUT);
15}
16
17void driveForward(int speed) { // speed 0-255
18digitalWrite(IN1, HIGH);
19digitalWrite(IN2, LOW);
20 analogWrite(ENA, speed);
21}
22
23void driveReverse(int speed) {
24digitalWrite(IN1, LOW);
25digitalWrite(IN2, HIGH);
26 analogWrite(ENA, speed);
27}
28
29void stopMotor() {
30digitalWrite(IN1, LOW);
31digitalWrite(IN2, LOW);
32}
33
34voidloop() {
35 driveForward(200);
36delay(2000);
37 stopMotor();
38delay(500);
39 driveReverse(200);
40delay(2000);
41 stopMotor();
42delay(500);
43}
📄 File: l293d_motor_driver_board_-_stm32.inoSTM32
871 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// L293D: IN1=PB0, IN2=PB1, ENA(PWM speed)=PA8 on STM32. Motor's own power (up to several amps) comes from a separate supply into the driver board, never from the microcontroller pin.
6#define IN1 PB0
7#define IN2 PB1
8#define ENA PA8
9
10voidsetup() {
11Serial.begin(115200);
12pinMode(IN1, OUTPUT);
13pinMode(IN2, OUTPUT);
14pinMode(ENA, OUTPUT);
15}
16
17void driveForward(int speed) { // speed 0-255
18digitalWrite(IN1, HIGH);
19digitalWrite(IN2, LOW);
20 analogWrite(ENA, speed);
21}
22
23void driveReverse(int speed) {
24digitalWrite(IN1, LOW);
25digitalWrite(IN2, HIGH);
26 analogWrite(ENA, speed);
27}
28
29void stopMotor() {
30digitalWrite(IN1, LOW);
31digitalWrite(IN2, LOW);
32}
33
34voidloop() {
35 driveForward(200);
36delay(2000);
37 stopMotor();
38delay(500);
39 driveReverse(200);
40delay(2000);
41 stopMotor();
42delay(500);
43}
📄 File: l293d_motor_driver_board_-_raspberry_pi_pico.inoRaspberry Pi Pico
877 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// L293D: IN1=14, IN2=15, ENA(PWM speed)=16 on Raspberry Pi Pico. Motor's own power (up to several amps) comes from a separate supply into the driver board, never from the microcontroller pin.
6#define IN1 14
7#define IN2 15
8#define ENA 16
9
10voidsetup() {
11Serial.begin(115200);
12pinMode(IN1, OUTPUT);
13pinMode(IN2, OUTPUT);
14pinMode(ENA, OUTPUT);
15}
16
17void driveForward(int speed) { // speed 0-255
18digitalWrite(IN1, HIGH);
19digitalWrite(IN2, LOW);
20 analogWrite(ENA, speed);
21}
22
23void driveReverse(int speed) {
24digitalWrite(IN1, LOW);
25digitalWrite(IN2, HIGH);
26 analogWrite(ENA, speed);
27}
28
29void stopMotor() {
30digitalWrite(IN1, LOW);
31digitalWrite(IN2, LOW);
32}
33
34voidloop() {
35 driveForward(200);
36delay(2000);
37 stopMotor();
38delay(500);
39 driveReverse(200);
40delay(2000);
41 stopMotor();
42delay(500);
43}
Dual H-bridge motor driver, lower current than L298N - same IN/EN control scheme.