Tags: Stepper, Motor, ULN2003, H-Bridge, Motor, Controller, Arduino, Microcontroller

Stepper Motor with ULN2003 H Bridge Motor Controller for Arduino and Microcontroller

  • 19.00 AED

    25.00 AED

    • Ex Tax:19.00 AED
    • Product Code: ULN2003
    • Availability: In Stock
    The ULN2003 stepper motor driver board allows you to easily control the 28BYJ-48 stepper motor from a microcontroller, like the Arduino Uno. One side of the board side has a 5 wire socket where the cable from the stepper motor hooks up and 4 LEDs to indicate which coil is currently powered. The moto..

    The ULN2003 stepper motor driver board allows you to easily control the 28BYJ-48 stepper motor from a microcontroller, like the Arduino Uno. One side of the board side has a 5 wire socket where the cable from the stepper motor hooks up and 4 LEDs to indicate which coil is currently powered. The motor cable only goes in one way, which always helps. On the side you have a motor on / off jumper (keep it on to enable power to the stepper).


    Features:

    onboard ULN2003A motor drive chip

    5- 12V power supply

    onboard 4-way signal lights

    the onboard XH-5P socket can be directly connected  with 28BYJ-48 stepper motor

    Control Stepper motor 28BYJ-48 with ULN2003 for Arduino


    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;
        }
      }
      
      



      There are no reviews for this product.

      Write a review

      Please login or register to review