• Hello,

    I using a L293D chip(16 pin) to control two 298:1 Micro Metal Gearmotor.
    the following attach files is my Circuit.

    Any i refer the http://www.espruino.com/L293D and write my code like below
    but when send to Espruino to LED is LightUp but the GearMotor still not work is it any step i missing?

    digitalWrite(LED3,1); //Check the Board is Word for LED
    
    var outputs = [C6,C7,C8,C9];
    digitalWrite(outputs[0],1); // output 1
    digitalWrite(outputs[1],1); // output 2
    digitalWrite(outputs[2],1); // output 3
    digitalWrite(outputs[3],1); // output 4
    

    1 Attachment

    • Circuit.jpg
  • I have capture a images for detail


    1 Attachment

    • 20140427_185456.jpg
  • Forgive me if i am wrong, but it looks like you don't have your motors connected to a ground. You have them hooked up to an output that is powered.

  • Hi, Ducky thank for reply.
    you are right i miss connect GND and "Bat" to Breadboard.

  • I have Change my Circuit to the Following.
    and update my code to

    digitalWrite(LED1,1); //Check the Board is Word for LED
    
    var outputs = [C6,C7,C8,C9];
    
    digitalWrite(outputs[0],1); // output 1
    digitalWrite(outputs[1],0); // output 2
    digitalWrite(outputs[2],1); // output 3
    digitalWrite(outputs[3],0); // output 4
    

    But the Gearmotor is still not working


    1 Attachment

    • 10312078_241440182711853_270007380_n.jpg
  • Oh, i dind't spot that you hadn't connected the power to the espruino. What happens if you attach one of the motor terminals to GND?

  • i found this, http://fritzing.org/projects/arduino-l29­3d its for arduino but it might help you.

  • @Ducky The idea of the L293D is that the motor can have both sides connected to the controller - so you can run the motor in reverse.

    @jacklee that circuit and code looks absolutely fine to me. Is the motor rated for 5v, or some higher voltage? Perhaps you could check with a meter and see if one side of the motor really is at 5v, and the other is at gnd?

  • @Ducky Thank You for you information and reply.
    @Gordon I found my problem but still have one issue for me.

    First: in bread board, power circuit(+,-)is separated at half point so i need to make the far right two wire near.

    The unsolved issue is i can't solve when i using [C6,C7,C8,C9] or [C6,C7,C4,C5]
    the motor is not work properly.
    Example if i using [C6,C7,C8,C9] and code like below . the motor should be stop,
    but one of the motor is still working

    var outputs = [C6,C7,C4,C5]; 
    digitalWrite(outputs[0],0); // output 1
    digitalWrite(outputs[1],0); // output 2
    digitalWrite(outputs[2],0); // output 3
    digitalWrite(outputs[3],0); // output 4
    

    I need to code like below to stop both of the motor

    var outputs = [C6,C7,C4,C5]; 
    digitalWrite(outputs[0],0); // output 1
    digitalWrite(outputs[1],0); // output 2
    digitalWrite(outputs[2],0); // output 3
    digitalWrite(outputs[3],1); // output 4
    

    I have testing few hours in [C6,C7,C8,C9] and [C6,C7,C4,C5] this two group.
    but the result is same all not work properly for me.

    After few hours I change my Circuit PIN to B3,B4,B5,B6
    Like the Attach Images below

    and code like below is work properly for me

    Both motor is Run

    var outputs = [B3,B4,B5,B6]; 
    digitalWrite(outputs[0],0); // output 1 
    digitalWrite(outputs[1],1); // output 2 
    digitalWrite(outputs[2],0); // output 3 
    digitalWrite(outputs[3],1); // output 4
    

    Both motor is Stop

    var outputs = [B3,B4,B5,B6]; 
    digitalWrite(outputs[0],0); // output 1 
    digitalWrite(outputs[1],0); // output 2 
    digitalWrite(outputs[2],0); // output 3 
    digitalWrite(outputs[3],0; // output 4
    

    I have No Idea why the PIN in the "C" is not working properly but the PIN in "B" is working Good?


    1 Attachment

    • final.jpg
  • I'm afraid I have no idea! I just tested here and C4/5/6/7 outputs output the correct values with digitalWrite.

    Maybe there is some kind of short on your board, but we test for that in manufacturing. Can you check the outputs with an LED (L293D doesn't have to be connected) and see if they output the correct values?

  • @Gordon Hi, I Found what is the issue .

    is my fault when i solder the pin header to Espruino not correct. their still have some gap.

    I have use a LED test by

    digitalWrite
    

    All PIN is working Fine Now

  • Great, thanks for letting me know!

  • Thanks @jacklee for this thread and for your diagrams! It helped me get the L293D working! You should consider turning it into a tutorial on the espruino page, because there is no other explanation about using the L293D on a breadboard (instead of soldering it to the espruino).

  • Hi @jacklee, can I ask what is this software that you using to draw the circuits?

  • @Pumych it's probably Fritzing

  • I must to say that I inspired by Espruino (because of JavaScript) to learn new interesting things. Thank you.

  • @gnz I happy my Post is helping you, Good Idea Yes i should turning it into a tutorial.

    @Pumych Yes, i using Fritzing and Illustrator for the circuits.

  • :/ Sorry to be posting this out of nowhere, but could you please share the fritzing part for the micrometal motors? I can't seem to find them anywhere. TIA

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

[SOLVED]L293D Control Two Micro Metal Gearmotor HP

Posted by Avatar for jacklee @jacklee

Actions