L293D Motor IC to run motor in both Direction

Hello friends

Today we will see how to use L293D motor shield to run a 5v DC motor in either way (CW & CCW)

L293D is a typical Motor driver or Motor Driver IC which allows DC motor to drive clockwise & anticlockwise direction. L293D is a 16-pin IC which can control a set of two DC motors simultaneously in any direction. It means that you can control two DC motor with a single L293D IC.

L293D motor IC can control 2 DC motor or 1 stepper motor



L293D IC is works on the concept of H-bridge. H-bridge is a circuit which allows the voltage to be flown in either direction. As we know very well voltage need to change its direction for being able to rotate the motor in clockwise or anticlockwise direction.

Thus H-bridge ICs are ideal for driving a DC motors in either direction simultaneously.

In a single L293D IC there are two h-Bridge circuit inside the IC which can rotate two dc motor independently. because its size is very small and compact it is very much used in many embedded, robotic, & Electronics application for controlling DC motors.

There are two Enable pins on l293d. Pin 1 and pin 9, for being able to drive the motor, the pin 1 and 9 need to be high. For driving the motor with left H-bridge you need to enable pin 1 to high. And for right H-Bridge you need to make the pin 9 to high. If anyone of the either pin1 or pin9 goes low then the motor in the corresponding section will suspend working. It’s like a switch.

 you can directly connect the pin16 VCC (5v) to pin 1 and pin 9 to make them high.


• Wide Supply-Voltage Range: 4.5 V to 36 V

• Separate Input-Logic Supply

• Internal ESD Protection

• High-Noise-Immunity Inputs

• Output Current 1 A Per Channel (600 mA for designed to drive inductive loads such as relays, L293D)

• Peak Output Current 2 A Per Channel (1.2 A for other high-current/high-voltage loads in positiveL293D)

• Output Clamp Diodes for Inductive Transient Each output is a complete totem-pole drive circuit, Suppression (L293D)


• Stepper Motor Drivers

• DC Motor Drivers The L293 and L293D are characterized for operation from 0°C to 70°C.

• Latching Relay Drivers


L293D IC Pin Configuration


Working Principle

Basically there are two channels if you are running only one motor so first you have to give 5V DC to pin 1 (Enable 1)

if you are using Using two motor so you need to give 5V DC to pin 9 (Enable 2) as well.

All GND Pin must be connected with ground of power supply.

Motors are must be connected at pin

3 & 6 for channel-1

14 & 11 for channel-2

You have to give power supply to motor at pin 8 you can run motor rating of 4.5 V to 36 V & Max 600mA.

ground must be shorted with control system ground at any of pin (4,5,12,13)

L293D Logic Table.

Suppose a Motor connected on left side output pins (pin 3,6). For rotating the motor in clockwise or in anticlockwise direction the input pins has to be provided with Logic as mention below.

Pin 2 = Logic 1 and Pin 7 = Logic 0 = Clockwise Direction
Pin 2 = Logic 0 and Pin 7 = Logic 1 = Anticlockwise Direction
Pin 2 = Logic 0 and Pin 7 = Logic 0 = Idle
Pin 2 = Logic 1 and Pin 7 = Logic 1 = Idle

In the similar way the motor connected at pin 11 & 14 can also operates.

Motor connection with L293D Motor IC


Sample project

L293D IC


Sample Code

Void setup () {
pinMode(13, OUTPUT);
Void loop(){
digitalWrite(13, HIGH);
digital write(12, HIGH);


do the wiring as shown in image upload the given code now you can see your motor will run in clockwise direction for 10 second & in anticlockwise direction for 10 seconds


Hobbiest Electrical DIY project passionate

Leave a Reply