13.5 SBUS [T-Series Datasheet]
This guide will help the reader understand, setup and operate the SBUS feature of T-Series devices.
Introduction
The SBUS feature makes it easy to interface with temperature and humidify sensors from Sensirion. All the details of the serial protocol, data conversions and checksums are handled so that the registers will return results in units of K or %RH.
Prerequisites
In this section we will cover the hardware components and the knowledge needed to use the SBUS feature.
LabJack DAQ devices
SBUS works with all T-Series devices. We are always adding features to our products. Check the below list to ensure that the firmware version on your device supports the sensor that you would like to use:
Support for SHT3x was added in firmware:
T4 - 1.0029
T7 - 1.0305
T8 - 1.0017
Sensors
Sensirion makes many sensors. Below is a list of sensors which this feature is compatible with:
SHT1x and SHT7x - Older devices which use the SBUS protocol
SHT3x - Newer device which uses I2C
EI-1050 (discontinued) which uses the SHT11 sensor
Some sensor examples:
*** Need to find and test sensors ***
Required Knowledge
Basics of controlling a T-Series device: registers and API
Usage
Using the SBUS feature is broken down into two components. How to physically connect the sensor (wiring section), and how to instruct the T-Series device to operate that sensor (operating section).
Wiring
Using the SBUS feature starts with connecting a sensor. Connect a sensor according to the below list:
Power - The sensor’s power supply must be connected to a 3.3V source. Many sensors define their logic high threshold as 0.7*Vdd. When supplied with 5V, the logic threshold will be 3.5V, which will not work with the 3.3V logic from a LabJack. Connect the power line to either a DIO set to output, a DAC set to 3.3V or the 3.3V output on the the T8.
Ground - A ground connection between the sensor and the LabJack DAQ must always be provided.
Data & Clock - The data and clock lines can be connected to any IO pair, the data line should always be on the lower numbered DIO. For example: FIO2 - Data and FIO3 - Clock.
Enable (optional) - The EI-1050 has an enable wire. The enable line allows multiple probes to share the clock, data, and power lines. Connect the enable line to any unused DIO. If you are only using one probe, the enable line can be connected to the power line.
Default DIO Assignments
The lines that the T-Series device will use for data, clock, and power are set at startup according to the below list. The assignments can be changed as desired.
T4
DIO4 (FIO4): Data Line
DIO5 (FIO5): Clock Line
DIO6 (FIO6): Power line. Will be set to output-high. Can be disabled.
T7/T8
DIO0 (FIO0): Data Line
DIO1 (FIO1): Clock Line
DIO2 (FIO2): Power line. Will be set to output-high. Can be disabled.
Operation
The SBUS feature is controlled through several interface registers. The behavior of the SBUS system will change depending on how the registers are used. The key differences are:
Enable Line: The enable line will be used any time the index of a result register does not match the current values in the data and clock registers. E.g.: If SBUS2_DATA_DIONUM = 0 and SBUS2_CLOCK_DIONUM = 1, and we read SBUS2_TEMP, the SBUS feature will use FIO2 as the enable line, FIO0 as DATA, and FIO1 as CLOCK. If SBUS2_DATA_DIONUM = 2 and SBUS2_CLOCK_DIONUM = 3, and we read SBUS2_TEMP, then the SBUS feature will not use an enable line.
Power Line: When reading from the TEMP or RH registers, the IO indicated by the value in SBUS_ALL_POWER_DIONUM will be set to output high. This functionality can be disable by setting the register to 9999.
SBUS Registers
Examples
HT3x sensors:
SHT3x sensors should not typically share data and clock lines, so only one sensor should be connected with default configurations. In this example we connect the wires from a probe to the lines specified by the default configuration:
T7/T8 | T4 | SHT3x |
---|---|---|
GND | GND | Ground (black) |
DIO0 (FIO0) | DIO4 (FIO4) | Data (SDA) |
DIO1 (FIO1) | DIO5 (FIO5) | Clock (SCL) |
DIO2 (FIO2) | DIO6 (FIO6) | Power (red) |
You can then read from SBUS0_TEMP and SBUS0_RH for the probe without writing any configuration values. In LJLogM, for example, just put the desired register name in any row. A read from SBUS0_TEMP will return the temperature, and a read from SBUS0_RH will return the humidity.
To add additional sensors an SBUS#_DATA_DIONUM and SBUS#_CLOCK_DIONUM register should be configured for each sensor. Each new probe should be connected to their own set of DIO. One exception is that any DIO set to output high or a DAC output set to 3.3V can easily power multiple sensors. For example, say you add two more sensors connected as shown in the table below:
T4/T7/T8 | SHT3x |
---|---|
GND | Ground (black) ProbeB, ProbeC |
DAC0 | Power (red) ProbeB, ProbeC |
DIO8 (EIO0) | Data (SDA) ProbeB |
DIO9 (EIO1) | Clock (SCL) ProbeB |
DIO10 (EIO2) | Data (SDA) ProbeC |
DIO11 (EIO3) | Clock (SCL) ProbeC |
You could then set SBUS1_DATA_DIONUM to 8 (DIO8) and SBUS1_CLOCK_DIONUM to 9 (DIO9). Reading SBUS1_TEMP and SBUS1_RH will return the temperature and humidity from ProbeB. You could set SBUS2_DATA_DIONUM to 10 (DIO10) and SBUS2_CLOCK_DIONUM to 11 (DIO11). Reading SBUS2_TEMP and SBUS2_RH will return the temperature and humidity from ProbeC.
EI-1050 probes using default configuration:
The EI-1050 has an enable line that allows multiple probes to use the same pair of data/clock lines. In this example we connect the wires from each probe to the lines specified by the default config:
T7/T8 | T4 | EI-1050 |
---|---|---|
GND | GND | Ground (black) |
DIO0 (FIO0) | DIO4 (FIO4) | Data (green) |
DIO1 (FIO1) | DIO5 (FIO5) | Clock (white) |
DIO2 (FIO2) | DIO6 (FIO6) | Power (red) |
FIO lines can only power 4 EI-1050 probes, so that is the limitation on number of probes using the default config. We can now connect the enable line from each probe to any DIO we want. Let's use:
T7/T8 | T4 | EI-1050 |
---|---|---|
DIO3 (FIO3) | DIO7 (FIO7) | Enable ProbeA (brown) |
DIO4 (FIO4) | DIO8 (EIO0) | Enable ProbeB (brown) |
DIO5 (FIO5) | DIO9 (EIO1) | Enable ProbeC (brown) |
DIO6 (FIO6) | DIO10 (EIO2) | Enable ProbeD (brown) |
You can now read from SBUS#_TEMP and SBUS#_RH for each probe without writing any config values. In LJLogM, for example, just put the desired register name in any row. For the T4, a read from SBUS8_TEMP will return the temperature from ProbeB, and a read from SBUS9_RH will return the humidity from ProbeC. For the T7/T8, a read from SBUS4_TEMP will return the temperature from ProbeB, and a read from SBUS5_RH will return the humidity from ProbeC.
Note that when using multiple probes this way, you might need to read one value from each probe before they will work. By default, digital I/O are set to input, which has a 100k pull-up, so all 4 probes in this example will be enabled at the same time, which will likely result in a read error. At the end of a read, the enable line is set to output-low, so once you do an initial read from each, they will all be disabled and on further reads only one will be enabled at a time.
EI-1050 probes with custom configuration (shared Data/Clock):
Say you connect 2 probes as follows:
GND | Ground (black) |
DIO8 (EIO0) | Data (green) |
DIO9 (EIO1) | Clock (white) |
DIO10 (EIO2) | Power (red) |
DIO11 (EIO3) | Enable ProbeA (brown) |
DIO12 (EIO4) | Enable ProbeB (brown) |
Write the following registers to configure and disable the probes:
SBUS_ALL_DATA_DIONUM = 8
SBUS_ALL_CLOCK_DIONUM = 9
SBUS_ALL_POWER_DIONUM = 10
EIO3 = 0
EIO4 = 0
You can now read from SBUS11_TEMP/SBUS11_RH for ProbeA values or SBUS12_TEMP/SBUS12_RH for ProbeB values.
EI-1050 with custom configuration (separate Data/Clock):
This example does not use the enable feature of the EI-1050, and thus applies to the SHT1x and SHT7x also.
In this example each probe has its own data and clock lines. Thus the enable line is not needed and we leave both probes enabled all the time. This technique requires 2 DIO per probe, whereas with the shared data and clock lines you need 1 DIO per probe (enable line) plus 2 DIO (data and clock). A couple downsides to sharing data and clock lines are that it can be difficult to get multiple wires in a single screw terminal and that increased wire capacitance can cause communication problems. Our testing has shown that 6 stock (6 ft cable) EI-1050 probes work fine with a single shared pair of data and clock lines.
Say you connect 2 EI-1050s as follows:
GND | Ground ProbeA (black) |
DIO8 (EIO0) | Data ProbeA (green) |
DIO9 (EIO1) | Clock ProbeA (white) |
DAC0 | Power ProbeA (red) |
DAC0 | Enable ProbeA (brown) |
GND | Ground ProbeB (black) |
EIO2/DIO10 | Data ProbeB (green) |
EIO3/DIO11 | Clock ProbeB (white) |
DAC0 | Power ProbeB (red) |
DAC0 | Enable ProbeB (brown) |
Since the EI-1050 enable lines are tied to power they will always be enabled. We can do that because we have assigned both probes dedicated DIO for data and clock.
In this example we use DAC0 to provide power for the sensors. The automatic power control is only supported on digital I/O lines, so we disable automatic power control and manually set DAC0 to 3.3 volts. Alternatively we could use a digital line to power the sensors, with or without automatic power control.
Write the following registers to configure and power the probes:
SBUS8_DATA_DIONUM = 8 // Automatic enable control disabled since DATA line is same as SBUS#.
SBUS8_CLOCK_DIONUM = 9
SBUS10_DATA_DIONUM = 10 // Automatic enable control disabled since DATA line is same as SBUS#.
SBUS10_CLOCK_DIONUM = 11
SBUS_ALL_POWER_DIONUM = 9999 // Disable automatic power control.
DAC0 = 3.3 // Power for both probes.
You can now read from SBUS8_TEMP/SBUS8_RH for ProbeA values or SBUS10_TEMP/SBUS10_RH for ProbeB values.
Note that the "#" in the register names above can be about anything you want. Say for ProbeB you instead did:
SBUS7_DATA_DIONUM = 10
SBUS7_CLOCK_DIONUM = 11
Now if you read SBUS7_TEMP/SBUS7_RH, the LabJack will use EIO2/3 to talk to the sensor. A possible problem, though, is that the LabJack will also control FIO7 as an enable even though FIO7 has nothing to do with ProbeB. It will set FIO7 to output-high, talk to the sensor, and then set FIO7 to output-low. The way to prevent control of an enable line is to use a "#" that is the same as the data or clock line.
SHT1x or SHT7x sensor using default configuration:
This example was made for the T7/T8. To adapt it for the T4 simply change the line numbers 0-2 to 4-6.
In this example we connect the 4 connections from the raw Sensirion sensor to the lines specified by the default config:
GND | Ground (black) |
DIO0 (FIO0) | Data (green) |
DIO1 (FIO1) | Clock (white) |
DIO2 (FIO2) | Power (red) |
Note that the SHT7x datasheet shows an added 10k pull-up resistor from Data to Power. The LabJack has an internal 100k pull-up that usually works, but some applications might need the stronger 10k pull-up (FIO0 to FIO2) and perhaps even a capacitor from Clock to GND. The filter cap should be near the sensor pins, not the LabJack terminals. Suggested value is equal to or less than 1 / (2 * pi * f * R)
, where f
is the clock frequency and R
is the source impedance—which is dominated in this case by the DIO (use 550 ohms for FIO and 180 ohms for EIO). 1nF or 10nF should be good for any DIO at the default SBUS clock frequency of 9100 Hz.
You can now read from SBUS0_TEMP & SBUS0_RH without writing any config values. In LJLogM, for example, just put the desired register name in any row. The SHT71 does not have an enable, so we set "#" equal to the data line (0) or clock line (1) which is a signal to the T-series device to not control an enable line.
Since the raw SHT sensors do not have an enable, each sensor must have its own Data and Clock lines.
If an SHT sensor is not working at this point, an oscilloscope or logic analyzer will likely be required to troubleshoot.
Troubleshooting
Checksum or acknowledgement errors can indicate that the clock speed is too fast for the hardware configuration. Use the SBUS_ALL_CLOCK_SPEED register to reduce the clock speed: