5V Stepper Motor with ULN2003 Driver

Rs.350.00
Product Code: stepper motor
Availability: In Stock
Qty:

Signal Output function :

  • Brand new and high quality.
  • Voltage: 5V.
  • Diameter: 28mm.
  • Step angle: 5.625 x 1 / 64.
  • Reduction ratio: 1 / 64.
  • 5 Line 4 phase can be driven by ordinary uln2003 chip can also be connected in phase 2 development board used for.
  • supporting the use of a direct plug and easy to use stepper motor used in the development board.
  • Dimensions of the Board : 31mm × 35mm.
  • Stepper motor driver board with ULN2003.
  • A, B, C, D four-phase LED indicates the status of the stepper motor work.
  • Stepper motor with a standard interface, when used directly pluggable.
  • Drive Module Board Size:2.8cm x 2.8cm x 2cm - 1.1inch x 1.1inch x 0.79inch.
  • Stepper motor Size:3.2cm x 3.2cm - 1.26inch x 1.26inch.

Package Included:

  • 1 x Drive Module Board ULN2003
  • 1 x Stepper motor

 

 

That’s quite the explanation. Most anything that requires motion control will use a step motor. So how do we get a BeagleBone to work a step motor?  We need four things:

  1. Step Motor – The motor steps (rotates) when the power is applied to the motor’s windings.
  2. Driver – The driver receives a command, interprets it, and send the necessary power to the step motor to achieve a step.
  3. Controller- A device (microprocessor) capable of sending a command to the driver.
  4. User Interface (UI) – A physical or virtual device that provides a user with effective interaction and control of the step motor.
Stepper Motor Driver Board ULN2003 for Arduino/AVR/ARM

Stepper Motor Driver Board ULN2003 for Arduino/AVR/ARM

There are all sorts of variations when it comes to integrating these four pieces. For example you could run a UI on a BeagleBoard that communicates, using one of a number of methods (i.e. USB, Ethernet), with a dedicated controller. That controller is cabled to a driver which in turn is wired to a motor. All well and good but I wanted a simpler and cheaper example.

In this example the BeagleBone will provide the UI and controller. The initial UI will be a shell script. While not very interactive it’s demonstrates that everything works. I’ll get more sophisticated later. The BeagleBone’s GPIO interface will be used to send commands to the driver.

I picked up an inexpensive driver and step motor intended for use with an Arduino. The driver board accepts a four bit command from an controller and in turn applies the necessary power pulse to step the motor. At the heart of the driver is a ULN2003AN integrated circuit. The board can supply between 5V to 12V to the motor from an independent power supply. It also has a bank of LED’s that correspond to the input signals received from the controller. They provide a nice visual when stepping.

Some step motor details:

  • Model: 28KYJ-48
  • Voltage: 5VDC
  • Phase: 4
  • Step Angle: 5.625° (1/64)
  • Reduction ratio: 1/64
It takes 4096 steps to rotate the spindle 360°. It is impossible to see a single step. When testing it pays to have something distinct on the spindle to show it is turning.

Physically connecting BeagleBone to the driver board is straight forward. Pick a free GPIO pin on the expansion header and run a wire from it to one of the input pins on the driver board. The driver board requires power. I tried powering it from the 5V and ground pins on expansion header P9, and an independent 5V power supply. Each worked well. Having wired a GPIO pin to the driver board you can use Linux’s sysfs GPIO interface to use it. Set the GPIO pin high and the corresponding LED on the driver board will illuminate. Set it low and the LED turns off.

Completing the wiring and toggling the LED’s did take long. Here’s now I wired the BeagleBone to the driver.

BeagleBone Drive Board
Signal Nane Pin Pin
VDD_5V  P9.3 +
GND  P9.1 -
GPIO1_6 p8.3 IN1
GPIO0_27 p8.17 IN2
GPIO1_15 p8.15 IN3
GPIO1_13 p8.11 IN4

The motor steps when a specific combination of wires running to the motor are powered. This is just a pulse of power. Just enough to get the motor to step. This driver and motor use a very simple protocol. Applying a signal to an input pin causes power to be sent to the motor on a corresponding wire.

Stepper Motor Driver Board ULN2003 for Arduino/AVR/ARM

Stepper Motor Driver Board

MCU IO Code Wire Color
IN1  A Blue
IN2  B Pink
IN3  C Yellow
IN4  D Orange

The motor steps when specific combinations of its wires are powered and the same combination is used to signal the driver. Discovering the correct stepping commands took a lot of searching on the Internet. The vast majority of information describes Arduino examples that rely on underlying Arduino libraries. I finally found this link and within a few minutes my motor was stepping.

The following codes define the step commands.

8 Step : A – AB – B – BC – C – CD – D – DA
4 Step : AB – BC – CD – DA (Usual application)

Step Command IN4 IN3 IN2 IN1
A 01H 0 0 0 1
AB 03H 0 0 1 1
B 02H 0 0 1 0
BC 06H 0 1 1 0
C 04H 0 1 0 0
CD 0CH 1 1 0 0
D 08H 1 0 0 0
DA 09H 1 0 0 1

Here’s a shell script that will step my motor one full rotation.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
 
timeout=10000
 
in1=38 # GPIO1_6  (p8.3)
in2=27 # GPIO0_27 (p8.17)
in3=47 # GPIO1_15 (p8.15)
in4=45 # GPIO1_13 (p8.11)
 
AB() {
        echo high > /sys/class/gpio/gpio$in1/direction
        echo high > /sys/class/gpio/gpio$in2/direction
        echo low > /sys/class/gpio/gpio$in3/direction
        echo low > /sys/class/gpio/gpio$in4/direction
}
BC() {
        echo low > /sys/class/gpio/gpio$in1/direction
        echo high > /sys/class/gpio/gpio$in2/direction
        echo high > /sys/class/gpio/gpio$in3/direction
        echo low > /sys/class/gpio/gpio$in4/direction
}
 
CD() {
        echo low > /sys/class/gpio/gpio$in1/direction
        echo low > /sys/class/gpio/gpio$in2/direction
        echo high > /sys/class/gpio/gpio$in3/direction
        echo high > /sys/class/gpio/gpio$in4/direction
}
 
DA() {
        echo high > /sys/class/gpio/gpio$in1/direction
        echo low > /sys/class/gpio/gpio$in2/direction
        echo low > /sys/class/gpio/gpio$in3/direction
        echo high > /sys/class/gpio/gpio$in4/direction
}
 
off() {
        echo low > /sys/class/gpio/gpio$in1/direction
        echo low > /sys/class/gpio/gpio$in2/direction
        echo low > /sys/class/gpio/gpio$in3/direction
        echo low > /sys/class/gpio/gpio$in4/direction
}
 
test() {
        for input in $in1 $in2 $in3 $in4
        do
                echo high > /sys/class/gpio/gpio$input/direction
                sleep 1
                echo low > /sys/class/gpio/gpio$input/direction
        done
}
 
step=0
 
while [ $step -lt 4096 ]
do
        echo "step: $step"
 
        AB
        usleep $timeout
 
        BC
        usleep $timeout
 
        CD
        usleep $timeout
 
        DA
        usleep $timeout
 
        step=`expr $step + 8`
done
 
off

Let’s see it in action.

Write a review

Your Name:

Your Review:

Note: HTML is not translated!

Rating: Bad Good

Enter the code in the box below:

IC Master

We deal ,all type of test equipment and integrated circuit, transistor, diode,IGBT, SMA, Connectors,  ceramic high capacitor and tantalum capacitor and other electronic components. We provide only new and original parts.

Contact us

  • +92-51-5550550
  • sales@icmasteronline.com
  • newicmaster

IC Master

IC Master 2018