SCD41 temperature offset effect delayed by several minutes

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
patja
 
Posts: 8
Joined: Fri Oct 15, 2010 4:21 pm

SCD41 temperature offset effect delayed by several minutes

Post by patja »

I'm using the Adafruit SCD41 C02, temp, humidity sensor module with a Magtag. The temperature reads too high so I am trying to use the temperature offset to adjust it.

The behavior I am seeing is that the temperature offset does not affect the first reading from the sensor, and is gradually applied over the course of the first few minutes.

With a delay of 30 seconds in my While: True loop and a temperature_offset value of 10, temp starts at about 25.4, and then every 30 seconds when I report a new reading to the serial console, it declines by a few degrees until it stabilizes around 15.7. It takes two to three minutes for the offset temperature to stabilize.

What I really want to do, and was doing initially, was to put the MagTag into deep sleep for one to five minutes between readings. Unfortunately what I've found when I try this is the temperature offset is never accounted for: since I am only taking one reading after waking from sleep it never stabilizes and I only get the initial high/incorrect/unadjusted temp value.

I am trying to determine if this is this a limitation of the sensor module, or in the circuitpython library, or in how I am using it? What are others' experiences with adjusting the temperature_offset?

I could just do the offset adjustment myself when I display the temp (I am already monkeying with it to present it as Fahrenheit rather than Celsius), but the temp offset also affects the humidity value.

Here is a simplified version of my code (for simplicity I removed the imports, network, and e-ink display stuff):

Code: Select all

magtag = MagTag()
i2c = board.I2C()
scd4x = adafruit_scd4x.SCD4X(i2c)

print("Temp offset: ", scd4x.temperature_offset)
print("Elevation: ", scd4x.altitude)
#commented out the settings adjustments.  they are correctly persisted upon reset after being set
#scd4x.stop_periodic_measurement() 
#time.sleep(3)
#scd4x.temperature_offset=10
#scd4x.altitude=93
#scd4x.ambient_pressure=1014
#scd4x.persist_settings()
#time.sleep(3)
#print("Temp offset: ", scd4x.temperature_offset)
scd4x.start_periodic_measurement()
print("Waiting for first measurement....")

while True:
    while not scd4x.data_ready:
        time.sleep(0.25)
    print("CO2: %d ppm" % scd4x.CO2)
    print("Temperature: %0.1f *C" % scd4x.temperature)
    print("Humidity: %0.1f %%" % scd4x.relative_humidity)
    print()
    time.sleep(30)


User avatar
patja
 
Posts: 8
Joined: Fri Oct 15, 2010 4:21 pm

Re: SCD41 temperature offset effect delayed by several minut

Post by patja »

As I've watched these things run I see the temperature reading continues to stabilize for quite some time. After running an hour or two I think maybe it doesn't need a temp offset after all, as it has overshot my target by about the amount of the offset. It just took a long while to get there.

I'm thinking that the temp is perhaps only suited for use in a constant-on scenario. No deep sleep.

User avatar
mikeysklar
 
Posts: 14194
Joined: Mon Aug 01, 2016 8:10 pm

Re: SCD41 temperature offset effect delayed by several minut

Post by mikeysklar »

@patja,

I agree with you probably the easiest scenario with the least issues would be to just to run in constant-on and not mess with temp offset.

Since this device has it's own heating element it would also be less than ideal to use the built-in temperature sensor for other ambient room measurements. It would make more sense to use another temperature sensor further from the unit.

That being said here are some relevant bits from the datasheet.

https://cdn.sparkfun.com/assets/d/4/9/a ... asheet.pdf
Screen Shot 2021-12-09 at 1.12.57 PM.png
Screen Shot 2021-12-09 at 1.12.57 PM.png (32.19 KiB) Viewed 96 times
Screen Shot 2021-12-09 at 1.13.41 PM.png
Screen Shot 2021-12-09 at 1.13.41 PM.png (90.64 KiB) Viewed 96 times

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

Return to “Adafruit CircuitPython”