You are on page 1of 5

Description

It’s an example of Unipolar Stepper Motor Interfacing To 8051 microcontroller.

Circuit Diagram

Click to Enlarge

Detail
It is simplest stepper motor interfacing example with 8051. In this project 8051 microcontroller controls unipolar stepper motor.

Stepper Motor
Stepper or stepping motors rotate through a fixed (pre-determined) angular step in response to input command provided by controller. On every next command motor advances one angular step. It means motor rotates in a series of angular intervals/steps with each step of same distance. If we reverse the order of input commands the direction of stepper motor also reverses.

Click to Enlarge Stepper Internal Circuit Diagram .

Click to Enlarge Above is the circuit diagram of 5 or 6 pin unipolar stepper motor. A1. Now commands sequence will become b1 a1 b0 a0 Hex Dec 0 0 0 0 0 1 1 0×01 0 0×02 1 2 . Each is further sub divided into 2 more coils resulting A0. For full step command sequence is given by b1 b0 a1 a0 Hex Decimal 0 0 0 1 0 1 0 0 0 0 1 0 1 0×01 0 0×04 0 0×02 0 0×08 1 4 2 8 We can make software interface simple by interchanging pin a1 with b0. Center tapped are usually connected to common supply source and command or command pattern is provided by its controller on inputs A0. B0 and B1. A1. There are 2 main coils A and B. B0 and B1.

ULN2003A also provides back emf protection diodes to remove back emf produce by coils.000000 MHz // // Microcontroller : AT89C2051-C51-C52-C55-S2051-S51-S52 // /////////////////////////////////////////////////////////// #include <AT89x051. We can parallel these drivers to handle more current according to stepper motor needs. Each ULN2003A contains 7 darling-ton pairs to provide interface between 8051 microcontroller and stepper motor. // // Pakistan. We know that coils produce back emf when these are switched from “on” to “off” or “off” to “on” state. // // Programmed By : Rashid Mehmood // // Project Name : Unipolar Stepper Motor Interfacing // // To 8051 // // Crystal : 24. Similarly 3 outputs of driver together. In the above controller circuit diagram we have paralleled 3 drivers. We have used separate power supplies for controller and stepper motor. Code Below is the simplest code of stepper motor demonstration. For basic operation & components used in an 8051 based microcontroller based systems see 8051 Basic LED Flasher. In the controller circuit diagram Port0 4 LSBs are connected to the inputs of 2 ULN2003A coil driver IC. We have connected 3 inputs together. } . // Start of code.h> void delay(unsigned int del) { while(del --). As microcontroller cannot drive stepper motors or coils directly.0 1 1 0 0 0 0 0×04 0 0×08 4 8 We can use this unipolar stepper motor as bipolar stepper motor by ignoring center tapped input. Each driver of ULN2003A can sink 500mA current maximum. Each pair of 3 drivers is driving a single coils of stepper motor. /////////////////////////////////////////////////////////// // Company : Micro Digital // // Address : Office # C7 Raza Plaza // // DAV College Road // // Rawalpindi.

void main() { char i. while(1) { for(i = 0. // Give some suitable delay. // You can change this delay // depending on your motor // maximum speed. This code can also be executed with little or no change on AT89C2051 microcontroller a small brother of AT89C51. } } } // End of code. . i < 4. delay(10000). i ++) { // Output pattern for next step. P0 = 0x01 << i.