SCD30 (on ESP32): wrong temp & hum: calibration issue

Hi guys,

I am comparing results from SCD30 sensor with other instruments, and I am not happy with the outcome.
In particular temperature is near 3,5°C degree above the average temp of other instruments and humidity about 5% below. (I cannot check co2 levels, it is the reason I bought this sensor...)

That said it seems that SCD30 sensor must be calibrated in order to take account of device's heat that depends on its setup (as I read on the interface descr) (and it seems the case cause I can suppose that device heat increase temp and could reduce hum).

From the interface desc I have not understood how to calibrate temperature (ie how to take account of the temperature offset) and if there is a way to adjust also humidity.

What I am trying at the moment to solve the issue is just using the AutoSelfCalibration function in the code setup (as presented in the groove example)

//Calibration for minimum 7 days,after this ,close auto self calibration operation.
scd30.setAutoSelfCalibration(1);

But I am not sure it will fix the temp & hum issues...

Could you help me with this?

Thanks in advance

In particular temperature is near 3,5°C degree above the average temp of other instruments and humidity about 5% below. (I cannot check co2 levels, it is the reason I bought this sensor...)

These other instruments offer a higher accuracy than the SCD30? The temperature difference more or less explains the humidity difference. Just ensure that you use an accurate device to set the self heating offset.

From the interface desc I have not understood how to calibrate temperature (ie how to take account of the temperature offset) and if there is a way to adjust also humidity.

The device offers to set an offset temperature to compensate sensor placement influences. The command is 0x5403, the following int16 is the offset in 0.01°C, so in your case 350. If you're using the Seeed library, you can use the setTemperatureOffset() method to set it.

If you are using the Arduino Core and not the ESP32 ADC API, you will find the ESP32 A:D is not as accurate.

ESP32 ADC API documentation:
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/adc.html

If you are using the Arduino Core and not the ESP32 ADC API, you will find the ESP32 A:D is not as accurate.

OP is not even using the ADC.

Thanks for the replies guys.

pylon:
These other instruments offer a higher accuracy than the SCD30? The temperature difference more or less explains the humidity difference. Just ensure that you use an accurate device to set the self heating offset.

Well, they are not expensive instruments (they are 3 digital thermohygrometer 20€ each), but the three are pretty aligned. (maximum 0,5 °C difference in temp and 1% in hum).

pylon:
The device offers to set an offset temperature to compensate sensor placement influences. The command is 0x5403, the following int16 is the offset in 0.01°C, so in your case 350. If you're using the Seeed library, you can use the setTemperatureOffset() method to set it.

Sorry, but I found commands about it but honestly I don't understand how to use them... Could you please explain me it as I was a child? I tried to use setTemperatureOffset() in the code but without success. I didn't find any code example performing such offsetting.

Idahowalker:
If you are using the Arduino Core and not the ESP32 ADC API, you will find the ESP32 A:D is not as accurate.

ESP32 ADC API documentation:
Page Not Found - ESP32 - — ESP-IDF Programming Guide latest documentation

To be precise I am using this module "ESP32 NodeMCU WiFi CP2102". In particular I power the SCD30 with 3.3V pin, I use G22 as SCL and G21 as SDA. (I had a lot of trouble during the projecting cause as you said ESP32 has a lot of pin that creates troubles when using also WiFi connection).

Maybe with correct offsetting everything will be fine. But not understood as to properly do it.

Thanks so much again

I am trying to use "SparkFun_SCD30_Arduino_Library" instead of the groove's one. In particular there is an example on how to change options like setMeasurementInterval(), setAltitudeCompensation(), setAmbientPressure(),
and finally setTemperatureOffset().

Now I am trying to run it with correct options, check the temperature against other instruments, then setting the temperature offset in the code.

I will keep you posted!

FABION:
To be precise I am using this module "ESP32 NodeMCU WiFi CP2102". In particular I power the SCD30 with 3.3V pin, I use G22 as SCL and G21 as SDA. (I had a lot of trouble during the projecting cause as you said ESP32 has a lot of pin that creates troubles when using also WiFi connection).

Please point out the posting where I indicated to you that connecting to the ESP32 GPIO pins would cause WiFI issues. I've not found a non ESP32 programming pin on an ESP32 that messes with WiFI.

Sorry Idahowalker, I misunderstood your post remembering when I failed at the beginning with my ESP32 cause I was using GPIO that were in conflicts (as I understood from my humble point of view) with WiFi connection. Anyway it seems not to be the issue there.

The issue is now that the code shows weird behaviour... At the beginning "SparkFun_SCD30_Arduino_Library" seemed to work well, despite the fact that there was still a gap between scd30 temp and other instruments temp, even if it was reduced to 2.3 C°.

So I tried to set the offset: airSensor.setTemperatureOffset(2.3); I got error, so I reboot everything with original code, then back to new using airSensor.setTemperatureOffset(1)

float offset = airSensor.getTemperatureOffset();
  Serial.print("Current temp offset: ");
  Serial.print(offset, 2);
  Serial.println("C");

  airSensor.setTemperatureOffset(1); 

float offset2 = airSensor.getTemperatureOffset();
  Serial.print("New temp offset: ");
  Serial.print(offset2, 2);
  Serial.println("C");

but then running the code I obtain these results:

15:21:03.539 -> Current temp offset: 1.00C
15:21:03.641 -> New temp offset: 0.00C

It seems like it is not properly setting the offset >:(

Now after some trials with offset 3, it seems to take in account the offset 2, giving a temp diff of 0,5 C° and roughly 0.5% on humidity.. so great result but I don't like how I came to it......... Something seems not working properly maybe with airSensor.getTemperatureOffset() because it seems that airSensor.setTemperatureOffset() affected the results

Perhaps the sensor is just not suited for your requirements and you may want to look into using another sensor.

Quote from the manual:

Temperature offset value is saved in non-volatile memory. The last set value will be used for temperature offset compensation after repowering.

So you have to power-cycle the sensor to actually activate the new temperature offset.

I have two SCD30 sensors running with the SparkFun_SCD30_Arduino_Library as well. Had to adjust one by 3 and the other by 3.2 with .setTemperatureOffset(3); One is running with an arduino Uno the other on D1 mini.
After setting the offset + reset it takes some minutes(!) to adjust the temperature.