Âçìáôéêüò ÊéíçôÞñáò

This is a 5v 28YBJ-48 Stepper Motor with Gear Reduction, so it has good torque for its size, but relatively slow motion.
These motors/drivers are made by the millions for A/C units, fans, duct controls etc.
4 Phase 5 Wire Connection
•Current : 160 mA per winding (320 mA in 4-step mode) Measured: 250mA stopped, 200 mA running fast
•Resistance : 31 Ù per coil winding (from Red wire to any coil)
•Voltage : 5V DC
•Step Angle (Internal Motor alone): 5.625° (64 steps per revolution) NOTE: this is with the Half-Step (8-step) sequence.
So the internal motor has 32 steps per revolution in 4-step mode (Arduino Library)
•Step angle: 5.625 x 1/64 at Output Shaft
•Step angle: 11.25 x 1/32 at Output Shaft
•Gear Reduction ratio: 1 / 64
•SO: it takes 2048 steps per output shaft revolution.. In 4-step sequence.
•No-Load Pull-Out Frequency : 800pps
•No-Load Pull-In Frequency : 500pps
•Pull-In Torque : ≥ 78.4mN.m
•Wiring Instruction : A (Blue), B (Pink), C (Yellow), D (Orange), E (Red, Mid-Point)

       

/*-----( Import needed libraries )-----*/
#include <Stepper.h>
/*-----( Declare Constants, Pin Numbers )-----*/
//---( Number of steps per revolution of INTERNAL motor in 4-step mode )---
#define STEPS_PER_MOTOR_REVOLUTION 32
//---( Steps per OUTPUT SHAFT of gear reduction )---
#define STEPS_PER_OUTPUT_REVOLUTION 32 * 64 //2048
/*-----( Declare objects )-----*/
// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it's
// attached to
//The pin connections need to be 4 pins connected
// to Motor Driver In1, In2, In3, In4 and then the pins entered
// here in the sequence 1-3-2-4 for proper sequencing
Stepper small_stepper(STEPS_PER_MOTOR_REVOLUTION, 8, 10, 9, 11);
/*-----( Declare Variables )-----*/
int Steps2Take;
void setup() /*----( SETUP: RUNS ONCE )----*/
{// Nothing (Stepper Library sets pins as outputs)
}/*--(end setup )---*/
void loop() /*----( LOOP: RUNS CONSTANTLY )----*/
{
small_stepper.setSpeed(1); // SLOWLY Show the 4 step sequence
Steps2Take = 4; // Rotate CW
small_stepper.step(Steps2Take);
delay(2000);
Steps2Take = STEPS_PER_OUTPUT_REVOLUTION / 2;
// Rotate CW ½ turn
small_stepper.setSpeed(100);
small_stepper.step(Steps2Take);
delay(1000);
Steps2Take = - STEPS_PER_OUTPUT_REVOLUTION / 2;
// Rotate CCW 1/2 turn
small_stepper.setSpeed(700); // 700 a good max speed??
small_stepper.step(Steps2Take);
delay(2000);
}