Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    Nicla Sense ME temperature and humidity inaccurate

    Nicla Sense ME temperature and humidity inaccurate


    I have three Nicla Sense ME boards, and on all of them the temperature is about 7.5 degrees too high, and the Humidity is about 22% too low. There is little difference between the native temperature reading and the compensated BSEC output. Adjusting the multiplier in the library to the corrected value also has little effect.

    I've tried running in standalone mode, and as a shield on an Arduino MKR1010. Same result. 

    Attached is a plot from 24h, demonstrating a comparison against a BME280.

    The code running on the Nicla Sense is below.

    Does anyone have any suggestions? And has anyone tested the gas sensor accuracy against a benchmark? I have my doubts, given the strange temperature and humidity readings.

    *Script to set the NICLA to respond to a wire command and return bsec data
    #include "Nicla_System.h"
    #include "Arduino_BHY2.h"
    #include <Wire.h>

    Sensor temp(SENSOR_ID_TEMP); //!!the library has a multiplier:
    Sensor humi(SENSOR_ID_HUM );
    Sensor baro(SENSOR_ID_BARO);
    Sensor gas(SENSOR_ID_GAS);

    SensorBSEC bsec(SENSOR_ID_BSEC_LEGACY); //it's critical to follow this tip

    #define BAUD_RATE_SERIAL_DATA (115200) //To transfer bsec data

    int sampleInt = 5000;
    unsigned long lastMillis = 0;

    void setup()




    Wire.begin(8); // join i2c bus with address #8
    Wire.onRequest(requestEvent); // register event

    void loop()
    int blueOn = 0;
    //static auto lastMillis = millis();

    // Update function should be continuously polled

    if ((unsigned long)(millis() - lastMillis) > sampleInt) {
    lastMillis = millis();

    uint32_t eCO2 = bsec.co2_eq();
    if (eCO2 < 800) nicla::leds.setColor(green);
    if (eCO2 >= 800 && eCO2 < 1200) nicla::leds.setColor(yellow); // it's near green, could be optimized
    if (eCO2 >= 1200) nicla::leds.setColor(red);
    blueOn = 0;

    if (millis() - lastMillis > 4000 & blueOn == 0) {
    //blue means its waiting for a new query
    blueOn == 1;


    void requestEvent() {
    String output = bsec.toString();
    char huh[131];
    output.toCharArray(huh, 131);
    Serial.print("Wire sending: ");
    Wire.write(huh, 131); // respond with message of 131 bytes
    // as expected by master


    28 REPLIES 28

    Community Moderator
    Community Moderator

    Hi sebp,

    The new firmware compensates for temperature and humidity values. Are the temperature and humidity values normal on your Nicla board?

    Yes, setting the temperature offset gives normal temperatur and humidity values of the BSEC sensor only.

    Community Moderator
    Community Moderator

    Hi sebp,

    Thanks for your feedback.
    Because of the placement of BME688 on Nicla board is close to heat source, so the new firmware compensate temperature and humidity values.

    Established Member

    I have checked the provided GitHub repo with all the commits, kind of a joke really. The given update is only for the temperature, no commits (outside of the firmware update) affect the Humidity or Pressure, so they still need linear regression. Moreover, the temperature offset function added actually requires testing against a different device for the highest accuracy, once again resulting to user done research, so it doesn't fix anything.

    Thanks Ciprian, that's good to know. 

    Seems to me there's a fundamental design flaw that prevents the sensor from operating within specification. If they can't fix it in software, then perhaps the solution is to issue a product recall, and redesign the boards.