Playing with Arduino, h-bridge and 6 lead bipolar stepper motor

Story

OKI_stepper_24V

Months ago I ripped some stepper motors out of a old printer and had an idea about building either a plotter or a CNC machine. After some snooping around the internet I found out that if I want to drive a stepper motor without burning my Arduino I need either some transistors or an h-bridge(s). I also noticed that my only 24V power supply does not have enough amperage so I had to use a 12V xbox 360 power supply and it worked fine. I also had to learn the difference between unipolar and bipolar stepper motors.

Unipolar and bipolar stepper motors explained by Microchip: http://www.youtube.com/watch?v=vxxnPJBxG3M

Tools / Parts I used:

  • Couple of SN754410NE QUADRUPLE HALF-H DRIVER
  • OKI 24V 7.7Ohm 6 lead 7.5DEG./STEP Stepping motor (2VA4M10054-) from an old printer
  • XBOX 360 power supplySN754410NE
  • Arduino UNO R3
  • Prototype shield v.5

SN754410NE Datasheet: http://www.ti.com/lit/ds/symlink/sn754410.pdf

stepper_and_arduinoI connected the power supply (12V 14.2A) to Vcc2 / pin 8, Arduino 5V and power supply trigger to Vcc1, Arduino Digital pins 0-3 to A1-A4 and on second chip 4 to A1 and 5 to A2. The same goes with the stepper motor and Y pins.

Test code

int motorPin1 = 0;
int motorPin2 = 1;
int motorPin3 = 2;
int motorPin4 = 3;
int motorPin5 = 4;
int motorPin6 = 5;
int delayTime = 500;

void setup() {
  pinMode(motorPin1, OUTPUT);
  pinMode(motorPin2, OUTPUT);
  pinMode(motorPin3, OUTPUT);
  pinMode(motorPin4, OUTPUT);
  pinMode(motorPin5, OUTPUT);
  pinMode(motorPin6, OUTPUT);
}

void loop() {
  digitalWrite(motorPin1, HIGH);
  digitalWrite(motorPin2, LOW);
  digitalWrite(motorPin3, LOW);
  digitalWrite(motorPin4, LOW);
  digitalWrite(motorPin5, LOW);
  digitalWrite(motorPin6, LOW);
  delay(delayTime);
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, HIGH);
  digitalWrite(motorPin3, LOW);
  digitalWrite(motorPin4, LOW);
  digitalWrite(motorPin5, LOW);
  digitalWrite(motorPin6, LOW);
  delay(delayTime);
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, LOW);
  digitalWrite(motorPin3, HIGH);
  digitalWrite(motorPin4, LOW);
  digitalWrite(motorPin5, LOW);
  digitalWrite(motorPin6, LOW);
  delay(delayTime);
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, LOW);
  digitalWrite(motorPin3, LOW);
  digitalWrite(motorPin4, HIGH);
  digitalWrite(motorPin5, LOW);
  digitalWrite(motorPin6, LOW);
  delay(delayTime);
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, LOW);
  digitalWrite(motorPin3, LOW);
  digitalWrite(motorPin4, LOW);
  digitalWrite(motorPin5, HIGH);
  digitalWrite(motorPin6, LOW);
  delay(delayTime);
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, LOW);
  digitalWrite(motorPin3, LOW);
  digitalWrite(motorPin4, LOW);
  digitalWrite(motorPin5, LOW);
  digitalWrite(motorPin6, HIGH);
  delay(delayTime);
}
Advertisements
This entry was posted in Arduino, Stepper motor. Bookmark the permalink.

2 Responses to Playing with Arduino, h-bridge and 6 lead bipolar stepper motor

  1. muhim says:

    What is the holding torque and speed torque of your oki stepper motor?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s