1. Interfacing of Stepper Motor with 8051 T.Srikrishna, M.Sc, M.Tech, GVP
Stepper Motor Interfacing with 8051
What is a stepper motor?
A motor, in general, is a device that converts electrical energy into
mechanical energy.
A stepper motor is a device that does the same task as above but, in steps.
It can divide a complete rotation into a number of steps.
A stepper motor rotates at small angles to complete 360 degrees rotation,
these small angles are called steps, hence the name Stepper Motor.
Typically, a stepper motor consists of 200 steps.
200 Steps = 360 degrees
1 Step = ‘x’ degrees
x = 360 / 200 = 1.8 degree
Therefore, every step is 1.8 degrees.
In the case of an 8-steps rotor, the step angle is 360 / 8 = 45 degrees.
Type of Stepper Motor
Stepper motors are broadly divided into two types
Unipolar stepper motor
Bipolar stepper motor
Unipolar stepper motor
The connections at the center of the coils are joined together and are connected
to the 12V supply. They are called unipolar steppers because power always comes
in on this one pole.
2. Interfacing of Stepper Motor with 8051 T.Srikrishna, M.Sc, M.Tech, GVP
What are the components of a stepper motor
Stator: The stator is made up of four coils, that are energized by the pulses
Rotor: The number of steps of the rotor and its alignment with the stator
determines the step angle and steps per revolution.
Permanent magnets: The rotor is mounted on a permanent magnet that attracts
or repels the stator coils and hence the propulsion occurs.
Working of a stepper motor
A stepper motor works on the principle of magnetic attraction and
repulsion.
The coils of stators are energized and de-energized by the pulses of the
microcontroller which creates magnetic north and south on the stator
poles.
The rotor is mounted on a permanent magnet having a permanent N and S
marked.
The sequence in which the coils are excited to form the poles causes
attraction and repulsion causing motion in the shaft and the load
connected to it.
3. Interfacing of Stepper Motor with 8051 T.Srikrishna, M.Sc, M.Tech, GVP
Steps A B C D HEX
1 1 0 0 0 08
2 0 1 0 0 04
3 0 0 1 0 02
4 0 0 0 1 01
Components required for interfacing a Stepper motor with 8051
Microcontroller
8051 Microcontroller
Stepper Motor
Current Driver IC
Interfacing stepper motor to 8051 Microcontroller
Here we are using Port 2 of 8051 to generate pulses and using a current
amplifier IC (ULN2003a) to amplify the current to drive the stepper motor
using the pulse of the microcontroller.
4. Interfacing of Stepper Motor with 8051 T.Srikrishna, M.Sc, M.Tech, GVP
o Connect the 4 pins of Port 2 to the input side of ULN2003a IC as
follows,
o Connect the outputs of the ULN2003a to the 4 wires of the stepper
motor
o Connect the two common wires of the stepper motor and Pin 9 of
the IC to a 12V DC supply.
5. Interfacing of Stepper Motor with 8051 T.Srikrishna, M.Sc, M.Tech, GVP
Assembly language program to interface stepper motor with 8051
ORG 00H
MOV TMOD, #01H
MAIN: MOV P2, #08H
ACALL DELAY
MOV P2, #04H
ACALL DELAY
MOV P2, #02H
ACALL DELAY
MOV P2, #01H
ACALL DELAY
SJMP MAIN
Delay Program:
DELAY: MOV R0, #200
BACK: MOV TH0, #0FCH
MOV TL0, #018H
SETB TR0
WAIT: JNB TF0, WAIT
CLR TR0
CLR TF0
DJNZ R0,BACK
RET
END