Read 16 digital inputs using a PC's serial port

May 12, 1997
Illustrated is an interface circuit that allows a PC to read 16 channels of digital inputs (see the figure). The circuit is connected to the PC’s COM1 serial port directly. The same serial port also powers...

Illustrated is an interface circuit that allows a PC to read 16 channels of digital inputs (see the figure). The circuit is connected to the PC’s COM1 serial port directly. The same serial port also powers the circuit so that no additional power supply is needed.

There are four directly accessible input lines (pin 1, 6, 8, and 9) in a RS-232 serial port. These four lines are expanded by two dual four-input multiplexers (IC-1 and IC-2) to accept 16 inputs. The inputs can be on/off switches or open-collector/drain transistors between each input line and ground. Each of the input lines has a 100k pullup resistor to set logic high when the switch is off.

Two output lines (pins 4 and 7) control the selection of the input channels. Each line condition allows the PC to read four input channels under the control of the C program (see the listing). Output pin 4 also provides the power supply for ICs through diode D3. C1 holds the energy to power ICs when pin 4 is low. Once pin 4 is high, C1 will be charged up again. Because the serial port provides both positive and negative current outputs, two Zener diodes (D1 and D2) are used to limit the voltage range of output lines within −0.6 and +5.1 V.

Sponsored Recommendations

What are the Important Considerations when Assessing Cobot Safety?

April 16, 2024
A review of the requirements of ISO/TS 15066 and how they fit in with ISO 10218-1 and 10218-2 a consideration the complexities of collaboration.

Wire & Cable Cutting Digi-Spool® Service

April 16, 2024
Explore DigiKey’s Digi-Spool® professional cutting service for efficient and precise wire and cable management. Custom-cut to your exact specifications for a variety of cable ...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!