NICLA SENSE ME BSEC ZERO VALUES "comp_t", "comp_h", "comp_g"""

Hi Arduino experts, I recently bought a nicla sense me board past couple of days and i tried to get a sensors values in BSEC.It's still return zero compensated values but co2 and other values are arrives.Only comp_t,comp_h,comp_g, values are not arrived.Any one know that problem please provide the solution.Thanks in advance,,,
#############
this is my code and serial monitor
#include "Arduino.h"
#include "Arduino_BHY2.h"
#include "Nicla_System.h"

SensorXYZ accel(SENSOR_ID_ACC);
SensorXYZ gyro(SENSOR_ID_GYRO);
Sensor temperature(SENSOR_ID_TEMP);
Sensor gas(SENSOR_ID_GAS);
SensorQuaternion rotation(SENSOR_ID_RV);
Sensor pressure(SENSOR_ID_BARO);
Sensor humidity(SENSOR_ID_HUM);
SensorBSEC bsec(SENSOR_ID_BSEC);
SensorQuaternion Geomagnetic(SENSOR_ID_GEORV);
SensorXYZ Magnetometer(SENSOR_ID_MAG);
Sensor Motion(SENSOR_ID_MOTION_DET);
void setup()
{
Serial.begin(115200);
while(!Serial);

BHY2.begin();

accel.begin();
gyro.begin();
temperature.begin();
gas.begin();
rotation.begin();
pressure.begin();
humidity.begin();
bsec.begin();
Geomagnetic.begin();
Magnetometer.begin();
Motion.begin();
}

void loop()
{
static auto printTime = millis();

// Update function should be continuously polled
BHY2.update();

if (millis() - printTime >= 1000) {
printTime = millis();

Serial.println(String("acceleration: ") + accel.toString());
Serial.println(String("gyroscope: ") + gyro.toString());
Serial.println(String("gas: ") + String(gas.value()));
Serial.println(String("temperature: ") + String(int(temperature.value())));
Serial.println(String("rotation: ") + rotation.toString());
Serial.println(String("pressure: ") + pressure.toString());
Serial.println(String("humidity: ") + humidity.toString());
Serial.println(String("MOTION DETECT: ") + Motion.toString());
Serial.println(String("Geomagnetic rotation vector: ") + Geomagnetic.toString());
Serial.println(String("MAGNETOMETER: ") + Magnetometer.toString());
Serial.println(String("BSEC info: ") + bsec.toString());
unsigned co2 = bsec.co2_eq();
Serial.println(String("CO2: ") + String(co2));
float b_voc_eq = bsec.b_voc_eq();
Serial.println(String("VOC: ") + String(b_voc_eq));
unsigned iaq_s = bsec.iaq_s();
Serial.println(String("IAQ_S: ") + String(iaq_s));
unsigned iaq = bsec.iaq();
Serial.println(String("IAQ: ") + String(iaq));
float comp_t = bsec.comp_t();
Serial.println(String("COOMPENSATED TEMPERATURE (celsius): ") + String(comp_t));
float comp_h = bsec.comp_h();
Serial.println(String("COMPENSATED HUMIDITY: ") + String(comp_h));
unsigned comp_g = bsec.comp_g();
Serial.println(String("COMPENSATED GAS RESISTANCE(ohms): ") + String(comp_g));

delay(10000);

}
}
#########
Serial monitor
##########
10:22:24.137 -> acceleration: XYZ values - X: 3222 Y: -546 Z: -2476
10:22:24.137 ->
10:22:24.137 -> gyroscope: XYZ values - X: 0 Y: 3 Z: 2
10:22:24.137 ->
10:22:24.137 -> gas: 11171.00
10:22:24.137 -> temperature: 41
10:22:24.137 -> rotation: Quaternion values - X: 0.852 Y: -0.279 Z: 0.438 W: 0.068 Accuracy: 0.762
10:22:24.137 ->
10:22:24.137 -> pressure: Data value: 1005.701
10:22:24.170 ->
10:22:24.170 -> humidity: Data value: 50.000
10:22:24.170 ->
10:22:24.170 -> MOTION DETECT:
10:22:24.170 -> Geomagnetic rotation vector: Quaternion values - X: 0.798 Y: -0.407 Z: 0.423 W: 0.134 Accuracy: 0.052
10:22:24.203 ->
10:22:24.203 -> MAGNETOMETER: XYZ values - X: -727 Y: -414 Z: -156
10:22:24.203 ->
10:22:24.203 -> BSEC info: BSEC output values - iaq: 0 iaq_s: 8 b_voc_eq: 0.38 co2_eq: 432 accuracy: 1 comp_t: 0.00 comp_h: 0.00 comp_g: 0
10:22:24.203 ->
10:22:24.203 -> CO2: 432
10:22:24.203 -> VOC: 0.38
10:22:24.203 -> IAQ_S: 8
10:22:24.236 -> IAQ: 0
10:22:24.236 -> COOMPENSATED TEMPERATURE (celsius): 0.00
10:22:24.236 -> COMPENSATED HUMIDITY: 0.00
10:22:24.236 -> COMPENSATED GAS RESISTANCE(ohms): 0

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

This is because most sensor frame size is less than 10 (and to save space), SENSOR_DATA_FIXED_LENGTH is defined as 10.

you could change the definition of SENSOR_DATA_FIXED_LENGTH (in libraries/Arduino_BHY2/src/sensors/SensorTypes.h) to a larger value such as 30 (which is greater than the frame size of 29 for sensor id 171), and you should be able to see the actual IAQ values rather than 0.

Btw you do not need the comp_h,t and g. They are extremely close to the actual temp, hum, pressure that can be had with:

temperature.value();
humidity.value();
pressure.value();

Thanks for your help.It's works now,, :slightly_smiling_face:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.