Go Down

Topic: Using two L293d Not enough power for four dc gear motors (Read 129 times) previous topic - next topic

Basilisvirus

I have build this schematic,

https://drive.google.com/open?id=1RzYbNb7mBylUuAMhcFz3WqH3_rwLf3kL

With this code:

//FIRST L293D

int Wheel_1_1=5;//wheel 1_1

int Wheel_1_2=3;//wheel 1_2

int Wheel_2_1=6;//wheel 2_1

int Wheel_2_2=9;//wheel 2_2

//SECOND L293D

int Wheel_3_1=4;//wheel 3_1

int Wheel_3_2=7;//wheel 3_2

int Wheel_4_1=8;//wheel 4_1

int Wheel_4_2=12;//wheel 4_2

void Break(){

digitalWrite(Wheel_1_1,0);

digitalWrite(Wheel_1_2,0);

digitalWrite(Wheel_2_1,0);

digitalWrite(Wheel_2_2,0);

digitalWrite(Wheel_3_1,0);

digitalWrite(Wheel_3_2,0);

digitalWrite(Wheel_4_1,0);

digitalWrite(Wheel_4_2,0);

}

void setup() {

//all the wheels

pinMode( Wheel_1_1,OUTPUT);

pinMode( Wheel_1_2,OUTPUT);

pinMode( Wheel_2_1,OUTPUT);

pinMode( Wheel_2_2,OUTPUT);

pinMode( Wheel_3_1,OUTPUT);

pinMode( Wheel_3_2,OUTPUT);

pinMode( Wheel_4_1,OUTPUT);

pinMode( Wheel_4_2,OUTPUT);

//move wheel 1 one direction

digitalWrite(Wheel_1_1,0);

digitalWrite(Wheel_1_2,1);

delay(2000);

Break();

//move wheel 1 other direction

digitalWrite(Wheel_1_1,1);

digitalWrite(Wheel_1_2,0);

delay(2000);

Break();

//move wheel 2 one direction [NOT ENOUGH CURRENT]

digitalWrite(Wheel_2_1,0);

digitalWrite(Wheel_2_2,1);

delay(2000);

Break();

//move wheel 2 other direction

digitalWrite(Wheel_2_1,1);

digitalWrite(Wheel_2_2,0);

delay(2000);

Break();

//move wheel 4 onr direction [NOT ENOUGH CURRENT]

digitalWrite(Wheel_4_1,0);

digitalWrite(Wheel_4_2,1);

delay(2000);

Break();

//move wheel 4 other direction

digitalWrite(Wheel_4_1,1);

digitalWrite(Wheel_4_2,0);

delay(2000);

Break();

}

void loop() {

// put your main code here, to run repeatedly:

}

Where, wherever i say [NOT ENOUGH CURRENT], means that the specific mtor move wont me exetuted due to lack of power.

If i use one l293d, it will work as expected, with all the motors (two at the time), with no issues. Whenever i connect the two l293d to the common ground of the arduino, the errors that i mentioned above happen.

I also use two different power sources [(5v 1A)x2] to power up each of the l293d, i even tried not usiong the 5v of the arduino at all, but still it lacks power.

Help?

Robin2

To make it easy for people to help you please modify your post and use the code button </>
Code: [Select]
so your code looks like this and is easy to copy to a text editor. See How to use the Forum

Your code is too long for me to study quickly without copying to a text editor.

Also use the AutoFormat tool to indent your code for easier reading.


You need to make a simple pencil drawing showing ALL the connections.
You need to provide as much detail as possible of the motors you are using including how much current they require when running and when stalled.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Wawa

The ancient/inefficient L293D already 'looses' ~2.5volt@600mA in H-bridge mode.

That means you need a 9volt supply for 6volt motors.

The chip will (because of the losses) also easily overheat with motor currents >600mA.
Leo..

MarkT

What is the stall current rating of your motors?  Is this less than 1/2 the max current of the L293D?
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up