maarten-pennings / CCS811

Arduino library for the CCS811 gas sensor for monitoring indoor air quality.
MIT License
167 stars 47 forks source link

Very high eCO2 values #12

Closed eried closed 5 years ago

eried commented 5 years ago

Hey! thanks a lot for the library, this is awesome. I saw the other thread with a similar question but my problem is slightly different: image

It looks like an inverse burn :P haha for first days seemed to work on an acceptable range, but now the values are crazy high. Do I really need the humedity and temperature reference?

I am using your example for ThingSpeak directly, no other modifications to the ESP8266.

abrahamMLG commented 5 years ago

Hi !!!! I have same problem, i conect with nano, burned 48 hours or more... when measures stop growing a few hours in 7992 ppm was disconected. I´m not sure if module receives temperature and humidity levels.

` void setTemp(){

h = dht.readHumidity()- ha; //Leemos la Humedad t = dht.readTemperature()- ta; //Leemos la temperatura en grados Centigrados taCCS= t-25; ccs.setEnvironmentalData(h, taCCS);

} `

I´m not sure if this line is required: float temp = ccs.calculateTemperature();
Thanks 4 share!!!

eried commented 5 years ago

I am still having the same issue but it is way less frequent now:

image

I am not sure I can trust those high readings after the initial period of burn

maarten-pennings commented 5 years ago

Hi @eried, sorry, I missed your previous post. The sensor can be used without T and RH compensation. But the computed eCO2 is better with setting the actual T and RH (the datasheet says, if I recall correctly, that the chip will use the default T=25C and RH=50%).

maarten-pennings commented 5 years ago

Hi @abrahamMLG. I do not understand the code you listed. The driver function is called CCS811::set_envdata(t,h) not ccs.setEnvironmentalData(h, taCCS)

abrahamMLG commented 5 years ago

Hi!, u right, mistake the sketch, sorry... I also try adafruit library and code corresponding at this sketch. But I check yours, upload and try again with same results... I don't know why, but when ccs is running a few hours increase the eco2 measure... My English is not so good and I can't translate to understand everything.. I will try to check baseline but I can understand the process... I don't wanna brick the ccs...

Thanks soooo much 4 your contribution with CCS811. It's soooo helpful.

Regards Abraham


De: Maarten Pennings notifications@github.com Enviado: lunes, 1 de abril de 2019 19:58:16 Para: maarten-pennings/CCS811 Cc: abrahamMLG; Mention Asunto: Re: [maarten-pennings/CCS811] Very high eCO2 values (#12)

Hi @abrahamMLGhttps://github.com/abrahamMLG. I do not understand the code you listed. The driver function is called CCS811::set_envdata(t,h) not ccs.setEnvironmentalData(h, taCCS)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/maarten-pennings/CCS811/issues/12#issuecomment-478681128, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AhOT1XQlb7v3HTNe181JJl0WhgcJjKqmks5vcki4gaJpZM4aixD4.

eried commented 5 years ago

Hi @eried, sorry, I missed your previous post. The sensor can be used without T and RH compensation. But the computed eCO2 is better with setting the actual T and RH (the datasheet says, if I recall correctly, that the chip will use the default T=25C and RH=50%).

Oh... I am going to try with those defaults. Thanks

abrahamMLG commented 5 years ago

Hi again, i think have solution to my problem, testing now... I use DHT sensor, and use softwareserial to read data wit BT app. Hope found the problem, i was using reading code in two places in the sketck, maybe this was the problem, now pass eco2 value to another variable and work with that.

`#include // I2C library

include "DHT.h" // Libreria sensor humedad y temperatura

include "ccs811.h" // CCS811 library

define DHTPIN 2 // Pin donde está conectado el sensor DHT

define DHTTYPE DHT11 // Descomentar si se usa el DHT 11

SoftwareSerial BT1(7,8); CCS811 ccs811(13); // nWAKE on 13 DHT dht(DHTPIN, DHTTYPE);

int h, t; int ha=10; // adjustment of the reading deviation in DHT comparing with the real measures int ta=1; // adjustment of the reading deviation in DHT comparing with the real measures bool ok; int co2;

void setup() {

BT1.begin(9600); // Enable serial Serial.begin(115200); Serial.println(""); Serial.println("setup: Starting CCS811 envdata demo"); Serial.print("setup: library version: "); Serial.println(CCS811_VERSION);

// Enable I2C, e.g. for ESP8266 NodeMCU boards: VDD to 3V3, GND to GND, SDA to D2, SCL to D1, nWAKE to D3 (or GND) Serial.print("setup: I2C "); Wire.begin(); Serial.println("ok");

// Enable ENS210 // Serial.print("setup: ENS210 "); // ok= ens210.begin(); // if( ok ) Serial.println("ok"); else Serial.println("FAILED");

// Enable dht dht.begin();

// Enable CCS811 Serial.print("setup: CCS811 "); ccs811.set_i2cdelay(50); // Needed for ESP8266 because it doesn't handle I2C clock stretch correctly ok= ccs811.begin(); if( ok ) Serial.println("ok"); else Serial.println("FAILED");

// Start CCS811 (measure every 1 second) Serial.print("setup: CCS811 start "); ok= ccs811.start(CCS811_MODE_1SEC); if( ok ) Serial.println("ok"); else Serial.println("FAILED"); delay(1000); }

void loop() { // Read ENS210 //int t_data, t_status, h_data, h_status; //ens210.measure(&t_data, &t_status, &h_data, &h_status );

/ / Process ENS210 Serial.print( "ENS210: " ); if( t_status==ENS210_STATUS_OK && h_status==ENS210_STATUS_OK ) { Serial.print("T="); Serial.print( ens210.toCelsius(t_data,1000) ); Serial.print(" mC "); Serial.print("H="); Serial.print( ens210.toPercentageH(h_data,1000) ); Serial.print(" m%RH "); // Pass environmental data from ENS210 to CCS811 ccs811.set_envdata210(t_data, h_data); } else { Serial.print( "T=" ); Serial.print( ens210.status_str(t_status) ); Serial.print(" "); Serial.print( "H=" ); Serial.print( ens210.status_str(h_status) ); Serial.print(" "); } Serial.print(" "); /

// Read CCS811 uint16_t eco2, etvoc, errstat, raw; ccs811.read(&eco2,&etvoc,&errstat,&raw);

// Read DHT h = dht.readHumidity()- ha; //Leemos la Humedad t = dht.readTemperature()- ta; //Leemos la temperatura en grados Celsius ccs811.set_envdata210(t, h); // Send data to ccs811

// Process CCS811

Serial.print("CCS811: ");
if( errstat==CCS811_ERRSTAT_OK ) {
Serial.print("eco2=");  Serial.print(eco2);  Serial.print(" ppm  ");
Serial.print("etvoc="); Serial.print(etvoc); Serial.print(" ppb  ");  

} else if( errstat==CCS811_ERRSTAT_OK_NODATA ) { Serial.print("waiting for (new) data"); } else if( errstat & CCS811_ERRSTAT_I2CFAIL ) { Serial.print("I2C error"); } else { Serial.print( "error: " ); Serial.print( ccs811.errstat_str(errstat) ); } Serial.println(); BT1.print("temperatura: ");BT1.println(t); BT1.print("humedad: ");BT1.println(h); BT1.print("eco2: ");BT1.println(eco2); BT1.flush();

// Wait delay(5000); }`

Regards

maarten-pennings commented 5 years ago

Hi @eried, I closed this issue, hope it is OK with you.