Sensirion / python-i2c-scd

Python Driver for Sensirion I²C Carbon Dioxid Sensor - SCD41
https://sensirion.github.io/python-i2c-scd/
BSD 3-Clause "New" or "Revised" License
6 stars 3 forks source link

SCD41 baseline correction #3

Closed marcelmindemann closed 1 year ago

marcelmindemann commented 1 year ago

Hello, I've got a question regarding the baseline correction of the SCD4x sensor family. First of all, I wasn't sure if the sensors even have something like an baseline correction, because the data sheets do not talk about it. But I take this function as evidence that it does: https://github.com/Sensirion/python-i2c-scd/blob/9cc290f84c46f30af527cebb6ea8f60e23953644/sensirion_i2c_scd/scd4x/commands.py#L353

Do the sensors feature an automatic baseline correction, e.g. do they frequently trigger this routine without user interaction? And more importantly, the comment mentions operating the sensor in an "environment with homogenous and constant CO₂ concentration". Does this environment only have to be constant, or does it actually have to be outside? My understanding of CO2 baseline corrections is that sensors regularly take their minimum datapoint over the last n hours and recalibrate to interpret that as 400 ppm. I don't understand how a correction factor could be computed in an environment of constant, but unknown CO2 concentration.

Thanks a lot for considering my question!

Edit: Sorry, it appears I was blind - the data sheet does indeed mention an automatic baseline correction, I was only CTRL+F'ing for the wrong string. The data sheet says "The automatic selfcalibration algorithm assumes that the sensor is exposed to the atmospheric CO2 concentration of 400 ppm at least once per week." Do you know how often the sensors triggers the ASC? If I operate the sensor with constant power interruptions, and it never has the opportunity to collect data points for a longer period than 2 days, will the sensor recalibrate against that or does it need a week of data?

psachs commented 1 year ago

Hi,

The SCD4x sensors do have an automatic self calibration feature (ASC) which is enabled by default (as you found out already). The sensor does not necessary need to run for a whole week. The assumption is only that you see 400ppm at least once within this week. The algorithm will then adjust the calibration offset so that the lowest ppm value is 400ppm. If you use the sensor in an environment that never sees fresh air (or is never operated while seeing fresh air) you might want to turn of the ASC.

The force recalibration allows you to manually calibrate the sensor. The interface takes in the target CO2 ppm value that the sensor is expected to measure in your environment. Your environment therefore doesn't need to be at 400ppm but can be at any value. But you have to get that target the value from a CO2 reference. If you don't have an option but can operate the SCD4x sensor in a fresh air environment with 400ppm you can of course use this as your force recalibration with trade-off that this is an estimation.