L293d

Hi,
I am a bit confuse about how to interface L293d on one website
http://www.toddholoubek.com/classes/pcomp/?page_id=394,
they connect red voltage wire on first and last pin of same side and on other

http://akashxav.com/2009/04/18/arduino-l293d-dc-motor/

They connected red wire on 1 and 16 pin.Can You tell me who to follow .

Is it possible I can power this circuit with 9volt batrery without voltage regulator for one dc motor or 2 dc motor.

Can you explain what is enable pin means in l293d datasheet.

Last if I connect 2 dc motor on l239d will it be called parallel or series circuit.

Thanks

I am not sure I understand your problem. I can't quite tell what the wires are connected to from the photographs, and there are lots of corrections on the other site.

If you explain what you are trying to do, folks may be able to give better advice.

Have you got a L293D datasheet? There are several block diagrams which explain things, but you need to be careful to use a diagram which fits what you want to do. If you explain which datasheet you have (the URL), and what you are trying to do, I could probably identify the appropriate diagram

Let me try to explain how to connect the chip. (I assume you understand how the pins are identified, and that the colour of the wires makes no difference:-)

The chip is in two largely independent halves. Lets call them A and B.

Half A: Pins 1, 2 and 7 are the inputs, and pin 3 and 6 output to motor A.

Half B: Pins 9, 10 and 15 are the inputs, and pins 11 and 14 output to motor B.

The enable pins (1 and 9) switch the outputs to the motor on (low resistance, and hence connecting it to power or ground) or off (very high resistance, so a motor would eventually come to a stop as no current flows).

There are several different ways of controlling the motor.
Here is one way, but there are, at least, two others.

In this approach, the PWM signal is connected to the Enable pins. This allows the PWM signal to provide speed control.

You will connect 3 Arduino pins to 3 input pins on each half of the L293D.

Connect an Arduino PWM pin to pin 1 (half A), and another PWM pin to 9 (half B).
You will use analogWrite for those two PWM pins to control the speed.

The other two Arduino pins for each side control motor direction.
Set them up with pinMode in setup. then ensure they are DIFFERENT, e.g. if pin 10 and 11 are used do:
digitalWrite(10, LOW);
digitalWrite(11, HIGH);
or
digitalWrite(11, LOW);
digitalWrite(10, HIGH);

There are two power systems. You can power two motors with a battery, but it may be drained quite quickly. This depends on how much current the motors use.

Connecting the + terminal of your battery to pin 8, and the - terminal to pins 4, 5, 12, 13
Connect the arduino +5V to pin 16, and Ground (Gnd) to pins 4,5, 12, 13.

Does that help?
GB

Hi - this tutorial might be a bit clearer since it references the chip layout directly: http://tigoe.net/pcomp/labs/lab-motors.shtml

pin 16 is for the 5v power to the chip itself.

pins 1 + 9 are the enable pins - basically on/off for the 1/2 H bridge. When those pins see 5v they are 'on' and current is enabled to the motor connected to one or both sides of the H bridge. If you wanted to control motor speed, one way would be to use PWM on the enable pin(s) to pulse them and achieve desired speed.

pin 8 is the +V input for power going to the motors- so you can use a higher voltage to drive the motors without frying the H-bridge chip.

About running from battery - guess it depends on how much current the motors draw and how long you want them to run. You would want a voltage regulator for the logic supply since from the spec the chip expects 4.5 - 7 v - as well as to protect the chip from inductive surges from the motors.

The H-bridge is two separate circuits on one chip - so it's not series or parallel

If you use two power supplies, be sure they share a common ground with the arduino (i.e. tie all the grounds together).

(I think what I have said is generally accurate - but someone may have better/more specific explanations)

--Roy

Hi,

Thanks for the reply.I am trying to run 1 toy dc motor in which I can control its speed and thinking of using 9v battery for dc motor without voltage regulation.If that works fine then I will connect another small toy dc motor to the circuit with the same 9 volt battery.

The toy dc motor seems to be about 5 volts(4AA).

This is the datasheet I am using

It is the same as the LM18293 that I used in my tutorial.
See this page for how to use it:- Motors 2

Those two circuits are the same. The 5V to pin 16 is needed for the logic, The power on pin 8 is for the motor. If that is 5V then it is connected to pin 16 otherwise it should be connected to the +9V in your case.