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

Near- and Far-Field Measurements

April 16, 2024
In this comprehensive application note, we delve into the methods of measuring the transmission (or reception) pattern, a key determinant of antenna gain, using a vector network...

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.

Empowered by Cutting-Edge Automation Technology: The Sustainable Journey

April 16, 2024
Advanced automation is key to efficient production and is a powerful tool for optimizing infrastructure and processes in terms of sustainability.

Comments

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