API Documentation

SFA3X

Sfa3xDevice

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

class sensirion_i2c_sfa3x.device.Sfa3xDeviceBase(channel)[source]

Low level API implementation of SFA3X

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

Starts the continuous measurement. After power-up, the sensor module is in idle-mode. Before any measurement values can be read, the measurement mode needs to be started using this command. Only available in idle mode, i.e. when no measurement is running. If a measurement is already running, stop it first with the stop_measurement command.

stop_measurement()[source]

Stops the continuous measurement and returns to idle mode. This command is only available in measurement mode. Returns error 67 (hex 0x43) if no measurement is running.

read_measured_values_as_integers()[source]

Reads the measured values from the module. The sensor will always return the latest available measurement. If a read measured value command is issued before a new measurement is available, the last available measurement will be sent again in the reply. Before the first sensor reading is available after starting the continuous measurement, the sensor returns an empty frame and error code 32 (hex 0x20).

Return hcho:

Formaldehyde concentration in ppb with a scaling of 5.

Return humidity:

Relative humidity in %RH with a scaling of 100.

Return temperature:

Temperature in degrees Celsius with a scaling of 200.

get_device_marking()[source]

Read the device marking string from the device.

Return device_marking:

Null-terminated ASCII string containing the serial number (same as barcode on sensor module). Up to 32 characters can be read from the device.

device_reset()[source]

After calling this command, the module is in the same state as after a Power-Reset. The reset is executed after sending the MISO response frame.

class sensirion_i2c_sfa3x.device.Sfa3xDevice(channel)[source]

Driver class implementation of SFA3X

sfa3x

Access to base class

__init__(channel)[source]
read_measured_values()[source]

Read measured values and apply scaling

Return hcho:

Formaldehyde concentration in ppb

Return humidity:

Relative humidity in %RH

Return temperature:

Temperature in degrees Celsius

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_sfa3x.commands.StartContinuousMeasurement[source]

Starts the continuous measurement. After power-up, the sensor module is in idle-mode. Before any measurement values can be read, the measurement mode needs to be started using this command. Only available in idle mode, i.e. when no measurement is running. If a measurement is already running, stop it first with the stop_measurement command.

CMD_ID = 6
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
class sensirion_i2c_sfa3x.commands.StopMeasurement[source]

Stops the continuous measurement and returns to idle mode. This command is only available in measurement mode. Returns error 67 (hex 0x43) if no measurement is running.

CMD_ID = 260
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
class sensirion_i2c_sfa3x.commands.ReadMeasuredValuesAsIntegers[source]

Reads the measured values from the module. The sensor will always return the latest available measurement. If a read measured value command is issued before a new measurement is available, the last available measurement will be sent again in the reply. Before the first sensor reading is available after starting the continuous measurement, the sensor returns an empty frame and error code 32 (hex 0x20).

CMD_ID = 807
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
rx = <sensirion_driver_adapters.rx_tx_data.RxData object>
class sensirion_i2c_sfa3x.commands.GetDeviceMarking[source]

Read the device marking string from the device.

CMD_ID = 53344
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
rx = <sensirion_driver_adapters.rx_tx_data.RxData object>
class sensirion_i2c_sfa3x.commands.DeviceReset[source]

After calling this command, the module is in the same state as after a Power-Reset. The reset is executed after sending the MISO response frame.

CMD_ID = 54020
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData 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_sfa3x.result_types.SignalHcho(hcho_raw)[source]

Measured formaldehyde concentration in ppb.

property value
class sensirion_i2c_sfa3x.result_types.SignalHumidity(humidity_raw)[source]

Measured humidity in %RH

property value
class sensirion_i2c_sfa3x.result_types.SignalTemperature(temperature_raw)[source]

Measured temperature in degrees Celsius

property value