A unipolar stepper motor is a type of electric motor that divides a full rotation into a series of discrete steps. It is called 'unipolar' because of the way the coils are wired, allowing for simpler driving circuitry. Stepper motors are commonly used in precision positioning devices like 3D printers, CNC machines, and robotics due to their ability to accurately control motion.
Pin Number | Description | Color (Typical) |
---|---|---|
1 | Coil 1 Start (A) | Red |
2 | Coil 1 End (A') | Yellow |
3 | Coil 2 Start (B) | White |
4 | Coil 2 End (B') | Blue |
5 | Common Wire 1 | Orange |
6 | Common Wire 2 | Black |
#include <Stepper.h>
// Change these values based on your motor's specifications
const int stepsPerRevolution = 200; // typically 200 steps for a 1.8 degree step angle
const int motorPin1 = 8; // Coil 1 Start (A)
const int motorPin2 = 9; // Coil 1 End (A')
const int motorPin3 = 10; // Coil 2 Start (B)
const int motorPin4 = 11; // Coil 2 End (B')
// Initialize the stepper library
Stepper myStepper(stepsPerRevolution, motorPin1, motorPin3, motorPin2, motorPin4);
void setup() {
// Set the speed in RPMs
myStepper.setSpeed(60);
}
void loop() {
// Step one revolution in one direction:
myStepper.step(stepsPerRevolution);
delay(500);
// Step one revolution in the other direction:
myStepper.step(-stepsPerRevolution);
delay(500);
}
Q: Can I run a unipolar stepper motor with a bipolar driver?
Q: How do I know if my stepper motor is unipolar or bipolar?
Q: What is the purpose of the common wires in a unipolar stepper motor?
Remember to always refer to the specific datasheet of your stepper motor model for precise information and ratings.