DIY 3D Tech

The On-Line Magazine for 3D Printing & CNC

28BYJ-48 Unipolar to Bipolar Conversion Project – Part 2

In this video we will complete the conversion of the 28BYJ-48 stepper motor from unipolar to bipolar format and drive it with an Ardunio Motor shield (Click here for shield info:  Also if your looking for the 28BYJ-48 motors, you can just click here to get a package of 5 or simply find out more these little gem of a motor.  Also for the coil pairings, in my case it was: Blue & Yellow and Orange & Pink.

Below is the sample code to run the modifed 28BYJ-48 stepper motor in bipolar mode:

// 28BYJ-48 Bipolar Test Code
// copyright
// this code is public domain, enjoy!

// Coil 1: Blue & Yellow
// Coil 2: Orange & Pink

// Make sure motor lib was added to Arduino Lib
// go here for ho to:

// Connect modifed 28BYJ-48 to motor controler Shield
// on motor port #2 (M3 and M4)

// Set 28byj-48 to 4096 steps on motor 2  (using M3 & M4)
AF_Stepper motor(4096, 2);

void setup() {
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("28byj-48 Test Start");

// Set motor speed to 10 RPMs
  motor.setSpeed(10);  // 10 rpm   

// Start repeating loop
void loop() {

  Serial.println("Micrsostep steps");
  // Do 10 times forward
  for (int i=0; i <= 10; i++){
      Serial.println("move forward");
      motor.step(1000000, FORWARD, MICROSTEP); 
   // Do 10 times backwards
  for (int i=0; i <= 10; i++){
      Serial.println("move backward");
      motor.step(1000000, BACKWARD, MICROSTEP); 

[amazon template=wishlist&asin=B00813HBBO]

[amazon template=wishlist&asin=B01321KCZG]