API Documentation
SFM-SF06
SfmSf06Device
The class SfmSf06DeviceBase implements the low level interface of the sensor. The class SfmSf06Device extends the SfmSf06DeviceBase. It provides additional functions to ease the use of the sensor.
- class sensirion_i2c_sfm_sf06.device.SfmSf06DeviceBase(channel)[source]
Low level API implementation of SFM_SF06
- property channel
- start_o2_continuous_measurement()[source]
The sensor starts measuring both O₂ flow and temperature and provides a status word. All three measurement results can be read out through one single I2C read when the continuous measurement is running. The specific command code used for the start continuous measurement command selects the calibrated gas or binary gas mixture (lookup table) for the flow signal.
- Supported by products:
SFM3003
SFM4300-20
SFM4300-50
SFM3119
SFM3013-300-CL
SFM3013-300-CLM
SFM3019
Note
The first measurement result will be available after 12ms. Small accuracy deviations (few % of reading) can occur during the first 30ms (including the 12ms)
- start_air_continuous_measurement()[source]
The sensor starts measuring both Air flow and temperature and provides a status word. All three measurement results can be read out through one single I2C read when the continuous measurement is running. The specific command code used for the start continuous measurement command selects the calibrated gas or binary gas mixture (lookup table) for the flow signal.
- Supported by products:
SFM3003
SFM4300-20
SFM4300-50
SFM3119
SFM3013-300-CL
SFM3013-300-CLM
SFM3019
Note
The first measurement result will be available after 12ms. Small accuracy deviations (few % of reading) can occur during the first 30ms (including the 12ms)
- start_n2o_continuous_measurement()[source]
The sensor starts measuring both N₂O (HeOx for SMF3013-300-CLM) flow and temperature and provides a status word. All three measurement results can be read out through one single I2C read when the continuous measurement is running. The specific command code used for the start continuous measurement command selects the calibrated gas or binary gas mixture (lookup table) for the flow signal.
- Supported by products:
SFM4300-20
SFM3013-300-CLM (HeOx)
Note
The first measurement result will be available after 12ms. Small accuracy deviations (few % of reading) can occur during the first 30ms (including the 12ms)
- start_co2_continuous_measurement()[source]
The sensor starts measuring both CO₂ flow and temperature and provides a status word. All three measurement results can be read out through one single I2C read when the continuous measurement is running. The specific command code used for the start continuous measurement command selects the calibrated gas or binary gas mixture (lookup table) for the flow signal.
- Supported by products:
SFM4300-20
Note
The first measurement result will be available after 12ms. Small accuracy deviations (few % of reading) can occur during the first 30ms (including the 12ms)
- start_air_o2_continuous_measurement(volume_fraction)[source]
The sensor starts measuring the Air/O₂ flow and temperature and provides a status word. All three measurement results can be read out through one single I2C read when the continuous measurement is running. The specific command code used for the start continuous measurement command selects the calibrated gas or binary gas mixture (lookup table) for the flow signal.
- Supported by products:
SFM3003
SFM4300-20
SFM4300-50
SFM3119
SFM3013-300-CL
SFM3013-300-CLM
SFM3019
- Parameters
volume_fraction – Volume fraction of dioxigen in ‰.
- start_n2o_o2_continuous_measurement(volume_fraction)[source]
The sensor starts measuring the N₂O / O₂ (HeOx for SMF3013-300-CLM) flow and temperature and provides a status word. All three measurement results can be read out through one single I2C read when the continuous measurement is running. The specific command code used for the start continuous measurement command selects the calibrated gas or binary gas mixture (lookup table) for the flow signal.
- Supported by products:
SFM4300-20
SFM3013-300-CLM (HeOx)
- Parameters
volume_fraction – Volume fraction of O₂ in ‰.
- start_co2_o2_continuous_measurement(volume_fraction)[source]
The sensor starts measuring the CO₂ / O₂ flow and temperature and provides a status word. All three measurement results can be read out through one single I2C read when the continuous measurement is running. The specific command code used for the start continuous measurement command selects the calibrated gas or binary gas mixture (lookup table) for the flow signal.
- Supported by products:
SFM4300-20
- Parameters
volume_fraction – Volume fraction of O₂ in ‰.
- read_measurement_data()[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 status word) can be read continuously with this command.
- Return flow
Calibrated flow signal.
- Return temperature
Calibrated temperature.
- Return status_word
Gives information about the measurement command that is currently running, information on the currently selected averaging mode, and the defined gas concentration of the current measurement command. A detailed description of the status_word can be found in the data sheet.
Note
The first measurement result will be available after 12ms. Small accuracy deviations (few % of reading) can occur during the first 30ms (including the 12ms)
- update_concentration_set(volume_fraction)[source]
Together with the instruction update_concentration_activate this instruction allows to update the concentration of a binary gas mixture dynamically, i.e. without exiting the running measurement mode. This first instruction transmits the new concentration value to the flow sensor. This instruction refers to Transmit concentration. For more details see data-sheet section Update Concentration
- Parameters
volume_fraction – Fraction value
Note
The concentration value must not be updated more than once per millisecond
If a concentration value greater than 1000 is passed to the sensor, the measurement mode will stop.
- Example
sensor.update_concentration_set(50)
- update_concentration_activate()[source]
By executing this instruction the previously with update_concentration_set set value becomes active. The instruction resets the I2C address pointer to the regular result output buffer such that the measurement data as described by the transfer read_measurement_data are optained upon a subsequent read. This instruction refers to Reset-i2c address pointer. For more details see data-sheet section Update Concentration
Note
The concentration value must not be updated more than once per millisecond
If a concentration value greater than 1000 is passed to the sensor, the measurement mode will stop.
- 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.
- configure_averaging(average_window)[source]
- This command configures the sensor’s averaging mode:
N=0 (default): average-until-read mode (c.f. Sec. 3)
1≤N≤128: fixed-N averaging mode. N is the number of internal measurements that are averaged for one returned measurement value (i.e. the average over N flow samples, where N = CmdArgument, c.f. Sec. 3).
The configured averaging mode will be used for flow measurements until a reset or re-execution of this command is performed. After a reset, averaging is set to average-until-read mode (i.e. N is set to 0). The highest averaging number allowed is 128. If a higher number is used in the command argument, it will be overruled by the maximal value of 128 samples to average. If no averaging is desired, set N to 1.
- Parameters
average_window – Average window configuration value.
- Example
sensor.configure_averaging(50)
- read_scale_offset_unit(command_code)[source]
This command provides the scale factor and offset to convert flow readings into physical units. The scale factor and offset are specific to the calibrated gas / gas mixture and its corresponding lookup table used for the flow measurement. Therefore, the gas / gas mixture needs to be specified in the command argument by the command code of the corresponding start continuous measurement. For detailed information see data-sheet.
- Parameters
command_code – Code of measurement from which we want to have that information.
- Return flow_scale_factor
Scale factor used by the sensor.
- Return flow_offset
Offset used by the sensor.
- Return flow_unit
Applicable flow unit.
- 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 performing measurements. 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.
- 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 16ms.
- 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
- Return product_identifier
32-bit unique product and revision number
- Return serial_number
64 bit unique serial number of the device
- class sensirion_i2c_sfm_sf06.device.SfmSf06Device(channel)[source]
Driver class implementation of SFM_SF06
- sf06
Access to base class
- start_n2o_continuous_measurement()[source]
Start NO2 measurement and readout the corresponding scale factor from the sensor
- start_n2o_o2_continuous_measurement(volume_fraction)[source]
Start measurement and update internal state
- Parameters
volume_fraction – Volume fraction of O₂ in ‰.
- start_co2_o2_continuous_measurement(volume_fraction)[source]
Start measurement and update internal state
- Parameters
volume_fraction – Volume fraction of O₂ in ‰.
- start_air_o2_continuous_measurement(volume_fraction)[source]
Start measurement and update internal state
- Parameters
volume_fraction – Volume fraction of dioxigen in ‰.
- read_measurement_data_raw()[source]
Rename overwritten function.
- Return flow
Calibrated flow signal.
- Return temperature
Calibrated temperature.
- Return status_word
Gives information about the measurement command that is currently running, information on the currently selected averaging mode, and the defined gas concentration of the current measurement command. A detailed description of the status_word can be found in the data sheet.
- read_measurement_data()[source]
Read measurement data and apply appropriate scaling.
- Return a_flow
This signal represents the mesured flow. It is scaled with the corresponding scaling factor and offset
- Return a_temperature
Measured temperature in degrees celsius. The raw value is scaled appropriately.
- Return a_status_word
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_sfm_sf06.commands.ErrorCodeT(value)[source]
An enumeration.
- I2C_ERROR = 0
- TIMEOUT = 1
- class sensirion_i2c_sfm_sf06.commands.StatusWordT(int_value: int = 0)[source]
- command_code = BitField(offset=12, width=4)
- exp_smoothing_flag = BitField(offset=11, width=1)
- avg_mode_flag = BitField(offset=10, width=1)
- gas_conc = BitField(offset=0, width=10)
- class sensirion_i2c_sfm_sf06.commands.FlowUnitT(int_value: int = 0)[source]
- prefix = BitField(offset=0, width=3)
- time_base = BitField(offset=4, width=4)
- unit = BitField(offset=8, width=4)
- class sensirion_i2c_sfm_sf06.commands.StartO2ContinuousMeasurement[source]
The sensor starts measuring both O₂ flow and temperature and provides a status word. All three measurement results can be read out through one single I2C read when the continuous measurement is running. The specific command code used for the start continuous measurement command selects the calibrated gas or binary gas mixture (lookup table) for the flow signal.
- Supported by products:
SFM3003
SFM4300-20
SFM4300-50
SFM3119
SFM3013-300-CL
SFM3013-300-CLM
SFM3019
- CMD_ID = 13827
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sfm_sf06.commands.StartAirContinuousMeasurement[source]
The sensor starts measuring both Air flow and temperature and provides a status word. All three measurement results can be read out through one single I2C read when the continuous measurement is running. The specific command code used for the start continuous measurement command selects the calibrated gas or binary gas mixture (lookup table) for the flow signal.
- Supported by products:
SFM3003
SFM4300-20
SFM4300-50
SFM3119
SFM3013-300-CL
SFM3013-300-CLM
SFM3019
- CMD_ID = 13832
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sfm_sf06.commands.StartN2OContinuousMeasurement[source]
The sensor starts measuring both N₂O (HeOx for SMF3013-300-CLM) flow and temperature and provides a status word. All three measurement results can be read out through one single I2C read when the continuous measurement is running. The specific command code used for the start continuous measurement command selects the calibrated gas or binary gas mixture (lookup table) for the flow signal.
- Supported by products:
SFM4300-20
SFM3013-300-CLM (HeOx)
- CMD_ID = 13845
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sfm_sf06.commands.StartCO2ContinuousMeasurement[source]
The sensor starts measuring both CO₂ flow and temperature and provides a status word. All three measurement results can be read out through one single I2C read when the continuous measurement is running. The specific command code used for the start continuous measurement command selects the calibrated gas or binary gas mixture (lookup table) for the flow signal.
- Supported by products:
SFM4300-20
- CMD_ID = 13854
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sfm_sf06.commands.StartAirO2ContinuousMeasurement(volume_fraction)[source]
The sensor starts measuring the Air/O₂ flow and temperature and provides a status word. All three measurement results can be read out through one single I2C read when the continuous measurement is running. The specific command code used for the start continuous measurement command selects the calibrated gas or binary gas mixture (lookup table) for the flow signal.
- Supported by products:
SFM3003
SFM4300-20
SFM4300-50
SFM3119
SFM3013-300-CL
SFM3013-300-CLM
SFM3019
- CMD_ID = 13874
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sfm_sf06.commands.StartN2OO2ContinuousMeasurement(volume_fraction)[source]
The sensor starts measuring the N₂O / O₂ (HeOx for SMF3013-300-CLM) flow and temperature and provides a status word. All three measurement results can be read out through one single I2C read when the continuous measurement is running. The specific command code used for the start continuous measurement command selects the calibrated gas or binary gas mixture (lookup table) for the flow signal.
- Supported by products:
SFM4300-20
SFM3013-300-CLM (HeOx)
- CMD_ID = 13881
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sfm_sf06.commands.StartCO2O2ContinuousMeasurement(volume_fraction)[source]
The sensor starts measuring the CO₂ / O₂ flow and temperature and provides a status word. All three measurement results can be read out through one single I2C read when the continuous measurement is running. The specific command code used for the start continuous measurement command selects the calibrated gas or binary gas mixture (lookup table) for the flow signal.
- Supported by products:
SFM4300-20
- CMD_ID = 13894
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sfm_sf06.commands.ReadMeasurementData[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 status word) can be read continuously with this command.
- rx = <sensirion_driver_adapters.rx_tx_data.RxData object>
- class sensirion_i2c_sfm_sf06.commands.UpdateConcentrationSet(volume_fraction)[source]
Together with the instruction update_concentration_activate this instruction allows to update the concentration of a binary gas mixture dynamically, i.e. without exiting the running measurement mode. This first instruction transmits the new concentration value to the flow sensor. This instruction refers to Transmit concentration. For more details see data-sheet section Update Concentration
- CMD_ID = 57725
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sfm_sf06.commands.UpdateConcentrationActivate[source]
By executing this instruction the previously with update_concentration_set set value becomes active. The instruction resets the I2C address pointer to the regular result output buffer such that the measurement data as described by the transfer read_measurement_data are optained upon a subsequent read. This instruction refers to Reset-i2c address pointer. For more details see data-sheet section Update Concentration
- CMD_ID = 57344
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sfm_sf06.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
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sfm_sf06.commands.ConfigureAveraging(average_window)[source]
- This command configures the sensor’s averaging mode:
N=0 (default): average-until-read mode (c.f. Sec. 3)
1≤N≤128: fixed-N averaging mode. N is the number of internal measurements that are averaged for one returned measurement value (i.e. the average over N flow samples, where N = CmdArgument, c.f. Sec. 3).
The configured averaging mode will be used for flow measurements until a reset or re-execution of this command is performed. After a reset, averaging is set to average-until-read mode (i.e. N is set to 0). The highest averaging number allowed is 128. If a higher number is used in the command argument, it will be overruled by the maximal value of 128 samples to average. If no averaging is desired, set N to 1.
- CMD_ID = 13930
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sfm_sf06.commands.ReadScaleOffsetUnit(command_code)[source]
This command provides the scale factor and offset to convert flow readings into physical units. The scale factor and offset are specific to the calibrated gas / gas mixture and its corresponding lookup table used for the flow measurement. Therefore, the gas / gas mixture needs to be specified in the command argument by the command code of the corresponding start continuous measurement. For detailed information see data-sheet.
- CMD_ID = 13921
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- rx = <sensirion_driver_adapters.rx_tx_data.RxData object>
- class sensirion_i2c_sfm_sf06.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 performing measurements. 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.
- CMD_ID = 13943
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sfm_sf06.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 16ms.
- CMD_ID = 0
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sfm_sf06.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
- CMD_ID = 57602
- 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.