API Documentation

SCD30

Scd30Device

class sensirion_i2c_scd30.device.Scd30DeviceBase(channel)[source]

Low level API implementation of SCD30

__init__(channel)[source]

Initialize self. See help(type(self)) for accurate signature.

start_periodic_measurement(ambient_pressure)[source]

Starts continuous measurement of the SCD30 to measure CO₂ concentration, humidity and temperature. Measurement data which is not read from the sensor will be overwritten. The CO₂ measurement value can be compensated for ambient pressure by feeding the pressure value in mBar to the sensor. Setting the ambient pressure will overwrite previous settings of altitude compensation. Setting the argument to zero will deactivate the ambient pressure compensation(default ambient pressure = 1013.25 mBar). For setting a new ambient pressure when continuous measurement is running the whole command has to be written to SCD30.

Parameters:ambient_pressure – Ambient pressure in millibar.
stop_periodic_measurement()[source]

Stops the continuous measurement of the SCD30.

set_measurement_interval(interval)[source]

Sets the interval used byt he SCD30 sensor to measure in continuous measurement mode. Initial value is 2s.The chosen measurement interval is saved in non-volatile memory and thus is not reset to its initial value after power up.

Parameters:interval – Measurement interval in seconds.
get_measurement_interval()[source]

Reads out the active measurement interval.

Return interval:
 Configured measurement interval
get_data_ready()[source]

Data ready command is used to determine if a measurement can be read from the sensor’s buffer. Whenever there is a measurement available from the internal buffer this command returns 1 and 0 otherwise. As soon as the measurement has been read by SCD30 the return value changes to 0.

Return data_ready_flag:
 Data ready flag
read_measurement_data()[source]

Allows to read new measurement data if data is available.

Return co2_concentration:
 
Return temperature:
 
Return humidity:
 
activate_auto_calibration(do_activate)[source]

Continuous automatic self-calibration (ASC) can be (de-)activated with this command. When activated for the first time a period of minimum 7 days is needed so that the algorithm can find its initial parameter set for ASC. The sensor has to be exposed to fresh air for at least 1 hour every day. Also during that period, the sensor may not be disconnected from the power supply. Otherwise the procedure to find calibration parameters is aborted and has to be restarted from the beginning. The successfully calculated parameters are stored in non-volatile memory of the SCD30 having the effect that after a restart the previously found parameters for ASC are still present.

Parameters:do_activate – Set activate flag.
get_auto_calibration_status()[source]

Read out the status of the active self calibration.

Return is_active:
 Indication if automatic calibration is active
force_recalibration(co2_ref_concentration)[source]

Forced recalibration (FRC) is used to compensate for sensor drifts when a reference value of the CO₂ concentration in close proximity to the SCD30 is available. For best results, the sensor has to be run in a stable environment in continuous mode at a measurement rate of 2s for at least two minutes before applying the FRC commandand sending the reference value. Setting a reference CO₂ concentration by the method described here will always supersede corrections from the ASC (see command activate_auto_calibration) and vice-versa. The reference CO₂ concentration has to be within the range 400 ppm ≤ cref(CO₂) ≤ 2000 ppm. The FRC method imposes a permanent update of the CO₂ calibration curve which persists after repowering the sensor. The most recently used reference value is retained in volatile memory and can be read out with the command sequence given below. After repowering the sensor, the command will return the standard reference value of 400 ppm.

Parameters:co2_ref_concentration – New CO2 reference concentration.
get_force_recalibration_status()[source]

Read out the CO₂ reference concentration.

Return co2_ref_concentration:
 Currently used CO2 reference concentration.
set_temperature_offset(temperature_offset)[source]

The on-board RH/T sensor is influenced by thermal self-heating of SCD30 and other electrical components. Design-in alters the thermal properties of SCD30 such that temperature and humidity offsets may occur when operating the sensor in end-customer devices. Compensation of those effects is achievable by writing the temperature offset found in continuous operation of the device into the sensor. Temperature offset value is saved in non-volatile memory. The last set value will be used for temperature offset compensation after repowering

Parameters:temperature_offset
get_temperature_offset()[source]

Read out the actual temperature offset. The result can be converted to ℃ by dividing it by 100.

Return temperature_offset:
 
get_altitude_compensation()[source]

Read out the configured altitude (height in [m] over sea level).

Return altitude:
 
set_altitude_compensation(altitude)[source]

Measurements of CO₂ concentration based on the NDIR principle are influenced by altitude. SCD30 offers to compensate deviations due to altitude by using this command. Setting altitude is disregarded when an ambient pressure is given to the sensor (see command start_periodic_measurement). Altitude value is saved in non-volatile memory. The last set value will be used for altitude compensation after repowering.

Parameters:altitude
read_firmware_version()[source]

Read the version of the current firmware.

Return major:Major version number.
Return minor:Minor version number.
soft_reset()[source]

The SCD30 provides a soft reset mechanism that forces the sensor into the same state as after powering up without the need for removing the power-supply. It does so by restarting its system controller. After soft reset the sensor will reload all calibrated data. However, it is worth noting that the sensor reloads calibration data prior to every measurement by default. This includes previously set reference values from ASC or FRC as well as temperature offset values last setting. The sensor is able to receive the command at any time, regardless of its internal state.

class sensirion_i2c_scd30.device.Scd30Device(channel)[source]

Driver class implementation of SCD30

__init__(channel)[source]

Initialize self. See help(type(self)) for accurate signature.

await_data_ready()[source]

Repeatedly call the get_data_ready() until the ready flag is set to 1. A the minimal measuremnt interval is 2s we iterate at most 200 times. Note that this is blocking the system for a considerable amount of time!

blocking_read_measurement_data()[source]

This is a convenience method that combines polling the data ready flag and reading out the data. Note that this is blocking the system for a considerable amount of time!

Return co2_concentration:
 
Return temperature:
 
Return humidity:
 
activate_auto_calibration(do_activate)

Continuous automatic self-calibration (ASC) can be (de-)activated with this command. When activated for the first time a period of minimum 7 days is needed so that the algorithm can find its initial parameter set for ASC. The sensor has to be exposed to fresh air for at least 1 hour every day. Also during that period, the sensor may not be disconnected from the power supply. Otherwise the procedure to find calibration parameters is aborted and has to be restarted from the beginning. The successfully calculated parameters are stored in non-volatile memory of the SCD30 having the effect that after a restart the previously found parameters for ASC are still present.

Parameters:do_activate – Set activate flag.
force_recalibration(co2_ref_concentration)

Forced recalibration (FRC) is used to compensate for sensor drifts when a reference value of the CO₂ concentration in close proximity to the SCD30 is available. For best results, the sensor has to be run in a stable environment in continuous mode at a measurement rate of 2s for at least two minutes before applying the FRC commandand sending the reference value. Setting a reference CO₂ concentration by the method described here will always supersede corrections from the ASC (see command activate_auto_calibration) and vice-versa. The reference CO₂ concentration has to be within the range 400 ppm ≤ cref(CO₂) ≤ 2000 ppm. The FRC method imposes a permanent update of the CO₂ calibration curve which persists after repowering the sensor. The most recently used reference value is retained in volatile memory and can be read out with the command sequence given below. After repowering the sensor, the command will return the standard reference value of 400 ppm.

Parameters:co2_ref_concentration – New CO2 reference concentration.
get_altitude_compensation()

Read out the configured altitude (height in [m] over sea level).

Return altitude:
 
get_auto_calibration_status()

Read out the status of the active self calibration.

Return is_active:
 Indication if automatic calibration is active
get_data_ready()

Data ready command is used to determine if a measurement can be read from the sensor’s buffer. Whenever there is a measurement available from the internal buffer this command returns 1 and 0 otherwise. As soon as the measurement has been read by SCD30 the return value changes to 0.

Return data_ready_flag:
 Data ready flag
get_force_recalibration_status()

Read out the CO₂ reference concentration.

Return co2_ref_concentration:
 Currently used CO2 reference concentration.
get_measurement_interval()

Reads out the active measurement interval.

Return interval:
 Configured measurement interval
get_temperature_offset()

Read out the actual temperature offset. The result can be converted to ℃ by dividing it by 100.

Return temperature_offset:
 
read_firmware_version()

Read the version of the current firmware.

Return major:Major version number.
Return minor:Minor version number.
read_measurement_data()

Allows to read new measurement data if data is available.

Return co2_concentration:
 
Return temperature:
 
Return humidity:
 
set_altitude_compensation(altitude)

Measurements of CO₂ concentration based on the NDIR principle are influenced by altitude. SCD30 offers to compensate deviations due to altitude by using this command. Setting altitude is disregarded when an ambient pressure is given to the sensor (see command start_periodic_measurement). Altitude value is saved in non-volatile memory. The last set value will be used for altitude compensation after repowering.

Parameters:altitude
set_measurement_interval(interval)

Sets the interval used byt he SCD30 sensor to measure in continuous measurement mode. Initial value is 2s.The chosen measurement interval is saved in non-volatile memory and thus is not reset to its initial value after power up.

Parameters:interval – Measurement interval in seconds.
set_temperature_offset(temperature_offset)

The on-board RH/T sensor is influenced by thermal self-heating of SCD30 and other electrical components. Design-in alters the thermal properties of SCD30 such that temperature and humidity offsets may occur when operating the sensor in end-customer devices. Compensation of those effects is achievable by writing the temperature offset found in continuous operation of the device into the sensor. Temperature offset value is saved in non-volatile memory. The last set value will be used for temperature offset compensation after repowering

Parameters:temperature_offset
soft_reset()

The SCD30 provides a soft reset mechanism that forces the sensor into the same state as after powering up without the need for removing the power-supply. It does so by restarting its system controller. After soft reset the sensor will reload all calibrated data. However, it is worth noting that the sensor reloads calibration data prior to every measurement by default. This includes previously set reference values from ASC or FRC as well as temperature offset values last setting. The sensor is able to receive the command at any time, regardless of its internal state.

start_periodic_measurement(ambient_pressure)

Starts continuous measurement of the SCD30 to measure CO₂ concentration, humidity and temperature. Measurement data which is not read from the sensor will be overwritten. The CO₂ measurement value can be compensated for ambient pressure by feeding the pressure value in mBar to the sensor. Setting the ambient pressure will overwrite previous settings of altitude compensation. Setting the argument to zero will deactivate the ambient pressure compensation(default ambient pressure = 1013.25 mBar). For setting a new ambient pressure when continuous measurement is running the whole command has to be written to SCD30.

Parameters:ambient_pressure – Ambient pressure in millibar.
stop_periodic_measurement()

Stops the continuous measurement of the SCD30.

Commands

class sensirion_i2c_scd30.commands.StartPeriodicMeasurement(ambient_pressure)[source]
__init__(ambient_pressure)[source]

Initialize self. See help(type(self)) for accurate signature.

class sensirion_i2c_scd30.commands.StopPeriodicMeasurement[source]
__init__

Initialize self. See help(type(self)) for accurate signature.

class sensirion_i2c_scd30.commands.SetMeasurementInterval(interval)[source]
__init__(interval)[source]

Initialize self. See help(type(self)) for accurate signature.

class sensirion_i2c_scd30.commands.GetMeasurementInterval[source]
__init__

Initialize self. See help(type(self)) for accurate signature.

class sensirion_i2c_scd30.commands.GetDataReady[source]
__init__

Initialize self. See help(type(self)) for accurate signature.

class sensirion_i2c_scd30.commands.ReadMeasurementData[source]
__init__

Initialize self. See help(type(self)) for accurate signature.

class sensirion_i2c_scd30.commands.ActivateAutoCalibration(do_activate)[source]
__init__(do_activate)[source]

Initialize self. See help(type(self)) for accurate signature.

class sensirion_i2c_scd30.commands.GetAutoCalibrationStatus[source]
__init__

Initialize self. See help(type(self)) for accurate signature.

class sensirion_i2c_scd30.commands.ForceRecalibration(co2_ref_concentration)[source]
__init__(co2_ref_concentration)[source]

Initialize self. See help(type(self)) for accurate signature.

class sensirion_i2c_scd30.commands.GetForceRecalibrationStatus[source]
__init__

Initialize self. See help(type(self)) for accurate signature.

class sensirion_i2c_scd30.commands.SetTemperatureOffset(temperature_offset)[source]
__init__(temperature_offset)[source]

Initialize self. See help(type(self)) for accurate signature.

class sensirion_i2c_scd30.commands.GetTemperatureOffset[source]
__init__

Initialize self. See help(type(self)) for accurate signature.

class sensirion_i2c_scd30.commands.GetAltitudeCompensation[source]
__init__

Initialize self. See help(type(self)) for accurate signature.

class sensirion_i2c_scd30.commands.SetAltitudeCompensation(altitude)[source]
__init__(altitude)[source]

Initialize self. See help(type(self)) for accurate signature.

class sensirion_i2c_scd30.commands.ReadFirmwareVersion[source]
__init__

Initialize self. See help(type(self)) for accurate signature.

class sensirion_i2c_scd30.commands.SoftReset[source]
__init__

Initialize self. See help(type(self)) for accurate signature.

Result Types