Hidden Hidden Hidden Hidden
 
 

DETECT EXTERNAL ON/OFF SWITCH POSITION (0,1)
APPLICATIONS > DIGITAL INPUT >

Measurement Hardware

The following instruNet hardware provides digital input channels that can sense the on/off state of an external spst switch.

i420 / i423 / i430 / i460 i60x i100

 

Working with Digital I/O

In the typical case, a logic 0 corresponds to 0 to 0.8Volts, and a logic 1 corresponds to 2V to 5V. For details on the number of channels and the characteristics of each, click on the model numbers below the above pictures. For details on working with digital i/o channels, click here.

Wiring Diagram

Each digital i/o channels contain an internal 2K to 4K ohm pull-up resistor (e.g. to 5Volts); therefore, attaching an external switch that shorts this node to 0V when closed will result in a logic 0 input when closed, and logic 1 input when open; as illustrated below. For information on avoiding contact bounce, please refer to the below discussion.


Eliminating Contact Bounce

When a switch toggles, it sometimes mechanically bounces between the on and off position, in a random manner, for < 30mSec. This is sometimes referred to as "contact bounce". If this multiple on and off during one toggle is a problem, then one might consider a "de-bouncing" circuit using a capacitor, as shown in the above illustration. When the switch is closed, the capacitor discharges quickly (e.g. microseconds) to 0V through 0 ohms (switch is closed and can be thought of as 0 ohms). Then, when the switch is opened, the capacitor charges up slowly (approx 30mSec in the above example) to a logic 1 (e.g. up to 5 Volts via internal pull up resistor). Therefore, if it pulses closed for a short time right after opening, the digital input sees a constant logic 0 until the capactor is charged. And if it pulses open right after closing, the digital input sees a constant logic 0 up till the last close pulse.

Schmitt Trigger Inputs

The i4xx digital and universal i/o channels include a hardware Schmitt trigger input circuit; however, the i100 and i200 do not. Schmitt Trigger means that the input will not fluctuate up and down while transitioning between a logic 0 and logic 1 voltage. For example, if the input voltage has 0.3Vrms of noise added to it, and it transitions from 0.5Volts and 2.5Volts slowly over a 1 second duration, the Schmitt trigger input will first see a 0, and then a 1; yet will not see intermediate pulses during the transition. In this example scenario, the behavior of NON-Schmitt trigger inputs is not defined (i.e. anything could be seen by digital input during a slow transition between a logic 0 and 1 voltage).