Skip to content

CCS811 & Deep Sleep #45

Description

@lloydrichards

Greetings,

So I've been doing some experimenting with using the CCS811 with a deep sleep functionality and have been getting some odd results. Perhaps someone also has some experience and can help me out. So the code looks something like this:

const SleepTimer = 15 //in min
void setup(){
esp_sleep_wakeup_cause_t wakeup_reason;
  wakeup_reason = esp_sleep_get_wakeup_cause();

switch (wakeup_reason)
  {
  case ESP_SLEEP_WAKEUP_UNDEFINED:
     ccs811.begin();
  break;

   case ESP_SLEEP_WAKEUP_TIMER:
      uint16_t eco2, etvoc, errstat, raw;

      ccs811.read(&eco2, &etvoc, &errstat, &raw);
      Serial.println(eco2);
      Serial.println(etvoc);
   break;
   };

   esp_sleep_enable_timer_wakeup(SleepTimer * 1000000LL);
   delay(100);
   esp_deep_sleep_start();
}

While this works and I get readings every 15 min and they even seem to be quite accurate for the first hour or two. The problem is that after that first hour the VOC steadily increases resulting in an increased eCO2. I have several CCS811 sensors so I've compared the deep sleep version with one that runs in the loop and there is odd behaviour going on while it's asleep.

I have several theories, including that while the sensor is not being read it slowly builds VOC in the sensor resulting in increased readings, but I have no way to verify this. If anyone has any ideas, it would be much appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions