Skip to content
This repository was archived by the owner on May 8, 2020. It is now read-only.

Commit 94fd057

Browse files
v3.5.3
- Changed the compensation equation formulas to use shifting operation - Updated the "bme680_get_profile_dur" API - Fixed Checkpatch and made linux compatible - Fixed bug of temperature compensation in pressure - Updated self test APIs
1 parent 2a51b9c commit 94fd057

File tree

7 files changed

+190
-164
lines changed

7 files changed

+190
-164
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ This package contains the Bosch Sensortec's BME680 gas sensor API
55
The sensor driver package includes bme680.h, bme680.c and bme680_defs.h files
66

77
## Version
8-
File | Version | Date
9-
-----|---------|-----
10-
bme680.c | 3.5.1 | 5 Jul 2017
11-
bme680.h | 3.5.1 | 5 Jul 2017
12-
bme680_defs.h | 3.5.1 | 5 Jul 2017
8+
File | Version | Date
9+
--------------|---------|-------------
10+
bme680.c | 3.5.3 | 30 Oct 2017
11+
bme680.h | 3.5.3 | 30 Oct 2017
12+
bme680_defs.h | 3.5.3 | 30 Oct 2017
1313

1414
## Integration details
1515
* Integrate bme680.h, bme680_defs.h and bme680.c file in to your project.
@@ -112,7 +112,7 @@ fill in the various parameters as shown below
112112
printf("T: %.2f degC, P: %.2f hPa, H %.2f %%rH ", data.temperature / 100.0f,
113113
data.pressure / 100.0f, data.humidity / 1000.0f );
114114
/* Avoid using measurements from an unstable heating setup */
115-
if(data.status & BME680_HEAT_STAB_MSK)
115+
if(data.status & BME680_GASM_VALID_MSK)
116116
printf(", G: %d ohms", data.gas_resistance);
117117
118118
printf("\r\n");

Self test/bme680_selftest.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
* patent rights of the copyright holder.
4141
*
4242
* File bme680_selftest.c
43-
* @date 5 Jul 2017
44-
* @version 3.5.1
43+
* @date 10 Oct 2017
44+
* @version 3.5.2
4545
*
4646
*/
4747

@@ -53,7 +53,7 @@
5353
#include "bme680_selftest.h"
5454

5555
#define MIN_TEMPERATURE INT16_C(0) /* 0 degree Celsius */
56-
#define MAX_TEMPERATURE INT16_C(4000) /* 40 degree Celsius */
56+
#define MAX_TEMPERATURE INT16_C(6000) /* 60 degree Celsius */
5757

5858
#define MIN_PRESSURE UINT32_C(90000) /* 900 hecto Pascals */
5959
#define MAX_PRESSURE UINT32_C(110000) /* 1100 hecto Pascals */
@@ -63,7 +63,7 @@
6363

6464
#define HEATR_DUR 2000
6565
#define N_MEAS 6
66-
#define LOW_TEMP 200
66+
#define LOW_TEMP 150
6767
#define HIGH_TEMP 350
6868

6969
/*!
@@ -124,9 +124,9 @@ int8_t bme680_self_test(struct bme680_dev *dev)
124124
if (rslt == BME680_OK) {
125125

126126
if (i % 2 == 0)
127-
t_dev.gas_sett.heatr_temp = LOW_TEMP; /* Lower temperature */
128-
else
129127
t_dev.gas_sett.heatr_temp = HIGH_TEMP; /* Higher temperature */
128+
else
129+
t_dev.gas_sett.heatr_temp = LOW_TEMP; /* Lower temperature */
130130

131131
rslt = bme680_set_sensor_settings(settings_sel, &t_dev);
132132

@@ -169,15 +169,16 @@ static int8_t analyze_sensor_data(struct bme680_field_data *data, uint8_t n_meas
169169
self_test_failed++;
170170

171171
for (i = 0; i < n_meas; i++) /* Every gas measurement should be valid */
172-
if (!(data[i].status & (BME680_GASM_VALID_MSK | BME680_HEAT_STAB_MSK)))
172+
if (!(data[i].status & BME680_GASM_VALID_MSK))
173173
self_test_failed++;
174174

175-
for (i = 2; i < n_meas; i += 2) {
176-
/* Invert formula to get integer values for centroid resistance, i.e. > 1 */
177-
cent_res = (data[i - 2].gas_resistance + data[i].gas_resistance) / (2 * data[i - 1].gas_resistance);
178-
}
175+
/* 3 cycles heating are completed(HT1/LT1, HT2/LT2,HT3/LT3)
176+
centroid gas ratio = 2*HT3 / (LT2+LT3) < 0.5*/
177+
/* Invert formula to get integer values for centroid resistance */
178+
if (n_meas >= 6)
179+
cent_res = (data[3].gas_resistance + data[5].gas_resistance) / (2 * data[4].gas_resistance);
179180

180-
if ((cent_res < 3) || (cent_res > 20)) /* 0.05 > cent_res^-1 < 0.03 */
181+
if ((cent_res < 2)) /*cent_res^-1 < 0.5 */
181182
self_test_failed++;
182183

183184
if (self_test_failed)

Self test/bme680_selftest.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
* patent rights of the copyright holder.
4141
*
4242
* @file bme680_selftest.h
43-
* @date 5 Jul 2017
44-
* @version 3.5.1
43+
* @date 10 Oct 2017
44+
* @version 3.5.2
4545
* @brief
4646
*
4747
*/

0 commit comments

Comments
 (0)