Controlling a Contact Closure Input
Posted 05 November 2004 - 10:50 AM
Answer: There are a few options.
1) The surefire way to do this is by using a digital I/O to control a mechanical relay. There are very few mechanical relays that can be directly controlled (no buffer required) with a digital I/O on the U12. One such relay is the PB282 from digikey.com. This relay has a load impedance of 370 ohms and is designed for 5 volt control, thus about 13.5 mA of control current is required. The D lines on the U12 can handle this, but an IO line cannot. The D line should be configured as output-high to turn on the relay (contact closure), and configured as output-low or input to turn off the relay. An analog output (AO) can also be used to control these relays (5 volts is on and 0 volts is off), and might be more convenient since they are on the screw terminals.
Here is some related info about controlling mechanical relays. The PB282 relay can be controlled by connecting a D line and GND to the control inputs of the relay, but if a relay needs more control current it is better to connect +5V and a D line to the relay as described in the following:
2) Another similar option is controlling an optocoupler or solid state relay. This is similar to the mechanical relay option, but the electrical characteristics of the solid state switch must be considered.
3) If one side of the wire on the machine is or can be connected to U12 ground (10 ohm series resistor recommended), the contact closure could be simulated directly by connecting the other wire to an IO or D line. With the IO/D line configured as input, there is a 1 Mohm resistor from the IO/D line to GND, thus this should appear as an open switch to the machine. With the IO/D line configured as output-low, there is esentially 1500 (IO) or 30 (D) ohms of resistance to ground, and one or both of these might be low enough to appear as a closed switch to the machine.
Posted 10 November 2004 - 02:59 PM
More info about the PB282 relay: PB282-ND is the Digikey part number and as of this writing they have about 50k in stock for less than $6 each.
The manufacturers part number is V23026A1001B201. The manufacturers web site is:
Searching on the part number takes you to the product page:
The datasheet on that page has a wiring diagram for the monostable A1 version. It is the view looking at the bottom of the relay (where the pins are). The pinout is made to match a 10-pin DIP IC, so there is no pin 2, 4, 7, or 9.
Pin 3 is the +Control and pin 8 is the -Control. For simplicity, and since this relay only requires 13 mA of control current, connect -Control to GND on the U12, and connect +Control to a D or AO line.
Connect pin 5 to one wire from the machine, and connect pin 1 or 10 to the other wire depending on whether you want normally-closed (pin 1) or normally-open (pin 10). The drawing shows the normal condition, so pin 5 is connected to pin 1 when the relay is off (disabled) and pin 10 when the relay is on (enabled).
To enable the relay, put 5 volts on pin 3 by setting the U12's D to output-high or AO line to 5 volts. To disable the relay (normal condition), set the D line to output-low or input, or set the AO line to 0.0 volts.
Posted 11 November 2004 - 01:28 PM
Posted 24 December 2007 - 09:16 PM
The surefire way to do this is by using a digital I/O to control a mechanical relay.
Wouldn't a solid-state relay work?
Posted 26 December 2007 - 10:20 PM
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users