How to connect the stepper

I want to use the following stepper: 103-h7123-0140
2019-11-26_16h31_30

Can you tell me where I have to connect orange/blue and red/yellow and if the polarity matters?

I tried the testcode but the axis isn’t turning, but vibrating instead…

These seem like the correct combo
Connect orange/blue to the A port and connect red/yellow to the the B port
Try switch the wires on the B port

I tried it but it is not working. What else can be the problem here?

Can you tell me the type of stepper you used for testing your shield and how you connected it?

Another question about the LED’s on the shield: They are bicolor (green/red) but what should they indicate? Sometimes it is a mix of both colors, and sometimes they light up green. I have no idea what this should tell me and I couldn’t find a description.

The Leds indicate which port is active and in which direction it flows.
Can you post your sketch?
Maybe a picture of your setup?

2019-11-27_14h56_07

I connected a laboratory power supply at the external Power Input (24V)

I used the KA03_example_code.ino delivered by Velleman

int pwm_a = 3; //PWM control for motor outputs 1 and 2
int pwm_b = 9; //PWM control for motor outputs 3 and 4
int dir_a = 2; //direction control for motor outputs 1 and 2
int dir_b = 8; //direction control for motor outputs 3 and 4

void setup()
{
pinMode(pwm_a, OUTPUT); //Set control pins to be outputs
pinMode(pwm_b, OUTPUT);
pinMode(dir_a, OUTPUT);
pinMode(dir_b, OUTPUT);

analogWrite(pwm_a, 100); //set both motors to run at (100/255 = 39)% duty cycle (slow)
analogWrite(pwm_b, 100);

}

void loop()
{
digitalWrite(dir_a, LOW);
digitalWrite(dir_b, LOW);

analogWrite(pwm_a, 50);
analogWrite(pwm_b, 50);

delay(1000);

analogWrite(pwm_a, 0);
analogWrite(pwm_b, 0);

delay(1000);

analogWrite(pwm_a, 150);
analogWrite(pwm_b, 150);

delay(1000);

analogWrite(pwm_a, 0);
analogWrite(pwm_b, 0);

delay(1000);

analogWrite(pwm_a, 255);
analogWrite(pwm_b, 255);

delay(1000);

analogWrite(pwm_a, 0);
analogWrite(pwm_b, 0);

delay(5000);

digitalWrite(dir_a, HIGH);
digitalWrite(dir_b, HIGH);

analogWrite(pwm_a, 50);
analogWrite(pwm_b, 50);

delay(1000);

analogWrite(pwm_a, 0);
analogWrite(pwm_b, 0);

delay(1000);

analogWrite(pwm_a, 150);
analogWrite(pwm_b, 150);

delay(1000);

analogWrite(pwm_a, 0);
analogWrite(pwm_b, 0);

delay(1000);

analogWrite(pwm_a, 255);
analogWrite(pwm_b, 255);

delay(1000);

analogWrite(pwm_a, 0);
analogWrite(pwm_b, 0);

delay(5000);

}

The code is designed for DC motors.
Here is a link with a tutorial for stepper motor


How can I connect the input pins of the IC to the digital I/O? For Input 1 and 3 I can use a Jumper wire since the headers don’t have the right pins. But for input 2 and 4?

These are the jumpers on the shield
image
image
based on your picture
DIRB = 8
PWMB = 9
DIRA = 2
PWMA = 3
Here’s another example code
https://www.arduino.cc/en/Tutorial/StepperOneRevolution

to the first example:
I shall connect Input1(L298) to digital Pin 8 arduino, which is DIRA on your shield, but the available Pins are 2,4,7. And input3 (DIRB)should go to digital Pin 9 Arduino, where I have pin 8,12,13.
I can work around this with cables and connect them to the arduino directly.

but how can I connect Input2(DIRA2) and Input4(DIRB2) to the arduino?

to the 2nd example:


same pins here…

Please checkout the schema


The pins you select are the arduino pins

Based on the shunts you change the numbers in the code

but I don’t have a header for DIRA2 and DIRB2

On the picture is see them mounted
image

These headers are DIRA DIRB and ENA ENB

where is the DIRA2 and DIRB2 header?

DIRA2 = DIRA and also for B
There is just a transistor between them


you can see that I have to connect the 4 Inputs of the L298 to Arduino digital pins

In your schematic I only connect 2 of the inputs (DIRA and DIRB) to the arduino digital pins. DIRA2 and DIRB2 have no connection to the arduino

2019-11-28_09h48_54
but the stepper library needs 4 pins

do you see the problem?

The other 2 are ENA and ENB
Also i found this library:


Maybe you can give it a try