0

I have been trying to use my newly bought L293d Motor Driver Module to run motors(a single motor in this test case, simple 5V toy motor) from my Arduino UNO. Thing is, this is an entire module, not just the IC (in which case there are many tutorials available). So I was following this tutorial to try and get my motor running.

Here is the tutorial - http://www.instructables.com/id/Arduino-and-L293D-Robot-Part-1-/?ALLSTEPS
Here's what the module looks like - The module

There are 6 Pins on the module, which bring out the 6 inputs, EN1, EN2, IN1, IN2, IN3, IN4. Now since I am using only one motor, I connected my motor to the OUTPUT 1 & 2 header given on the module. I then take the 5V and GND from Arduino and connect them to my Module's 5V and GND header, (leaving the 12V one empty), I thought that this would be enough as my motor is also of 5V.
I then connected the IN1 and IN2 to the pins 7 & 8 on my Arduino and used the following code-

// Simple code to make the motor turn
int RightMotorForward = 7;
int RightMotorReverse = 8;

void setup()
{
  pinMode(RightMotorForward, OUTPUT);
  pinMode(RightMotorReverse, OUTPUT);
}

void loop()

{
   digitalWrite(RightMotorForward, HIGH);
   delay(10000);

   digitalWrite(RightMotorForward,LOW);
   delay(1000);
}

Nothing happened. The motor didn't work and I have no idea why. I've gone through the entire datasheet for L293D but I found nothing that could help me. I suspect that it has something to do with the EN1 pin, but I don't really know how to use it, the tutorial said to connect it to 5V, which I tried but no results. So where am I making the mistake? How do I get this to work?

2 Answers 2

0

ooops. That 5V you are applying to 5V pin is actually an output pin.

You must apply some input voltage at the 12V & GND inputs.

Don't forget to remove that 5V connection to 5V pin

4
  • you can also try providing 5Vs from Arduino 5V output pin to module 12V input pin. that might also work.
    – ARK
    Apr 20, 2016 at 19:36
  • I'm gonna try connecting the 12V with a 9V battery, that should be enough to run my motor shouldn't it?
    – YaddyVirus
    Apr 21, 2016 at 1:31
  • that depends on how much current your motor is drawing...
    – ARK
    Apr 21, 2016 at 4:37
  • I tried my above stated experiment and that did work. My battery was of no use after about 40 seconds though.. :P
    – YaddyVirus
    Apr 21, 2016 at 8:48
0

While no one can tell you exactly how to connect that board without having its documentation or the board in hand to examine visually or with an ohm-meter, it is quite likely that by leaving the "12v" terminal unconnected, no power is being provided to the motor side of the circuit.

It kind of looks like there is a voltage regulator on board, so it may be that it will even provide 5v on that terminal when given something 7 volts (or so) or higher on the "12v" terminal - again, we cannot know without details of your exact board.

The L293 is an old and low-performing chip, with internal losses that mean that to achieve 5 volts across a motor, you will need to supply very nearly 7 volts to the chip. The difference gets wasted as heat.

9
  • Strangely there's no documentation or tutorials available for this on the internet, I'm gonna post a tutorial as soon as I can get it working. Anyways according to you this has nothing to do with the EN1 pin and I should try giving power to both the terminals right? I'm gonna keep the 5V power supply same and will add a 9V battery to the 12 V output, ground remains common.
    – YaddyVirus
    Apr 21, 2016 at 1:29
  • No, I don't think you should power both terminals, rather, you almost certainly need to power the 12v. And the EN pin is certainly relevant - it just is unlikely to be enough. A 9v battery does not have the current capacity for a motor project - you need either a power supply or a series of connection of quality AA cells at minimum. Apr 21, 2016 at 2:20
  • so uh, the EN1 pin just sits empty?
    – YaddyVirus
    Apr 21, 2016 at 5:06
  • No. Read the L293D data sheet. Apr 21, 2016 at 5:12
  • I did. Acc to the datasheet the EN1 pin is to be connected to a 5v supply... I tried doing that but it didn't work.
    – YaddyVirus
    Apr 21, 2016 at 5:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.