Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Controlled Bipolar Stepper Motor

View and Edit Project In Cirkit DesignerImage of Arduino UNO Controlled Bipolar Stepper Motor

Circuit Documentation

Summary

This circuit involves an Arduino UNO microcontroller controlling a Bipolar Stepper Motor (NEMA 17). The Arduino UNO is programmed to drive the stepper motor using a simple direct drive method. The connections between the Arduino and the stepper motor are established through digital pins D8, D9, D10, and D11.

Component List

Arduino UNO

Bipolar Stepper Motor (NEMA 17)

Wiring Details

Arduino UNO

Bipolar Stepper Motor (NEMA 17)

Code Documentation

Arduino UNO Code

/*---------------------------------------*\
| Simple direct drive of Bipolar Stepper  |
\*---------------------------------------*/

// pins connected
#define Ap 10  // A+ line
#define Am 11  // A- line
#define Bp 9   //  .
#define Bm 8   //  .

void setup() {
  // set output
  pinMode(Ap,OUTPUT);  pinMode(Am,OUTPUT);
  pinMode(Bp,OUTPUT);  pinMode(Bm,OUTPUT);
}

int I = 0 ;
void loop() {
  // This is Wave Fullstep motion - only one coil energized at a time
  if ( I++ <25 ) {  // stop after 25*4 steps (=100) - quarter turn with gearRatio "2:1"
    delay(10);
    digitalWrite(Bm,LOW);  digitalWrite(Ap,HIGH);
    delay(10);
    digitalWrite(Ap,LOW);  digitalWrite(Bp,HIGH);
    delay(10);
    digitalWrite(Bp,LOW);  digitalWrite(Am,HIGH);
    delay(10);
    digitalWrite(Am,LOW);  digitalWrite(Bm,HIGH);
  } else while(1);
}

This code sets up the Arduino UNO to control the Bipolar Stepper Motor using a wave full-step motion, where only one coil is energized at a time. The motor will perform 100 steps, which corresponds to a quarter turn with a gear ratio of 2:1.