Hi, I've got a cheap 28BYJ-48 5V stepper motor, I'm using a driving board with a ULN2003 IC to drive it. For whatever reason this thing only turns counter-clockwise. Here's my code:
#include <Stepper.h>
// These are probably wrong
// The motor spins slightly less than one full revolution
int steps = 64;
int gearReduction = 32;
int totalSteps = steps * gearReduction;
Stepper stepper1(totalSteps, 2, 3, 4, 5);
void setup() {
stepper1.setSpeed(10);
Serial.begin(9600);
}
void loop() {
stepper1.step(totalSteps);
delay(2500);
stepper1.step(-totalSteps);
delay(2500);
}
The pins on the driving board (IN1, IN2, IN3, IN4) are connected to pins 2, 3, 4, 5 on my Arduino Mega in that same order.
The most commonly recommended solution here in the forum is to swap the IN2 and IN3 pins to get it working, but this does not work for me. I also tried a bunch of different pin orders to no avail. Most different orders result in the motor not rotating at all or just stuttering in place.
I tested the resistance between each of the 5 motor wires (represented as ABCDE) these are the results:
A-E 23ohms
C-E 23ohms
A-C 46ohms
No connections on B and D
I don't know enough about stepper motors to draw any conclusions from this. I think that the E wire is the +V common, I don't know about the other ones, are the A and C wires the on the same phase? Shouldn't I see a connection between wires B& D? Or between those and the common?
Something interesting that I noticed is that if I hold the motor shaft just as it starts rotating the motor stops and changes direction.
I also tried slowing down the motor to the point that I can see the LEDs on the driving board blinking, the motor still only turns in one direction. The LEDs blink in the same order defined in the Stepper library:
* The sequence of control signals for 4 control wires is as follows:
*
* Step C0 C1 C2 C3
* 1 1 0 1 0
* 2 0 1 1 0
* 3 0 1 0 1
* 4 1 0 0 1
When the motor is supposed to be running in reverse the LEDs also blink in the reverse order.
The motor only moves on every other step. I don't now whether this is normal.
That's all. I hope you guys can help me.
Sorry for my awkward usage of the english language. Any feedback would be appreciated.

