Tags: Stepper, Motor, Driver, ULN2003, arduino, microcontroller, pic, raspberry, pi

Stepper Motor Driver ULN2003 For Arduino Microcontroller Pic RaspberryPi

  • 5.00 AED

    9.00 AED

    • Ex Tax:5.00 AED
    • Brands techmaze
    • Product Code: Digital
    • Availability: In Stock
    The ULN2003 Stepper Motor Driver Board allows you to easily control the 28BYJ-48 Stepper motor or Dc Motor from a microcontroller, like the Arduino/AVR/PIC. One side of the board has a 5 wire socket where the cable from the stepper motor hooks up and it has 4 LED to indicate which coil is currently ..
    The ULN2003 Stepper Motor Driver Board allows you to easily control the 28BYJ-48 Stepper motor or Dc Motor from a microcontroller, like the Arduino/AVR/PIC. One side of the board has a 5 wire socket where the cable from the stepper motor hooks up and it has 4 LED to indicate which coil is currently powered. The ULN2003 has a logic control voltage at 3~5V and can provide voltage to the motor up to 5~15V at 500mA.

    Control Stepper motor 28BYJ-48 with ULN2003 for Arduino


    The source code for stepper motor 28BYJ-48 with ULN2003 for Arduino

    #define STEPPER_PIN_1 9
    #define STEPPER_PIN_2 10
    #define STEPPER_PIN_3 11
    #define STEPPER_PIN_4 12
    int step_number = 0;
    void setup() {
    pinMode(STEPPER_PIN_1, OUTPUT);
    pinMode(STEPPER_PIN_2, OUTPUT);
    pinMode(STEPPER_PIN_3, OUTPUT);
    pinMode(STEPPER_PIN_4, OUTPUT);
    
    }
    
    void loop() {
     
      OneStep(false);
      delay(2);
    }
    
    
    void OneStep(bool dir){
        if(dir){
    switch(step_number){
      case 0:
      digitalWrite(STEPPER_PIN_1, HIGH);
      digitalWrite(STEPPER_PIN_2, LOW);
      digitalWrite(STEPPER_PIN_3, LOW);
      digitalWrite(STEPPER_PIN_4, LOW);
      break;
      case 1:
      digitalWrite(STEPPER_PIN_1, LOW);
      digitalWrite(STEPPER_PIN_2, HIGH);
      digitalWrite(STEPPER_PIN_3, LOW);
      digitalWrite(STEPPER_PIN_4, LOW);
      break;
      case 2:
      digitalWrite(STEPPER_PIN_1, LOW);
      digitalWrite(STEPPER_PIN_2, LOW);
      digitalWrite(STEPPER_PIN_3, HIGH);
      digitalWrite(STEPPER_PIN_4, LOW);
      break;
      case 3:
      digitalWrite(STEPPER_PIN_1, LOW);
      digitalWrite(STEPPER_PIN_2, LOW);
      digitalWrite(STEPPER_PIN_3, LOW);
      digitalWrite(STEPPER_PIN_4, HIGH);
      break;
    } 
      }else{
        switch(step_number){
      case 0:
      digitalWrite(STEPPER_PIN_1, LOW);
      digitalWrite(STEPPER_PIN_2, LOW);
      digitalWrite(STEPPER_PIN_3, LOW);
      digitalWrite(STEPPER_PIN_4, HIGH);
      break;
      case 1:
      digitalWrite(STEPPER_PIN_1, LOW);
      digitalWrite(STEPPER_PIN_2, LOW);
      digitalWrite(STEPPER_PIN_3, HIGH);
      digitalWrite(STEPPER_PIN_4, LOW);
      break;
      case 2:
      digitalWrite(STEPPER_PIN_1, LOW);
      digitalWrite(STEPPER_PIN_2, HIGH);
      digitalWrite(STEPPER_PIN_3, LOW);
      digitalWrite(STEPPER_PIN_4, LOW);
      break;
      case 3:
      digitalWrite(STEPPER_PIN_1, HIGH);
      digitalWrite(STEPPER_PIN_2, LOW);
      digitalWrite(STEPPER_PIN_3, LOW);
      digitalWrite(STEPPER_PIN_4, LOW);
     
    } 
      }
    step_number++;
      if(step_number > 3){
        step_number = 0;
      }
    }
    
    


    Tags: stepper motor; motor driver; stepper; driver; module

    There are no reviews for this product.

    Write a review

    Please login or register to review