My stepper always turning same direction.

?m using this stuff :
http://www.ebay.com/itm/2PCS-DC-5V-Gear-Stepper-Step-Motor-with-ULN2003-Driver-Board-4-Phase-28YBJ-48-/290758877302?pt=LH_DefaultDomain_0&hash=item43b2946076

i tried it last week and there was no problem.

And i have very simple codes. I just want to turn it cw and ccw. But it only turns cw.
Here is my codes :

#include <Stepper.h>

#define STEPS 100

Stepper stepper(STEPS, 9, 10, 11, 12);

void setup()
{
  
  stepper.setSpeed(30);  
}

void loop()
{
  stepper.step(-100);
  delay (1000);
  stepper.step(-100); 
  delay(1000);
}

in addition i tried

#include <Stepper.h>

#define STEPS 100

Stepper stepper(STEPS, 9, 10, 11, 12);

void setup()
{
  
  stepper.setSpeed(30);  
}

void loop()
{
  stepper.step(-1); 
}

And

#include <Stepper.h>

#define STEPS 100

Stepper stepper(STEPS, 9, 10, 11, 12);

void setup()
{
  
  stepper.setSpeed(30);  
}

void loop()
{
  stepper.step(1); 
}

it always steps same direction.
i checked my connections many times what should i do?

Try this one:

#include <Stepper.h>

#define STEPS 4096

Stepper stepper(STEPS, 9, 10, 11, 12);

void setup()
{
  stepper.setSpeed(10);    // One revolution every six seconds
}

void loop()
{
  stepper.step(4000);  // Turn one way
  delay (1000);
  stepper.step(-4000);  // Turn the other
  delay(1000);
}

The specs seem to indicate a 64 step stepper with 1:64 gearing resulting in 4096 steps per revolution.

it didn't work again. motor locked i think 4069 is too much.
I changed the connections like

Stepper stepper(STEPS, 12, 11, 10, 9);

result is same.
i upgraded version of my IDE (maybe its about library)again same.

is there a problem about ULN 2003?

Can you show exactly how its connected up? Have you checked with a multimeter that each of the 4 outputs is switching?
(program it to turn extremely slowly, 1 step / second or so)

What makes you think the phase-order is 9,10,11,12? Are you guessing? Have you tried 9,11,10,12 or 9,10,12,11 ?

I'm wondering whether one of the 4 phases is not working, perhaps because of a bad connection. When you turn it cw with individual steps, can you see the motor moving on each step?

uln2003 driver board have already four leds and i can follow the lights. every phase working properly but even i change the code leds lighting same order. i think the driver chip(uln2003) can be broken. because there is no problem at connections , i connect the cables correct as tutorial. other codes working good like blink(for pin9 10 11 and 12) so it seems like i ruined the uln2003 but i don't konw how :smiley:

i will buy a driver chip tomorrow when i solve the problem i will write

Rather than guess if the ULN2003 is broken use a multimeter on the outputs. Then you'll know.

I have that same stepper and driver board. Connect arduino pins 8, 9, 10, 11 to In1,In2, In3 and In4. Then code as:
Stepper stepper(STEPS, 8, 10, 9, 11);

Bob Weber

1 Like