Stepper Motor and ULN2003 Driver Board (HCROBO0055)

Various stepper / DC motors and servo's
Post Reply
admin
Site Admin
Posts: 879
Joined: Sun Aug 05, 2012 4:02 pm

Stepper Motor and ULN2003 Driver Board (HCROBO0055)

Post by admin » Tue Aug 16, 2016 9:50 am

Image



The ULN2003 Stepper Motor Driver Board uses a ULN2003 IC to drive 4-phase, 5-wire stepper motors.

Supply Voltage: 5V (Supplied motor suitable for 5V applications)
Max Output Current: 0.5A (Single Output)
4 LED indicators
Size: 40.5mm x 21.3mm
Stepper Motor Cable Length (approx.): 24cm
Holding Torque: 0.3kg/cm
Diameter: 28mm
Step Angle: 5.625 degrees
Reduction Ratio: 1/64

Pinout
Image

Example Arduino Sketch
  1. /* FILE:    ARD_Stepper_Motor_HCROBO0055_Example.pde
  2.     DATE:    02/09/12
  3.     VERSION: 0.1
  4.  
  5. This is an example of how to use the HobbyComponents Arduino compatible stepper
  6. motor with driver interface (HCROBO0055) . When run this program will
  7. continually
  8. rotate the motor one full revolution in the forward direction
  9. followed by one full
  10. revolution in the reverse direction. Although this stepper motor will
  11. work with the
  12. standard Arduino stepper motor library functions, this program
  13. demonstrates how easy
  14. it is to directly control.
  15.  
  16. You may copy, alter and reuse this code in any way you like, but please leave
  17. reference to HobbyComponents.com in your comments if you redistribute
  18. this code.
  19.  
  20. THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO
  21. WARRANTIES, WHETHER
  22. EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED
  23. WARRANTIES OF
  24. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK
  25. OF NEGLIGENCE.
  26. HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
  27. INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
  28. DAMAGES FOR ANY
  29. REASON WHATSOEVER.
  30.  
  31. */
  32.  
  33.  
  34.  
  35.  
  36. /* Defines the values passed to the function vStepMotor()
  37.     to specify which direction you would like the motor to
  38.     turn in. */
  39.  
  40. #define FORWARD true
  41. #define REVERSE false
  42.  
  43. /* Defines the digital IO pins used to control each of
  44.     the stepper motors coils. */
  45.  
  46. #define MOTOR_COIL_1_DIO 8
  47. #define MOTOR_COIL_2_DIO 9
  48. #define MOTOR_COIL_3_DIO 10
  49. #define MOTOR_COIL_4_DIO 11
  50.  
  51. /* The number of steps for 1 revolution of this stepper
  52.     motor is 360 degrees divided by the motor step angle
  53.     of 5.625 multiplied by the gear ratio 1/64 multiplied
  54.     by the number of coils 4 divided by two.
  55.     Therefore: 360 / (5.625 * (1 / 64)) = 512 */
  56.  
  57. #define STEPSPER1REV 512
  58.  
  59.  
  60. /* Set the 4 DIO pins used to drive the stepper motor to outputs */
  61. void setup()
  62. {
  63.   pinMode(MOTOR_COIL_1_DIO, OUTPUT);
  64.   pinMode(MOTOR_COIL_2_DIO, OUTPUT);
  65.   pinMode(MOTOR_COIL_3_DIO, OUTPUT);
  66.   pinMode(MOTOR_COIL_4_DIO, OUTPUT);
  67. }
  68.  
  69. /* MAIN PROGRAM */
  70. void loop()
  71. {
  72.   /* Used for counting the number of steps the motor has made */
  73.   word u16StepCounter;
  74.  
  75.   /* Rotate the stepper motor one full forward revolution */
  76.   for (u16StepCounter = 0; u16StepCounter < STEPSPER1REV; u16StepCounter++)
  77.   {
  78.     vStepMotor(FORWARD, 3);
  79.   }
  80.  
  81.   /* Rotate the stepper motor one full reverse revolution */
  82.   for (u16StepCounter = 0; u16StepCounter < STEPSPER1REV; u16StepCounter++)
  83.   {
  84.   vStepMotor(REVERSE, 3);
  85.   }
  86. }
  87.  
  88. /* Function will pulse all four coils of the stepper motor in either the forward
  89.     or reverse directions. The function accepts two inputs, a true or a false denoting
  90.     the direction the motor should turn in (true = forward, false =reverse), and a step
  91.     delay time in milliseconds between each step. */
  92.  
  93. void vStepMotor(boolean bDirection, word u16StepDelay)
  94. {
  95.   /* Holds which DIO pin is currently associated with which motor coil */
  96.   byte bMotorCoil_1;
  97.   byte bMotorCoil_2;
  98.   byte bMotorCoil_3;
  99.   byte bMotorCoil_4;
  100.  
  101.   /* Set the order of the DIO pins depending on the direction the
  102.     motor is requires to turn in. */
  103.   if (bDirection == true)
  104.   {
  105.     bMotorCoil_1 = MOTOR_COIL_1_DIO;
  106.     bMotorCoil_2 = MOTOR_COIL_2_DIO;
  107.     bMotorCoil_3 = MOTOR_COIL_3_DIO;
  108.     bMotorCoil_4 = MOTOR_COIL_4_DIO;
  109.   }else
  110.   {
  111.     bMotorCoil_1 = MOTOR_COIL_4_DIO;
  112.     bMotorCoil_2 = MOTOR_COIL_3_DIO;
  113.     bMotorCoil_3 = MOTOR_COIL_2_DIO;
  114.     bMotorCoil_4 = MOTOR_COIL_1_DIO;
  115.   }
  116.  
  117.  
  118.   /* Pulse each of the stepper motors coils in a sequential order */
  119.   digitalWrite(bMotorCoil_1, HIGH);
  120.   digitalWrite(bMotorCoil_2, LOW);
  121.   digitalWrite(bMotorCoil_3, LOW);
  122.   digitalWrite(bMotorCoil_4, LOW);
  123.  
  124.   delay(u16StepDelay);
  125.  
  126.   digitalWrite(bMotorCoil_1, LOW);
  127.   digitalWrite(bMotorCoil_2, HIGH);
  128.   digitalWrite(bMotorCoil_3, LOW);
  129.   digitalWrite(bMotorCoil_4, LOW);
  130.  
  131.   delay(u16StepDelay);
  132.  
  133.   digitalWrite(bMotorCoil_1, LOW);
  134.   digitalWrite(bMotorCoil_2, LOW);
  135.   digitalWrite(bMotorCoil_3, HIGH);
  136.   digitalWrite(bMotorCoil_4, LOW);
  137.  
  138.   delay(u16StepDelay);
  139.  
  140.   digitalWrite(bMotorCoil_1, LOW);
  141.   digitalWrite(bMotorCoil_2, LOW);
  142.   digitalWrite(bMotorCoil_3, LOW);
  143.   digitalWrite(bMotorCoil_4, HIGH);
  144.  
  145.   delay(u16StepDelay);
  146.  
  147.   digitalWrite(bMotorCoil_1, LOW);
  148.   digitalWrite(bMotorCoil_2, LOW);
  149.   digitalWrite(bMotorCoil_3, LOW);
  150.   digitalWrite(bMotorCoil_4, LOW);
  151. }


Downloads:
HCROBO0055_Schematic.jpeg


Disclaimer: Libraries, example code, and diagrams are provided as an additional free service by Hobby Components and are not sold as part of this product. We do no provide any guarantees or warranties as to their accuracy or fitness for purpose.

Descriptions and diagrams on this page are copyright Hobby Components Ltd and may not be reproduced without permission.
You do not have the required permissions to view the files attached to this post.

JennyH
Posts: 1
Joined: Mon Jul 11, 2022 10:10 am

Re: Stepper Motor and ULN2003 Driver Board (HCROBO0055)

Post by JennyH » Mon Jul 11, 2022 10:15 am

ULN2003AN ULN2003 Stepper Motor Driver Module Board For Arduino 28BYJ-48 5V 12V High Power Development System Board
Is there a datasheet for this?

andrew
Site Admin
Posts: 1422
Joined: Sun Aug 05, 2012 4:15 pm

Re: Stepper Motor and ULN2003 Driver Board (HCROBO0055)

Post by andrew » Mon Jul 11, 2022 2:02 pm

Is there a datasheet for this?
If you mean a schematic, I've just added one to the first post.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Post Reply

Return to “Motors & Servos”