Step motor + Easy Driver + Arduino not working

Hi.

So, I have an Arduino Ethernet R3 board, an Easy Driver v4.4, a step motor Mitsumi M42SP-4N and a 24V charger.

Everything connected following this diagram

I used the example codes from Arduino and others, being the latest one

#define DIR_PIN 2
#define STEP_PIN 3

void setup() { 
  pinMode(DIR_PIN, OUTPUT); 
  pinMode(STEP_PIN, OUTPUT); 
} 

void loop(){ 

  //rotate a specific number of degrees 
  rotateDeg(360, 1); 
  delay(1000);

  rotateDeg(-360, .1);  //reverse
  delay(1000); 


  //rotate a specific number of microsteps (8 microsteps per step)
  //a 200 step stepper would take 1600 micro steps for one full revolution
  rotate(1600, .5); 
  delay(1000); 

  rotate(-1600, .25); //reverse
  delay(1000); 
}



void rotate(int steps, float speed){ 
  //rotate a specific number of microsteps (8 microsteps per step) - (negitive for reverse movement)
  //speed is any number from .01 -> 1 with 1 being fastest - Slower is stronger
  int dir = (steps > 0)? HIGH:LOW;
  steps = abs(steps);

  digitalWrite(DIR_PIN,dir); 

  float usDelay = (1/speed) * 70;

  for(int i=0; i < steps; i++){ 
    digitalWrite(STEP_PIN, HIGH); 
    delayMicroseconds(usDelay); 

    digitalWrite(STEP_PIN, LOW); 
    delayMicroseconds(usDelay); 
  } 
} 

void rotateDeg(float deg, float speed){ 
  //rotate a specific number of degrees (negitive for reverse movement)
  //speed is any number from .01 -> 1 with 1 being fastest - Slower is stronger
  int dir = (deg > 0)? HIGH:LOW;
  digitalWrite(DIR_PIN,dir); 

  int steps = abs(deg)*(1/0.225);
  float usDelay = (1/speed) * 70;

  for(int i=0; i < steps; i++){ 
    digitalWrite(STEP_PIN, HIGH); 
    delayMicroseconds(usDelay); 

    digitalWrite(STEP_PIN, LOW); 
    delayMicroseconds(usDelay); 
  } 
}

just to make the motor move, but nothing happens. It’s like no energy is going to the motor.

I have no more ideas in what to try more. Any suggestion?
(And yes, I am new in this, so it might be something really really simple)

Before you try to debug all that code, can you prove to yourself that you can step the motor at all to check your wiring?

A simpler sketch would help, or perhaps this: https://www.sparkfun.com/tutorials/400

If you have the motor M42SP-4NK, it has 5.5 ohm windings and a current limit of 400 mA/winding. You need to set the motor current in the EasyDriver properly, or the motor will overload the power supply and motor driver, which shuts everything down.

Are the jumpers all set correctly? - you have to not be in sleep mode or reset, and ensure there's a 5V rail...

wildbill:
Before you try to debug all that code, can you prove to yourself that you can step the motor at all to check your wiring?

A simpler sketch would help, or perhaps this: Stepper Motor Quickstart Guide - SparkFun Electronics

I tried that one and it’s not working either. Actually that was the first set of code I tried.

jremington: That might be an option, precisely because I didn’t really understand that :x I just went for the voltage and maximum mA on the charger. And I don’t understand what you are saying, sorry.

MarkT: I’m quite sure it is. Followed the diagrams and when it didn’t work, I started to switch them in hope that there could be some difference to the diagram.

Edit: I have another motor (Pololu 1207), and I also can’t make it work.

I’m wondering if it’s something with the easy driver.

I'm wondering if it's something with the easy driver.

I'm wondering if it needs 5V to the lower left corner to drive the logic

JimboZA hit the nail on the head. You have motor voltage on the driver but no logic voltage. Two more jumper wires and you should be in business.

picolero: JimboZA hit the nail on the head. You have motor voltage on the driver but no logic voltage. Two more jumper wires and you should be in business.

Actually no. Check the data sheet - that's a supply you can use for other things.

This simple code works with a Pololu A4988 driver and should work with your board - provided you make the step and dir pins match your wiring.

// testing a stepper motor with a Pololu A4988 driver board
// on an Uno the onboard led will flash with each step
// as posted on Arduino Forum at http://forum.arduino.cc/index.php?topic=208905.0

byte directionPin = 9;
byte stepPin = 8;
int numberOfSteps = 50;
byte ledPin = 13;
int pulseWidthMicros = 50;  // microseconds
int millisbetweenSteps = 50; // milliseconds

void setup() 
{ 

  Serial.begin(9600);
  Serial.println("Starting StepperTest");
  digitalWrite(ledPin, LOW);
  
  delay(2000);

  pinMode(directionPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  
 
  digitalWrite(directionPin, HIGH);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseWidthMicros);
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
  
  delay(3000);
  

  digitalWrite(directionPin, LOW);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseWidthMicros);
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
  
}

void loop() 
{ 

}

…R

This is my first project with an arduino.
I’ve tried two ways to get my Arduino uno working with this easy driver and stepper motor:

I’ve been trying the first and second examples. Stepper motor steps but doesn’t stop. Tried increasing “delayMicroseconds(100);” values to 1000 and changing the “if (Distance == 3600)” all the way down 4. No effect on the motor. Motor turns continuously until easy driver power supply is terminated. “L” and “on” light on arduino uno still on after easy drive powers down.

For this one, I have the power hooked up to my variable power supply. is 1A enough current?
No motor stepping.

Can someone help me out with getting one of these working?

Bpgoss1: This is my first project with an arduino. I've tried two ways to get my Arduino uno working with this easy driver and stepper motor:

Did you read all the earlier posts in this Thread about wiring your motor? Did you try the very simple the code I posted in Reply #8?

Do you have a real sparkfun Easydriver - if not post a link to the datasheet for the driver you do have? Post a link to the datasheet for your motor. Post a photo of a drawing showing exactly how you have everything connected - not a photo of your project

...R

Robin2:
This simple code works with a Pololu A4988 driver and should work with your board - provided you make the step and dir pins match your wiring.

// testing a stepper motor with a Pololu A4988 driver board

// on an Uno the onboard led will flash with each step
// as posted on Arduino Forum at http://forum.arduino.cc/index.php?topic=208905.0

byte directionPin = 9;
byte stepPin = 8;
int numberOfSteps = 50;
byte ledPin = 13;
int pulseWidthMicros = 50;  // microseconds
int millisbetweenSteps = 50; // milliseconds

void setup()
{

Serial.begin(9600);
  Serial.println(“Starting StepperTest”);
  digitalWrite(ledPin, LOW);
 
  delay(2000);

pinMode(directionPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(ledPin, OUTPUT);

digitalWrite(directionPin, HIGH);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseWidthMicros);
    digitalWrite(stepPin, LOW);
   
    delay(millisbetweenSteps);
   
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
 
  delay(3000);

digitalWrite(directionPin, LOW);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseWidthMicros);
    digitalWrite(stepPin, LOW);
   
    delay(millisbetweenSteps);
   
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
 
}

void loop()
{

}




The digitalWrite on ledPin will add delay to the frequency. On my 200 step stepper through a4988 module I must use a longer delay or I get no motor response.
Try removing the led digitalWrite line of code and set pulesWidthMicros to 445 and change delay(millsbetweenSteps) to delayMicroseconds(millsbetweenSteps) and set to 880. For me it moves the motor. Changing the delay between pin HIGH and pin LOW will change the motors efficiency and direction. (No dir pin required.)
This issue may be related to power input. I am using 12v @ 350mh and the digitalWrite moves the motor but the step function doesnt.

I used 12 vcd and it works perfectly!