Electronic and Computer Resources - Parallel Port Interfacing and Programming using Turbo C


BACK          HOME          NEXT


Interfacing with Stepper Motor

Basically a stepper motor consists of coil windings. It is sequence of activation of these windings that the rotation of the motor can be controlled.

Shown below is a schematic diagram of a six-terminal stepper motor. We just named the terminals A, A1, and A2 for the first pair and B, B1, and B2 for the second pair.




To be able to control the stepper motor to rotate step by step, each two windings of each pair should be activated alternately. Below is an illustration of the steps needed for a stepper to be able to rotate step by step forward and reverse rotation.



               0 => No Current

               1 => with Current



The interfacing circuit of a stepper motor is similar to the interfacing circuit of a coil. We still need a current driver and a free wheeling diode.



Stepper Motor Control Program

A 12V stepper motor and two push buttons are interfaced to D0 to D3 and S4 to S6 respectively of the parallel printer port. Write a program that will control the motor to rotate 24 steps clockwise if push button 1 is pressed and rotate 24 steps reverse if push button 2 is pressed.

The program should end if push button 3 is pressed.


Interfaced circuit diagram


R5-R7  =  10k


Interfacing Circuit Diagram


Here is the link of the source code of the programMotor.CPP


 BACK          HOME          NEXT




    Parallel Printer Port  

    Port Functions

    Sending a Byte

    Reading a Byte

    Interfacing LED

    Interfacing Push Button

    Interfacing 7-Segment

    Interfacing Coil

    Interfacing Relay

    Interfacing  S. Motor

    Interfacing AC Load

    Interfacing Sensor




Electronic and Computer Resources - Parallel Port Interfacing and Programming using Turbo C







1.  The Parallel Printer Port     2.  Port Functions in Turbo C    3.  Sending a Byte to the Port    4.  Reading a Byte     5.  Interfacing with LED

6.   Interfacing with Push Button     7.  Interfacing with 7-Segment    8.  Interfacing with Coil    9.  Interfacing with Relay    

10.  Interfacing with Stepper Motor    11.  Interfacing with AC Load    12.  Interfacing with Sensor

For questions, corrections and suggestions, 

email to: [email protected]

Hosted by www.Geocities.ws