Open-Collector Signals (App Note) | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver


Free Shipping for U.S. Orders $150+   |   5-year Warranty   |   Try Our Devices & Support for 60 Days, Risk Free  |   50 of 54 Products In-Stock Now

Open-Collector Signals (App Note)

This app note is written for all LabJacks except the U12.  The U12 has 1MΩ pull-downs, rather then the 100kΩ pull-ups on all other devices.

Open-collector (also called open-drain, NPN, or PNP) is a very common type of digital signal.  Rather than providing a low-impedance 5 volts and ground like a push-pull signal, an open-collector signal provides open and ground. This type of signal can be thought of as a switch connected to ground.  The various terms are used somewhat loosely, and often all variations are simply called "open-collector", but following is the most common usage:

Open-collector = NPN = Changes between open and low.

Open-drain = PNP = Changes between open and high.

Since the LabJack digital inputs have a 100kΩ internal pull-up resistor that holds them high when nothing is connected, an NPN signal is a natural fit and can generally be connected directly to the input.  When the NPN signal is inactive, it is not driving any voltage and the pull-up resistor pulls the digital input to logic high.  When the NPN signal is active, it drives 0 volts which overpowers the pull-up and pulls the digital input to logic low.  Sometimes, an external pull-up (e.g. 4.7kΩ from Vs to digital input) will be installed to increase the speed and strength (i.e. more immune to EMI) of the logic high condition.

Figure 1. Open-Collector (NPN) General Connection To Digital Input

Rground is typically 0Ω, but occasionally a series resistor is used to prevent from large currents flowing into ground.

Rseries is typically 0Ω, unless needed to create an RC low-pass filter or if needed to limit current for voltages substantially higher than 5 volts.  If there is some uncertainty about whether the signal is actually open-collector or could drive a voltage beyond 5 volts, use an Rseries of 22kΩ as discussed in the Driven Signals App Note.

Rpullup (external pull-up resistor) is typically not required, but is used much more often than Rground and Rseries.  A 4.7kΩ is sometimes added if a stronger pull-up is needed to avoid false lows due to EMI.  The only downside to adding this external pull-up is that VS has to source a little extra current and the NPN switch has to sink this extra current, but it is only about 1mA with 4.7kΩ.


Without the optional resistors, Figure 1 simplifies to Figure 2 which is the most common connection:


Figure 2. Open-Collector (NPN) Typical Connection To Digital Input


For a PNP switch, Rpulldown (rather than Rpullup) is required from the digital input to GND.  Add a 4.7kΩ pull-down resistor that overpowers the internal 100kΩ pull-up and holds the digital input low when the PNP is inactive (open).  When the PNP is active (high), it will overpower the pull-down and hold the digital input high.  Note that if the PNP high voltage is greater than 5 volts, Rseries is needed to protect the digital input as discussed earlier.  In this case Rseries combines with Rpulldown to create a voltage divider (and also the internal 100k pull-up to 3.3V, but we will ignore that for a rough calculation).  Rseries=10k and Rpulldown=4.7k, means a gain of about x0.32 so a 12V input signal will be divided down to ~3.8 volts.  Rseries=22k and Rpulldown=4.7k, means a gain of about x0.18 so a 24V input signal will be divided down to ~4.3 volts.

Another option for PNP switches is an LJTick-Divider.

Our oldest device, the U12, has a 1MΩ pull-down rather then the 100kΩ pull-up on each digital line.  We recommend always using a 4.7kΩ pull-up resistor (to +5V) with NPN signals or a 4.7kΩ pull-down resistor (to GND) with PNP signals.

Various mention is made above to protecting from voltages greater than 5 volts.  The actual limits can be found in Appendix A of each device's datasheet.  The U12 starts clamping at VS+0.3, while the U3, U6, UE9, T4, and T7, start clamping at a fixed 5.8 volts, so an added series resistor should be considered for voltages beyond those levels.

Note that an individual ground connection to the LabJack is often not needed for every signal.  Any signals powered by the same external supply, or otherwise referred to the same external ground, should share a single ground connection to the LabJack whenever possible.