I am trying to calibrate the SCD30 sensor to a reference of known CO2 concentration at 410ppm. I am using the force calibration method. As recommended by the working document, I run the sensor for 2 minutes, then execute the force calibration code. My problem is that after restarting the sensor, the force calibration data is not updated, but wind back to 400ppm. (ps, I turned off the auto calibration to avoid it overrides force calibration result).
My questions are 1) does this mean the sensor returned to an "uncalibrated" status? 2) how to make the sensor remember the force calibration result?
266 seconds
Forced Recalibration reference: 410 ppm
T, 22.23Adafruit SCD30 test!
SCD30 Found!
Measurement Interval: 2 seconds
6 seconds
Forced Recalibration reference: 400 ppm
T, 23.66C,RH, 3.69 %,CO2, 0.000 ppm,,
8 seconds
Forced Recalibration reference: 400 ppm
T, 23.65C,RH, 3.70 %,CO2, 396.043 ppm,,
10 seconds
Forced Recalibration reference: 400 ppm
T, 23.62C,RH, 3.68 %,CO2, 434.326 ppm,,
12 seconds
Forced Recalibration reference: 400 ppm
T, 23.61C,RH, 3.78 %,CO2, 410.667 ppm,,
14 seconds
Forced Recalibration reference: 400 ppm
T, 23.58C,RH, 3.78 %,CO2, 407.019 ppm,,
16 seconds
Forced Recalibration reference: 400 ppm
T, 23.56C,RH, 3.77 %,CO2, 408.125 ppm,,
18 seconds
Forced Recalibration reference: 400 ppm
T, 23.55C,RH, 3.72 %,CO2, 407.193 ppm,,
20 seconds
....
158 seconds
Forced Recalibration reference: 400 ppm
T, 22.59C,RH, 2.98 %,CO2, 416.902 ppm,,
Forced Recalibration reference: 400 ppm
(here the code force calibration again)
Forced Recalibration reference: 410 ppm
160 seconds
Forced Recalibration reference: 410 ppm
T, 22.61C,RH, 3.07 %,CO2, 416.672 ppm,,
162 seconds
Forced Recalibration reference: 410 ppm
T, 22.60C,RH, 3.06 %,CO2, 416.675 ppm,,
164 seconds
Forced Recalibration reference: 410 ppm
T, 22.58C,RH, 3.04 %,CO2, 410.001 ppm,,
166 seconds
Forced Recalibration reference: 410 ppm
T, 22.57C,RH, 3.10 %,CO2, 409.875 ppm,,
My code:
- Code: Select all | TOGGLE FULL SIZE
// Basic demo for readings from Adafruit SCD30
#include <Adafruit_SCD30.h>
Adafruit_SCD30 scd30;
int i=1;
void setup(void) {
Serial.begin(115200);
while (!Serial) delay(10); // will pause Zero, Leonardo, etc until serial console opens
Serial.println("Adafruit SCD30 test!");
// Try to initialize!
if (!scd30.begin()) {
Serial.println("Failed to find SCD30 chip");
while (1) { delay(10); }
}
Serial.println("SCD30 Found!");
// if (!scd30.setMeasurementInterval(10)){
// Serial.println("Failed to set measurement interval");
// while(1){ delay(10);}
// }
Serial.print("Measurement Interval: ");
Serial.print(scd30.getMeasurementInterval());
Serial.println(" seconds");
}
void loop() {
if (scd30.dataReady()){
//Serial.println("Data available!");
Serial.print(i*2); Serial.println(" seconds");
Serial.print("Forced Recalibration reference: ");
Serial.print(scd30.getForcedCalibrationReference());
Serial.println(" ppm");
if (!scd30.read()){ Serial.println("Error reading sensor data"); return; }
Serial.print("T, ");
Serial.print(scd30.temperature);
Serial.print("C,");
Serial.print("RH, ");
Serial.print(scd30.relative_humidity);
Serial.print(" %,");
Serial.print("CO2, ");
Serial.print(scd30.CO2, 3);
Serial.print(" ppm,");
Serial.println(",");
} else {
//Serial.println("No data");
}
delay(2000);
i = i+1;
if (i == 80){
Serial.print("Forced Recalibration reference: ");
Serial.print(scd30.getForcedCalibrationReference());
Serial.println(" ppm");
scd30.forceRecalibrationWithReference(410);
Serial.print("Forced Recalibration reference: ");
Serial.print(scd30.getForcedCalibrationReference());
Serial.println(" ppm");
}
}