Problem with arduino & two L298 controller

I’m looking for some help with controlling step motor.
I have an arduino mega 2560 and two L298 control cards. When i use only one of theses cards, i can control the stepper motor easily, all is working fine. But when i add the second control card, then no stepper motor works anymore - they both only vibrate instead of turning. When i remove the +5V pin that is wired to one of the two cards, then all work again… My guess is that the arduino can’t deliver enough current to the two cards simultaneously. The current for the arduino card is given only through a USB cable : could someone tell me if that is the problem and if i could resolve it by wiring a 7-12V DC current… Thanks for any idea

"The current for the arduino card is given only through a USB cable " So you've only got 500mA for 2 cards and the arduino. Sure sounds like you need more.

Get yourself a 5V wallwart and power the L298 IN PARALLEL with the arduino, instead of going thru the card.

Thanks CrossRoads,

I'll try that asap. With this configuration, do you think i could use up to 4 L298 in parallel ?

For 8 motors? Sure, as long as you have enough current available.

Thanks CrossRoads, that's a good news. But i'm still having a problem with controlling two motors I've made tests, and still it's not working :-( I've wired the arduino card to a 9V DC power that can deliver up to 1200mA : the problem still remains I've wired it to another DC power, trying several voltage, from 5V to 12V. This one could deliver up to 3A : but it's still not working. In both cases, the motors vibrate but don't turn. If i remove one motor, then everything works again, just like if the DC power was helpless. I can't figure out why. So, i was wondering : the arduino card needs to be connected to a PC with a USB cable even if i use a DC current (because datas are sent to the arduino). If the arduino card is connected both to a USB cable and a DC power, does it use the DC power ? Any idea is very welcome !

Do you have a voltmeter? Check the voltage from the power supply when the motors are "vibrating". If the program code is correct, and the motors are just "vibrating", there is probably not enough current provided by the power supply.

Hi SurferTim. Unfortunatly, i don't have a voltmeter. But I made some more tests. First, i discover that when DC power is used to feed the arduino, then its current can be used through the Vin Pin, while the 5V pin uses the current from the USB cable. Second, when i wire only one control card (ref : on the arduino using the 5V pin, everything works perfectly. BUT when wire the same card to the Vin Pin and a DC power with 7,5/9 or 12V (cand deliver up to 3A), the motor turns a little bit and then vibrate... And when i wire two cards on 5V pin, both motor vibrate... And when i wire the two cards on the Vin Pin nothing happens. Why does it work with 5V/500mA from USB and doesn't with more power ? that is really weird for me because everything looks like if the Vin Pin delivers less current than the 5V pin : it should be the opposite. I've tried with several DC power, and the result is the same. Thanks for any idea.

I don’t read French well, but I know a little of the L298. You must find the right pin on the circuit board.

The L298 has two “power supply” inputs. Vs and Vss.
Vs is the power supply to the motors.
Vss is the logic level reference. That should be 5v.

Well SurferTim, it's getting weirder and weirder ! Here is a link with an english description of the control card i use : I've made a test to control if the control card is correctly wired. I found than i inverted the connections, pluging the power supply of the motor in the Vss and the logic level reference in the Vs... so i corrected the wiring and... nothing works anymore ! So, when i connect correctly (as it is described by DFRobot) the control card to the two power supply Vs and Vss, the motor don't work. When i inverse the wiring, putting 5V in the Vss and motor power supply in the Vs then the motor works fine. I can't understand why. Maybe this is the source of my dual control card problem but i'm really not sure.

I really don’t care what the English version says either. :wink:
Vs is the motor power supply.
Vss is the logic reference.

I've tried to check the shield connections to see if the Vss of the L298 is connected to the VD output of the card and if the Vs of the L298 is connected to the VS of the card but i've not been able to check that. What's sure is that the constructor of the card precise that the Motor DC supply must be connected to the VS entry of the card and that the Logical supply must be connected to the VD entry of the card. Why i wire my card this way, it doesn't work, but when i inverse the wiring the motor works fine. So actually this not really problem. The problem is that when i connect two control cards and the arduino card is only powered with a USB cable, the motors don't work anymore. I've tried to add a DC power to the arduino (made tests with 7,5V 9V and 12V, up to 3A), and i wired the control card to the Vin of the arduino : doesn't work too. I then tried to wire the control card to the 5V : doen't work too. Actually it only works when there is only one control card connected to the arduino and when the logical entry of the control card is connected to 5V of the arduino card. I can't figure out what is problem, very frustating :0

I just looked at the board, not the specs. Did you remove the jumper from the pins marked “VD=VS”? It appears that board has an onboard regulator for the digital supply. If you are using less than 12v for the Vs, leave the jumper on and disconnect any power supply to VD.

But insure the ground is connected to the Arduino ground!