You are on page 1of 2

PRACTICAL-11

AIM: To study speed control of stepper motor using microcontroller.

Theory:

The main principle of this circuits is to rotate the stepper motor step wise at a particular step anagle.
The ULN2003 IC is used to drive the stepper motor as the controller cannot provide current
required by the motor.

Circuit Components:

 AT89C51 micro controller


 ULN2003A
 Stepper Motor
 Crystal
 Resistor

Program:

#include<reg52.h>
#include<stdio.h>
void delay(int);
void main()
{
do
{
P2=0×01; //0001
delay(1000);
P2=0×02; //00010
delay(1000);
P2=0×04; //0100
delay(1000);
P2=0×08; //1000
delay(1000);
}
while(1);
}
void delay(int k)
{
int i, j;
for(i=0; i<k; i++)
{
for(j=0; j<100; j++)
{
}
}
}

Circuit:

C1
U1 U4(COM)
33pF 19 39
XTAL1 P0.0/AD0
X1 P0.1/AD1
38
CRYSTAL 37
C2 P0.2/AD2
18 36
XTAL2 P0.3/AD3
35
P0.4/AD4
34
P0.5/AD5
33pF R1 33
P0.6/AD6 U4
9 32
RST P0.7/AD7
9
10K COM M1
21 1 16
P2.0/A8 1B 1C
22 2 15
P2.1/A9 2B 2C
C3 P2.2/A10
23 3
3B 3C
14
29
10uF/16V 24 4 13
PSEN P2.3/A11 4B 4C
30 25 5 12
ALE P2.4/A12 5B 5C
31 26 6 11 +88.8
EA P2.5/A13 6B 6C
27 7 10 MOTOR-BLDCM
P2.6/A14 7B 7C
28
R4 P2.7/A15
ULN2003A
10K 1 10
P1.0 P3.0/RXD
2 11
P1.1 P3.1/TXD
3 12
+5V P1.2 P3.2/INT0
4 13
P1.3 P3.3/INT1
5 14
P1.4 P3.4/T0
6 15
P1.5 P3.5/T1
7 16
P1.6 P3.6/WR
8 17
+5V P1.7 P3.7/RD
AT89C51

Fig: Speed control of Stepper motor

You might also like