Plug-in data acquisition boards: Interfacing digital inputs/outputs



Home | Forum | DAQ Fundamentals | DAQ Hardware | DAQ Software

Input Devices
| Data Loggers + Recorders | Books | Links + Resources


AMAZON multi-meters discounts AMAZON oscilloscope discounts


Switch sensing

In many applications, and particularly in industrial monitoring and control, switches form a primary interface for control actions that must be initiated by an operator. Operator controlled panel switches can be used to indicate that an action should be performed by the system.

Alternatively, where switches have multiple contacts, one contact can actually perform the action required (i.e. turning on a pump), while another contact can be used to indicate that the action was actually initiated. The monitoring of abnormal system conditions can also be made easier by using limit switches to indicate that an alarm condition has been reached. In each of these cases, and in many other applications, the condition of the switch contact must be determined, requiring that the switches be interfaced and sensed by DAQ hardware.


AMAZON multi-meters discounts AMAZON oscilloscope discounts


Since switches are passive devices with no power source, they must be made to emit TTL signal levels for direct connection to a TTL compatible digital I/O interface. The open/closed position of the switch is then deduced by the TTL logic level read at the digital input. This can be carried out quite easily, as demonstrated in the two switch-sensing connections shown in ill. F.30.

In the first switch-sensing connection, a pull-up resistor connected to one side of the switch is pulled up to the supply voltage level, which is normally available from the DAC board.


AMAZON multi-meters discounts AMAZON oscilloscope discounts


The open position of the switch contact is deduced by the high logic level read at the digital input. When the switch contact is in the closed position the digital input is connected to digital ground. This configuration has higher noise immunity and has the added advantage that one terminal is connected straight to ground and can be grounded at a convenient point near the location of the switch.

In the second switch-sensing configuration, a pull-down resistor is used to present a low logic level (digital ground) at the digital input, when the switch contact is open. When the switch contact is in the closed position, the digital input is connected directly to the 5 V supply voltage. The value of the pull-up or pull-down resistor is determined by the supply voltage and the digital input current sink capability.

ill. F.30 Switch position sensing circuits

Where it's likely that the signal source will be a button, switch or contact that bounces or glitches, or the signal may be a voltage higher than TTL levels, additional de-bounce and /or voltage divider circuitry is required.

F.10.2 AC/DC voltage sensing

In industrial monitoring and control, the throwing of a switch is used to begin or end an action, such as switching power to a motor or other machinery. In critical processes, the action of turning the switch is not necessarily enough to confirm that the motor has received power. This would require the sensing of the AC/DC voltages present at the motor inputs. As the AC/DC voltages involved could be quite high, any sensing circuitry directly connected to the digital I/O interface would need to provide high isolation, in addition to compatibility with the TTL digital I/O interface. A very simple AC/DC voltage sensing circuit that performs these tasks is shown in ill. F.31.

ill. F.31 AC/DC voltage sensing circuit: Isolated input not polarized ; Circuitry sharing PC ground ; Filter switch 0.1µF

There are several advantages of this low cost circuit. it's polarity insensitive and can be driven from 12 or 24 volt AC control transformers, the input voltage range can be extended by increasing the resistance of Rx and the use of the opto-isolator, guarantees high isolation, typically 500 V.

Detection of AC voltages requires the use of a filter to smooth out the AC pulses from the opto-isolator and provide a continuous signal level to the digital inputs. This slows down the response to AC voltages (typically 1 ms), however, if the capacitor is switchable, it can be de-selected, thus allowing faster response times (typically 20 µs), for DC input voltages.

F.10.3 Driving an LED indicator

Where it's necessary to provide a visual indication of an action being performed or to inform an operator of the status of a system or process, and a low level indicator is acceptable, light emitting diodes (LEDs) provide an easily implemented solution. As the standard TTL outputs from devices such as the 8255 PPI chip may not have sufficient drive to operate an LED, special driver circuitry is required, as shown in ill. F.32.

ill. F.32 Driving an LED

Driving relays

Using a plug-in board for digital control, in particular to operate relays that control AC or DC power or alarms, gives the PC tremendous power for a variety of control applications. Where digital I/O interfaces are required to operate relays, special circuitry is usually required because the relays typically can't be driven directly from TTL signal levels. In addition, the drive current required to operate either electromechanical or solid-state relays is much greater than that provided by normal TTL circuits, such as the 8255 PPI chip.

To accommodate any special signal level and current drive requirements of relays several options are available:

• Specialized rack mounted relay boards that interface directly, via ribbon cable, to the output connectors of common digital I/O boards. The circuitry necessary for the higher current drive, required to operate the relays, is provided on the relay boards. Individual relay modules may be fitted to the boards to meet the contact configuration and rating required for a specific application.

• Specialized plug-in digital I/O boards with higher current drive capability, designed especially for interfacing directly to relay modules.

• Specialized plug-in digital I/O boards, that contain both the drive circuitry and relays on a single board.

• External drive circuitry is provided by the user for each relay requiring higher drive current than that provided by the digital outputs of the digital I/O board being used.

Whether included on specialized digital I/O boards, or provided by the user, circuitry is required to interface to electromechanical and solid-state relays. This is discussed in the following sections.

Electromechanical relays:

Electromechanical relays, by nature of their construction, provide a degree of isolation from the voltages switched through their contacts. Where a failure occurs, the contacts can usually withstand an AC voltage of ten thousand volts for a short time.

Coils of electromechanical relays provide an inductive load to drive circuitry. When the coil current is removed, the back EMF generated by the energy in the coil can cause damage to driving circuitry. Extra protection is required, usually in the form of a freewheel diode, across the relay control terminals, whereby the back EMF generated is dissipated through the diode's current path.

Electromechanical relays are also prone to contact arcing while switching inductive loads.

Continued contact arcing causes contact degradation, high contact impedance, and eventual failure. In addition, contact arcing causes electromagnetic radiation, which may cause interference in digital circuitry. (To prevent degradation of contacts from the back EMF induced when switching inductive loads, a freewheel diode (and possibly a resistor in series to dissipate energy) should be placed across the contacts.) The drive current required to operate this type of relay depends on the rated coil voltage and coil resistance. As an example, a relay with a rated coil voltage of 5 V and coil resistance of 100 §Ù would require 50 mA drive current.

Clearly, the TTL compatible outputs of the 8255 chip could not provide this. Buffering with a high drive current chip is required. The ULN2003 Darlington Transistor Array chip serves two purposes, providing up to 500 mA of open collector drive current, as well as internally providing the freewheel diode required to dissipate the back EMP created when de-energizing the coil. The circuit configuration for driving this type of relay is shown below in ill. F.33.

ill. F.33 Driving electromechanical relays and preventing back-EMF damage

One advantage of this type of relay is that multiple pole relays are available which allow the switching of several contacts at the same time.

Solid state relays:

Solid state relays (SSRs) are fabricated from power semiconductor devices. Their opto-isolated inputs provide a degree of isolation (up to 4000 VAC) from high voltages appearing at their output.

Solid state relays able to switch loads up to 3.5 A at rated voltages of 0-200 DC and 0-220 V AC are capable of starting small motors, switching larger capacity motor starter relays, electric appliances, sprinkler valves, alarms and enunciator beams.

These relays require greater than TTL levels of current to switch on. As a result, a simple 8255 circuit does not have the power to turn on a solid state relay. An output buffer, a chip capable of sinking at least 16 mA of drive current, is required between the 8255 digital output lines and the solid state relay. The ULN2003 Darlington Transistor Array chip is more than capable of driving these types of relay. ill. F.34 below shows the configuration for driving an SSR.

Driving solid state relays

There are several advantages of solid state relays over reed and electromechanical relays:

• Solid state relays don't have the problems of contact arcing and there is no back EMF to drive circuits when switched off.

• Two solid state relays can be connected in parallel with each other and handle twice the current of a single relay's rating. Built-in circuitry allows the units to share the current with no additional wiring.

• Switching of high current SSRs is performed at the AC voltage zero crossover point, thus preventing surge currents and electromagnetic interference.

NEXT: Counter/timer I/O boards

PREV: Digital I/O boards

All related articles   Top of Page   Home



Updated: Monday, December 3, 2018 10:09 PST