11-21-2020 12:26 PM - edited 11-21-2020 01:00 PM
Hi,
I use a Wemos D1 ESP8266 Board with a BME680 connected to I2C , BSEC libary installed and adjustments done as decribed in the Github pages (https://github.com/BoschSensortec/BSEC-Arduino-library) and using the "basic" example from there. Temp., humidity, pressure look OK, but all other values do not change since 9 days (IAC =25, Accuracy=0, CO2 = 500, VOC = 0.5).
Edit: Gas resitance changes, esp. when I breath on it, so Iassume the sensor works, but caclulation of the values not.
I've tested three versions of the BSEC library, but no change (1.2.1474, 1.4.703, 1.4.8.0).
I'm using Arduino IDE 1.8.13, includes are: bsec.h (as per example provided)
Any ideas?
Thanks
Desh
Solved! Go to Solution.
12-02-2020 11:42 PM
@Jet: Thank you for your answer, but how would I do that in the basic example code provided (basic.ino, see below)?
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
basic.ino
#include "bsec.h"
// Helper functions declarations
void checkIaqSensorStatus(void);
void errLeds(void);
// Create an object of the class Bsec
Bsec iaqSensor;
String output;
// Entry point for the example
void setup(void)
{
Serial.begin(115200);
Wire.begin();
iaqSensor.begin(BME680_I2C_ADDR_PRIMARY, Wire);
output = "\nBSEC library version " + String(iaqSensor.version.major) + "." + String(iaqSensor.version.minor) + "." + String(iaqSensor.version.major_bugfix) + "." + String(iaqSensor.version.minor_bugfix);
Serial.println(output);
checkIaqSensorStatus();
bsec_virtual_sensor_t sensorList[10] = {
BSEC_OUTPUT_RAW_TEMPERATURE,
BSEC_OUTPUT_RAW_PRESSURE,
BSEC_OUTPUT_RAW_HUMIDITY,
BSEC_OUTPUT_RAW_GAS,
BSEC_OUTPUT_IAQ,
BSEC_OUTPUT_STATIC_IAQ,
BSEC_OUTPUT_CO2_EQUIVALENT,
BSEC_OUTPUT_BREATH_VOC_EQUIVALENT,
BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_TEMPERATURE,
BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY,
};
iaqSensor.updateSubscription(sensorList, 10, BSEC_SAMPLE_RATE_LP);
checkIaqSensorStatus();
// Print the header
output = "Timestamp [ms], raw temperature [°C], pressure [hPa], raw relative humidity [%], gas [Ohm], IAQ, IAQ accuracy, temperature [°C], relative humidity [%], Static IAQ, CO2 equivalent, breath VOC equivalent";
Serial.println(output);
}
// Function that is looped forever
void loop(void)
{
unsigned long time_trigger = millis();
if (iaqSensor.run()) { // If new data is available
output = String(time_trigger);
output += ", " + String(iaqSensor.rawTemperature);
output += ", " + String(iaqSensor.pressure);
output += ", " + String(iaqSensor.rawHumidity);
output += ", " + String(iaqSensor.gasResistance);
output += ", " + String(iaqSensor.iaq);
output += ", " + String(iaqSensor.iaqAccuracy);
output += ", " + String(iaqSensor.temperature);
output += ", " + String(iaqSensor.humidity);
output += ", " + String(iaqSensor.staticIaq);
output += ", " + String(iaqSensor.co2Equivalent);
output += ", " + String(iaqSensor.breathVocEquivalent);
Serial.println(output);
} else {
checkIaqSensorStatus();
}
}
// Helper function definitions
void checkIaqSensorStatus(void)
{
if (iaqSensor.status != BSEC_OK) {
if (iaqSensor.status < BSEC_OK) {
output = "BSEC error code : " + String(iaqSensor.status);
Serial.println(output);
for (;;)
errLeds(); /* Halt in case of failure */
} else {
output = "BSEC warning code : " + String(iaqSensor.status);
Serial.println(output);
}
}
if (iaqSensor.bme680Status != BME680_OK) {
if (iaqSensor.bme680Status < BME680_OK) {
output = "BME680 error code : " + String(iaqSensor.bme680Status);
Serial.println(output);
for (;;)
errLeds(); /* Halt in case of failure */
} else {
output = "BME680 warning code : " + String(iaqSensor.bme680Status);
Serial.println(output);
}
}
}
void errLeds(void)
{
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
delay(100);
digitalWrite(LED_BUILTIN, LOW);
delay(100);
}
12-03-2020 08:28 AM
Hi Sir:
Did you verify other example code? In this code, I didn't find this function, iaqSensor.setConfig(bsec_config_iaq), which configure the BSEC library with information about the sensor.
I recommend you to test other reference code or refer to them to modify your code.
12-23-2020 06:26 PM
@Jet: I finally had time to test your input today. Using the "basic_config_state" example it worked after 5 minutes. You could clearly see all values changing when I did breate on it. So I can now use it for my CO2 box 😁 Many thanks!
I have some additional questions though - sorry 🤔:
12-24-2020 02:27 AM - edited 12-24-2020 03:15 AM
Hi Sir:
Regarding some additional questions:
1. Please see the topic and you will know their definition descriptions:
IAQ have no unit, and PPM means parts per milion. And from BME680 datasheet you also can know what b-voc we test in laboratory is how to mixture.
2. IAQ only reflect the air quality worse or better, which means the device is in more better air condition or more worse, can't compare one site with another site at the same time, but we can know the air quality is becoming good or bad after you move sensor.
3. Humidity may not be re-calibrated, but termperature offset can be inputed to BESC algorithm. by bsec_iot_init() function.
Recommand you to recreate a new topic to talk about your thoughts in order to trace it.
We will give you the satified answers for your queries.
New thought, new topic, 😄.
12-24-2020 02:45 PM
Hi Jet,
thanks a lot for the fast answers as always. The answers and link provided did help me for now.
Keep up the good work
Desh