Introduction: How to Use the L293D Motor Driver - Arduino Tutorial

Picture of How to Use the L293D Motor Driver - Arduino Tutorial

The L293D is a 16-pin Motor Driver IC which can control a set of two DC motors simultaneously in any direction. The L293D is designed to provide bidirectional drive currents of up to 600 mA (per channel) at voltages from 4.5 V to 36 V (at pin 8!). You can use it to control small dc motors - toy motors. Sometimes it can be extremely hot.

In this tutorial you will learn how to use it with Arduino uno to control two dc motors.

Step 1: What You Will Need

Picture of What You Will Need

For this project you will need:

  • Arduino uno
  • Breadboard
  • L293D Motor Driver IC
  • 2x (small) DC motors

Step 2: The Circuit

Picture of The Circuit

The connections are easy, see the image above with the breadboard circuit schematic.

Tip: You can connect an external power source to L293D pin 8, up to 36V! Make sure not to "burn" your motors!

Step 3: The Code

Here's the code, embedded using codebender!

Try downloading the codebender plugin and clicking on the Run on Arduino button to program your Arduino with this sketch. And that's it, you've programmed your Arduino board!

You can keep playing with that by clicking the "Edit" button and start making your own modifications to the code. For example try to combine parts of code to move both motors simultaneously.

Try to use analogWrite(pin, PWM value) instead digitalWrite(pin, HIGH/LOW) to control the speed of motors!

Step 4: Well Done!

You have successfully completed one more Arduino "How to" tutorial and you learned how to use the L293D motor driver IC to control two dc motors with the Arduino uno board.

I hope you liked this, let me know in the comments.
There will be more of them, so make sure to click Follow button!


S.S4 (author)2017-01-15

Hi. Can I have 4 time more current consumption (4*600 mA) from L293D to a DC motor with just one direction by using parallel circuit of input's and output's of the this H-bridge IC ? (as shown in picture)

S.S4 (author)S.S42017-01-16

so , because no body answered me quickly, I decide to make this idea myself, and I succeed . by this method you can reach up to 2400 mA from all of four H-bridge's of one L293D, also if you solder 1, 2 or 3 IC's on top of together you can reach multple current's depend number of IC's.

good luck.

jwzumwalt (author)S.S42017-11-08

Perhaps a better option is to use the L293 (no 'D') which is rated at 1amp per output.

john.moody.73744 (author)S.S42017-10-30

You Rock.

Arduino12345 (author)2017-10-29

u can use 4017 ic instead of arduino

jsar0707 made it! (author)2017-10-19

Wow....I did It....Thanks Instructables.....

Ron P Cherian (author)2017-06-26


RohitT13 (author)2017-03-22

Hey, there is an error when displaying the code from Please fix this error soon or provide the code snippet some other way. That would be really helpful.

cia-21 (author)2016-04-03

Hey, can I make a variable speed driver with L293D?

PramêshB1 (author)cia-212017-03-02

Yeah, using analogwrite instead of digitalwrite & assigning values

Gokuls22 (author)2016-11-07


rahulsanju12 (author)2016-10-22


Please can you attach the circuit design not in pcb or breadboard .

dsg03230 (author)2016-05-24


I built this exact circuit and am running it on an Arduino Uno with a distance sensor as well. When I check the current flowing through a single motor with a multimeter, it peaks at about 80mA for the given script and upwards of 160mA with continuous use. Won't this damage the Arduino? I read the maximum recommended current through a digital pin is only 40 mA. If I add more resistance, the motors won't turn. Any input?

cia-21 (author)2016-04-03

Hey, can I make a variable speed driver with L293D?

hiponiaE (author)2016-03-12

Hello about the L293D motor IC what are the other replacement for it.? I mean, there is no available stock of the said IC and im going to use it im project arduino and bluetooth car. So, is there other value of IC as replacement for it.?
Any help would be greatly appreciated, thank you.

rapamar (author)2015-12-10

Thanks! i am controlling 4 motor by this method! since i only need them to run in one direction, i can use all positive pins available while sending all the negatives from the motors together.. Will post an instructable soon!

Aadhil Rafeek (author)2015-11-10

Great tutorial!!!

yousifhobelos (author)2015-09-23

Hello brother !!

Here im trying to build a cnc devices , somehow i use the same motor driver ..

s i decided to use much stronger steppers ,, so i used 2.3Kg 12 volt stepper motor ..

but the qusetion is : 1) can this motor burn out my L293D motor driver ?

2) should i use an external power supplay ?

or it gonna be fine ?

eliesalame (author)2015-08-24

Hi codebender_cc

This reminded me of when I used two L293D to control 4 motors, it was not hard to do but the wiring this beast was a nightmare. So I decided to make a PCB board to reduce the number of wire :), I will share this Instructable soon thanks to you.

Cheers from Canada

Liamthe1st (author)2015-08-17

I am a in UK a full Member Pro etc

codebender_cc (author)Liamthe1st2015-08-23

Hi! You can add it on your favorites list by clicking the "Favorite" button.

I try to download it as pdf and is working fine on my pc...

ronaldpmathews (author)2015-08-16

You said that I can connect upto 36V to PIN8. Is't the PIN8 connected to 5V on Arduino? Should I connect the external source after removing 5V connection from arduino?

Pin 8 of L293 gives power to motors, and can drive up to 36V. But you have to check first your motors specs! Small dc motors are usually 5~9V. So be careful with this or you can burn your motors!

Correct, If you want to connect an external power source you have first remove connection from 5V.

Remember that L293 IC can drive only 0.5A per channel (for each motor).

Liamthe1st (author)2015-08-17

I am a in UK a full Member Pro etc

Liamthe1st (author)2015-08-17

for some reason down load PDF is not showing so I can not save this .

Dklawz (author)2015-08-15

Sorry. Shouldn't the pins be 2,7,10 and 15 for inputs?

codebender_cc (author)Dklawz2015-08-15

Hello, no need it because by default all pins are inputs ;)

JeremyG1 (author)2015-08-04

Great instructable! Made it as soon as i woke up!

About This Instructable




Bio: Arduino Tutorials by Team
More by codebender_cc:How to use a magnetic door switch / sensor with ArduinoHow to Measure LUX With ArduinoHow to Control an RGB LED Strip - Arduino Tutorial
Add instructable to: