[help driver step motor] homemade arduino mega 2560?

My motor is this http://www.wantmotor.com/ProductsView.asp?id=155&pid=80 (the second in the tab).
I have arduino mega 2560 and i want realize a driver to pilot this the step motor.

This is my sketch:

int motore1D = 30;
int motore2D = 31;
int morore3D = 32;
int motore4D = 33;

void setup() {
pinMode(30,OUTPUT);
pinMode(31,OUTPUT);
pinMode(32,OUTPUT);
pinMode(33,OUTPUT);
}
void  loop() {
  digitalWrite(30, HIGH);
  digitalWrite(31, LOW);
  digitalWrite(32, LOW);
  digitalWrite(33, LOW);
  delay(10);
  digitalWrite(30, LOW);
  digitalWrite(31, HIGH);
  digitalWrite(32, LOW);
  digitalWrite(33, LOW);
  delay(100);
  digitalWrite(30, LOW);
  digitalWrite(31, LOW);
  digitalWrite(32, HIGH);
  digitalWrite(33, LOW);
  delay(100);
  digitalWrite(30, LOW);
  digitalWrite(31, LOW);
  digitalWrite(32, LOW);
  digitalWrite(33, HIGH);
  delay(100);
  return;
}

Who can help me to do the electronic part? :smiley:

Have you looked at the circuits in the Reference section on the Stepper library?

There are several sample circuits shown there.

Please read forum rules . Use CODE TAGS toolbutton [</>]. Highlight the code , click codetags button , then SAVE.

Yes, but i would realize it with a transistor or a opamp.

Neither a transistor nor an opamp will run a stepper motor correctly. The examples here use a darlington array (a group of double transistors) or one of two H-bridge chips. You might do better looking for a dedicated stepper motor driver, like these, these or this, than building one from scratch. Of course, building your own is a good lesson in electronics and frustration control.

I believe the part raschemmel was referring to was that you need to put your code in tags. As it is, it's difficult to read, and unwanted bbcode translations may appear.
[whoops - you did that while I was typing. Thanks!]

In order to be bidirectional a stepper driver requires one H- bridge for each coil.

So, how can I resize or choose the components for the motor?

I'm sorry to be the one to tell you this but the questions you ask suggest you lack the experience to implement a DIY driver. Order something online.
I believe you have been given suggestions.

Use an L293D, is engoght for this motor ( 12V 0,4A per Coli)

Bye Uwe

The second motor appears to be 4-wire, 30 ohm, 0.4A - is that correct?

Why choose that version? Its the least sensible combination - 4-wire and high impedance.

Normally you would choose 5, 6 or 8 wire high-impedance motor, or 4, 6 or 8 wire low-impedance
motor if you wanted performance (more than 150rpm or so) or microstepping.

For low-performance a 5-wire unipolar motor is very simple to drive, an ULN2803 or similar is all you
need.

4-wire low-impedance motor driven from a chopper driver like the DRV8825 will give much more
speed and torque-at-speed.