BHI260AP sensor with BMP390 to get pressure and temperature sensor data and convert to altimeter

Hi, 

I am working on BHI260AP bosch shuttle board 3.0 which have on baord BMP390 barometer. 

I have update the firmware (firmware/BHI260AP/Bosch_Shuttle3_BHI260_aux_BMM150_BMP390_BME688.fw.h) of BHI260AP to get pressure sensor and temperature data.

I am using below API to parse the sensor data, 

 

 

void bhy2_parse_temperature_celsius(const uint8_t *data, bhy2_float *temperature)
{
    /* 1 LSB = 1/100 degC */
    float scale_factor = (float)1 / 100;

    *temperature = (float)BHY2_LE2S16(data) * scale_factor;
}

void bhy2_parse_humidity(const uint8_t *data, bhy2_float *humidity)
{
    float scale_factor = (float)1;

    *humidity = data[0] * scale_factor;
}

void bhy2_parse_pressure(const uint8_t *data, bhy2_float *pressure)
{
    /* 1 LSB = 1/128 Pa */
    float scale_factor = (float)1 / 128;

    *pressure = (float)BHY2_LE2U24(data) * scale_factor;
}

 

 

I am facing issue in clarification in conversion of sensor data,  this api i found from bhy2_parse.c file. here
1) Currently i am getting "1005.523438" using above API but not sure about the unit, is it Pa or hPa ?
2) From BHI260AP data sheet for BHY2_SENSOR_ID_TEMP_WU payload is 3 byte but i am getting 5 byte, is it correct or not? 
     How should i convert raw data into temperature if it is 5 byte?

3) What parameter should i pass in below API to get the relative altitude? There is no virtual sensor id is available to get altitude. 

 

void bhy2_parse_altitude(const uint8_t *data, bhy2_float *altitude)

 


Anyone can please help me to resolve the query.?

Regards.

 

Best reply by BSTRobin

Hi AN22,

1.Please refer to the following replies for your questions.

1) Currently i am getting "1005.523438" using above API but not sure about the unit, is it Pa or hPa ?

--> It is hPa.

2) From BHI260AP data sheet for BHY2_SENSOR_ID_TEMP_WU payload is 3 byte but i am getting 5 byte, is it correct or not? 
     How should i convert raw data into temperature if it is 5 byte?

-->Payload of BHY2_SENSOR_ID_TEMP_WU is 5 bytes and only 3 bytes are used: 1byte sensor id and 2 bytes temperature data. (The value of temperature has updated to uint32_t in the latest release)

3) What parameter should i pass in below API to get the relative altitude? There is no virtual sensor id is available to get altitude. 
void bhy2_parse_altitude(const uint8_t *data, bhy2_float *altitude)
--> This API cannot be used because no VirtAltitude is supported in current fw.

2.We also upload example code which parse temperature, humidity, pressure, gas sensor data for your reference.

 

environment.c
16.86KB
View original
4 replies
Resolved