DIYmall 28BYJ48 Stepper Motor 5V + ULN2003 Driver Board kit for Arduino Tutorial

5V-Stepper-Motor-ULN2003-Driver-Board

What you need :
1 X Arduino uno
1 X USB Cable
1 X stepper motor 28BYJ48 5V
1 X ULN2003
6 X Female to male cable

Connection:
ULN2003       Arduino
5V                         5V
GND                     GND
IN1                         8
IN2                        9
IN3                        10
IN4                        11

ULN2003 connect with stepper motor 28BYJ48

Once connection, connect Arduino uno r3 with computer via usb cable

Arduino code:
/*
BYJ48 Stepper motor code
Connect :
IN1 >> D8
IN2 >> D9
IN3 >> D10
IN4 >> D11
VCC … 5V Prefer to use external 5V Source
Gnd
written By :Mohannad Rawashdeh
https://www.instructables.com/member/Mohannad+Rawashdeh/
28/9/2013
*/

#define IN1 8
#define IN2 9
#define IN3 10
#define IN4 11
int Steps = 0;
boolean Direction = true;// gre
unsigned long last_time;
unsigned long currentMillis ;
int steps_left=4095;
long time;
void setup()
{
Serial.begin(115200);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
// delay(1000);

}
void loop()
{
while(steps_left>0){
currentMillis = micros();
if(currentMillis-last_time>=1000){
stepper(1);
time=time+micros()-last_time;
last_time=micros();
steps_left–;
}
}
Serial.println(time);
Serial.println(“Wait…!”);
delay(2000);
Direction=!Direction;
steps_left=4095;
}

void stepper(int xw){
for (int x=0;x<xw;x++){
switch(Steps){
case 0:
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
break;
case 1:
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, HIGH);
break;
case 2:
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
break;
case 3:
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
break;
case 4:
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
break;
case 5:
digitalWrite(IN1, HIGH);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
break;
case 6:
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
break;
case 7:
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
break;
default:
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
break;
}
SetDirection();
}
}
void SetDirection(){
if(Direction==1){ Steps++;}
if(Direction==0){ Steps–; }
if(Steps>7){Steps=0;}
if(Steps<0){Steps=7; }
}

Video link  https://youtu.be/akoYIyD4ZVw

How to change logo to arduino code?

  1. Download  GIMP , link https://www.gimp.org/
  2. Open GIMP, then click file-open  choose the logo picture( you need edit your logo in photoshop first, to make the logo size almost full size of the whole picture)
  3. In GIMP, Colors-desaturate, to convert the logo color to black

  4. Image-mode-indexed, choose use black and white(1-bit) in palette
  5. File-export as-XBM
  6. Open the XBM file in textedit, you will get code like this:
    #define DIYmall_width 120
    #define DIYmall_height 64
    static char DIYmall_bits[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0xf8, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x01, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0xe0, 0xff,
    0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x07, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f,
    0x00, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00,
    0x80, 0xff, 0xff, 0x0f, 0x00, 0x10, 0xf0, 0x0f, 0x00, 0xe0, 0x07, 0x00,
    0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x00, 0xf0, 0xe0, 0x3f, 0x00,
    0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x01, 0xf0,
    0xc1, 0x7f, 0x00, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0xe0,
    0xff, 0x07, 0xf0, 0x07, 0xff, 0x00, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00,
    0x80, 0x3f, 0x00, 0xfc, 0x0f, 0xf0, 0x07, 0xfe, 0x03, 0xff, 0x01, 0x00,
    0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0xf0, 0x1f, 0xf0, 0x07, 0xfc, 0xc7,
    0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0xc0, 0x3f, 0xf8,
    0x07, 0xf8, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00,
    0xc0, 0x3f, 0xf8, 0x07, 0xe0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x80, 0x3f, 0x00, 0x80, 0x7f, 0xf8, 0x07, 0xc0, 0xff, 0x0f, 0x00, 0x02,
    0x00, 0x08, 0x03, 0x80, 0x3f, 0x00, 0x80, 0x7f, 0xf8, 0x0f, 0x80, 0xff,
    0x87, 0x87, 0x07, 0x00, 0x0c, 0x03, 0x80, 0x3f, 0x00, 0x80, 0x7f, 0xf8,
    0x0f, 0x00, 0xff, 0x83, 0x87, 0x07, 0x00, 0x0c, 0x03, 0x80, 0x3f, 0x00,
    0x80, 0x7f, 0xf8, 0x0f, 0x00, 0xff, 0x83, 0x8f, 0x07, 0x00, 0x0c, 0x03,
    0x80, 0x3f, 0x00, 0x80, 0x7f, 0xf8, 0x0f, 0x00, 0xff, 0x81, 0xcd, 0x07,
    0x3f, 0x0c, 0x03, 0x80, 0x3f, 0x00, 0xc0, 0x3f, 0xf8, 0x0f, 0x00, 0xfe,
    0x81, 0xcd, 0x86, 0x71, 0x0c, 0x03, 0x80, 0x3f, 0x00, 0xc0, 0x3f, 0xf8,
    0x0f, 0x00, 0xfe, 0x80, 0xcd, 0x86, 0x60, 0x0c, 0x03, 0x80, 0x3f, 0x00,
    0xe0, 0x1f, 0xf0, 0x0f, 0x00, 0xfe, 0x80, 0xd9, 0x06, 0x70, 0x0c, 0x03,
    0x80, 0x3f, 0x00, 0xf8, 0x0f, 0xf0, 0x07, 0x00, 0xfe, 0x80, 0xf9, 0x06,
    0x7f, 0x0c, 0x03, 0x80, 0x3f, 0x80, 0xff, 0x07, 0xf0, 0x07, 0x00, 0xfe,
    0x80, 0x79, 0x86, 0x61, 0x0c, 0x03, 0x80, 0xff, 0xff, 0xff, 0x03, 0xf0,
    0x07, 0x00, 0xfe, 0x80, 0x79, 0xc6, 0x70, 0x0c, 0x03, 0x80, 0xff, 0xff,
    0xff, 0x00, 0xf0, 0x07, 0x00, 0xfe, 0x80, 0x71, 0xc6, 0x79, 0x0c, 0x03,
    0x80, 0xff, 0xff, 0x3f, 0x00, 0xe0, 0x03, 0x00, 0xfe, 0x80, 0x31, 0x86,
    0x6f, 0x0c, 0x03, 0x00, 0xfc, 0xff, 0x03, 0x00, 0xe0, 0x01, 0x00, 0x78,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
  7. Save the arduino code