Share |
Login Form
Newsletter(s)



Receive HTML?

Latest Members




PC Controlled DC Motor – Keyboard Control Hot

 
User rating
 
3.0 (1)

A PC can be used to control the speed and the direction of a DC motor using the circuit of Fig. 1 along with the brief BASIC listing provided. The circuit is used to interface a DC motor to the parallel port (LPT1) of an IBMcompatible PC. It consists of complementary transistors connected in an Hbridge network. Four diodes are used to provide a free-wheeling action.


Two general-purpose small-signal transistors TR5 and TR6 (type 2SC1483, or perhaps a BC548 or equivalent – ARW) are used to interface the power driver stage to the parallel port of the PC. The data bits D0 and D1 (pin 2 and pin 3) of the parallel port are used to drive the bridge circuit, whilst pin 25 is referenced to the ground of the bridge power supply. A simple QuickBasic program to run the DC motor at any speed and in any direction is given in Listing 1. The address of the parallel port is 378H. When a low on data bit D0 and a high on data bit D1 is sent, this switches transistors TR1 and TR3 on. The result is a current flow through the motor in one direction.

When a high on data bit D0 and a low on data bit D1 is sent, this switches transistor TR2 and transistor TR4 on instead. A current flows through the motor in the opposite direction hence changing its direction of rotation.

Speed Control

The speed of the motor is controlled using pulse width modulation through software. If TR1 is on for example (D0 = low) then current flow through the motor is controlled by switching on alternately the transistor TR2 and TR3. The duration of two FOR TO NEXT loops in the program determines the speed of motor. If the duration of one FOR TO NEXT loop is increased, then the duration of the second FOR TO NEXT loop is decreased accordingly to maintain constant overall loop timing. This results in fixed frequency output pulses at data bit D0 or data bit D1. The pulse width of the output is controlled by the loops’ timing hence controlling the speed of motor. In my case the QuickBasic program running on a Pentium 166MHz PC produced a frequency of about 7kHz at the output, with the speed and direction of the motor controlled by the function keys F1 and F2. The H-bridge T0220 power transistor types shown are rated for 3A and alternative types could readily be used.

Article reproduced by permission of Wimborne Publishing
. www.epemag.com

User reviews

Average user rating from: 1 user(s)

To write a review please register or login.
Overall:
 
3.0   (1)
 
 

software ??

Overall:
 
3.0
0 of 0 people found the following review helpful

I cant find the QuickBasic program ???

 
 
Written by :
Barnaby Brown