I need some help here... I need to control 4 DC motors with Arduino.
I want them all to do the same thing
I'm using 2x L293D ICs with the following schematic (forget the remaining pins):
But when I power the circuit, I hear a noise and the motors don't rotate at full speed (when "told" to). When I phisically disconnect one of the 4 motors, I see that the other 3 rotate faster.
I must admit I have a doubt if that schematic is correct. Perhaps I'm draining too much current from just 1 pin. Particullary the PWM pin.
What are you using for power in this circuit? Given that you disconnect 1 and the other 3 run faster suggests your power source doesn't have enough current sourcing capability to move all 4 motors.
The PWM pin isn't going to be the one draining current, it'll be pin 8 (Vs, motor supply voltage) that you have to worry about!
I haven't measured the current that the motors are demanding (I currently am not able to do it, as I'm not near them). When I'm able to measure, I'll post here.
According to motor suplier, 139mA is the current they consume without friction. This is how they are right now.
In fact they turn, but not as much as when I have just 2 motors connected, for example.
My sketch is 2 digitalWrite's (for direction signals) and 1 PWM at 255... Nothing special.
It's not a good way to control the speed as you don't get any flywheel breaking effect so it is only effective on loaded motors not free spinning ones.
Just a point, have you connected the H-bridge direct to the 12V (you should) and not to the 5V going through the on board arduino regulator (you shouldn't)
When I phisically disconnect one of the 4 motors, I see that the other 3 rotate faster.
Points to lack of current capability from the power source but you have ruled that out.
It could be it is not wired up right or that you need some supply decoupling on the controller chips.
Thanks Grumpy_Mike.
Before I go for it, I must say I've been doing some tests...
I didn't measure the current in each motor, but I did measure the current being drained from the power supply.
Imagine the following situation:
I got both the ICs powered up and receiving the control signals.
For the first test, I connected 2 motors to the first IC. Current around 330mA (OK)
Then I connected 1 motor to the 2nd IC... Current rises up to more than 2A for some moments and it estabilizes at 1,5A... (NOT OK, because the motors slow down)
I tought: Could it be the 2nd control board? So I did the same test, but the other way around...
I connected 2 motors to the 2nd IC... Everything normal (330mA), but when I plug 1 motor to the first IC, they all slow down, and the same thing happens to the current.
i.e., everything ok if I connect 2 motors on the same IC, because I also tested pluging 2 motors on different ICs and it also slows down.
Based on this test, does someone have a clue of what might be happening?
If the motors work independently on each controller then my guess is something wrong with your wiring. Please take a few minutes and sketch something out for us to refer to.
--
The Quick Shield: breakout all 28 pins to quick-connect terminals
Ok, I'll make the full schematic to post here... I think that you can help me with this, and I understand that is not easy to help without something to look into.
When I finish, I'll post here, ok?
I hope you can help me.