Picture of Control your motors with L293D and Arduino
After long research and trial and error, I have came up to a new walkthrough regarding this nice chip, the L293D.

Each project is one project and each one has its own unique power configurations, so you must be aware of the best battery choice and how to distribute voltage through your robot.

I strongly advice you to read the following articles:

Picking Batteries for your Robot
Once you've decided on batteries, how do you regulate the voltage


L293D gives you the possibility to control two motors in both directions - datasheet
Remove these adsRemove these ads by Signing Up

Step 1: Basic implementation

Picture of Basic implementation
This is the most basic implementation of the chip.

As you can see, a 5V Voltage Regulator is between the battery and pins 1, 9, 16.

Pin 8 gets power before the VReg, if your motor needs for example 6V you should put 6V directly in this pin, all the other pins should not get more than 5V.

This will work with no problem at all, but if you want to do the right implementation take a look at the next example:

Step 2: Advanced implementation

Picture of Advanced implementation
This is the correct Implementation (with the capacitors), and note that pin 8 is feeded by unregulated voltage. This means that if your motors need more than 5V, you should power this pin with that amount of voltage, and the rest of the circuit with 5V.

Step 3: Arduino code

// Use this code to test your motor with the Arduino board:

// if you need PWM, just use the PWM outputs on the Arduino
// and instead of digitalWrite, you should use the analogWrite command

// --------------------------------------------------------------------------- Motors
int motor_left[] = {2, 3};
int motor_right[] = {7, 8};

// --------------------------------------------------------------------------- Setup
void setup() {

// Setup motors
int i;
for(i = 0; i < 2; i++){
pinMode(motor_left[i], OUTPUT);
pinMode(motor_right[i], OUTPUT);


// --------------------------------------------------------------------------- Loop
void loop() {






// --------------------------------------------------------------------------- Drive

void motor_stop(){
digitalWrite(motor_left[0], LOW);
digitalWrite(motor_left[1], LOW);

digitalWrite(motor_right[0], LOW);
digitalWrite(motor_right[1], LOW);

void drive_forward(){
digitalWrite(motor_left[0], HIGH);
digitalWrite(motor_left[1], LOW);

digitalWrite(motor_right[0], HIGH);
digitalWrite(motor_right[1], LOW);

void drive_backward(){
digitalWrite(motor_left[0], LOW);
digitalWrite(motor_left[1], HIGH);

digitalWrite(motor_right[0], LOW);
digitalWrite(motor_right[1], HIGH);

void turn_left(){
digitalWrite(motor_left[0], LOW);
digitalWrite(motor_left[1], HIGH);

digitalWrite(motor_right[0], HIGH);
digitalWrite(motor_right[1], LOW);

void turn_right(){
digitalWrite(motor_left[0], HIGH);
digitalWrite(motor_left[1], LOW);

digitalWrite(motor_right[0], LOW);
digitalWrite(motor_right[1], HIGH);
1-40 of 102Next »
TarekT229 days ago

Hey ,

I have one qst , can i use this H Bridge with a Linear acutator (Motor) , who needs 24 V, if yeah , did i just need to feed pin 8 with 24 V source ?


Yes. The datasheet says that the l293d has a maximum input current of 36 volts i Think. You should only supply this to pin 8 however.
Hi. Great tutorial. There is one thing i do not understand though, probably because im not an electrical engineer: why Are the 100 uf capacitors needed?

Nice instructables. Can i use regulated 5 volt from arduino instead of 7805?
Nice instructables. Can i use regulated 5 volt from arduino instead of 7805?
Nice instructables. Can i use regulated 5 volt from arduino instead of 7805?
HemilP7 days ago

why you have connected 0.1uf capacitors in L293D connection?

guibot (author)  HemilP7 days ago
I think it was in the L293D datasheet

¿Cuáles son los materiales?

My L293D chip is getting heating up and after a few seconds the motors are stopping. please help.

I think your motor is drawing too much current. The max continuous current output of L293D is 600mA(Refer the data sheet). L293 has thermal shutdown protection that automatically shut off motor outputs when over heat. Use 298N that can allow 2A continuously. What motor you are driving with this IC?

I am using small ordinary 6v motors which come in the cheap rc cars.
mgarg51 year ago
Sir just 2 questions, Can i use this setup for a robotic arm. I have 2 L293D chips i need to inetrface. Is it posible? If yes then how? & also can i use Dc motors with just power and ground for this setup instead of a motor with a feedback?

i think you can. but it my be a bit difvult

AdithyaA21 month ago

i luv drones

alys51 month ago

can I connect 3 of these setups with 3 l293d on the arduino uno rev3 but will I have enough pins beacause I am connecting a nrf24l0 on the same arduino I need 3 l293d to work on so will there be enough pins for this

tysweat1 month ago

If you want simpler code, I wrote an Arduino library for the L293D motor controller. You can find it at https://github.com/tysweat/arduino-L293D

how can I control 4 motors

Use 2 L293D chips

thanks tys5
davast1 month ago
Can this driver used in line follower
alee752 months ago

Thanks for making this. I'm totally new to this, but it will give me a good place to start. It worked well .

guibot (author)  alee752 months ago

Hi! I'm glad to know it worked for you!! ;)

aditya jindal2 months ago
Great project! I have made it and it is working properly but I want to control motor speed also with arduino. How can I do it
guibot (author)  aditya jindal2 months ago

Hi! if you want to control speed you should use analogWrite(pin, value), where value is a number between 0 and 255.

for mor info check the PWM tutorial on the Arduino page:

kamhagh3 months ago

my motors don't move when on the ground, i found out its giving 3.3v for 2 motors connected and 5v for 1 motor, im using 4 AA batteries, it works when connected directly, my motors draw 600MAX when moving hardly! 300mah normally!

what should i do? i already ordered a 2200mah 3s (11.1v) battery hopping it woul work!

great tuts here is another tuts

sagund8 months ago

hello there...i am building a robot using arduino and L293D.....and i want to use bluetooth module on the same to control the robot using android app...i wonder if you could help me with the codes to be written on the arduino....thankyou :))


It didn't work at all!!!!

Any tips?????

guibot (author)  Haythem Kenway5 months ago

more details please..

yhdesai5 months ago

make it a shield

DanM510 months ago

Thanks for the post. I made this circuit and it worked well. The photo was taken before I found the error on only hooking the unregulated power to one pin.

JenniferR4 DanM57 months ago


Do you have a code for that car? I have the same exact one.

skadd4life1 year ago

I want to use a 5v motor, and use a 5v DC powersource (not battery, wall plug). Do I still need to regulate my voltage? Can my 5V source be used for Vs pin of the L293D and microcontroller Vcc? Or, do I somehow need to isolate the 5v between those inputs? Thanks!

BTW, I plan to use ATtiny to provide PWM to L293D.

How did I go with the Attiny? I want to try as well

jamestav ccarpio211 months ago

You can see how to use an ATtiny on my blog. It shows how to program it and everything.


jamestav11 months ago

I like it! You are very detailed and specific. There is also an Adafruit Shield that uses 2 of those chips and is very good. They're cheap as well, like 5 or 6 bucks. I have a tutorial on how to use them http://jamestav.com/l293d-motor-shield/

supershwa1 year ago
Good instructable - to clarify, the [battery] in this example powers the motors separate from the Arduino power source: the Arduino controlling this circuit has a separate power source (an additional 7-12v source plugged into the Arduino.) You should be able to use a 9v battery for the motors, and a separate 9v for the Arduino (the motors can run faster this way.)
1-40 of 102Next »