Stepper Motor Control Using ATC Microcontroller

by KNS Pvt Ltd
Rs. 1,400.00


Stepper motors are used for precision position control in many applications like floppy drives, printers, process control instruments, robotics and machine tool control. The Stepper Motor Controller using the 89C51 micro-controller can accurately control the rotation direction (clockwise or anti-clockwise), speed and number of revolutions with help of six tactile switches. This module is simple and easy to construct and can be used in many application e.g. Machine control, Robotics for controlling the axial rotation in XY plane. A similar circuit can be added to control the rotation of the motor in either XZ or YZ plane.


Things which you will Learn:

*Application of the AT89C51 microcontroller for stepper motor control and interfacing.
*Implementation of the bridge rectifier.
*Programming of the AT89C51 microcontroller in Assembly language.
*Concepts of Stepper motor angle.

Product Description

Robots are the future of the World and the main element in them is the stepper motors for joins and actuatiors. So we bring you a simple circuit for controlling the Stepper motor using the IC AT89C51.


At the heart of the Stepper Motor Controller is an AT89C51 microcontroller. From traffic control equipment to input devices, computer networking products, and stepper motor controllers, 89C51 microcontrollers deliver a high performance with a choice of configurations and options matched to the specific needs of each application.

In the Stepper Motor Controller circuit, the control switches for the motor are connected to Reset and Port P0.7 pins of the microcontroller while the stepper motor is connected to port pins P2.4 through P2.7 of the microcontroller (IC2) through the motor-driver circuit consisting of four Darlington pairs comprising transistors BC548 and SL100 (T1-T2, T3-T4, T5-T6, and T7-T8). 

When transistors conduct, 5V (Vcc) is applied to the coils of the motor and the currents flowing through them create magnetic fields and the motor starts rotating. The magnetic field energy thus created is stored in the coils.

When transistors stop conducting, the power to the coils is cut off, the magnetic field collapses and a reverse voltage (called inductive kick back or back emf) is generated in the coils. The back emf can be more than 100 volts. The diodes connected across the coils absorb the reverse voltage spike.


The crystal frequency used in this circuit is 11.059MHz. The speed of the stepper motor is proportional to the frequency of the input pulses or it is inversely proportional to the time delay between pulses, which can be achieved through software by making use of instruction execution time.

When power is applied, the reset input must first go high and then low. A resistor-capacitor combination (R1-C3) is used to achieve this until the capacitor begins to charge. At a threshold of about 2.5V, the reset input reaches a low level and the microcontroller begins to function normally. Reset switch (S2) allows you to reset the program without having to interrupt the power.

Driver Circuit Design: Ports P0 through P3 of the microcontroller are not capable of driving loads that require tens of milliamperes (mA). The microcontroller outputs a current of 1.7 mA. To drive the coil of a stepper motor requiring a torque of 7 kg-cm, 12V DC and 2 amp/phase, a driver circuit using transistors SL100 and 2N3055 are used to amplify the current to 2.72 amp. Since the stepper motor has four coils, we need to use four Darlington pairs.


The program for the Stepper Motor Controller is written in Assembly language and compiled using the ASM51 cross-assembler. The AT89C51 is programmed using Atmel Flash programmer. One step rotation of he stepper motor used in this project equals 1.8 degrees. When the motor is programmed for 200 steps, the motor makes one complete revolution i.e. 360 degrees.

Click To View Circuit Diagram

Click here to Download PDF