Stepper Motor Controlling Using ULN2003

The ULN2003 internally employs high voltage, high current darlington arrays each containing seven open collector darlington pairs with common emitters. Each channel rated at 500mA and can withstand peak currents of 600mA. Suppression diodes are included for inductive load driving and the inputs are pinned opposite the outputs to simplify board layout. ULN2003A is of 5V TTL, CMOS. These versatile devices are useful for driving a wide range of loads including solenoids, relays DC motors, LED displays filament lamps, thermal printheads and high power buffers. The ULN2003A are supplied in 16 pin plastic DIP packages with a copper leadframe to reduce thermal resistance.

 

Some important features of ULN2003A:

 

  • Seven DARLINGTONS per package
  • output current 500mA per driver (600mA peak)
  • Output voltage 50V
  • integrated suppression integrated suppression diodes for inductive loads
  • Outputs can be paralleled for higher current
  • TTL/CMOS/PMOS/DTL compatible inputs
  • Inputs pinned opposite outputs to simplify layout

 

ULN2003 

Stepper motors can be classified into 2-

Unipolar and Bipolar

Here we will discuss how Bi-polar Stepper motor can be interfaced with micro controller. The Bipolar Stepper motor has 2 coils.  The coils are identical and are not electrically connected. You can identify the separate coils by touching the terminal wires together-- If the terminals of a coil are connected, the shaft becomes harder to turn.

 

 

How to interface Bipolar Stepper motor???

Terminal 1a is positive and 1b is negative, the rotor points to the East in this diagram.  If these two terminals were reversed in polarity the rotor would point to the West.  Coil 2 is entirely de-activated in the diagram. In a basic Wave Drive clockwise sequence, winding 1 is de-activated and winding 2 activated to advance to the next phase. The rotor is guided in this manner from one winding to the next, producing a continuous cycle.  Note that if two adjacent windings  are activated, the rotor is attracted mid-way between the two windings. The diagram below shows, how to interface stepper motor with ULN2003 and ULN2003 to the microcontroller.

 

The Pins 1 to 4 of ULN2003 is connected to the microcontroller pins. Through Pins 13 to 16 of ULN 2003, Stepper motor draws the control sequence for the sake of rotation. Pin 9 is common and 8 is ground. The sequence 0011 (03H),0110 (06H),1100 (0CH),1001 (09H) provides maximum torque in a two phase configuration. This sequence energizes two adjacent phases, which offers an improved torque-speed product and greater holding torque.

 

The Example program in PIC for interfacing Stepper motor

 

#include"pic.h"

#include"delay.h"

void main()

{

int a[4]={0X03,0X06,0X0C,0X09};

int b[4]={0X09,0X0C,0X06,0X03};

int i;

TRISD=0X00;

for(i=0;i<=4;i++)

{

PORTD=a[i];

DelayMs(5);

}

DelayMs(2);

for(i=0;i<=4;i++)

{

PORTD=b[i];

DelayMs(5);

}

}

 

In the above program the stepper motor will rotate in Clockwise direction and then in anticlockwise and the sequence will continue.

- HARI KRISHNAN

Comments

Member since:
15 March 2009
Last activity:
5 years 1 week

can you provide the code for AVR controller