API Documentation

SFA4X

Sfa4xDevice

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

class sensirion_i2c_sfa4x.device.Sfa4xDeviceBase(channel)[source]

Low level API implementation of SFA4X

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

Start a continuous measurement (interval 1 s).

read_measurement_data_raw()[source]

Read HCHO, relative humidity, temperature, sensor info, sensor status, after calling start_continous_measurement()

Return hcho_concentration:

Calibrated HCHO concentration read from the sensor.

Return relative_humidity:

Relative humidity read from the sensor.

Return temperature:

Temperature read from the sensor.

Return status:

Information about the sensor status.

stop_continuous_measurement()[source]

Stop continuous measurement to run other i2c commands or to save power.

get_serial_number()[source]

Read the sensor’s unique serial number.

Return serial_number:

The 48-bit unique serial number of the sensor.

start_selftest()[source]

The self-test is a special autonomous test, able to detect certain malfunctions, e.g. due to bad soldering during assembly. The test checks the integrity of electric connections between the user interface and the sensor cell. It is recommended to run the self-test once, after the sensor has been soldered to the PCB. After powering on the device, it is in idle state. The start_selftest command initiates a special measurement mode. Refer to the read_selftest_data command for instructions on how to read out the sensor data after starting the self-test. The self-test brings the sensor into special measurement mode for 5 – 6 minutes.

read_selftest_data()[source]

After starting the self-test, the read_selftest_data command is used to obtain the selftest status and result. It is recommended to trigger a readout e.g. every 10 seconds, until the output is different from 65535 (hex: FFFF). Interpretation of the result: * 65535 (hex: FFFF): Test is still running. Wait longer. * 0: Test successful. * other: Test failed.

Return selftest_result:

Self-test result.

get_product_id()[source]

Read the sensor’s product id.

Return product_id:

4-byte product Id. Bytes 1-3 product code, byte 4 revision

class sensirion_i2c_sfa4x.device.Sfa4xDevice(channel)[source]

Driver class implementation of SFA4X

sfa4x

Access to base class

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

reads measurement data

Return hcho_concentration:

Measured HCHO concentration

Return relative_humidity:

Measured relative humidity

Return temperature:

Measured relative temperature

Return status:

Measurement status

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

Start a continuous measurement (interval 1 s).

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

Read HCHO, relative humidity, temperature, sensor info, sensor status, after calling start_continous_measurement()

CMD_ID = 49387
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
rx = <sensirion_driver_adapters.rx_tx_data.RxData object>
class sensirion_i2c_sfa4x.commands.StopContinuousMeasurement[source]

Stop continuous measurement to run other i2c commands or to save power.

CMD_ID = 20690
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
class sensirion_i2c_sfa4x.commands.GetSerialNumber[source]

Read the sensor’s unique serial number.

CMD_ID = 718
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
rx = <sensirion_driver_adapters.rx_tx_data.RxData object>
class sensirion_i2c_sfa4x.commands.StartSelftest[source]

The self-test is a special autonomous test, able to detect certain malfunctions, e.g. due to bad soldering during assembly. The test checks the integrity of electric connections between the user interface and the sensor cell. It is recommended to run the self-test once, after the sensor has been soldered to the PCB. After powering on the device, it is in idle state. The start_selftest command initiates a special measurement mode. Refer to the read_selftest_data command for instructions on how to read out the sensor data after starting the self-test. The self-test brings the sensor into special measurement mode for 5 – 6 minutes.

CMD_ID = 1546
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
class sensirion_i2c_sfa4x.commands.ReadSelftestData[source]

After starting the self-test, the read_selftest_data command is used to obtain the selftest status and result. It is recommended to trigger a readout e.g. every 10 seconds, until the output is different from 65535 (hex: FFFF). Interpretation of the result: * 65535 (hex: FFFF): Test is still running. Wait longer. * 0: Test successful. * other: Test failed.

CMD_ID = 49387
pack()[source]
tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
rx = <sensirion_driver_adapters.rx_tx_data.RxData object>
class sensirion_i2c_sfa4x.commands.GetProductId[source]

Read the sensor’s product id.

CMD_ID = 1023
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_sfa4x.result_types.SignalHchoConcentration(raw_hcho_concentration)[source]

Convert raw HCHO concentration to physical value

property value
class sensirion_i2c_sfa4x.result_types.SignalRelativeHumidity(raw_relative_humidity)[source]

Convert raw relative humidity to RH%

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

Convert raw temperature to °C

property value