GithubHelp home page GithubHelp logo

Comments (8)

abrahamMLG avatar abrahamMLG commented on June 17, 2024

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!!!

from ccs811.

eried avatar eried commented on June 17, 2024

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

from ccs811.

maarten-pennings avatar maarten-pennings commented on June 17, 2024

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%).

from ccs811.

maarten-pennings avatar maarten-pennings commented on June 17, 2024

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)

from ccs811.

abrahamMLG avatar abrahamMLG commented on June 17, 2024

from ccs811.

eried avatar eried commented on June 17, 2024

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

from ccs811.

abrahamMLG avatar abrahamMLG commented on June 17, 2024

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 <Wire.h> // 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

from ccs811.

maarten-pennings avatar maarten-pennings commented on June 17, 2024

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

from ccs811.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.