Sensor BME680 (temp, humidity, pressure, gas)

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
D55m14
Posts: 9
Joined: 22 Jul 2016 16:38

Sensor BME680 (temp, humidity, pressure, gas)

Post by D55m14 »

Hi,

I'm trying to connect to Z-UNO the Adafruit sensor BME680 to measure humidity, temperature, pressure and gas.

Is there any suggestion about to porting the Arduino version of software available at https://github.com/adafruit/Adafruit_BME680 ?

The Arduino version gets many compiler errors.

tnks

donato
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: Sensor BME680 (temp, humidity, pressure, gas)

Post by PoltoS »

You should try start with BMP180 (built in) and BME280 (https://forum.z-wave.me/viewtopic.php?t=24195) libraries for Z-Uno
D55m14
Posts: 9
Joined: 22 Jul 2016 16:38

Re: Sensor BME680 (temp, humidity, pressure, gas)

Post by D55m14 »

Hi PoltoS,

tnks for your reply but the attached library at link you suggested is no more available .

donato
michap
Posts: 437
Joined: 26 Mar 2013 10:35
Contact:

Re: Sensor BME680 (temp, humidity, pressure, gas)

Post by michap »

BME680 use other calculations, the Bosch library is different.
I could not compile it on Z-Uno in this time, some functions are not available in Z-Uno and lib must be rewritten.

Anyway the air quality index (AQI) can not be calculated with Z-Uno, the needed ressources for Z-Uno are not available.
Same (ressources) for small Arduino chips. I made it with ESP8266 chip, hee it is working and possible.

With Z-Uno following steps needed:
1) rewrite the BOSCH library so that basic values can be received
2) calibrate the gas sensor
3) make long time data analysing of the gas sensor resistance value and try to create an own AQI - but it is really not very easy.
But you can detect the quality change and make a "bad quality" level.

I haven't made the changes in library in this time (no spare time for this) - maybe somebody else will check it? ;)

Alternate: use BME280 and any other gas sensor (checking the library before ;)...).

Michael
D55m14
Posts: 9
Joined: 22 Jul 2016 16:38

Re: Sensor BME680 (temp, humidity, pressure, gas)

Post by D55m14 »

Ok tnks michael.

For the Bme280 did you rewrite the adafruit library ?
michap
Posts: 437
Joined: 26 Mar 2013 10:35
Contact:

Re: Sensor BME680 (temp, humidity, pressure, gas)

Post by michap »

No, I made it based on the Bosch library.
You can test it here - without warranty ;)
It was working for me last year.I have added the file again.
https://forum.z-wave.me/viewtopic.php?t=24195

But it will NOT work with BME680 !

Michael
D55m14
Posts: 9
Joined: 22 Jul 2016 16:38

Re: Sensor BME680 (temp, humidity, pressure, gas)

Post by D55m14 »

Hi,

In Adafruit BME680 library I've this struct ;

/*!
* @brief BME680 device structure
*/
struct bme680_dev {
/*! Chip Id */
uint8_t chip_id;
/*! Device Id */
uint8_t dev_id;
/*! SPI/I2C interface */
enum bme680_intf intf;
/*! Memory page used */
uint8_t mem_page;
/*! Ambient temperature in Degree C*/
int8_t amb_temp;
/*! Sensor calibration data */
struct bme680_calib_data calib;
/*! Sensor settings */
struct bme680_tph_sett tph_sett;
/*! Gas Sensor settings */
struct bme680_gas_sett gas_sett;
/*! Sensor power modes */
uint8_t power_mode;
/*! New sensor fields */
uint8_t new_fields;
/*! Store the info messages */
uint8_t info_msg;
/*! Burst read structure */
bme680_com_fptr_t read;
/*! Burst write structure */
bme680_com_fptr_t write;
/*! Delay in ms */
bme680_delay_fptr_t delay_ms;
/*! Communication function result */
int8_t com_rslt;
};

and this typedef :
typedef int8_t (*bme680_com_fptr_t)(uint8_t dev_id, uint8_t reg_addr, uint8_t *data, uint16_t len);

Compiling I get this error :

C:\Users\donato\AppData\Local\Temp\build1710771747761838432.tmp\Adafruit_BME680_ucxx.c:757: syntax error: token -> 'charunsigned' ; column 48

At row 757 of ucxx.x there is

struct bme680_dev
{
// OLD-FASHIONED DECL
unsigned char chip_id;
// OLD-FASHIONED DECL
unsigned char dev_id;
// OLD-FASHIONED DECL
bme680_intf intf;
// OLD-FASHIONED DECL
unsigned char mem_page;
// OLD-FASHIONED DECL
char amb_temp;
// OLD-FASHIONED DECL
struct bme680_calib_data calib;
// OLD-FASHIONED DECL
struct bme680_tph_sett tph_sett;
// OLD-FASHIONED DECL
struct bme680_gas_sett gas_sett;
// OLD-FASHIONED DECL
unsigned char power_mode;
// OLD-FASHIONED DECL
unsigned char new_fields;
// OLD-FASHIONED DECL
unsigned char info_msg;
// OLD-FASHIONED DECL
char (* read)(unsigned charunsigned charunsigned char *unsigned int);
// OLD-FASHIONED DECL
char (* write)(unsigned charunsigned charunsigned char *unsigned int);
// OLD-FASHIONED DECL
void (* delay_ms)(unsigned long);
// OLD-FASHIONED DECL
char com_rslt;
};

Any suggestion ?

Is a compiler bug ?

tnks

donato
Post Reply