bbence:
Hi,
I have bought a dual motor contoller around a year ago but have not really used it much recently. Something like this:
http://viewitem.eim.ebay.hu/Arduino-2A-High-Power-Hbridge-Dual-Motor-Controller/150558006669/item
Today I started playing with it.
First I have tried powering from the 5V coming from the Arduino (there's a jumper setting for it). It worked pretty fine.
(BTW I have tried with the sketch that is also
on the ebay site.)
It would be helpful if we could see how you hooked it up exactly; the diagram on the ebay page seems straightforward, though. So I take it you set the jumper on the L298 board for 5 volts, and hooked the Arduino's regulated 5V output (5V pin) to VD (logic) on the L298 board? What did you hook up to VS (motor power) on the L298 board to drive the motors? That pin should be hooked up (likely) to a source of voltage about 2 volts higher than VD (according to the documentation on the L298 - you do have a copy of the datasheet and have read it, right?).
bbence:
After I have tried powering from an external power source (an 12V, 500ma charger), then it stopped working (I'm pretty sure I have connect the right wires :)).
Did you also change the jumper?
Based on what I can see from that page - there is a jumper that, when jumped (connected), means "VS=VD"; in other words, the voltage that you apply to VS for motor power, is routed to the 5 volt regulator on-board the L298 driver board. When it isn't connected, it means that you need to supply an external source of power to VD (logic) separate from VS (motor); whether this goes thru the on-board regulator or not is unclear (you'll want to figure this out). Likely it does; if so, then this voltage needs to be about 7 volts or more so that the regulator will work.
bbence:
What is strange, that there are leds on the shield indicating both the power and the direction. And the power leds are fading as the Arduino PWM pin sends different signals. So it looks like at at least some parts of the shield is working.
But the motors are not moving. I also tried the board standalone (there are jumpers that can control the motors independently).
Also does not work.
Both motors can be powered from a power supply easily, so it's not the motors.
If you are only using 5 volts for both motor and logic to the L298 board, that will not work at all, which may be what you are experiencing. Try this:
- Set the board up as "standalone" mode - no Arduino connected.
- Set the jumper to "VS=VD", and apply a 9V supply to VS.
- See if you can control the motors in "standalone" mode
I say use a "9V" supply, because the voltage regulator used on that board may or may not be a low-dropout regulator (probably not), and dropping 7 volts for the 5 volt logic needed is going to heat that thing up; whether that is good or bad is debatable, it depends on how well it is heatsinked, etc. Dropping only 4 volts with a 9 volt source is more reasonable.
In "standalone" mode, you need to apply a source of regulated 5 volts (to simulate logic level HIGH) to the E1/E2 (enable) and M1/M2 (motor) pins - if you use anything higher, you stand the risk of burning out the inputs to the L298 (how did you control the standalone mode before? maybe this is your issue?).
Once you have things working in "standalone mode", then we can proceed to hooking up the Arduino - provided your controller still works, of course.
bbence:
Could I have fried my motor controller? If yes, can I find out, which part? Is it easy to repair or should I get a new one (I have basic soldering skills)?
Yes - you could have - but without knowing or understanding how you actually hooked it up, nor without understanding the circuit being used (ie - how the controller PCB is hooked up - it's schematic/parts - on these cheap chinese knockoffs, it is always best to try to get a schematic, or barring that, reverse engineering one - before you start to play with it) - who really knows?
So, instead - you need to start with the basics of control, without the Arduino in the loop - to determine what, if anything, is wrong. If there is a part that is broken, it is likely to be one of three parts on the board:
- The L298 - which is a thru-hole part, and fairly easy to replace, if you know how to desolder such a part
- The on-board voltage regulator - which doesn't look as easy, because it is an SMT part - but it is doable with a steady hand and some tweezers
- The 14-pin SMT IC near the power connector - which is some kind of 74HCxxx part (?) - and I have no idea what it is for or why
Now - I have no idea what currency that auction is in, but I do know that these kinds of driver boards typically run from $5.00 USD to $20.00 USD; you might find it much easier (and cheaper) to simply replace the board, than trying to source the above components and replacing them (after running diagnostics to determine what works and what doesn't).