Unipolar Stepper Motor
![]() |
animation source :wikipedia |
Stepper Motors and It's Working Principles :
In this tutorial I will show , how to interface stepper motor with microcontroller and in this case I will use pic18f2550 microcontroller .Basically stepper motor works step by step .It can rotate 360 degree by the movements of equal steps.They are available stepper motor with steps 200, 180, 144, 72, 24 with rotation angles 1.8°, 2°, 2.5°, 5°, 15° respectively. Stepper motor moves each step at a time where every steps are equal .Generally stepper motor works on the principle of electromagnetic induction. A internal rotor is surrounded by electromagnetic stators where rotor and stator like to be stable by achieving different poles.In this way the stepper motor rotate .If one stator gets power , thetab stator attracts the rotor .At this situation the rotor rotates so that the stable state can be achieved .If next stator is on and others are off .The motor will complete the next step .
Generally Stepper Motors are Divided into Three Types :
1.Hybrid Stepper Motor
2.Permanent Magnet Stepper Motor
3.Variable Reluctance Stepper Motor
[Note : If you would like to learn more about Stepper motor with more details ,please follow the link wikipedia ]
According to the arrangement of windings the stepper motors are divided into two types :
1.Unipolar Motor2.Bipolar Motor
Unipolar :
This type of stepper motor is very popular and most preferable for the hobbyists .Unipolar stepper motor contains centre tapped windings inside .In this case coils are connected through a common wire and the poles can be changed without changing the direction of current .That's why the commutation circuit is very simple for unipolar stepper motor .
Bipolar :
This types of motor have no centre taped windings .For achieving reverse magnetic poles the current should be reversed in direction .In order to control this motor we need L293D ic because it is more complex to control .Basically L293D is used as the alternative of H-bridge circuit .H-bridge circuit is also used to controlling dc motor.[Note : If you would like to see "How to Interface Bipolar Stepper Motor ", Please follow the link]
Driving Operation of Stepper Motor :
Wave drive Operation (One becomes On at a time) :
In this case each stator gets power at a time and the rotation continues to the next .
![]() |
Bipolar Stepper Motor Interfacing With PIC Microcontroller (PIC18F2550) in Proteus [step by step] |
Full Step Drive Operation(Two become On at a time) :
In this case two stators get power at a time and the rotation continues to the next .This is very popular method .
Half Drive Operation(One or Two become On at a Time) :
In this case one or two stators get power and this makes the rotation of half drive operation .
![]() |
Unipolar Stepper Motor Interfacing With PIC Microcontroller (PIC18F2550) in Proteus [step by step] |
Now at this situation , we have got necessary information to create a Project .
Proteus Circuit :
Please Follow the instructions given in the pictures .
Please Complete the circuit as Given below . This Circuit is for Unipolar Stepper Motor
![]() |
Unipolar Stepper Motor Interfacing With PIC Microcontroller (PIC18F2550) in Proteus [step by step] |
Now Create a Project in MikroC .If you are a beginner , you can follow the instruction :
MikroC Code :
Source Code :
#Wave Drive :
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
void main() {
CMCON = 0x07;
ADCON1 = 0x0F;
Trisb=0x00;
while(1){
PORTB.F0=0;
PORTB.F1=0;
PORTB.F2=0;
PORTB.F3=1;
delay_ms(1000);
PORTB.F0=0;
PORTB.F1=0;
PORTB.F2=1;
PORTB.F3=0;
delay_ms(1000);
PORTB.F0=0;
PORTB.F1=1;
PORTB.F2=0;
PORTB.F3=0;
delay_ms(1000);
PORTB.F0=1;
PORTB.F1=0;
PORTB.F2=0;
PORTB.F3=0;
delay_ms(1000);
}
}
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#Full Drive :
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
void main() {
CMCON = 0x07; // To turn off comparators
ADCON1 = 0x0F;
Trisb=0x00;
delay_ms(1000);
while(1){
PORTB.F0=0;
PORTB.F1=0;
PORTB.F2=1;
PORTB.F3=1;
delay_ms(1000);
PORTB.F0=0;
PORTB.F1=1;
PORTB.F2=1;
PORTB.F3=0;
delay_ms(1000);
PORTB.F0=1;
PORTB.F1=1;
PORTB.F2=0;
PORTB.F3=0;
delay_ms(1000);
PORTB.F0=1;
PORTB.F1=0;
PORTB.F2=0;
PORTB.F3=1;
delay_ms(1000);
}
}
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#Half Drive :
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
void main() {
CMCON = 0x07; // To turn off comparators
ADCON1 = 0x0F;
Trisb=0x00;
delay_ms(1000);
while(1){
PORTB.F0=0;
PORTB.F1=0;
PORTB.F2=0;
PORTB.F3=1;
delay_ms(1000);
PORTB.F0=0;
PORTB.F1=0;
PORTB.F2=1;
PORTB.F3=1;
delay_ms(1000);
PORTB.F0=0;
PORTB.F1=0;
PORTB.F2=1;
PORTB.F3=0;
delay_ms(1000);
PORTB.F0=0;
PORTB.F1=1;
PORTB.F2=1;
PORTB.F3=0;
delay_ms(1000);
PORTB.F0=0;
PORTB.F1=1;
PORTB.F2=0;
PORTB.F3=0;
delay_ms(1000);
PORTB.F0=1;
PORTB.F1=1;
PORTB.F2=0;
PORTB.F3=0;
delay_ms(1000);
PORTB.F0=1;
PORTB.F1=0;
PORTB.F2=0;
PORTB.F3=0;
delay_ms(1000);
PORTB.F0=1;
PORTB.F1=0;
PORTB.F2=0;
PORTB.F3=1;
delay_ms(1000);
}
}
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
How to run the MikroC and save hex file .
Now go to the proteus circuit to load the hex file
Run the Project
Result :
![]() |
Full Drive |
![]() |
Wave Drive |
![]() |
Half Drive |
Just Click on '' SKIP ADD '' and You will get the download link
Thank You !
Thanks for sharing this complete guide. also check my website
ReplyDelete