Go Down

Topic: how to control a stepper with step and drivers (Read 1 time) previous topic - next topic


hi all, i just have a new driver but this driver uses 3 pin command, so i cant find any reference yet, the pins are, STEP, DIR and ENABLE...

for now i just want and easy code just to guide me, if anyone can help me please


You could use the third-party AccelStepper library:
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp


the matter its not the lib, its just that i dont know how to connect and run the driver using step and dir


Enable needs to be pulled either High  (5V) or Low(5V) to enable the device.
If DIR is low(0V) the motor will rotate 1 direction, if DIR is High(5V) it will rotate the other direction.
Every time STEP goes from either High(5V) to Low (0), or Low(0v) to High(5v) (It will be one combination or the other, but not both. the motor will move 1 step.

The reason I am a little vague here is that I don't know wheter the Enable is active High or active low. Active Low is generally a safe bet for Enable and STEP. If you have the controller connected to the motor and power it up, when the motor is anabled it will be much harder to turn by hand as the coils are then energized.



If the enable is active low then I would assume that step is also an active low signal. To make 1 step you take the STEP pin to 0v and then return it to 5v. Every time that cycle is repeated the motor will take 1 step.

DIR will be either 5V or 0V depending on direction.


im using this code but the stepper doesnt move

Code: [Select]
#define MI_PIN_STEP 8
#define MI_PIN_DIR 9
#define MI_PIN_EN      10

void setup()
  //Wire.begin ();
  Serial.begin ( 57600 );
  pinMode ( MI_PIN_STEP, OUTPUT );
  pinMode ( MI_PIN_DIR, OUTPUT );
  pinMode ( MI_PIN_EN, OUTPUT );

  digitalWrite ( MI_PIN_EN, HIGH );

void loop()
  digitalWrite ( MI_PIN_EN, LOW );
  digitalWrite ( MI_PIN_DIR, HIGH );
  //digitalWrite ( MI_PIN_DIR, LOW );
  // Step
  digitalWrite ( MI_PIN_STEP, LOW );
  delay ( 100 );
  digitalWrite ( MI_PIN_STEP, HIGH );

  delay ( 200 );


Perhaps you are wrong and the ENABLE is not active-low.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131