Kuman 28BYJ-48 5V 4-Phase 5-Wire Unipolar Stepper Motor for use with micros such as a arduino
5V Stepper Motor + ULN2003 Driver Board
Kuman 28BYJ-48 Stepper Motor
Step angle: 5.625° 1/64 x
Reduction ratio: 1/64
28BYJ-48 Unipolar wiring (red wire is the center tap)
ULN2003A Darlington driver - ULN2003A circuit board with LEDs
ULN2003A driver with LEDs board
Motor Connections
The diagram to the left shows the 5 wires connected to the motor. Plug the motor into the driver board.
The Arduino should be connected to the ULN2003 driver board as shown below:
5V+ connect to +5V
5V- connect to 0V (Ground)
IN1: to Arduino digital input pin 8
IN2: to Arduino digital input pin 9
IN3: to Arduino digital input pin 10
IN4: to Arduino digital input pin 11
Driving the Motor
You should drive the motor by enabling the pins in an 8-phase order as shown to the left (Clockwise movement):
Drive IN4 only
Drive IN4 and IN3
Drive IN3 only
Drive IN3 and IN2
etc.
For anti-clockwise motion, simply follow the sequence in reverse
Example Code
// This Arduino example demonstrates bidirectional operation of a
// 28BYJ-48, using a ULN2003 interface board to drive the stepper.
// The 28BYJ-48 motor is a 4-phase, 8-beat motor, geared down by
// a factor of 68. One bipolar winding is on motor pins 1 & 3 and
// the other on motor pins 2 & 4. The step angle is 5.625/64 and the
// operating Frequency is 100pps. Current draw is 92mA.
////////////////////////////////////////////////
//declare variables for the motor pins
int motorPin1 = 8; // Blue - 28BYJ48 pin 1
int motorPin2 = 9; // Pink - 28BYJ48 pin 2
int motorPin3 = 10; // Yellow - 28BYJ48 pin 3
int motorPin4 = 11; // Orange - 28BYJ48 pin 4
// Red - 28BYJ48 pin 5 (VCC)
int motorSpeed = 1200; //variable to set stepper speed
int count = 0; // count of steps made
int countsperrev = 512; // number of steps per full revolution
int lookup[8] = {B01000, B01100, B00100, B00110, B00010, B00011, B00001, B01001};
//////////////////////////////////////////////////////////////////////////////
void setup() {
//declare the motor pins as outputs
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(motorPin3, OUTPUT);
pinMode(motorPin4, OUTPUT);
Serial.begin(9600);
}
//////////////////////////////////////////////////////////////////////////////
void loop(){
if(count < countsperrev )
clockwise();
else if (count == countsperrev * 2)
count = 0;
else
anticlockwise();
count++;
}
//////////////////////////////////////////////////////////////////////////////
//set pins to ULN2003 high in sequence from 1 to 4
//delay "motorSpeed" between each pin setting (to determine speed)
void anticlockwise()
{
for(int i = 0; i < 8; i++)
{
setOutput(i);
delayMicroseconds(motorSpeed);
}
}
void clockwise()
{
for(int i = 7; i >= 0; i--)
{
setOutput(i);
delayMicroseconds(motorSpeed);
}
}
void setOutput(int out)
{
digitalWrite(motorPin1, bitRead(lookup[out], 0));
digitalWrite(motorPin2, bitRead(lookup[out], 1));
digitalWrite(motorPin3, bitRead(lookup[out], 2));
digitalWrite(motorPin4, bitRead(lookup[out], 3));
}
Code for working with a feedback pot
CODE (ARDUINO)
/*
* Stepper motor with potentiometer rotation
* (or other sensors) using 0 analog inputs
* Use IDE Stepper.h comes with the Arduino library file */
#include <Stepper.h>
// Here to set the stepper motor rotation is how many steps
#define STEPS 100
// attached toSet the step number and pin of the stepper motor
Stepper stepper(STEPS, 8, 9, 10, 11);
// Define variables used to store historical readings
int previous = 0;
void setup()
{
// Set the motor at a speed of 90 steps per minute
stepper.setSpeed(90);
}
void loop()
{
int val = analogRead(0); // Get sensor readings
stepper.step(val - previous); // Move the number of steps for the current readings less historical readings
previous = val; // Save historical readings
}
C++ files
Amazon £12.98 for 5 sets
Features:
- Drive Module Board Size(in): 1.37*1.18*0.6 ; Stepper Motor diameter: 1.06(in) ; Stepper Motor lines: 9.45(in)
- A, B, C, D four-phase LED indicates the status of the stepper motor work.?Stepper motor with a standard interface, directly plugged.
- 5 line 4 phase can be used for ordinary ULN2003 chip driver, connect to the 2 phase , support the development board,With convenient use, direct docking
- Rated Voltage: DC5V 4-phase
- Insulation Resistance: >10MΩ (500V)
- Dielectric Strength: 600V AC / 1mA / 1s
- Step angle: 5.625 x 1/64
- DC Resistance: 200Ω±7% (25C)
- Reduction ratio: 1/64
- Insulation Grade: A
- No-load Pull in Frequency: >600Hz
- No-load Pull out Frequency: >1000Hz
- Pull in Torque: >34.3mN.m(120Hz)
- Temperature Rise: 《40K(120Hz)
Component listing:
Uln2003 Stepper Motor *5
Driver Board *5
40-pin male to female jumper wires *1
Driving many Stepper Motors
If you plan to use many Stepper motors make sure you can supply the required current, use a second 5V supply if required with the ULN2003 Driver Board and Stepper Motors.
Two pin drive circuit and software
There is a way to use 4 additional resistors and a diode to make a circuit that only requires 2 outputs to control the stepper motor instead of four, releasing more pins to drive additional motors.
two pin circuit
Note the drive software needs to be modified to use this configuration.
The two pin circuit uses the ULN2003 chip to invert the drive signals from control 1 and also the control 2 to drive one phase of the stepper motor in phase and the other anti-phase.