From ba7906ad9f664993a00a2f39d4699c9b1b03fd6c Mon Sep 17 00:00:00 2001 From: admar Date: Tue, 24 May 2022 22:24:39 +0200 Subject: [PATCH] Set static temperature offset for BME680 + select correct configuration --- Claire.ino | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Claire.ino b/Claire.ino index 7f3b673..6ab3adb 100644 --- a/Claire.ino +++ b/Claire.ino @@ -40,6 +40,10 @@ static int CONNECT_SW_PIN = 0; Adafruit_NeoPixel leds_rgb_proto_paper(NUM_LEDS_PROTO_PAPER, DATA_PIN_PROTO_PAPER, NEO_GRB + NEO_KHZ800); Adafruit_NeoPixel leds_rgbw_proto_v1(NUM_LEDS_PROTO_V1, DATA_PIN_PROTO_V1, NEO_RGBW + NEO_KHZ800); +const uint8_t bsec_config_iaq[] = { + #include "config/generic_33v_3s_4d/bsec_iaq.txt" +}; + static int ledMapPrecipitation[12] = {0}; static int ledMapPAQI[12] = {0}; static int ledMapUVI = 0; @@ -312,7 +316,7 @@ void readSensors(void) { unsigned long time_trigger = millis(); if (iaqSensor.run()) { // If new data is available - output = String(time_trigger); + output = "Time: " + String(time_trigger); output += " ms, Traw: " + String(iaqSensor.rawTemperature); output += " *C , P: " + String(iaqSensor.pressure); output += " hPa, RHraw: " + String(iaqSensor.rawHumidity); @@ -320,8 +324,8 @@ void readSensors(void) { output += " Ohm, IAQ: " + String(iaqSensor.iaq); output += ", accuracy: " + String(iaqSensor.iaqAccuracy); output += ", Tcorr: " + String(iaqSensor.temperature); - output += " *C, RHcorr" + String(iaqSensor.humidity); - output += " %, IAQ static" + String(iaqSensor.staticIaq); + output += " *C, RHcorr: " + String(iaqSensor.humidity); + output += " %, IAQstatic: " + String(iaqSensor.staticIaq); output += ", eCO2: " + String(iaqSensor.co2Equivalent); output += " ppm, eVOC: " + String(iaqSensor.breathVocEquivalent); output += " ppm"; @@ -370,6 +374,10 @@ void setup() { leds_rgb_proto_paper.begin(); // INITIALIZE NeoPixel strip object } else { Serial.println(F("BME680 found; assuming hw variant \"proto v1\"")); + + iaqSensor.setConfig(bsec_config_iaq); + iaqSensor.setTemperatureOffset(13.5f); + checkIaqSensorStatus(); hw_variant = HW_PROTO_V1; setup_pins_proto_v1(); @@ -631,7 +639,7 @@ static int colormap(float x) { float colormapIaqi(void) { float x = 0.0f; - float iaqi = iaqSensor.iaq; + float iaqi = iaqSensor.staticIaq; if (iaqi <= 50.0f) { x = 1.0f; // Excellent