loading

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

For this project you will need:

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

Step 2: 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!

<p>Hey, there is an error when displaying the code from <a href="https://codebender.cc/." rel="nofollow">https://codebender.cc/. </a> Please fix this error soon or provide the code snippet some other way. That would be really helpful.</p>
<p>Hey, can I make a variable speed driver with L293D?</p>
Yeah, using analogwrite instead of digitalwrite &amp; assigning values
<p>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) </p>
<p>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.</p><p>good luck.</p>
<p>simple</p>
<p>Urgent,</p><p>Please can you attach the circuit design not in pcb or breadboard . </p>
<p>Hello,</p><p> 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?</p>
<p>Hey, can I make a variable speed driver with L293D?</p>
<p>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.? <br> Any help would be greatly appreciated, thank you.</p>
<p>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!</p>
<p>Great tutorial!!!</p>
<p>Hello brother !!</p><p>Here im trying to build a cnc devices , somehow i use the same motor driver ..</p><p>s i decided to use much stronger steppers ,, so i used 2.3Kg 12 volt stepper motor ..</p><p>but the qusetion is : 1) can this motor burn out my L293D motor driver ?</p><p>2) should i use an external power supplay ?</p><p>or it gonna be fine ?</p>
<p>Hi codebender_cc</p><p>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.</p><p>Cheers from Canada </p>
I am a in UK a full Member Pro etc
<p>Hi! You can add it on your favorites list by clicking the &quot;Favorite&quot; button. </p><p>I try to download it as pdf and is working fine on my pc... </p>
<p>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?</p>
<p>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!</p><p>Correct, If you want to connect an external power source you have first remove connection from 5V. </p><p>Remember that L293 IC can drive only 0.5A per channel (for each motor).</p>
I am a in UK a full Member Pro etc
for some reason down load PDF is not showing so I can not save this .
<p>Sorry. Shouldn't the pins be 2,7,10 and 15 for inputs?</p>
<p>Hello, no need it because by default all pins are inputs ;)</p>
<p>Great instructable! Made it as soon as i woke up!</p>

About This Instructable

62,298views

244favorites

License:

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