API Documentation

SF06-LF

Sf06LfDevice

The class Sf06LfDeviceBase implements the low level interface of the sensor. The class Sf06LfDevice extends the Sf06LfDeviceBase. It provides additional functions to ease the use of the sensor.

class sensirion_i2c_sf06_lf.device.Sf06LfDeviceBase(channel)[source]

Low level API implementation of SF06_LF

__init__(channel)[source]
property channel
start_h2o_continuous_measurement()[source]

Starts continuous measurement mode using calibration values for H₂O. The sensor measures both the flow rate and the temperature. After the command has been sent, the chip continuously measures and updates the measurement results which can be read with read_measurement_data_raw.

Note

The first measurement result will be available after 12ms. Due to the thermal measurement principle small accuracy deviations (% m.v.) can occur while the sensor warms-up (60ms for SLF3x, 120ms for LD2x including the 12 ms for measurement initialization).

start_ipa_continuous_measurement()[source]

Starts continuous measurement mode using calibration values for Isopropyl alcohol. The sensor measures both the flow rate and the temperature. After the command has been sent, the chip continuously measures and updates the measurement results which can be read with read_measurement_data_raw. Supported by products: SLF3C-1300F, SLF3S-1300F, SLF3S-0600F, SLF3S-4000B

Note

The first measurement result will be available after 12ms. Due to the thermal measurement principle small accuracy deviations (% m.v.) can occur while the sensor warms-up (60ms for SLF3x, 120ms for LD2x including the 12 ms for measurement initialization).

read_measurement_data_raw()[source]

After the command start_xx_continuous_measurement has been sent, the chip continuously measures and updates the measurement results. New results (flow, temperature, and signaling flags) can be read continuously with this command.

Return raw_flow

For SLF3C-1300F, SLF3S-1300F convert to ml/min by applying: flow = raw_flow / 500 For SLF3S-4000B convert to ml/min by applying: flow = raw_flow / 32 For SLF3S-0600F convert to μl/min by applying: flow = raw_flow / 10 For LD20-0600L convert to ml/h by applying: flow = raw_flow / 1200 For LD20-2600B convert to ml/h by applying: flow = raw_flow / 20

Return raw_temperature

Convert to degrees celsius by temperature = raw_temperature / 200

Return signaling_flags

Gives additional information about the measurement status. Refer to the sensor data sheet for detailed information. Following flags are defined: Air-in-Line flag (Bit 0), High Flow flag (Bit 1), Exponential smoothing active (Bit 5)

Note

The first measurement result will be available 12ms after starting the measurement. Small accuracy deviations (% m.v.) can occur during the first 60ms for SLF3x, 120ms for LD2x (including the 12ms initialization)

stop_continuous_measurement()[source]

This command stops the continuous measurement and puts the sensor in idle mode. After it receives the stop command, the sensor needs up to 0.5ms to power down the heater, enter idle mode and be receptive for a new command.

start_single_thermal_conductivity_measurement_sync()[source]

This command starts one thermal conductivity measurement and blocks for 2.3 seconds until the measurement results are ready. After completion of the measurement, the heater is switched off and the sensor enters idle mode and the results can be read anytime with read_thermal_conductivity_measurement_data. The sensor measures the thermal conductivity, the sensor temperature, and the delta-temperature (a measure for the temperature difference between the liquid and the sensor). Supported by products: SLF3C-1300F, SLF3S-4000B

start_single_thermal_conductivity_measurement_async()[source]

This command starts one thermal conductivity measurement and returns immediately. Note that the sensor does not accept any other commands while the measurement is running, which takes approximately 2.3 seconds. After completion of the measurement, the heater is switched off and the sensor enters idle mode and the results can be read anytime with read_thermal_conductivity_measurement_data. The sensor measures the thermal conductivity, the sensor temperature, and the delta-temperature (a measure for the temperature difference between the liquid and the sensor). Supported by products: SLF3C-1300F, SLF3S-4000B

read_thermal_conductivity_measurement_data()[source]

Reads single thermal conductivity measurement after a measurement has been started with start_single_thermal_conductivity_measurement_sync or start_single_thermal_conductivity_measurement_async. Supported by products: SLF3C-1300F, SLF3S-4000B

Return thermal_conductivity

thermal conductivity

Return raw_temperature

Convert to degrees celsius by temperature = raw_temperature / 200

Return raw_delta_temperature

The delta-temperature is a measure for the temperature difference between the liquid and the sensor. Convert to degrees celsius by delta_temperature = raw_delta_temperature / 1000

enter_sleep()[source]

In sleep mode the sensor uses a minimum amount of power. The mode can only be entered from idle mode, i.e. when the sensor is not measuring. This mode is particularly useful for battery operated devices. To minimize the current in this mode, the complexity of the sleep mode circuit has been reduced as much as possible, which is mainly reflected by the way the sensor exits the sleep mode. In sleep mode the sensor cannot be soft reset. Supported by products: LD20-0600L, LD20-2600B

exit_sleep()[source]

The sensor exits the sleep mode and enters the idle mode when it receives the valid I2C address and a write bit (‘0’). Note that the I2C address is not acknowledged. It is necessary to poll the sensor to see whether the sensor has received the address and has woken up. This should take typically 25ms. Supported by products: LD20-0600L, LD20-2600B

read_product_identifier_prepare()[source]

Prepare to read the product identifier and the serial number. The command can only be executed from the idle mode, i.e. when the sensor is not performing measurements.

read_product_identifier()[source]

This command allows to read product identifier and the serial number. The command can only be executed from the idle mode, i.e. when the sensor is not performing measurements and read_product_identifier_prepare is called before.

Return product_identifier

Note that the last 8 bits are the sensor’s revision number and are subject to change in case of an update of the specifications.

Return serial_number

serial number

class sensirion_i2c_sf06_lf.device.Sf06LfDevice(channel)[source]

Driver class implementation of SF06_LF

sf06_lf

Access to base class

__init__(channel)[source]
read_measurement_data(inv_flow_scale_factor)[source]

Reads the raw measurement values and converts them to their physcial units where applicable. For the flow the scaling factor and resulting flow unit depends on the specific sensor. The scaling factor is passed as an argument and the raw flow value is converted by applying: flow = raw_flow / inv_flow_scale_factor The scaling factors for the supported sensor are defined in enum inv_flow_scale_factors

Parameters

inv_flow_scale_factor – used to convert raw flow value

Return a_flow

As the flow scaling differs for specific sensor types the scaling factor must be passed as an argument. See the enum inv_flow_scale_factors for scaling factors of supported sensors. The raw value is converted by: flow = raw_flow / inv_flow_scale_factor Resulting unit depends on your specific sensor type.

Return a_temperature

temperature in degree celsius

Return a_signaling_flags

read_thermal_conductivity_measurement_data()[source]

Reads single thermal conductivity measurement after a measurement has been started with start_single_thermal_conductivity_measurement. Supported by products: SLF3C-1300F, SLF3S-4000B

Return a_thermal_conductivity

thermal conductivity in arbitary unit

Return a_temperature

temperature in degree celsius

Return a_delta_temperature

delta temperature in degree celsius

read_product_identifier()[source]

Read product identifier and the serial number. The command can only be executed from the idle mode, i.e. when the sensor is not performing measurements.

Return product_identifier

Note that the last 8 bits are the sensor’s revision number and are subject to change in case of an update of the specifications.

Return serial_number

serial number

Commands

The transfer classes specify the data that is transferred between host and sensor. The generated transfer classes are used by the driver class and not intended for direct use.

class sensirion_i2c_sf06_lf.commands.InvFlowScaleFactors(value)[source]

An enumeration.

SLF3C_1300F = 500
SLF3S_1300F = 500
SLF3S_4000B = 32
SLF3S_0600F = 10
LD20_0600L = 1200
LD20_2600B = 20
class sensirion_i2c_sf06_lf.commands.SignalingFlagsT(int_value: int = 0)[source]
air_in_line_flag = BitField(offset=0, width=1)
high_flow_flag = BitField(offset=1, width=1)
exp_smoothing_active = BitField(offset=5, width=1)
class sensirion_i2c_sf06_lf.commands.StartH2oContinuousMeasurement[source]

Starts continuous measurement mode using calibration values for H₂O. The sensor measures both the flow rate and the temperature. After the command has been sent, the chip continuously measures and updates the measurement results which can be read with read_measurement_data_raw.

CMD_ID = 13832
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
class sensirion_i2c_sf06_lf.commands.StartIpaContinuousMeasurement[source]

Starts continuous measurement mode using calibration values for Isopropyl alcohol. The sensor measures both the flow rate and the temperature. After the command has been sent, the chip continuously measures and updates the measurement results which can be read with read_measurement_data_raw. Supported by products: SLF3C-1300F, SLF3S-1300F, SLF3S-0600F, SLF3S-4000B

CMD_ID = 13845
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
class sensirion_i2c_sf06_lf.commands.ReadMeasurementDataRaw[source]

After the command start_xx_continuous_measurement has been sent, the chip continuously measures and updates the measurement results. New results (flow, temperature, and signaling flags) can be read continuously with this command.

pack()[source]
rx = <sensirion_driver_adapters.rx_tx_data.RxData object>
class sensirion_i2c_sf06_lf.commands.StopContinuousMeasurement[source]

This command stops the continuous measurement and puts the sensor in idle mode. After it receives the stop command, the sensor needs up to 0.5ms to power down the heater, enter idle mode and be receptive for a new command.

CMD_ID = 16377
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
class sensirion_i2c_sf06_lf.commands.StartSingleThermalConductivityMeasurementSync[source]

This command starts one thermal conductivity measurement and blocks for 2.3 seconds until the measurement results are ready. After completion of the measurement, the heater is switched off and the sensor enters idle mode and the results can be read anytime with read_thermal_conductivity_measurement_data. The sensor measures the thermal conductivity, the sensor temperature, and the delta-temperature (a measure for the temperature difference between the liquid and the sensor). Supported by products: SLF3C-1300F, SLF3S-4000B

CMD_ID = 13894
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
class sensirion_i2c_sf06_lf.commands.StartSingleThermalConductivityMeasurementAsync[source]

This command starts one thermal conductivity measurement and returns immediately. Note that the sensor does not accept any other commands while the measurement is running, which takes approximately 2.3 seconds. After completion of the measurement, the heater is switched off and the sensor enters idle mode and the results can be read anytime with read_thermal_conductivity_measurement_data. The sensor measures the thermal conductivity, the sensor temperature, and the delta-temperature (a measure for the temperature difference between the liquid and the sensor). Supported by products: SLF3C-1300F, SLF3S-4000B

CMD_ID = 13894
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
class sensirion_i2c_sf06_lf.commands.ReadThermalConductivityMeasurementData[source]

Reads single thermal conductivity measurement after a measurement has been started with start_single_thermal_conductivity_measurement_sync or start_single_thermal_conductivity_measurement_async. Supported by products: SLF3C-1300F, SLF3S-4000B

pack()[source]
rx = <sensirion_driver_adapters.rx_tx_data.RxData object>
class sensirion_i2c_sf06_lf.commands.EnterSleep[source]

In sleep mode the sensor uses a minimum amount of power. The mode can only be entered from idle mode, i.e. when the sensor is not measuring. This mode is particularly useful for battery operated devices. To minimize the current in this mode, the complexity of the sleep mode circuit has been reduced as much as possible, which is mainly reflected by the way the sensor exits the sleep mode. In sleep mode the sensor cannot be soft reset. Supported by products: LD20-0600L, LD20-2600B

CMD_ID = 13943
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
class sensirion_i2c_sf06_lf.commands.ExitSleep[source]

The sensor exits the sleep mode and enters the idle mode when it receives the valid I2C address and a write bit (‘0’). Note that the I2C address is not acknowledged. It is necessary to poll the sensor to see whether the sensor has received the address and has woken up. This should take typically 25ms. Supported by products: LD20-0600L, LD20-2600B

CMD_ID = 0
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
class sensirion_i2c_sf06_lf.commands.ReadProductIdentifierPrepare[source]

Prepare to read the product identifier and the serial number. The command can only be executed from the idle mode, i.e. when the sensor is not performing measurements.

CMD_ID = 13948
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
class sensirion_i2c_sf06_lf.commands.ReadProductIdentifier[source]

This command allows to read product identifier and the serial number. The command can only be executed from the idle mode, i.e. when the sensor is not performing measurements and read_product_identifier_prepare is called before.

CMD_ID = 57602
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
rx = <sensirion_driver_adapters.rx_tx_data.RxData object>

Result Types

The signal classes specify transformations of the raw sensor signals into a meaningful units. The generated signal types are used by the driver class and not intended for direct use.

class sensirion_i2c_sf06_lf.result_types.SignalFlow(raw_flow, inv_flow_scale_factor)[source]

As the flow scaling differs for specific sensor types the scaling factor must be passed as an argument. See the enum inv_flow_scale_factors for scaling factors of supported sensors. The raw value is converted by: flow = raw_flow / inv_flow_scale_factor Resulting unit depends on your specific sensor type.

property value
class sensirion_i2c_sf06_lf.result_types.SignalTemperature(raw_temperature)[source]

temperature in degree celsius

property value
class sensirion_i2c_sf06_lf.result_types.SignalDeltaTemperature(raw_delta_temperature)[source]

delta temperature in degree celsius

property value
class sensirion_i2c_sf06_lf.result_types.SignalThermalConductivity(raw_thermal_conductivity)[source]

thermal conductivity in arbitary unit

property value