Control a dc motor with your PC
Use the printer port to select three different speeds.
Firas M Ali Al-Raie, Polytechnic Higher Institute of Yefren, Yefren, Libya; Edited by Martin Rowe and Fran Granville -- EDN, August 26, 2010
| View as PDF |
The circuit in this Design Idea controls the speed of a 5V permanent-magnet dc motor through the PC’s parallel port (Figure 1). You use the C++ computer program to run the motor at three speeds. The circuit uses PWM (pulse-width modulation) to change the average value of the voltage to the dc motor. You connect the motor to the PC’s parallel port with an interface circuit. The design comprises IC1, a 74LS244 buffer; IC2, a ULN2003 driver; relay switches S1, S2, and S3; IC3, a 555 astable multivibrator circuit; and Q1, a 2N2222 driving transistor. The 555 timer operates as a variable-pulse-width generator. You change the pulse width by using relays to insert or split resistors in the 555 circuit.
The computer program controls these
resistors. When S1 is on and both S2 and
S3 are off, the timer output is set to logic
one, thereby driving the motor with its
maximum speed. When S1 and S2 are
on, the 555 timer generates a pulse signal
with a 50% duty cycle. In this case,
the charging resistor, RA1, is equal to
the discharging resistor, RB. In the third
case, S1 and S3 are on, and the charging
resistor is RA2,where RA2=0.1×RB, reducing
the on time of the pulse signal and, consequently, the speed of the motor to
the lower limit. Table 1 summarizes the
on/off-operation conditions of the relays
and the corresponding dc-motor speeds.The code prompts you to select a certain speed, stores your selection as an integer variable choice, generates the proper digital sequence, and stores it at another integer variable. You place the value of the integer variable data at a PC’s parallel port using the outportb function. The program uses the kbhit function to stop the motor when you hit any key on the keyboard.
Talkback
-
Why is R8 shorted out?
Boris Mohar - 2010-5-11 13:51:28 PDT -
Pin 3 of the 555 timer could be connected to an unused
section of the ULN2003, and relay S1 eliminated. Relay S2 and S3 could be replaced with a PNP transistor and two resistors (each). Q1 collector should probably have a reverse diode to prevent spikes from the motor when it is switched off (by PWM or shoutdown). Not a bad idea overall...
Harry Bissell - 2010-15-9 07:01:47 PDT -
Consider the author of this design idea (which is a perfectly valid one) comes from Libya - there are millions of locations across the globe which still have legacy computers - and will have for a while. This kind of utility may be less useful in our highly 'advanced' communities - however there are so many more - and are emerging markets for electronics that will enable continued growth for our industry - so long as we are sensitive to where they are in the technology development curve - and what their needs are.
Drew Hmiel - 2010-30-8 06:36:33 PDT -
operating a motor from a pc is like giving a ten year old your car keys.
Bob Clarke - 2010-29-8 03:42:02 PDT -
OpenOffice (even version 2.4, which I'm running on Debian Linux) opens .docx files with no problem
Michael Darrett - 2010-28-8 23:25:22 PDT


















