The external features of the LabJack U12 are:
Figure 2-1 shows the top surface of the LabJack U12. Not shown is the USB and DB25 connector, which are both on the top edge. The DB25 connector provides connections for 16 digital I/O lines, called D0-D15. It also has connections for ground and +5 volts. All connections besides D0-D15, are provided by the 30 screw terminals shown in Figure 1. Each individual screw terminal has a label, AI0 through STB.
The status LED blinks 4 times at power-up, and then blinks once and stays on after enumeration (recognition of the LabJack U12 by the PC operating system). The LED also blinks during burst and stream operations, unless disabled. The LED can be enabled/disabled through software using the functions AISample, AIBurst, or AIStreamStart. Since the LED uses 4-5 mA of current, some users might wish to disable it for power-sensitive applications.
Hardware
The LabJack U12 has 8 screw terminals for analog input signals. These can be configured individually and on-the-fly as 8 single-ended channels, 4 differential channels, or combinations in between. Each input has a 12-bit resolution and an input bias current of ±90 µA.
G=1 ±20 volts
G=2 ±10 volts
G=4 ±5 volts
G=5 ±4 volts
G=8 ±2.5 volts
G=10 ±2 volts
G=16 ±1.25 volts
G=20 ±1 volt
The reason the range is ±20 volts at G=1 is that, for example, AI0 could be +10 volts and AI1 could be -10 volts giving a difference of +20 volts, or AI0 could be -10 volts and AI1 could be +10 volts giving a difference of -20 volts.
The PGA (programmable gain amplifier, available on differential channels only) amplifies the AI voltage before it is digitized by the A/D converter. The high level drivers then divide the reading by the gain and return the actual measured voltage.
Figure 2.1-1 shows a typical single-ended connection measuring the voltage of a battery. This same measurement could also be performed with a differential connection to allow the use of the PGA. In general, any single-ended measurement can be performed using a differential channel by connecting the voltage to an even-numbered analog input, and grounding the associated odd-numbered analog input (as shown by the dashed connection to AI1 in Figure 2.1-1).
Figure 2.1-2 shows a typical differential connection measuring the voltage across a current shunt. A differential connection is required when neither leg of the shunt is at ground potential. Make sure that the voltage of both AI0 an AI1 with respect to ground is within ±10 volts. For instance, if the source (Vs) shown in Figure 2.1-2 is 120 VAC, the difference between AI0 and AI1 might be small, but the voltage from both AI0 and AI1 to ground will have a maximum value near 170 volts, and will seriously damage the LabJack.
Whether or not the ground (GND) connection is needed (Figure 2.1-2) will depend on the nature of Vs.
Figure 2.1-3 shows a single-ended connection used to measure the output voltage of a typical voltage-divider circuit. The voltage divider circuit is a simple way to convert a varying resistance (thermistor, photoresistor, potentiometer, etc.) to a varying voltage. With nothing connected to Va, the value of the unknown resistance, R2, can be calculated as:
R2 = Va*R1 / (Vs-Va)
where Vs is the supply voltage (+5V in Figure 2.1-3).
When Va is connected to AI0, as shown in Figure 2.1-3, the input bias current of the LabJack affects the voltage divider circuit, and if the resistance of R1 and R2 is too large, this effect must be accounted for or eliminated. This is true for any signal with too high of a source impedance.
All measuring devices have maximum analog input bias currents that very from picoamps to milliamps. The input bias current of the LabJack U12’s analog inputs varies from +70 to -94 microamps (µA). This is similar to an input impedance of about 100 kΩ, but because the current is nonzero at 0 volts, it is better to model the analog input as a current sink obeying the following rule:
Iin = 8.181*Va - 11.67 µA
Because the input bias current is known, as a function of input voltage, the simple voltage divider equation can be modified as follows to account for input bias current:
R2 = Va / [((Vs-Va)/R1) – (8.181µ * Va) + 11.67µ]
As an alternative to the equation above, Va can be buffered by a single-supply rail-to-rail operational amplifier, and the original simple voltage divider equation can be used. This solution works for any single-ended signal which stays between 0 and +5 volts. Some op-amp choices are:
Software
Readings from the analog inputs are returned by the functions EAnalogIn, AISample, AIBurst, and AIStreamRead.
EAnalogIn is a simplified (E is for easy) function that returns a single reading from 1 analog input channel. Execution time is up to 20 ms.
AISample returns a single reading of 1-4 channels, and takes up to 20 ms to execute, providing a maximum date rate of about 50 Hz per channel.
AIBurst acquires multiple samples of 1-4 channels at a hardware-timed sample rate of 400-8192 Hz. The acquisition can be triggered based on a change of state on IO0 or IO1. This function also returns the states of the IO pins (which are read every 4 samples).
Internally, the actual number of samples collected and transferred by the LabJack during an AIBurst call is the smallest power of 2, from 64 to 4096, which is at least as big as numSamples. The execution time of this function, in milliseconds, can be estimated as:
Turbo (default) => 30+(1000*numSamplesActual/sampleRate)+(0.4*numSamplesActual)
Normal => 30+(1000*numSamplesActual/sampleRate)+(2.5*numSamplesActual)
numSamples = numScans * numChannels
sampleRate = scanRate * numChannels
AIStreamRead is called periodically during a stream acquisition started by AIStreamStart. Each call retrieves multiple samples of 1-4 channels from the LabJack stream buffer, along with the states of the IO pins (read every 4 samples). Hardware-timed sample rates of 200-1200 Hz are available. If any function besides AIStreamRead is called while a stream is in progress, the stream will be stopped.
The LabJack U12 has 2 screw terminals for analog output voltages. Each analog output can be set to a voltage between 0 and the supply voltage (+5 volts nominal) with 10-bits of resolution.
The output voltage is ratiometric with the +5 volt supply (+5V), which is generally accurate to ±5% (see Appendix A). If an output voltage of 5 volts is specified, the resulting output will be 100% of the supply voltage. Similarly, specifying 2.5 volts actually gives 50% of the supply voltage. The maximum output voltage is almost 100% of +5V at no-load, and decreases with load. See the specifications in Appendix A relating to maximum output voltage. Also note that loading either analog output will cause an IR drop through the source impedance of each.
If improved accuracy is needed, measure the +5 volt supply with an analog input channel, and the actual output voltage can be calculated. For instance, if an analog output of 2.5 volts is specified and a measurement of +5V returns 5.10 volts, the actual output voltage is 2.55 volts (at no-load). Alternatively (and preferably), the analog output can itself be measured with an analog input.
There is a 1st order low-pass filter on each analog output with a 3dB frequency around 22 Hz.
The analog outputs are initialized to 0.0 volts on power-up or reset.
The analog outputs can withstand a continuous short-circuit to ground, even when set at maximum output.
Voltage should never be applied to the analog outputs, as they are voltage sources themselves. In the event that a voltage is accidentally applied to either analog output, they do have protection against transient overvoltages such as ESD (electrostatic discharge) and continuous overvoltage of a couple volts. An applied voltage that exceeds the capability of this protection will most likely damage the resistor R63 (AO0) or R62 (AO1) on the LabJack U12 PCB. The symptom of such a failure would be reduced voltage from the analog outputs, particularly at load, and could be verified by measuring the resistance of R62/R63 (should be less than 50 ohms but a damaged resistor will measure higher). A simple repair for such damage is to remove the damaged resistor and simply make a short with a blob of solder.
Software
The analog outputs are set using the function EAnalogOut (easy function) or AOUpdate, which take up to 20 ms to execute, providing a maximum update rate of about 50 Hz per channel. AOUpdate also controls/reads all 20 digital I/O and the counter.
Connections to 4 of the LabJack’s 20 digital I/O are made at the screw terminals, and are referred to as IO0-IO3. Each pin can individually be set to input, output high, or output low. These 4 channels include a 1.5 kΩ series resistor that provides overvoltage/short-circuit protection. Each channel also has a 1 MΩ resistor connected to ground.
All digital I/O are set to input on power-up or reset.
One common use of a digital input is for measuring the state of a switch as shown in Figure 2.3-1. If the switch is open, IO0 reads FALSE. If the switch is closed, IO0 reads TRUE.
While providing overvoltage/short-circuit protection, the 1.5 kΩ series resistor on each IO pin also limits the output current capability. For instance, with an output current of 1 mA, the series resistor will drop 1.5 volts, resulting in an output voltage of about 3.5 volts.
Software
The easy functions EDigitalIn or EDigitalOut are used to read or set the state of one digital line, and both take up to 20 ms to execute.
The functions AOUpdate and DigitalIO are used to set the direction, set the state, and/or read the state, of each IO pin. Both of these functions take up to 20 ms to execute, providing a maximum update rate of about 50 Hz per pin.
The function AISample can set/read the state of each IO, but setting the state will have no effect unless the IO have been configured as outputs using another function. The function Counter reads the state of each IO.
The functions AIBurst and AIStreamRead, take a reading of the IO states and return it with the analog data. The states of the 4 IO are read simultaneously every 4 samples, providing a data rate of up to 2048 Hz per pin for burst mode, or 300 Hz per pin for stream mode. For 1 or 2 channel scans, duplicate data (4x or 2x) will be added to the read array such that the size is numScans.
Connections to 16 of the LabJack’s 20 digital I/O are made at the DB25 connector, and are referred to as D0-D15. These 16 lines have no overvoltage/short-circuit protection, and can sink or source up to 25 mA each (total sink or source current of 200 mA max for all 16). This allows the D pins to be used to directly control some relays. All digital I/O are CMOS output and TTL input except for D13-D15, which are Schmitt trigger input. Each D pin has a 1 MΩ resistor connected to ground.
These digital I/O can detect the state of a switch using the same circuit shown in Figure 2-5.
All digital I/O are set to input on power-up or reset.
Table 2.4.1. DB25 Pinouts
1: | D0 | 6: | D5 | 11: | +5V | 16: | GND | 21: | D11 |
2: | D1 | 7: | D6 | 12: | +5V | 17: | GND | 22: | D12 |
3: | D2 | 8: | D7 | 13: | +5V | 18: | D8 | 23: | D13 |
4: | D3 | 9: | NC | 14: | GND | 19: | D9 | 24: | D14 |
5: | D4 | 10: | +5V | 15: | GND | 20: | D10 | 25: | D15 |
Figure 2.4.2. Standard DB25 pin numbers looking at the female connector on the U12
Because the D pins have no overvoltage/short-circuit protection, the user must be careful to avoid damage. A series resistor can provide substantial protection for these pins (see the CB25 datasheet). The following are examples of things that could damage a D pin and/or the entire LabJack:
Software
The easy functions EDigitalIn or EDigitalOut are used to read or set the state of one digital line, and both take up to 20 ms to execute.
The functions AOUpdate and DigitalIO are used to set the direction, set the state, and/or read the state, of each D pin. In addition, DigitalIO also returns the current state of the direction and output registers. Both of these functions take up to 20 ms to execute, providing a maximum update rate of about 50 Hz per pin.
The input connection to the 32-bit counter is made at screw-terminal CNT. Internally there is a 1.5 kΩ series resistor (provides overvoltage protection) and then a 1 MΩ resistor to ground (weakly holds line low when floating).
The counter is incremented when it detects a falling edge followed by a rising edge. This means that if you reset the counter while your signal is low, you will not get the first count until it goes high-low-high. In situations where this first count is important, you should simply substract the initial count from the final count, rather than doing a reset.
The counter (CNT) is disabled when the watchdog is enabled.
Software
The functions ECount (easy function), AOUpdate, and Counter are used to reset or read the counter. If a reset is specified, the counter is read first. All of these functions take up to 20 ms to execute, providing a maximum update rate of about 50 Hz.
Counter readings can also be returned in stream mode (AIStreamRead) at up to 300 Hz.
These terminals are primarily used at the factory during testing and calibration.
CAL is a precision 2.5 volt reference, and can be used during normal operation, but care should be taken to observe the current limits specified in Appendix A. The CAL pin is protected from ESD and overvoltage, but severe overvoltage (steady-state or transient) can damage CAL, and result in the failure of all analog inputs.
STB has 2 purposes. One is to disable the watchdog as described in Section 4.35, and the other is to create a rectangular output signal for testing. For the latter, if the U12 is streaming the STB frequency matches the sampling frequency, while if not streaming the STB frequency is about 28 kHz. To get this output signal on STB use the enableSTB parameter in the Counter function.
The LabJack has a nominal +5 volt internal power supply. Power can be drawn from this power supply by connecting to the +5V screw-terminals, or the +5V pins on the DB25 connector. The total amount of current that can be drawn from the +5V pins, analog outputs, and digital outputs, is 450 mA for most desktop computers and self-powered USB hubs. Some notebook computers and bus-powered hubs will limit this available current to about 50 mA.
The USB specification requires all hosts and hubs to have overcurrent protection. If the user puts too large a load on +5V (including a short circuit of +5V to GND) of the LabJack U12 (a USB device), the host or hub is responsible for limiting the current.
The GND connections available at the screw-terminals and DB25 connector provide a common ground for all LabJack functions. They are all the same.
Caution should be used whenever making connections with systems that have their own power source. It is normal to connect U12 ground to other grounds to create a common reference, but the risk is that the U12 ground will become the preferred ground for the other systems and they could try to send high currents into the U12. To prevent this it is often a good idea to put a 10-100 ohm resistor (or even a fuse) in series with GND on the U12 and any grounds from active systems.
The LabJack U12 is also available in 2 OEM (original equipment manufacturer) versions:
Dimensional drawings are available here. The pin-header pinouts can be found in “LabJack_U12_PH-NTH_Dimensions.pdf” which is in “u12dimensions.zip”.
Normally, nothing ships with these OEM LabJacks except for the populated PCB. All software is available online on the U12 Support Page.