loading
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

Step 1: 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:
Hi I like your Instructables very much! Great job! I have a question that I think you may know the answer to. I need a small chip like this one that I can program and put it in a circuit so when it activates by a sensor ( in my case I want to put a light sensor (LDR))When light hits the light sensor It turns on a motor for a period of time (lets say 5 seconds). Then when the sensor finds it self in the dark it turns on the motor ( again for 5 sec) BUT IN THE opposite DIRECTION. All in All When there is lite it turns on the motor for 5 sec on one side (lets say left) when there is no light it turns the motor for 5 sec (on the oposite side, right) Do you know such a chip that will enable me to program it and make it do what I described??? Thank you! Stanislav
The Arduino board is fully programable, you can see more info at www.arduino.cc
<p>heya m making a line follower but my motors are not working according to arduino they just run when supply is given plz do guide me<br>viditsmartboy1808@gmail.com</p>
<p>Can you post the arduino code and a photo of connections so we can see ?</p>
Yea, but I need something smaller, much much smaller like a chip...
there are arduino clones of many sizes, or can build your customized arduino only with the essencial components, <a rel="nofollow" href="http://lab.guilhermemartins.net/index.php?s=ratazana">I have build one for this project</a><br/><br/>check the following links:<br/><br/><a rel="nofollow" href="http://store.fundamentallogic.com/ecom/index.php?main_page=index&amp;cPath=15">http://store.fundamentallogic.com/ecom/index.php?main_page=index&amp;cPath=15</a><br/><br/><a rel="nofollow" href="http://www.arduino.cc/en/Main/ArduinoBoardNano">http://www.arduino.cc/en/Main/ArduinoBoardNano</a><br/>
Thank you!
Once you've programmed the arduino you can remove the chip, add a crystal and it can act alone with a power source - you don't always need a smaller arduino ;)
Great, that is good to hear... I am new in programing and electronic... :P Why do I need a crystal, actually what does a crystal do??? How should it be connected? What chip should I use? Thank you!
this might interest you<br/><a rel="nofollow" href="http://lab.guilhermemartins.net/?p=539">http://lab.guilhermemartins.net/?p=539</a><br/>
Thanks!
and this :)<br/><a rel="nofollow" href="http://lab.guilhermemartins.net/?p=817">http://lab.guilhermemartins.net/?p=817</a><br/>
Thanks! x2 :D
I recommend the Arduino Duemillanove, it's relatively easy to use and program and the crystal (i have no idea besides this) is just to make it functional outside the board it's in. The arduino Duemillanove uses the AtMega328. ps: a "crystal" is just a component like a resister or capacitor, it's not a diamond or a ruby :P
I have the Arduino Duemillanove ... Are there types of crystals, if yes, which type should I use??? Are there separate chips that you can buy, without the whole board? On the chip it self hod do I know where should I hock up the sensor, power, motor, crystal... Yes, I am a n00b! ;) Thank you!
I will answer you honestly; i don't know. But googling goes a long way ;)
:P Thanks!
Any of the microcontrollers whether PIC or AVR can do this. But you will still need support components for regulating power and possibly programming interface, so yes the Arduino is a little big, but you may find you need the same components in any case.
Well, maybe, but the problem is I can't fit the Arduino into the case... I think that I I just program the chip and solder all the components... I would save much space... So should I use this chip? How do I actually program it, the chip that is? As I said, I need something small..like a bug circuit with the programed chip that turns on the motor when it gets a signal for a defined amount of time... Thanks!
You can use the same setup, simply save the states of the ldr and you can check if there was light before and have the arduino reverse the motor-&gt;<br/><br/>if ( pin 1 = high)<br/>{<br/>turn right<br/>5 sec<br/>}<br/>if (pin 1 = low)<br/>{<br/>turn left<br/>5 sec<br/>}<br/><br/>else<br/>{<br/>do nothing<br/>}<br/><br/>Hope I could help<br/>
THANK YOU SO MUCH!!! OK, so I just upload this to the Arduino? On what pins do I connect the motor, LDR, power??? I needed someone to write the code because I am a complete n00b in programing... THANK YOU! Could you please now just help me, to say, put it together, like on what pins do I connect the motor, LDR, power... Can I remove the ATMega chip and use it with out the Arduino board, connecting the components directly to the chip? Thank you!
no you can't, it's just pseudocode so you can get an idea what you have to programm, sadly I don't own an arduino so I can't write it for you. sry
Well... Thanks any way... Thanks, you helped me! :D
If that is all you are looking to do, then a pickaxe 08-M coupled with the circuit in this instructable should do the trick. the cheapest 08-M that I found was about $3.00 USD.
And how do you program them? Thanks!
the chips have a serial in, serial out(also a in0), and a ground to share with a serial cable. They do take a little more diy to use, because the breakout boards sold on the internet are terrible, and you can make one much smaller, cheaper, and funner with a perf board, solder, pic, and various components. The pic must be programmed with a certain resistor setup that can be found all over the internet.
Ah ok thanks! I think I am going to use an arduino, that is the arduino chip thanks!
<p>Can i controll the Speed of this motors?</p>
You can do pwm, pulsating the input for speed control
<p>Sure you can, speed can be assign using PWM (pulse width modulation).</p><p>Use the following commands: <br>analogWrite(pinMotorA, value);<br>digitalWrite(pinMotorB, LOW);</p><p>PS - don't forget to check the Arduino Reference</p>
<p>Please help me !!! I just burns my 2 L293D ic's, yeah its heat up during I am controlling my Car, I am using NI -CD 8 AA 700mAH 9.6 V Battery, the positive of battery attach to the IC VSS(Pin 8) and negative of IC attach to the arduino gnd. Someone reply me please ......</p>
Wrong way round maybe? High voltage on low voltage input?
<p>Used this for my schoolproject and controlled it with a wiinunchuck, thank you so much for your help! Good instructables!</p>
<p>Arduino Robotics Car From Scratch :</p><p><a href="http://www.instructables.com/id/LAB-L293D-ARDUINO-CHIP-BREADBOARD-/?ALLSTEPS" rel="nofollow">http://www.instructables.com/id/LAB-L293D-ARDUINO-...</a></p>
<p>Arduino Robotics Car From Scratch :</p><p><a href="http://www.instructables.com/id/LAB-L293D-ARDUINO-CHIP-BREADBOARD-/?ALLSTEPS" rel="nofollow">http://www.instructables.com/id/LAB-L293D-ARDUINO-...</a></p>
Nice instructables. Can i use regulated 5 volt from arduino instead of 7805?
<p>Yes you can, its a good way to get started with it</p>
<p>I don't think so. Arduino board can not supply current to run a motor. You need an external supply.</p>
<p>So are the 100uF/16V capacitors, the same as the 0.1uf capacitors, and are they both used to control the current spike from the motors, or are they used to regulate the voltage to 6V. I have a 14.8 volt lithium ion battery, and have a 5 volt regulator in for the sensors and the microcontroller. I also have a 6V regulator going into pin 8 for my motors. I'm confused about what pin 16 does; is it's ouput voltage 6V? Does pin 16 rely on the input voltage from pin 8?</p>
<p>Hello,</p><p>Thanks a lot for this tutorial! I wanted to control motors with my arduino for a long time but just didn't get started. Though I have a few questions before I start.</p><p>In step 2:<br>1) To plug the motor in, I just stick the wires in the tie points above the white wires? row 42 and 46?</p><p>2) I need to control a 12V motor, so if I understood this correctly I just take a 12V source and plug the + to pin 8 and the - to the ground? But then you have like, 1 side of pin 8 has 12V and the other side has 5V. I don't really get how that works.</p><p>3) Do I need to change the capacitor if I use a higher voltage? I assume yes, how do I calculate it?</p><p>Thanks in advance!</p>
<p>1) Yes you are right, connect the motor wires on row 42 and 46.<br>2) The L-293D driver has two power inputs, one for logic (5V - VSS - pin 20) and other for Motor Power (VS - pin 10), this enable you to work with until 36V motors!!<br>3) You will use a same capacitance capacitor, but the work voltage of this capacitor will be according the supply voltage of the motor used.</p>
<p>Thanks for the answer :)</p><p>One more question, should I connect the 5V output of the arduino on both sides of the breadboard? As far as I've got it now, I do. But it is not in the picture (I'm using the picture of the breadboard in step 2)</p><p>I just connected the 2 -parts on the breadboard and the 2 +parts.<br>The +-wire of the external battery is connected to pin 8 of the L293D.</p><p>This question may sound dumb, but I just don't want to blow up my arduino :p</p>
<p>Greetings, sorry but I not understand your question, can you take a picture? to be sure and help you to not blow up your arduino.<br>If you has an blow up arduino, this can be repaired, do you know?</p>
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?<br><br>Best<br>Kristian
<p>Because inductive loads like motors, will generate spike voltage transients (electrical noise) that can disturb or block a &micro;Controller.</p>
<p>I am too a beginner in these things. I want to know how the capacitor helps in this case.</p>
<p>The capacitor will work like a buffer (&quot;electrical shock absorber&quot;), that absorb a spike and fill a low voltage, the voltage variations when will be smoother or inexistent. the microcontroller needs a constant power supply to work fine any spikes or electrical noise will disturb, restart or block ...</p>
Add good heatsink on your ground l293d .
<p>what is the enable for?</p>
<p>If you want simpler code, I wrote an Arduino library for the L293D motor controller. You can find it at <a href="https://github.com/tysweat/arduino-L293D" rel="nofollow">https://github.com/tysweat/arduino-L293D</a></p>

About This Instructable

385,273 views

476 favorites

License:

Bio: Designer & digital artist
More by guibot: Create an FPV 4WD Robot making wheels out of plastic bottles Clever ways of attaching components to your robot
Add instructable to: