Interface Circuits Control Real Devices
You can build this basic interface circuit and use it with a PC to control devices.
Leo Sennott and Mike Sirois, Alpha Industries, Woburn, MA -- Test & Measurement World, 6/1/1997
Our company manufactures and tests many types of RF and microwave devices, and our testing requires different types of test equipment and handlers. When we started developing our tests, we decided to use PCs to control our test systems so we could take advantage of off-the-shelf hardware and software. But we did have to design some special control circuits. The circuits we designed easily adapt to different tester and handler applications.Our test systems include solenoids, motors, pneumatic valves, and indicators, which force us to deal with 5-V (TTL), 12-V, and 24-V signals. At times we have to deal with other voltages, too. Although manufacturers sell I/O boards that operate with TTL signals, we couldn't find boards that would handle a variety of signal voltages. As a result, we designed our own.
We started with a standard ISA bus card that provides three 8-bit I/O ports. We chose the CIO-DIO24H board from ComputerBoards (Mansfield, MA) because each of its TTL-compatible outputs can furnish up to 15 mA and sink up to 64 mA. Similar I/O boards from other manufacturers would work just as well. The CIO-DIO24H board lets us program its three ports--A, B, and C--independently as either input or output ports. The board also split the C port into two 4-bit ports that we can control independently as either input or output ports.
In most applications we used ports A and B as outputs. We split port C into four output lines and four input lines. Most of our handler and instrumentation interfaces require more control lines (outputs) than sense lines (inputs).
Design General-Purpose Circuits
After we decided on an I/O card, we designed the circuits that would work with our handlers. Instead of designing a special interface circuit for each control voltage, we designed a general-purpose circuit that can control DC voltages from 0 V to 24 V. For simplicity, the circuit in Figure 1 shows only three output circuits and one input circuit; the actual circuit provides 20 outputs and 4 inputs.
Each of the 20 output lines from the PC controls an NPN Darlington driver, and each ULN2803 IC supplies eight individual drivers. Each driver can sink up to 500 mA at up to 50 V. And each driver circuit includes a protection diode for which we set the bias by connecting a jumper between the driver IC's Vdd input (pin 10) and 5 V, 12 V, or 24 V. In this way we set up groups of eight drivers so they're compatible with specific driving needs. For example, we can drive 24-V relays, 12-V solenoids, and so on.
We set up several of the Darlington drivers so each could also control a relay with DPDT contacts (Figure 1 shows only two relays). When we need to use a relay, we use a jumper to connect it to its corresponding driver circuit. The relays let the interface switch high currents or voltages that the Darlington drivers can't handle.
Instead of leaving the relay contacts uncommitted, we provided two common connections to each set of DPDT contacts. And we set up the relay outputs so we could choose whether to supply power to devices when a relay was on or when it was off.
Control Line Voltages, Too
In addition to providing electromechanical relays, we dedicated one output line to driving a small solid-state relay. That relay can easily control a 110-VAC load such as a motor or lamp. Some of the semiconductor devices we test are sensitive to light, so during testing we use the solid-state relay to turn off a lamp that lights the test head.
All designers know that circuits require testing and troubleshooting. To make it easier to troubleshoot our circuits, we included an LED for each output line from the PC add-in card. The LEDs indicate the state of every I/O line, and they prove useful when it comes time to examine software and hardware actions.
Most of our applications need only a few input lines to the PC. So, our interface includes only four inputs. An LM339 voltage-comparator IC lets our circuit sense on-off signals from our handlers. A voltage divider biases the comparator's + input to 75% of the supply voltage, and a jumper lets us select a 10-k resistor as either a pull up or a pull down for the Ð sense input. The comparator's output drives a line that goes to port C on the PC add-in card. (For clarity, our schematic diagram shows only one comparator circuit.)
![]() |
|
Decoding Expands Outputs
Although we needed only a few input lines, we could easily run out of output lines in our applications. But by carefully examining our needs, we could find a way to use the lines we had. In one case, we needed 15 control lines, but a close look showed that the PC would have to activate only one of the 15 at a time. So, instead of dedicating 15 output lines to this application, we used only four. We decoded those four output lines into 16 states (Fig. 2).
![]() |
|
Four-to-sixteen-line decoders come in many forms, but we chose to build one by cascading a CD4556 (active-low output) decoder and two CD4555 (active-high output) CMOS decoders. We used the 15 outputs that correspond to input conditions 00012 through 11112, or 1 through 15, to control the valves. Each of the 15 decoder outputs controls a Darlington driver. (Because the computer resets the output port to all zeros, 00002, we couldn't use the 0 output to control a device such as a valve, since the output would remain on most of the time.) We connected an LED to each of the four decoder inputs to aid in debugging and testing.
Search Sites for Drivers
All our external hardware needs software to control it. So, when we chose an I/O board we made sure the manufacturer supplied driver routines we could use with programs such as QuickBasic, Visual Basic, C, C++, LabView, TestPoint, and HP VEE.
If you have difficulty finding driver software, sources on the World Wide Web can help. For example the www.LVR.com/parport.htm site offers many types of I/O drivers, and the FTP site ftp.metrabyte.com offers 16-bit and 32-bit I/O drivers. T&MW
Leo Sennott works as an engineering project manager at Alpha Industries. He has an A.S.E.E. from Wentworth Institute of Technology and a B.S. from New Hampshire College.
Mike Sirois is a systems engineer at Alpha Industries; he graduated from the University of California at Davis with a B.S.E.E. degree.
|
Get a DLL for Free Sources of ICs Digi-Key, Thief River Falls, MN. 800-344-4539. Web: www.digi-key.com |



















