Stepper motor connections.... plz help

Hello, its first time i get on this forum, i just bought arduino mega 2560. i was wondering how can drive stepper motor using it, i bought easy driver as well. i found code on arduino site "http://www.arduino.cc/en/Tutorial/StepperBipolar " but they using ULN2003A driver, is anybody has an ideal how can i use the same program but with the easy driver which is in the website "http://www.trossenrobotics.com/easydriver-v3-stepper-motor-driver.aspx?relatedid=1261". thanks alot. i need pic of how to connect the wires.

You wouldn't use the sketch from that tutorial with the Easy Driver module.
Instead, you send step pulses to "Step", to change the speed, it's like a clock pin; you change direction by taking "Dir" high or low.
It has a lot of other control pins, most of which could be "hard-wired" high or low if on-the-fly configurability isn't needed.

Your Trossen link is titled having something to do with a "V3", but it directs to a page featuring the "V4".
Other than "Step" and "Dir", the "V3" has none of the features of the "V4".

first of all, thanks alot for ur help. i found drawing that could help me but i dont know if it will work with my program that i got from the link i showed you. the drawing in the attachment. i wonder if that is the connection that would work. the only thing is the program use 4 pins in this drawing it used 2 pins , i wish u understand me. i wish that you can help me with that.

Stepper-Motor-Arduino-v1-460x311.jpg

That drawing looks like it is for the Version 3.
Not much to it.
The ATX power supply might be "over-kill".

the only thing is the program use 4 pins in this drawing it used 2 pins... i wish u understand me

I think I understand you.
But which "program"? Don't use the sketch from the tutorial, that is for a different situation (different set-up).

Your sketch should simply:
Make "DIR" HIGH or LOW (that determines the direction of rotation)

Pulse the Step pin to make the motor advance.
I suppose that something like this

void motor_go ()
{  
   for (int spin = 0; spin < 20; spin ++)
   {
     digitalWrite(step_pin, HIGH);
     delay (100);   // try different values
     digitalWrite(step_pin, LOW);
     delay (500);   // try different values
   }
}

will make it "go".


I am not sure whether the Easy Driver needs 5V from the Arduino.
The drawing does not show a connection, but I am not so convinced.
I'm guessing that it may.

thanks alot for the simple program, but i wonder how can i connect the easy driver with the stepper motor. because im sure that arduino will burn right away if i try to run the stepper motor from the board, so i need to use the easy driver. how can i connect the 3 devices together. also regard the program, what is the difference between the program in this link "http://www.arduino.cc/en/Tutorial/StepperBipolar " and the program you wrote for me

Do you have an Easy Driver (which version) or are you just planning on getting one?

remo0101:
i wonder how can i connect the easy driver with the stepper motor. because im sure that arduino will burn right away if i try to run the stepper motor from the board, so i need to use the easy driver. how can i connect the 3 devices together.

By 3 devices you mean: Arduino, Easy Driver, and stepper motor?
If so, the drawing that you posted shows how.

remo0101:
what is the difference between the program in this link "http://www.arduino.cc/en/Tutorial/StepperBipolar " and the program you wrote for me

The sketch in the tutorial is meant to be used with a darlington driver for its output section. The sketch generates the Gray code series for energising the stepper coils in turn right.
The IC on the Easy Driver board does that "Gray coding" for you - all it needs is a pulse to advance to the next step (faster pulse rate = faster rotation). That is what puts the Easy in Easy Driver.

i have the easy driver already which in this link "http://www.trossenrobotics.com/easydriver-v3-stepper-motor-driver.aspx?relatedid=1261", yes i meant by the 3 devices stepper motor, board and easy driver, but the drawing shows that im using 2 pins which are 4,and 5, i thought we need to use 4 pins. also regard your program, how can i include that in my code. cuz i have long pogram, what should be introduce to make ur program work, and is your program let me stop the stepper motor after specific time !!! finally, thanks so much.

You are right, the V4+ does have more pins.
I'm supposing, now, but the extra connections for the enhanced features are likely pulled high (or low) as default. So, not connecting them ought not to result a catastrophe.

I can't say how you should include this or that into your existing sketch. As I see it, you should try to get the Easy Driver (etc.) working on its own and get a firm understanding of it.

Have your tried

? ? ?

so away of connection, what is my program from A to Z if i want to let the stepper motor run for t time , or for a specific angle !!!!!! plz help me with that

Most of that you'll have to hammer out yourself. Take ownership.
This sketch should start you down the "Road of Discovery".
The motor runs slowly for 4 seconds or so, takes a break, runs quickly for 4 seconds, takes a another break, and starts the process over again.

/*
    easy driver 
    demo sketch
    Step pin connects to
    Arduino pin D2
*/    
    
byte step_pin = 2;  // pin alias

void setup()
{
  pinMode (step_pin, OUTPUT);
}

void loop ()
{  
   // speed 1
   for (int spin = 0; spin < 40; spin ++)
   {
     digitalWrite(step_pin, HIGH);
     delay (2);   // try different values
     digitalWrite(step_pin, LOW);
     delay (100);   // try different values
   }
   delay (1000);   // pause 1 sec
   
   // speed 2
   for (int spin = 0; spin < 80; spin ++)
   {
     digitalWrite(step_pin, HIGH);
     delay (2);   // try different values
     digitalWrite(step_pin, LOW);
     delay (50);   // try different values
   }
   delay (1000);   // pause 1 sec
}

changed values of "spin"

http://bildr.org/2011/06/easydriver/

http://garagelab.com/profiles/blogs/tutorial-stepper-motor-easy-driver-arduino