API Documentation
STS3X
Sts3xDevice
The class Sts3xDeviceBase implements the low level interface of the sensor. The class Sts3xDevice extends the Sts3xDeviceBase. It provides additional functions to ease the use of the sensor.
- class sensirion_i2c_sts3x.device.Sts3xDeviceBase(channel)[source]
Low level API implementation of STS3X
- property channel
- measure_single_shot_high_repeatability()[source]
Single shot measurement with high repeatability
- Return temperature_ticks
Temperature ticks. Convert to degrees celsius by -45 + 175 * value / 65535
- measure_single_shot_high_repeatability_clock_stretching()[source]
Single shot measurement with high repeatability and clock stretching enabled.
- Return temperature_ticks
Temperature ticks. Convert to degrees celsius by -45 + (175 * value / 65535)
- measure_single_shot_medium_repeatability()[source]
Single shot measurement with medium repeatability
- Return temperature_ticks
Temperature ticks. Convert to degrees celsius by -45 + 175 * value / 65535
- measure_single_shot_medium_repeatability_clock_stretching()[source]
Single shot measurement with medium repeatability and clock stretching enabled
- Return temperature_ticks
Temperature ticks. Convert to degrees celsius by -45 + (175 * value / 65535)
- measure_single_shot_low_repeatability()[source]
Single shot measurement with low repeatability
- Return temperature_ticks
Temperature ticks. Convert to degrees celsius by -45 + 175 * value / 65535
- measure_single_shot_low_repeatability_clock_stretching()[source]
Single shot measurement with low repeatability and clock stretching enabled
- Return temperature_ticks
Temperature ticks. Convert to degrees celsius by -45 + (175 * value / 65535)
- start_measurement_0_5_mps_high_repeatability()[source]
Start periodic measurement mode with 0.5 mps and high repeatability.
- start_measurement_0_5_mps_medium_repeatability()[source]
Start periodic measurement mode with 0.5 mps and medium repeatability.
- start_measurement_0_5_mps_low_repeatability()[source]
Start periodic measurement mode with 0.5 mps and low repeatability.
- start_measurement_1_mps_high_repeatability()[source]
Start periodic measurement mode with 1 mps and high repeatability.
- start_measurement_1_mps_medium_repeatability()[source]
Start periodic measurement mode with 1 mps and medium repeatability.
- start_measurement_1_mps_low_repeatability()[source]
Start periodic measurement mode with 1 mps and low repeatability.
- start_measurement_2_mps_high_repeatability()[source]
Start periodic measurement mode with 2 mps and high repeatability.
- start_measurement_2_mps_medium_repeatability()[source]
Start periodic measurement mode with 2 mps and medium repeatability.
- start_measurement_2_mps_low_repeatability()[source]
Start periodic measurement mode with 2 mps and low repeatability.
- start_measurement_4_mps_high_repeatability()[source]
Start periodic measurement mode with 4 mps and high repeatability.
- start_measurement_4_mps_medium_repeatability()[source]
Start periodic measurement mode with 4 mps and medium repeatability.
- start_measurement_4_mps_low_repeatability()[source]
Start periodic measurement mode with 4 mps and low repeatability.
- start_measurement_10_mps_high_repeatability()[source]
Start periodic measurement mode with 10 mps and high repeatability.
- start_measurement_10_mps_medium_repeatability()[source]
Start periodic measurement mode with 10 mps and medium repeatability.
- start_measurement_10_mps_low_repeatability()[source]
Start periodic measurement mode with 10 mps and low repeatability.
- read_measurement()[source]
Read out data after a “start measurement” command has been issued.
- Return temperature_ticks
Temperature ticks. Convert to degrees celsius by -45 + 175 * value / 65535
Note
After the read out command fetch data has been issued, the data memory is cleared, i.e. no measurement data is present.
- stop_measurement()[source]
Stop the periodic measurement mode.
Note
Upon reception of this command the sensor will abort the ongoing measurement and enter the single shot mode.
- read_status_register()[source]
Read out the status register
- Return status_register
The contents of the status register
Note
The status register contains information on the operational status of the heater, the alert mode and on the execution status of the last command and the last write sequence.
- clear_status_register()[source]
Clear (set to zero) all flags (Bit 15, 10, 4) in the status register.
- soft_reset()[source]
Perform a soft reset.
Note
A system reset of the STS3x can be achieved in multiple ways: - Soft reset: use this command - I2C general call: all devices on the I2C bus are reset by sending the command 0x06 to the I2C address 0x00 - Reset pin: send a pulse to the dedicated nReset pin. The nReset pin has to be pulled low for a minimum of 1 µs to generate a reset of the sensor. - Hard reset: Power down (incl. pulling SDA, SCL and ADDR low)
During the reset procedure the sensor will not process commands.
- class sensirion_i2c_sts3x.device.Sts3xDevice(channel)[source]
Driver class implementation of STS3X
- sts3x
Access to base class
- measure_single_shot(measurement_repeatability, is_clock_stretching)[source]
Single shot measurement with the specified properties
- Parameters
measurement_repeatability – The repeatability of the periodic measurement
is_clock_stretching – Toggle clock stretching
- Return a_temperature
Converted from ticks to degrees celsius by -45 + (175 * value / 65535)
- start_periodic_measurement(measurement_repeatability, messages_per_second)[source]
Start the periodic measurement measurement mode with the specified properties.
This is a convenience method that can be used together with the ‘blocking_read_measurement’ command.
- Parameters
measurement_repeatability – The repeatability of the periodic measurement
messages_per_second – The messages per second of the periodic measurement
- blocking_read_measurement()[source]
Reads the measurement initiated with the ‘start_periodic_measurement’ command.
This is a convenience method that takes into consideration the configured messages per second with which the ‘start_periodic_measurement’ command was called and blocks accordingly.
- Return a_temperature
Converted from ticks to degrees celsius by -45 + (175 * value / 65535)
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_sts3x.commands.MeasureSingleShotHighRepeatability[source]
Single shot measurement with high repeatability
- CMD_ID = 9216
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- rx = <sensirion_driver_adapters.rx_tx_data.RxData object>
- class sensirion_i2c_sts3x.commands.MeasureSingleShotHighRepeatabilityClockStretching[source]
Single shot measurement with high repeatability and clock stretching enabled.
- CMD_ID = 11270
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- rx = <sensirion_driver_adapters.rx_tx_data.RxData object>
- class sensirion_i2c_sts3x.commands.MeasureSingleShotMediumRepeatability[source]
Single shot measurement with medium repeatability
- CMD_ID = 9227
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- rx = <sensirion_driver_adapters.rx_tx_data.RxData object>
- class sensirion_i2c_sts3x.commands.MeasureSingleShotMediumRepeatabilityClockStretching[source]
Single shot measurement with medium repeatability and clock stretching enabled
- CMD_ID = 11277
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- rx = <sensirion_driver_adapters.rx_tx_data.RxData object>
- class sensirion_i2c_sts3x.commands.MeasureSingleShotLowRepeatability[source]
Single shot measurement with low repeatability
- CMD_ID = 9238
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- rx = <sensirion_driver_adapters.rx_tx_data.RxData object>
- class sensirion_i2c_sts3x.commands.MeasureSingleShotLowRepeatabilityClockStretching[source]
Single shot measurement with low repeatability and clock stretching enabled
- CMD_ID = 11280
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- rx = <sensirion_driver_adapters.rx_tx_data.RxData object>
- class sensirion_i2c_sts3x.commands.StartMeasurement05MpsHighRepeatability[source]
Start periodic measurement mode with 0.5 mps and high repeatability.
- CMD_ID = 8242
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.StartMeasurement05MpsMediumRepeatability[source]
Start periodic measurement mode with 0.5 mps and medium repeatability.
- CMD_ID = 8228
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.StartMeasurement05MpsLowRepeatability[source]
Start periodic measurement mode with 0.5 mps and low repeatability.
- CMD_ID = 8239
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.StartMeasurement1MpsHighRepeatability[source]
Start periodic measurement mode with 1 mps and high repeatability.
- CMD_ID = 8496
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.StartMeasurement1MpsMediumRepeatability[source]
Start periodic measurement mode with 1 mps and medium repeatability.
- CMD_ID = 8486
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.StartMeasurement1MpsLowRepeatability[source]
Start periodic measurement mode with 1 mps and low repeatability.
- CMD_ID = 8493
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.StartMeasurement2MpsHighRepeatability[source]
Start periodic measurement mode with 2 mps and high repeatability.
- CMD_ID = 8758
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.StartMeasurement2MpsMediumRepeatability[source]
Start periodic measurement mode with 2 mps and medium repeatability.
- CMD_ID = 8736
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.StartMeasurement2MpsLowRepeatability[source]
Start periodic measurement mode with 2 mps and low repeatability.
- CMD_ID = 8747
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.StartMeasurement4MpsHighRepeatability[source]
Start periodic measurement mode with 4 mps and high repeatability.
- CMD_ID = 9012
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.StartMeasurement4MpsMediumRepeatability[source]
Start periodic measurement mode with 4 mps and medium repeatability.
- CMD_ID = 8994
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.StartMeasurement4MpsLowRepeatability[source]
Start periodic measurement mode with 4 mps and low repeatability.
- CMD_ID = 9001
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.StartMeasurement10MpsHighRepeatability[source]
Start periodic measurement mode with 10 mps and high repeatability.
- CMD_ID = 10039
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.StartMeasurement10MpsMediumRepeatability[source]
Start periodic measurement mode with 10 mps and medium repeatability.
- CMD_ID = 10017
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.StartMeasurement10MpsLowRepeatability[source]
Start periodic measurement mode with 10 mps and low repeatability.
- CMD_ID = 10042
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.ReadMeasurement[source]
Read out data after a “start measurement” command has been issued.
- CMD_ID = 57344
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- rx = <sensirion_driver_adapters.rx_tx_data.RxData object>
- class sensirion_i2c_sts3x.commands.StopMeasurement[source]
Stop the periodic measurement mode.
- CMD_ID = 12435
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.ReadStatusRegister[source]
Read out the status register
- CMD_ID = 62253
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- rx = <sensirion_driver_adapters.rx_tx_data.RxData object>
- class sensirion_i2c_sts3x.commands.ClearStatusRegister[source]
Clear (set to zero) all flags (Bit 15, 10, 4) in the status register.
- CMD_ID = 12353
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.SoftReset[source]
Perform a soft reset.
- CMD_ID = 12450
- tx = <sensirion_driver_adapters.rx_tx_data.TxData object>
- class sensirion_i2c_sts3x.commands.StatusRegisterT(int_value: int = 0)[source]
- write_data_checksum_status = BitField(offset=0, width=1)
- command_status = BitField(offset=1, width=1)
- system_reset_detected = BitField(offset=4, width=1)
- tracking_alert = BitField(offset=10, width=1)
- heater_status = BitField(offset=13, width=1)
- alert_pending_status = BitField(offset=15, width=1)
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.