I've just bought this shield : http://www.zartronic.fr/module-contrôleur-de-moteur-2a-l298-p-43.html
I'm trying to control a bipolar stepper with a 1200mA and 9V external power source. I've wired Coil 1 to M1+/- outputs of the shield, and coil 2 to M2+/-. When i load the "Stepper_onerevolution" sample from arduino's sketch, the motor doesn't move but just makes vibrations... i've tried several other sketch found on the web, and the result is always the same... and i can't figure out why =(
So now, i don't know if the problem comes from my wiring or from the sketch. If anyone has an idea, it would help a lot. Thanks
Edit : i've made some more tests, and the motor seems to make one step in a direction, then the next one in the other direction. I've tried to wire the motor in other ways, but still the same result. I then tried to wire the shield in other ways to the arduino, but nothing new. I'm beginning to think that the problem comes from the sketch.
My arduino (Mega2560) is connected to the shield in this way : pin 8 -> E1 ; pin 9 -> M1 ; pin 10 -> E2 ; pin 11 = M2. I've made a little schematic of it - i don't really know what you are calling J3 & J4. Here's a picture of the shield with all the informations about my wiring :
Weirdly, the Motor1 status LED is blinking (and i can hear the motor vibrating) while the Motor2 status LED is always on. I'm using the "Stepper_onerevolution" of the arduino's IDE for my tests. Thanks a lot for helping me.
I think the two E pins are the Enable pins and the two M pins are the Direction pins. The Stepper class appears to not be designed to use Enable signals, so it only uses 2 output pins if you are driving a unibipolar stepper (as you are). I think you need to connect the two E pins to +5v and the two M pins to Arduino outputs, and use the 3-argument version of the Stepper constructor instead of the 5-argument version.
MANY TANKS DC42 : you were right. It now works perfectly ! My final goal is to control the motor with half steps but i believe this can't be done with only two pins connected to the arduino. Do you think that this is possible with this shield and a 4 wiring configuration ? Many, MANY thanks again
Yes, I think that should be possible, but not with the Stepper class in the library. Here is the sequence of inputs I think you need to generate (1 = high, 0 = low, x = don't care):
E1 M1 E2 M2
1 0 0 x
1 0 1 0
0 x 1 0
1 1 1 0
1 1 0 x
1 1 1 1
0 x 1 1
1 0 1 1
OK, so i can even let my wiring as it is - so cool ! Which also means that i can control many step motors with a Mega2560. That makes many good news !!! i'll try to program that sequence asap. Thanks again for your precious help.