API Documentation

SCD4x

SCD4xI2cDevice

class sensirion_i2c_scd.scd4x.device.Scd4xI2cDevice(connection, slave_address=98)[source]

SCD4x I²C device class to allow executing I²C commands.

__init__(connection, slave_address=98)[source]

Constructs a new SCD4X I²C device.

Parameters:
  • connection (I2cConnection) – The I²C connection to use for communication.
  • slave_address (byte) – The I²C slave address, defaults to 0x62.
read_serial_number()[source]

Read the serial number from the device.

Returns:The serial number.
Return type:int
start_periodic_measurement(power_mode=<Scd4xPowerMode.HIGH: 1>)[source]

Start periodic measurement with given power mode

Parameters:power_mode (Scd4xPowerMode) – The power mode (HIGH or LOW) to use for periodic measurements. High power mode measures every 5 seconds, while low power mode measures every 30 seconds. Default: High power mode

Note

Only available in idle mode.

read_measurement()[source]

Read measurement during periodic measurement mode. Returns Co2, temperature and relative humidity as tuple

Returns:
  • co2 (Scd4xCarbonDioxid) - CO₂ response object
  • temperature (Scd4xTemperature) - Temperature response object.
  • humidity (Scd4xHumidity) - Humidity response object
Return type:tuple
stop_periodic_measurement()[source]

Stop periodic measurement.

Note

this command is only available in periodic measurement mode

get_temperature_offset()[source]

Get Temperature Offset I²C Command

The temperature offset represents the difference between the measured temperature by the SCD4x and the actual ambient temperature. Per default, the temperature offset is set to 4°C.

Returns:

Note

Only available in idle mode.

set_temperature_offset(t_offset)[source]

Setting the temperature offset of the SCD4x inside the customer device correctly allows the user to leverage the RH and T output signal. Note that the temperature offset can depend on various factors such as the SCD4x measurement mode, self-heating of close components, the ambient temperature and air flow. Thus, the SCD4x temperature offset should be determined inside the customer device under its typical operation and in thermal equilibrium.

Note

Only availabe in idle mode

Param:(float) t_offset The temperature offset in degree Celsius
get_sensor_altitude()[source]

Get Sensor Altitude I²C Command

Get configured sensor altitude in meters above sea level. Per default, the sensor altitude is set to 0 meter above sea-level.

Note

Only available in idle mode.

set_sensor_altitude(sensor_altitude)[source]

Set Sensor Altitude I²C Command

Set sensor altitude in meters above sea level. Note that setting a sensor altitude to the sensor overrides any pressure compensation based on a previously set ambient pressure.

Param:(int) sensor_altitude: The altitude in meters above sea level

Note

Only available in idle mode.

set_ambient_pressure(ambient_pressure)[source]

Set Ambient Pressure I²C Command

The set_ambient_pressure command can be sent during periodic measurements to enable continuous pressure compensation. Note that setting an ambient pressure to the sensor overrides any pressure compensation based on a previously set sensor altitude.

Parameters:ambient_pressure (int) – Ambient pressure in hPa. Convert value to Pa by: value * 100.

Note

Available during measurements.

perform_forced_recalibration(target_co2_concentration)[source]

Perform Forced Recalibration I²C Command

To successfully conduct an accurate forced recalibration, the following steps need to be carried out:

  1. Operate the SCD4x in a periodic measurement mode for > 3 minutes in an environment with homogenous and constant CO₂ concentration.
  2. Stop periodic measurement. Wait 500 ms.
  3. Subsequently issue the perform_forced_recalibration command and optionally read out the baseline correction. A return value of 0xffff indicates that the forced recalibration failed.
Parameters:target_co2_concentration (int) – Target CO₂ concentration in ppm.
Returns:FRC correction value in CO₂ ppm or 0xFFFF if the command failed.
Return type:int
get_automatic_self_calibration()[source]

Get Automatic Self Calibration I²C Command

Returns:True if ASC is enabled, False if ASC is disabled
Return type:int
set_automatic_self_calibration(asc_enabled)[source]

Set Automatic Self Calibration I²C Command

Parameters:asc_enabled (int) – True to enable ASC, False to disable ASC
get_data_ready_status()[source]

Get Data Ready Status I²C Command

Check whether new measurement data is available for read-out.

Returns:True if data ready, else False
Return type:bool
persist_settings()[source]

Persist Settings I²C Command

Configuration settings such as the temperature offset, sensor altitude and the ASC enabled/disabled parameter are by default stored in the volatile memory (RAM) only and will be lost after a power-cycle. This command stores the current configuration in the EEPROM of the SCD4x, making them persistent across power-cycling.

Note

To avoid unnecessary wear of the EEPROM, this command should only be sent when persistence is required and if actual changes to the configuration have been made (The EEPROM is guaranteed to endure at least 2000 write cycles before failure). Note that field calibration history (i.e. FRC and ASC) is automatically stored in a separate EEPROM dimensioned for specified sensor lifetime.

perform_self_test()[source]

Perform Self Test I²C Command

The perform_self_test feature can be used as an end-of-line test to confirm sensor functionality.

Returns:0 means no malfunction detected
Return type:int
perform_factory_reset()[source]

Perform Factory Reset I²C Command

Initiates the reset of all configurations stored in the EEPROM and erases the FRC and ASC algorithm history.

Note

To avoid unnecessary wear of the EEPROM, this command should only be sent when actual changes to the configuration have been made which should be reverted (The EEPROM is guaranteed to endure at least 2000 write cycles before failure). Note that field calibration history (i.e. FRC and ASC) is automatically stored in a separate EEPROM dimensioned for specified sensor lifetime.

reinit()[source]

Reinit I²C Command

The reinit command reinitializes the sensor by reloading user settings from EEPROM. Before sending the reinit command, the stop measurement command must be issued. If reinit command does not trigger the desired re-initialization, a power-cycle should be applied to the SCD4x.

Note

Only available in idle mode.

measure_single_shot()[source]

Measure Single Shot I²C Command

On-demand measurement of CO₂ concentration, relative humidity and temperature. The sensor output is read with the read_measurement command.

Note

Only available in idle mode.

measure_single_shot_rht_only()[source]

Measure Single Shot Rht Only I²C Command

On-demand measurement of relative humidity and temperature only. The sensor output is read with the read_measurement command.

Note

Only available in idle mode.

power_down()[source]

Power Down I²C Command

Put the sensor from idle to sleep mode to reduce current consumption.

Note

Only available in idle mode.

wake_up()[source]

Wake Up I²C Command

Wake up sensor from sleep mode to idle mode.

Note

Only available in sleep mode.

connection

Get the used I²C connection.

Returns:The used I²C connection.
Return type:I2cConnection
execute(command)

Execute an I²C command on this device.

Parameters:command (I2cCommand) – The command to be executed.
Returns:The interpreted response of the executed command.
Return type:Depends on the executed command.
slave_address

Get the I²C slave address.

Returns:The I²C slave address.
Return type:byte

SCD4xI2cCommand

class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdBase(command, tx_data, rx_length, read_delay, timeout, post_processing_time=0.0)[source]

SCD4x I²C base command.

__init__(command, tx_data, rx_length, read_delay, timeout, post_processing_time=0.0)[source]

Constructs a new SCD4x I²C command.

Parameters:
  • command (int/None) – The command ID to be sent to the device. None means that no command will be sent, i.e. only tx_data (if not None) will be sent. No CRC is added to these bytes since the command ID usually already contains a CRC.
  • tx_data (bytes-like/list/None) – Bytes to be extended with CRCs and then sent to the I²C device. None means that no write header will be sent at all (if command is None too). An empty list means to send the write header (even if command is None), but without data following it.
  • rx_length (int/None) – Number of bytes to be read from the I²C device, including CRC bytes. None means that no read header is sent at all. Zero means to send the read header, but without reading any data.
  • read_delay (float) – Delay (in Seconds) to be inserted between the end of the write operation and the beginning of the read operation. This is needed if the device needs some time to prepare the RX data, e.g. if it has to perform a measurement. Set to 0.0 to indicate that no delay is needed, i.e. the device does not need any processing time.
  • timeout (float) – Timeout (in Seconds) to be used in case of clock stretching. If the device stretches the clock longer than this value, the transceive operation will be aborted with a timeout error. Set to 0.0 to indicate that the device will not stretch the clock for this command.
  • post_processing_time (float) – Maximum time in seconds the device needs for post processing of this command until it is ready to receive the next command. For example after a device reset command, the device might need some time until it is ready again. Usually this is 0.0s, i.e. no post processing is needed.
interpret_response(data)

Validates the CRCs of the received data from the device and returns the data with all CRCs removed.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:The received bytes, or None if there is no data received.
Return type:bytes or None
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdStartPeriodicMeasurement[source]

Start Periodic Measurement I²C Command

start periodic measurement, signal update interval is 5 seconds.

Note

This command is only available in idle mode.

__init__()[source]

Constructor.

interpret_response(data)

Validates the CRCs of the received data from the device and returns the data with all CRCs removed.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:The received bytes, or None if there is no data received.
Return type:bytes or None
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdReadMeasurement[source]

Read Measurement I²C Command

read sensor output. The measurement data can only be read out once per signal update interval as the buffer is emptied upon read-out. If no data is available in the buffer, the sensor returns a NACK. To avoid a NACK response the get_data_ready_status can be issued to check data status. The I2C master can abort the read transfer with a NACK followed by a STOP condition after any data byte if the user is not interested in subsequent data.

Note

This command is only available in measurement mode. The firmware updates the measurement values depending on the measurement mode.

__init__()[source]

Constructor.

interpret_response(data)[source]

Validates the CRCs of the received data from the device and returns the interpreted data.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:
  • co2 (Scd4xCarbonDioxid) - CO₂ response object
  • temperature (Scd4xTemperature) - Temperature response object.
  • humidity (Scd4xHumidity) - Humidity response object
Return type:tuple
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdStopPeriodicMeasurement[source]

Stop Periodic Measurement I²C Command

Stop periodic measurement and return to idle mode for sensor configuration or to safe energy.

Note

This command is only available in measurement mode.

__init__()[source]

Constructor.

interpret_response(data)

Validates the CRCs of the received data from the device and returns the data with all CRCs removed.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:The received bytes, or None if there is no data received.
Return type:bytes or None
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdGetTemperatureOffset[source]

Get Temperature Offset I²C Command

The temperature offset represents the difference between the measured temperature by the SCD4x and the actual ambient temperature. Per default, the temperature offset is set to 4°C.

Note

Only available in idle mode.

__init__()[source]

Constructor.

interpret_response(data)[source]

Validates the CRCs of the received data from the device and returns the interpreted data.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdSetTemperatureOffset(t_offset)[source]

Set Temperature Offset I²C Command

Setting the temperature offset of the SCD4x inside the customer device correctly allows the user to leverage the RH and T output signal. Note that the temperature offset can depend on various factors such as the SCD4x measurement mode, self-heating of close components, the ambient temperature and air flow. Thus, the SCD4x temperature offset should be determined inside the customer device under its typical operation and in thermal equilibrium.

Note

Only available in idle mode.

__init__(t_offset)[source]

Constructor.

Parameters:t_offset (int) – Temperature offset in degree celsius
interpret_response(data)

Validates the CRCs of the received data from the device and returns the data with all CRCs removed.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:The received bytes, or None if there is no data received.
Return type:bytes or None
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdGetSensorAltitude[source]

Get Sensor Altitude I²C Command

Get configured sensor altitude in meters above sea level. Per default, the sensor altitude is set to 0 meter above sea-level.

Note

Only available in idle mode.

__init__()[source]

Constructor.

interpret_response(data)[source]

Validates the CRCs of the received data from the device and returns the interpreted data.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:Sensor altitude in meters.
Return type:int
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdSetSensorAltitude(sensor_altitude)[source]

Set Sensor Altitude I²C Command

Set sensor altitude in meters above sea level. Note that setting a sensor altitude to the sensor overrides any pressure compensation based on a previously set ambient pressure.

Note

Only available in idle mode.

__init__(sensor_altitude)[source]

Constructor.

Parameters:sensor_altitude (int) – Sensor altitude in meters.
interpret_response(data)

Validates the CRCs of the received data from the device and returns the data with all CRCs removed.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:The received bytes, or None if there is no data received.
Return type:bytes or None
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdSetAmbientPressure(ambient_pressure)[source]

Set Ambient Pressure I²C Command

The set_ambient_pressure command can be sent during periodic measurements to enable continuous pressure compensation. Note that setting an ambient pressure to the sensor overrides any pressure compensation based on a previously set sensor altitude.

Note

Available during measurements.

__init__(ambient_pressure)[source]

Constructor.

Parameters:ambient_pressure (int) – Ambient pressure in hPa. Convert value to Pa by: value * 100.
interpret_response(data)

Validates the CRCs of the received data from the device and returns the data with all CRCs removed.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:The received bytes, or None if there is no data received.
Return type:bytes or None
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdPerformForcedRecalibration(target_co2_concentration)[source]

Perform Forced Recalibration I²C Command

To successfully conduct an accurate forced recalibration, the following steps need to be carried out:

  1. Operate the SCD4x in a periodic measurement mode for > 3 minutes in an environment with homogenous and constant CO₂ concentration.
  2. Stop periodic measurement. Wait 500 ms.
  3. Subsequently issue the perform_forced_recalibration command and optionally read out the baseline correction. A return value of 0xffff indicates that the forced recalibration failed.
__init__(target_co2_concentration)[source]

Constructor.

Parameters:target_co2_concentration (int) – Target CO₂ concentration in ppm.
interpret_response(data)[source]

Validates the CRCs of the received data from the device and returns the interpreted data.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:FRC correction value in CO₂ ppm or 0xFFFF if the command failed.
Return type:int
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdGetAutomaticSelfCalibration[source]

Get Automatic Self Calibration I²C Command

By default, the ASC is enabled.

__init__()[source]

Constructor.

interpret_response(data)[source]

Validates the CRCs of the received data from the device and returns the interpreted data.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:1 if ASC is enabled, 0 if ASC is disabled
Return type:int
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdSetAutomaticSelfCalibration(asc_enabled)[source]

Set Automatic Self Calibration I²C Command

By default, the ASC is enabled.

__init__(asc_enabled)[source]

Constructor.

Parameters:asc_enabled (int) – 1 to enable ASC, 0 to disable ASC
interpret_response(data)

Validates the CRCs of the received data from the device and returns the data with all CRCs removed.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:The received bytes, or None if there is no data received.
Return type:bytes or None
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdStartLowPowerPeriodicMeasurement[source]

Start Low Power Periodic Measurement I²C Command

Start low power periodic measurement, signal update interval is 30 seconds.

Note

This command is only available in idle mode.

__init__()[source]

Constructor.

interpret_response(data)

Validates the CRCs of the received data from the device and returns the data with all CRCs removed.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:The received bytes, or None if there is no data received.
Return type:bytes or None
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdGetDataReadyStatus[source]

Get Data Ready Status I²C Command

Check whether new measurement data is available for read-out.

__init__()[source]

Constructor.

interpret_response(data)[source]

Validates the CRCs of the received data from the device and returns the interpreted data.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:If last 11 bits are 0 data not ready, else data ready
Return type:int
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdPersistSettings[source]

Persist Settings I²C Command

Configuration settings such as the temperature offset, sensor altitude and the ASC enabled/disabled parameter are by default stored in the volatile memory (RAM) only and will be lost after a power-cycle. This command stores the current configuration in the EEPROM of the SCD4x, making them persistent across power-cycling.

Note

To avoid unnecessary wear of the EEPROM, this command should only be sent when persistence is required and if actual changes to the configuration have been made (The EEPROM is guaranteed to endure at least 2000 write cycles before failure). Note that field calibration history (i.e. FRC and ASC) is automatically stored in a separate EEPROM dimensioned for specified sensor lifetime.

__init__()[source]

Constructor.

interpret_response(data)

Validates the CRCs of the received data from the device and returns the data with all CRCs removed.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:The received bytes, or None if there is no data received.
Return type:bytes or None
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdGetSerialNumber[source]

Get Serial Number I²C Command

Reading out the serial number can be used to identify the chip and to verify the presence of the sensor. The get serial number command returns 3 words. Together, the 3 words constitute a unique serial number with a length of 48 bits (big endian format).

__init__()[source]

Constructor.

interpret_response(data)[source]

Validates the CRCs of the received data from the device and returns the interpreted data.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:
  • serial_number (int) - 48 bit serial number
Return type:tuple
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdPerformSelfTest[source]

Perform Self Test I²C Command

The perform_self_test feature can be used as an end-of-line test to confirm sensor functionality.

__init__()[source]

Constructor.

interpret_response(data)[source]

Validates the CRCs of the received data from the device and returns the interpreted data.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:0 means no malfunction detected
Return type:int
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdPerformFactoryReset[source]

Perform Factory Reset I²C Command

Initiates the reset of all configurations stored in the EEPROM and erases the FRC and ASC algorithm history.

Note

To avoid unnecessary wear of the EEPROM, this command should only be sent when actual changes to the configuration have been made which should be reverted (The EEPROM is guaranteed to endure at least 2000 write cycles before failure). Note that field calibration history (i.e. FRC and ASC) is automatically stored in a separate EEPROM dimensioned for specified sensor lifetime.

__init__()[source]

Constructor.

interpret_response(data)

Validates the CRCs of the received data from the device and returns the data with all CRCs removed.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:The received bytes, or None if there is no data received.
Return type:bytes or None
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdReinit[source]

Reinit I²C Command

The reinit command reinitializes the sensor by reloading user settings from EEPROM. Before sending the reinit command, the stop measurement command must be issued. If reinit command does not trigger the desired re-initialization, a power-cycle should be applied to the SCD4x.

Note

Only available in idle mode.

__init__()[source]

Constructor.

interpret_response(data)

Validates the CRCs of the received data from the device and returns the data with all CRCs removed.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:The received bytes, or None if there is no data received.
Return type:bytes or None
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdMeasureSingleShot[source]

Measure Single Shot I²C Command

On-demand measurement of CO₂ concentration, relative humidity and temperature. The sensor output is read with the read_measurement command.

Note

Only available in idle mode.

__init__()[source]

Constructor.

interpret_response(data)

Validates the CRCs of the received data from the device and returns the data with all CRCs removed.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:The received bytes, or None if there is no data received.
Return type:bytes or None
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdMeasureSingleShotRhtOnly[source]

Measure Single Shot Rht Only I²C Command

On-demand measurement of relative humidity and temperature only.

Note

Only available in idle mode.

__init__()[source]

Constructor.

interpret_response(data)

Validates the CRCs of the received data from the device and returns the data with all CRCs removed.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:The received bytes, or None if there is no data received.
Return type:bytes or None
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdPowerDown[source]

Power Down I²C Command

Put the sensor from idle to sleep mode to reduce current consumption.

Note

Only available in idle mode.

__init__()[source]

Constructor.

interpret_response(data)

Validates the CRCs of the received data from the device and returns the data with all CRCs removed.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:The received bytes, or None if there is no data received.
Return type:bytes or None
Raises:I2cChecksumError – If a received CRC was wrong.
class sensirion_i2c_scd.scd4x.commands.Scd4xI2cCmdWakeUp[source]

Wake Up I²C Command

Wake up sensor from sleep mode to idle mode.

Note

Only available in sleep mode.

__init__()[source]

Constructor.

interpret_response(data)

Validates the CRCs of the received data from the device and returns the data with all CRCs removed.

Parameters:data (bytes) – Received raw bytes from the read operation.
Returns:The received bytes, or None if there is no data received.
Return type:bytes or None
Raises:I2cChecksumError – If a received CRC was wrong.

Data Types

class sensirion_i2c_scd.scd4x.data_types.Scd4xPowerMode[source]

An enum containing all available power mode settings for the co2 measurements.

HIGH = 1

High power mode measures every 5 seconds

LOW = 2

Low power mode measures every 30 seconds

class sensirion_i2c_scd.scd4x.data_types.Scd4xTemperatureOffsetDegC(degree_celsius)[source]

Represents a temperature offset in degree celsius.

With the ticks you can access the raw data as sent to the device. For the converted values you can choose between degrees_celsius and degrees_fahrenheit.

Parameters:degree_celsius (int) – The temperature as degree celsius
__init__(degree_celsius)[source]

Creates an instance from the received raw data.

degrees_celsius

The converted temperature offset in °C.

degrees_fahrenheit

The converted temperature offset in °F.

ticks

The ticks (int) as received from the device.

Response Types

class sensirion_i2c_scd.scd4x.response_types.Scd4xTemperature(ticks)[source]

Represents a measurement response for the temperature.

With the ticks you can access the raw data as received from the device. For the converted values you can choose between degrees_celsius and degrees_fahrenheit.

Parameters:ticks (int) – The read ticks as received from the device.
__init__(ticks)[source]

Creates an instance from the received raw data.

ticks

The ticks (int) as received from the device.

degrees_celsius

The converted temperature in °C.

degrees_fahrenheit

The converted temperature in °F.

class sensirion_i2c_scd.scd4x.response_types.Scd4xHumidity(ticks)[source]

Represents a measurement response for the humidity.

With the ticks you can access the raw data as received from the device. For the converted value the percent_rh attribute is available.

Parameters:ticks (int) – The read ticks as received from the device.
__init__(ticks)[source]

Creates an instance from the received raw data.

ticks

The ticks (int) as received from the device.

percent_rh

The converted humidity in %RH.

class sensirion_i2c_scd.scd4x.response_types.Scd4xCarbonDioxide(ticks)[source]

Represents a measurement response for the humidity.

With the ticks you can access the raw data as received from the device. For the converted value the percent_rh attribute is available.

Parameters:ticks (int) – The read ticks as received from the device.
__init__(ticks)[source]

Creates an instance from the received raw data.

ticks

The ticks (int) as received from the device.

co2

CO2 ppm.

class sensirion_i2c_scd.scd4x.response_types.Scd4xTemperatureOffset(ticks)[source]

Represents a temperature offset.

With the ticks you can access the raw data as received from the device. For the converted values you can choose between degrees_celsius and degrees_fahrenheit.

Parameters:ticks (int) – The read ticks as received from the device.
__init__(ticks)[source]

Creates an instance from the received raw data.

ticks

The ticks (int) as received from the device.

degrees_celsius

The converted temperature offset in °C.

degrees_fahrenheit

The converted temperature offset in °F.