Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: FRC requires a wait time after calling forceRecalibration() #4

Open
ferdinand0815 opened this issue Oct 3, 2024 · 4 comments
Open
Assignees

Comments

@ferdinand0815
Copy link

When using the FRC method to calibrate the sensor, it is important to let it run for some time after calling forceRecalibration(). This is contrary to the field calibration application note which states "The effect of FRC takes place immediately."

Calling either softReset() or stopPeriodicMeasurement() (or power cycling the device) will null the just set calibration.

For calibration to work, one needs to either have a delay() or just keep measuring. The required wait time seems to be related to the measurement cycles - once two cycles are past the calibration curve is saved.

// let the CO2 reading be:
// -> 800 ppm

sensor.forceRecalibration(1200);
sensor.softReset();
// -> 800 ppm - fail

sensor.forceRecalibration(1200);
delay(5000);
sensor.softReset();
// -> 1200 ppm - good

I hope this helps someone.

@sdmueller
Copy link

Hi @ferdinand0815

Thanks for using our sensors!

I tried to reproduce the behavior you observed but on my side the FRC value is applied immediately and stays after soft resetting.

Are you sure the FRC call does not return an error in the first case (return value should be 0)?
If yes, what does sensor.getForceRecalibrationStatus(...) read out before and after the soft reset?

And what firmware version is your sensor on?

@sdmueller sdmueller self-assigned this Oct 9, 2024
@ferdinand0815
Copy link
Author

ferdinand0815 commented Oct 16, 2024

Please refer to the attached script: sdc30test.ino.zip. This is using an ESP8266.

I do use the non-blocking getDataReady()/readMeasurementData(). Maybe the measurement interval is important. I played around with stopPeriodicMeasurement() before starting calibration but this seems to have no effect.

Please do not just add a delay() to the forceRecalibration() ... ;)

Output for 1601 ms delay after calling forceRecalibration() - calibration fails

SDC30: Firmware version 3.66, altitude 450 m, temp offset 350 C, auto calibration disabled
CO2: 0.00 ppm
CO2: 737.47 ppm
CO2: 850.24 ppm
CO2: 860.41 ppm
CO2: 845.60 ppm
CO2: 841.16 ppm
CO2: 841.52 ppm
Reference CO2 before calibration: 400 ppm
Forcing calibration to 1200 ppm
Reference CO2 after calibration: 1200 ppm
Waited for 1601 ms
Restarting ESP ...�
[...]
SDC30: Firmware version 3.66, altitude 450 m, temp offset 350 C, auto calibration disabled
CO2: 0.00 ppm
CO2: 738.39 ppm
CO2: 825.60 ppm
CO2: 826.26 ppm
CO2: 827.11 ppm
CO2: 815.13 ppm
CO2: 815.83 ppm

Output for 2601 ms delay - calibration works

SDC30: Firmware version 3.66, altitude 450 m, temp offset 350 C, auto calibration disabled
CO2: 0.00 ppm
CO2: 740.87 ppm
CO2: 841.72 ppm
CO2: 823.00 ppm
CO2: 826.75 ppm
CO2: 824.49 ppm
CO2: 817.02 ppm
Reference CO2 before calibration: 400 ppm
Forcing calibration to 1200 ppm
Reference CO2 after calibration: 1200 ppm
Waited for 2601 ms
Restarting ESP ...�
[...]
SDC30: Firmware version 3.66, altitude 450 m, temp offset 350 C, auto calibration disabled
CO2: 0.00 ppm
CO2: 1070.39 ppm
CO2: 1216.61 ppm
CO2: 1206.10 ppm
CO2: 1215.21 ppm
CO2: 1214.48 ppm
CO2: 1217.50 ppm

@sdmueller
Copy link

Very interesting find.

I could now reproduce this exact behavior as well. I was testing on a different firmware version before.

We will investigate this internally and I will update you if I know something more.

Thanks!

@ferdinand0815
Copy link
Author

Also please note, the first measurement reported is always 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants