Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCS811 Baseline Issues #69

Open
kdonahoe opened this issue Oct 8, 2021 · 8 comments
Open

CCS811 Baseline Issues #69

kdonahoe opened this issue Oct 8, 2021 · 8 comments

Comments

@kdonahoe
Copy link

kdonahoe commented Oct 8, 2021

Hello,

I've been having baseline issues with my CCS811 sensor for a while. Below is a plot where the blue line is VOC, and red is the baseline value, scaled down (/100) to fit on the plot. During the day, there is a lot of activity, which is expected, but after 5 or 6 PM, no people or chemicals should really be in the area. The VOC value drifts pretty crazily during the night hours, and this has been witnessed for weeks (it is running continuosly). Currently writing the temp and humidity to the ENV registers, but not writing to the baseline at all, because that behaved oddly for me in the past. My questions are:

  1. Why do the baseline values change so much during stable (almost zero) VOC values?
  2. How do we turn off automatic baseline correction?
  3. Recommended fix?

voc_baseline

Thanks for any help

@nordicp
Copy link

nordicp commented Oct 11, 2021

Hi, I saw rising signals during nighttime before and it took me a lot of effort to identify the source of the VOCs. Finally I identified a breeze of air coming from a workshop/production floor through an elevator shaft. During daytime the ventilation system ventilated off the VOCs but at nighttime things were different.
In your case it would be interesting to see the sensor resistance together with baseline (BL) and eCO2 or TVOC output. If resistance is dropping during night there must be something in the air. If resistance stays fairly stable but signal is high it is linked to the BL.
Could you tell a bit about the history of the sensor? How long has it been running? Uninterrupted? I am asking because the sensor will handle baseline correction differently during the first few days of operation and I wonder why the BL is changing so much within a few hours.
Best regards, Martin

@kdonahoe
Copy link
Author

Hi Martin, thank you for your ideas. We will definitely add the sensor resistance to our debug.

This sensor has been running for about 2 weeks now, uninterrupted. Below is a picture of the VOC plot from Friday. There is generally some human movement near the sensor throughout the week day, which is shown a bit during the day,

image

Meanwhile, here's the VOC plot from Saturday (when no one is in this environment). Over the weekend, the VOC values hang at zero, and we don't see this crazy curve at night time.-

image

@iCassius
Copy link

iCassius commented Nov 4, 2021

I have same issus . I bought 2 ccs811 with 2 nodemcu for testing.
One of the readings will start to rise indefinitely after a random time
The value of TVOC and Co2 will rise to more than 30000+
QQ截图20211105060410
I got the Baseline and re-written it, the value will return to 400+ after restarting

The value of the other one is much more normal.
These 2 sensors are placed on my desk and no more than half a meter
I try to use esphome to test one of them, the value will be much more stable

@maarten-pennings
Copy link
Owner

I expect that the software just reads the values measured by the css811 chip. So I expect that the differences are caused by the chips. That you try swapping them to see what the differences come from?

@nordicp
Copy link

nordicp commented Nov 8, 2021

TVOC and eCO2 output is processed data and without looking at the sensor resistance it is hard to make a guess. Please log the two sensor aside each other and record eCO2/TVOC and sensor resistance. Data graphs of resistance should have a logarithmic y-axis.
Do both modules have the same history (total power up time, same mode of operation) ?
I recommend mode 1 (1s data interval) for best performance.

@JeeWee65
Copy link

JeeWee65 commented Feb 2, 2023

TVOC and eCO2 output is processed data and without looking at the sensor resistance it is hard to make a guess. Please log the two sensor aside each other and record eCO2/TVOC and sensor resistance. Data graphs of resistance should have a logarithmic y-axis.
Do both modules have the same history (total power up time, same mode of operation) ?
I recommend mode 1 (1s data interval) for best performance.

I have same issues as iCassius. How can I get the resistance in a graph? Might be obvious to you but I didn't see code how to read that yet.

@maarten-pennings
Copy link
Owner

The last output parameter of the read() method returns the raw data. One part of that is the electrical current. The other part is an adc value which maps to a voltage. From current and voltage you can compute resistance. Hope this helps enough.

@JeeWee65
Copy link

JeeWee65 commented Feb 3, 2023

The last output parameter of the read() method returns the raw data. One part of that is the electrical current. The other part is an adc value which maps to a voltage. From current and voltage you can compute resistance. Hope this helps enough.

Thank you. I have the sensor hooked up via a D1 mini to ESPHome to get and use the data in Home Assistant. In ESPhome I don't sees this raw data, I see however that the baseline shifts with the CO2 value although I've set a baseline value in the configuration.

If I don't find another solution I will try to connect it to my pc and try the Arduino code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants