You are on page 1of 5

L239D DC Motor Driver & Pin Configuration

Although I’ve only used 1 motor, it is possible to use 2 motors on a single L293D chip, of course you then have to compensate on the current accordingly to ensure enough juice for both motors under peak load. Remember that if you use 2 motors, the power source will be the same voltage but the current needed will be doubled – a good start is by altering how your batteries are connected in series or parallel. “The L293D is a monolithic integrated, high voltage, high current, 4-channel driver.” Basically this means using this chip you can use DC motors and power supplies of up to 36 Volts, thats some pretty big motors and the chip can supply a maximum current of 600mA per channel, the L293D chip is also what’s known as a type of H-Bridge. The H-Bridge is typically an electrical circuit that enables a voltage to be applied across a load in either direction to an output, e.g. motor. This means you can essentially reverse the direction of current and thus reverse the direction of the motor. It works by having 4 elements in the circuit commonly known as corners: high side left, high side right, low side right, and low side left. By using combinations of these you are able to start, stop and reverse the current. You could make this circuit out of relays but its easier to use an IC – The L293D chip is pretty much 2 H-Bridge circuits, 1 per side of the chip or 1 per motor. The bit we really care about in all of this is the 2 input pins per motor that do this logic and these, more importantly for our needs, can be controlled from the Arduino board. You also don’t have to worry about voltage regulation so much because it allows for 2 power sources – 1 direct source, upto 36V for the motors and the other, 5V, to control the IC which can be supplied from the Arduino power supply or since my motor power supply is only 6V I’m going to use this (if the motor supply was higher I would consider using a transistor or voltage regulator). The only thing to remember is that the grounding connection must be shared/ common for both supplies. Below you can see the pin layout for the chip and the truth table showing the output logic.

so instead my Arduino runs off of my 9 Volt power supply I made. especially if I was to add in another motor and a couple of servos. Arduino L293D Circuit Components .Pin 1 High High High High Low Pin 2 Low High Low High Not applicable Pin 7 High Low Low High Not applicable Function Turn clockwise Turn anti-clockwise Stop Stop Stop Generally speaking most DC motors require a lot more current than the Arduino board can provide for instance the motor that I’m using needs around 5 to 6 Volts. but then its going to drain quickly when it has to power everything. Now I could use a 12 Volt power source for the Arduino. You could also add in a capacitor for each motor that you use – something like a 220nF multilayer ceramic capacitor should be OK for the small motors. (here) You’ll need a few capacitors in this circuit to smooth out the power load to the motors as much as possible to help avoid any spikes and stabalise the current. I’m using a 50 Volt 10 uF capacitor on the power supply – I suggest you do this as the bare minimum.

1 for each motor. . Gold) 50V 10uF Capacitor 6V DC motor L293D motor controller/ driver chip (IC) A switch (push. Orange. toggle etc. You’ll see that its basically got 2 sides.. Black.) Arduino Deumilanove w/ ATMEGA328 Breadboard / Prototyping board Jumper/ Connector wires 4x AA battery holder 4x AA batteries Optional 220nF multilayer ceramic capacitor (Y5V) Optional 9V DC power supply or use the USB power for the Arduino Building the L293D motor driver circuit First lets start with the 16 pins on the L293D chip and what we need to wire these to.10K Ohm resistor (Brown.

Is for the other motor terminal 7. Ground 5. this should be given the rated voltage of your motor. Enables and disables the 2nd motor on or off (high or low) 10. Logic pin for the motor (input is either high or low) goes to Arduino digital pin 4 3. I also add the capacitor in between the power supply – making sure that the negative and positive terminals are correctly aligned. Logic pin for our motor (input is either high or low) goes to Arduino digital PWM pin 3 8. Ground 14. in this case the power from motor supply You can see from my photos how I’ve placed the L293D and wired it according to the above pins. Power supply for the motor. Logic pin for the 2nd motor (input is either high or low) 16. . Finally I complete the circuit by adding in wires to carry the current from one side of the breadboard to the other and I add in the motor and its power supply. so mine is from a 6V supply 9. Next I have my switch on Arduino digital pin 2 and I have the GND pin from Arduino connected to the GND rail on my breadboard. Connected to +5V. Ground 6. Is for one of the 2nd motor terminals can be either +/12. Enables and disables the motor whether it is on or off (high or low) comes from the Arduino digital PWM pin 9 2. Is for one of the motor terminals can be either +/4.1. Ground 13. Logic pin for the 2nd motor (input is either high or low) 11. Is for the 2nd motors other terminal 15.

 7/:340:2.07.0.5   89.34./7. 5:8 94009.

/-4.% 70.7/.

7/ :2507.!7494953-4.

..90300/9470908094 4: 800 9.947708 -...5.99074/07 -.24947   .5.'54078:5547:8090&$5407147907/:34 :/39024947/7..07.799905384390.07.4330.07.3/.7.498/08 1470.990708 5943.947 '  5943.998-.8.:9 78909889. 32:9.2.

3-00907 .4208174290 7/:34/9.53   814743041902494790723.8..3//8.531479024947 35:980907474 408947/:34/9.-0890249470907984347411 474 .!53   4.  3.-08.

-08.531474:724947 35:980907474 408947/:34/9.90/.53147903/24947 35:980907474   814743041903/2494790723.!53   !4078:551479024947 9884:/-0.49.0414:724947 84230 81742..    74:3/   74:3/   81479049072494790723.8.03907.-08903/249474347411 474   4.'8:55   3.3//8.3-00907 .   4.

  74:3/  74:3/  8147903/249478490790723.30/  3.47/3 9490 .-4.3/ 70/ 9 ..:9-..0 90723. 43 7/:34 /9.70 .0 5.0 ...3 800 1742 2 54948 4  ..947 3 -09003 90 5407 8:55  2.5.// 90 .9.7/94 904907.0 538  09  .3/..//3 370894.0 90  53 1742 7/:34 .//39024947./-4.7.3/  .3/ 5489.0 2 89.0/ 90  .7790.:7703917424308/04190-70..84 .90/94 ' 398.8 .3 8:70 9.90/ 94 90  7. 43 2 -70. 53  .3/9854078:55  .809054071742249478:55 4: ..4770.7/   .  ./-4.4330...  4.9 .9 90 30.53147903/24947 35:980907474   4330.42509090.

  .