Unipolar Stepper Motor
Identify a stepper motor by rotating its center shaft. If you can feel tiny pulses or clicks, you have a stepper motor. Now count the number of wire leads connected to your motor. If the motor has 5 or 6 wire leads, it is a unipolar stepper motor. If it has four wire leads it is a bipolar stepper motor. The circuit below is for a unipolar stepper motor. See this page for a good explanation of the difference between a unipolar and a bipolar stepper motor.
A stepper motor is the best motor to use for timing, or for a project involving gears. Each rotation is a controlled number of clicks therefore it is known for its accuracy.
Note: You will need to play around with the wire leads coming out of the stepper motor. Determine which is positive and which order the other four leads should be placed in the circuit. In the stepper motor used for the in-class tutorial the order was: white, green, red, black going into the darlington array integrated circuit (IC chip). Not all motors will have the same configuration! :(

IF YOU HAVE FIVE WIRES: one of those wires will connect to power.
IF YOU HAVE SIX WIRES: two of those wires will connect to power.
// program a unipolar stepper motor
// a stepper motor is the best choice for controlling motor speed with the greatest accuracy
// its accuracy is based on the number of ticks per rotation, like a watch motor
int motorPin1 = 2;
int motorPin2 = 3;
int motorPin3 = 4;
int motorPin4 = 5;
int delayTime = 50; // change this to speed up or slow down the motor
void setup() {
Serial.begin(9600);
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(motorPin3, OUTPUT);
pinMode(motorPin4, OUTPUT);
}
void loop() {
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, HIGH);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
Serial.println("1");
delay(delayTime);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, HIGH);
digitalWrite(motorPin3, HIGH);
digitalWrite(motorPin4, LOW);
delay(delayTime);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, HIGH);
digitalWrite(motorPin4, HIGH);
delay(delayTime);
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, HIGH);
delay(delayTime);
}
Comments (0)
You don't have permission to comment on this page.