SCD30 forced calibration - how to?

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
877
 
Posts: 6
Joined: Sun Jan 16, 2022 3:29 pm

SCD30 forced calibration - how to?

Post by 877 »

HI all,

I have a couple of these SCD30's. maybe overthinking it but how exactly do you calibrate them?

Here is my project with LCD screen :https://github.com/877dev/CO2-Sensor. I am getting readings as low as 300ppm, which of course is wrong, I would assume 414ppm outside https://gml.noaa.gov/ccgg/trends/global.html .
garage_co2_levels.png
garage_co2_levels.png (28.77 KiB) Viewed 622 times

I know I need to user sensor_tuning.ino sketch and set forced value https://github.com/adafruit/Adafruit_SC ... tuning.ino.

If I flash edit and flash sensor_tuning.ino to the Wemos D1 mini, how long does it take to do the forced calibration? As the Wemos/SCD30 will be inside on my desk, and not outside in fresh air at first, does the SCD30 just take the lowest value it reads over a period and set that to the forced value 414ppm?

Do I let it run the sensor_tuning sketch for a while (how long?), then bring it back inside and just reflash my original code, and the sensor retains the new base level co2? I can't sit outside with my laptop reading serial port :)



To confuse matters I also need to set seal level and temp/humidity offsets:

161m above sea level
-2.5c temperature
-10% humidity
BME280 SCD30 comparison.png
BME280 SCD30 comparison.png (125.51 KiB) Viewed 624 times

User avatar
877
 
Posts: 6
Joined: Sun Jan 16, 2022 3:29 pm

Re: SCD30 forced calibration - how to?

Post by 877 »

@scottmil @mikeysklar hope you don't mind me posting you, I noticed you had a similar discussion recently and maybe could help please?
viewtopic.php?f=19&t=177913&p=868699&hi ... on#p868699

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: SCD30 forced calibration - how to?

Post by adafruit_support_carter »

See here for general info and guidance:
https://learn.adafruit.com/adafruit-scd ... alibration

User avatar
scottmil
 
Posts: 24
Joined: Fri Apr 16, 2021 6:18 pm

Re: SCD30 forced calibration - how to?

Post by scottmil »

It sounds like you are using the wrong Arduino sketch. My implementation uses a modified version of adafruit_scd30_test.ino. If you want to use Forced Calibration, then I think you should insert this line into your sketch setup routine:

scd30.forceRecalibrationWithReference(414);

The SCD30 takes several minutes to warm up. My indoor SCD30 generally measures over 500-600 ppm. I use an OLED to display the temperature and humidity as well, and use an ESP32 to send the data via wifi to my Hubitat home automation setup.

User avatar
877
 
Posts: 6
Joined: Sun Jan 16, 2022 3:29 pm

Re: SCD30 forced calibration - how to?

Post by 877 »

adafruit_support_carter wrote:See here for general info and guidance:
https://learn.adafruit.com/adafruit-scd ... alibration
Thank you, I read that article several times but needed more info hence the post.

Forced Re-Calibration
This is the easiest approach. The SCD-30 is placed in an environment with a known CO2 concentration. Then the FRC routine is called and this known concentration value (in ppm) is supplied. But how do you come up with that known value? That is a caveat of this approach and Sensirion (see PDF linked above) suggests:

Exposing the SCD-30 to fresh outside air and using a value of 400 ppm.

So, put the SDC30 in fresh air, basically?

Then it says (changed values to mine):
However, once you have your reference value, performing a FRC is super easy. Assuming a reference CO2 concentration of 414 ppm has been determined, then with the Arduino library use: scd30.forceRecalibrationWithReference(414);
Is the value saved on the SCD30, i.e. I can run the test sketch once in fresh air with scd30.forceRecalibrationWithReference(414); leave it ouside for say 10mins, then power down, move the sensor back indoors and write my own sketch to the esp8266 (excluding scd30.forceRecalibrationWithReference(414);

Or does it need fresh air every time the esp8266 reboots and run scd30.forceRecalibrationWithReference(414); (surely not) ?


Finally would a offset value work just as well, i.e. take the lowest sensor co2 reading over a few days. and add/subtract to get 414ppm?
Last edited by 877 on Mon Jan 17, 2022 4:31 pm, edited 3 times in total.

User avatar
877
 
Posts: 6
Joined: Sun Jan 16, 2022 3:29 pm

Re: SCD30 forced calibration - how to?

Post by 877 »

scottmil wrote:It sounds like you are using the wrong Arduino sketch. My implementation uses a modified version of adafruit_scd30_test.ino. If you want to use Forced Calibration, then I think you should insert this line into your sketch setup routine:

scd30.forceRecalibrationWithReference(414);

The SCD30 takes several minutes to warm up. My indoor SCD30 generally measures over 500-600 ppm. I use an OLED to display the temperature and humidity as well, and use an ESP32 to send the data via wifi to my Hubitat home automation setup.
Thanks for the reply! Do you include that FRC code in every sketch, or just run it once to set the reference value to the sensor?

User avatar
scottmil
 
Posts: 24
Joined: Fri Apr 16, 2021 6:18 pm

Re: SCD30 forced calibration - how to?

Post by scottmil »

I leave the calibration value in the Arduino setup routine to ensure my FRC value is always being used. Per the 5/2020 version of the Sensation SCD30 documentation, it appears that the FRC value is not stored in non-volatile memory, although the calibration curve is permanently updated by the FRC value.

"The FRC method imposes a permanent update of the CO2 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." per:

https://sensirion.com/media/documents/D ... iption.pdf

User avatar
877
 
Posts: 6
Joined: Sun Jan 16, 2022 3:29 pm

Re: SCD30 forced calibration - how to?

Post by 877 »

scottmil wrote:I leave the calibration value in the Arduino setup routine to ensure my FRC value is always being used. Per the 5/2020 version of the Sensation SCD30 documentation, it appears that the FRC value is not stored in non-volatile memory, although the calibration curve is permanently updated by the FRC value.

"The FRC method imposes a permanent update of the CO2 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." per:

https://sensirion.com/media/documents/D ... iption.pdf
Hi again,

I'm not understanding this to be honest, sorry!

Example, your scd30 is inside where the air is 600ppm. Your arduino including scd30 is rebooted. The sketch runs the FRC code, where you have defined 400ppm. So surely the sensor now calibrates it's curves to say it's currently in 400ppm, even though it's in 600ppm?

i.e. every time the arduino restarts the FRC code saves whatever the current ppm is, as 400ppm.


This article makes more sense https://emariete.com/en/sensirion-scd30 ... l-channel/
Where you calibrate once in fresh air, then flash your own sketch minus the frc routine.

User avatar
scottmil
 
Posts: 24
Joined: Fri Apr 16, 2021 6:18 pm

Re: SCD30 forced calibration - how to?

Post by scottmil »

So sorry...my mistake, and I apologize for the incorrect information in my post above.

You are very correct...the SCD30 sensor is calibrated only once, in your case scd30.forceRecalibrationWithReference(414) in an assumed 414 ppm C02 environment.

You can uncomment the following lines in the example sketch sensor_tuning.ino to initially set the reference value.
// if (!scd30.forceRecalibrationWithReference(400)){
// Serial.println("Failed to force recalibration with reference");
// while(1) { delay(10); }
// }

After calibrating my SCD30, I used the examples sketches adafruit_scd30_test.ino and oled_co2_monitor.ino as guides to develop my app to to interface with Hubitat.

User avatar
877
 
Posts: 6
Joined: Sun Jan 16, 2022 3:29 pm

Re: SCD30 forced calibration - how to?

Post by 877 »

scottmil wrote:...the SCD30 sensor is calibrated only once, in your case scd30.forceRecalibrationWithReference(414) in an assumed 414 ppm C02 environment.
Ah great, I was struggling to understand it :) Never used Hubitat, I'm using Node Red.
Thanks for your time!

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”