With this circuit you can control two unipolair stepper motors in full step mode via the RS232 serial port of your PC. A terminal program such as Hyperterminal can be used to control the stepper motors. The stepper motors can be driven one at a time.

 Features:

  • Drives two unipolair stepper motors in full step mode
  • Accepts commands via the serial port of your PC.
  • Can be used with any OS that has a standard terminal program such as Hyperterminal.
  • Drives stepper motors up to 24V, 500mA.
  • Power supply ......................12-24 VDC

Hardware

A MAX232 IC is used to convert the signals from the serial port of the PC to the TTL level of the AVR µ-controller. A AT2313 µ-controller is used to take the signals from the serial port and to translate the signals to drive the coils of the stepper motor.

The signals from the µ-controller are amplified by the ULN2803A which is an Darlington Array that can drive loads up to 500mA. It's input is TTL level and the output is up to 30VDC. The stepper motor is driven in full step mode, for every step two windings are energised. The motor can be rotated left and right by sending commands to the board with the terminal program. A maximum of 32000 step can be made with each command.

Step Coil1A Coil1B Coil2A Coil2B
1 on on off off
2 off on on off
3 off off on on
4 on off off on

Schematic and PCB Layout

pc steppermotor driver sch 

pc steppermotor driver brd


Software

The software code is build with the AVR BASCOM compiler

To run the stepper motor you need a terminal program such as Hyperterminal. To synchronize the terminal program with the stepper board you need to make the next settings in the terminal program: 
COM1 - 9600 baud - data bits 8 - 1 stop bit - No parity bit - No handshake.
The COM port can be set to the COM port that you use on your PC.

There are 4 commands that you can send to the stepper controller: 
m0rx and m0lx and m1lx and m1rx
The x in the command is a number from 0 to 32000. If you send the command m0l2000 the motor 0 turns clock wise 2000 steps and if you send m0r2000 the motor 0 turns counter clock wise 2000 steps.

After power up the board, a message is shown in your terminal program. You can then give the commands to control the stepper motors. See the example below.

pc steppermotor driver pic2

stepper_driver_rs232.bas