Giter Site home page Giter Site logo

dfrobot_bme680's Introduction

DFRobot_BME680

BME680 is an integrated environmental sensor developed specifically for mobile applications and wearables where size and low power consumption are key requirements. Expanding Bosch Sensortec’s existing family of environmental sensors, the BME680 integrates for the first time individual high linearity and high accuracy sensors for gas, pressure, humidity and temperature.

产品效果图

SKU: SEN0248

Table of Contents

Summary

Provides an Arduino library for reading and interpreting Bosch BME680 data over I2C over SPI.Reads temperature, humidity, gas, IAQ(details in examples\readme), pressure and calculates altitude.

Installation

To use this library download the zip file, uncompress it to a folder named DFRobot_BME680. Download the zip file first to use this library and uncompress it to a folder named DFRobot_BME680.

Methods

  /**
   * @fn begin
   * @brief begin BME680 device
   * @return result
   * @retval  non-zero : falid
   * @retval  0        : succussful
   */
  int16_t begin(void);
  /**
   * @fn update
   * @brief update all data to MCU ram
   */
  void    update(void);
  /**
   * @fn iaqUpdate
   * @brief update all data to MCU ram with IAQ (only for esp8266 now)
   *
   * @return result:
   * @retval 0 :complete
   * @retval 1 :busy
   */
  int8_t  iaqUpdate(void);
  /**
   * @fn startConvert
   * @brief start convert to get a accurate values
   */
  void  startConvert(void);
  /**
   * @fn readTemperature
   * @brief read the temperature value (unit C)
   *
   * @return temperature valu, this value has two decimal points
   */
  float readTemperature(void);
  /**
   * @fn readPressure
   * @brief read the pressure value (unit pa)
   *
   * @return pressure value, this value has two decimal points
   */
  float readPressure(void);
  /**
   * @fn readHumidity
   * @brief read the humidity value (unit %rh)
   * @return humidity value, this value has two decimal points
   */
  float readHumidity(void);
  /**
   * @fn readAltitude
   * @brief read the altitude (unit meter)
   * @return altitude value, this value has two decimal points
   */
  float readAltitude(void);
  /**
   * @fn readCalibratedAltitude
   * @brief read the Calibrated altitude (unit meter)
   *
   * @param seaLevel  normalised atmospheric pressure
   *
   * @return calibrated altitude value , this value has two decimal points
   */
  float readCalibratedAltitude(float seaLevel);
  /**
   * @fn readGasResistance
   * @brief read the gas resistance(unit ohm)
   * @return temperature value, this value has two decimal points
   */
  float readGasResistance(void);
  /**
   * @fn readSeaLevel
   * @brief read normalised atmospheric pressure (unit pa)
   * @param altitude   accurate altitude for normalising
   * @return normalised atmospheric pressure
   */
  float readSeaLevel(float altitude);
  /**
   * @fn readIAQ
   * @brief read IAQ
   * @return The result of IAQ
   */
  float readIAQ(void);
  /**
   * @fn setParam
   * @brief set bme680 parament
   *
   * @param eParam        :which param you want to change
   *        dat           :object data, can't more than 5
   */  
  void    setParam(eBME680_param_t eParam, uint8_t dat);
  /**
   * @fn setGasHeater
   * @brief set bme680 gas heater
   * @param temp        :your object temp
   * @param t           :time spend in milliseconds
   */
   void    setGasHeater(uint16_t temp, uint16_t t);
  /**
   * @fn isIAQReady
   * @brief check IAQ ready
   * @return result:
   * @retval 0 :ready
   * @retval 1 :not ready
   */
  uint8_t isIAQReady(void);

Compatibility

MCU Work Well Work Wrong Untested Remarks
FireBeetle-ESP32
FireBeetle-ESP8266
FireBeetle-BLE4.1
Arduino uno
Arduino leonardo

History

  • 2017/12/04 - Version 2.0.0 released.
  • 2017/09/04 - Version 1.0.0 released.

Credits

Written by Frank([email protected]), 2017. (Welcome to our website)

dfrobot_bme680's People

Contributors

forknowyou avatar gboldwang avatar luoyufenglalala avatar ouki-wang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dfrobot_bme680's Issues

To get it working with Arduino (and ESP32S3)

Hello,

i had compilation problem with BME680 and ESP32S3.
Here is the solution for me:
Library:

  1. install DFROBOT BME680 (2.0.0)
  2. install`` BSEC (1.8.1492)

Download this: https://community.bosch-sensortec.com/varuj77995/attachments/varuj77995/bst_community-mems-forum/12299/1/ESP32_S3_OUT.zip

Copy bsec_datatypes.h and bsec_interface.h in DFRobot_BME680 library's folder.

Create a folder esp32s3 in BSEC_Software_Library\src.
Put libalgobsec.a in this folder.

In your sketch, add:
#include "bsec.h"

And it works.

Gas sensor values

Hello,

I'm getting pretty high values from the gas sensor: somewhere between 90-980 ppm in the living room.
Is it normal?

Bosch datasheet talks about the IAQ Index Air Quality between 50-500:

0 – 50 good
51 – 100 average
101 – 150 little bad
151 – 200 bad
201 – 300 worse
301 – 500 very bad

At 980ppm I suppose I should be dead :D

IAQ_I2C Compile Errors

Hello,

I receive these error when I compile the IAQ_I2C.ino. I would be very grateful for any help.

Arduino: 1.8.5 (Windows 10), Board: "ESP32 Dev Module, QIO, 80MHz, 4MB (32Mb), 115200, Debug"

libraries\DFRobot_BME680-master\bsec_integration.c.o:(.literal.bsec_iot_init+0x8): undefined reference to `bsec_init'

libraries\DFRobot_BME680-master\bsec_integration.c.o:(.literal.bsec_iot_init+0xc): undefined reference to `bsec_update_subscription'

libraries\DFRobot_BME680-master\bsec_integration.c.o:(.literal.bsec_iot_loop+0x28): undefined reference to `bsec_sensor_control'

libraries\DFRobot_BME680-master\bsec_integration.c.o:(.literal.bsec_iot_loop+0x2c): undefined reference to `bsec_do_steps'

libraries\DFRobot_BME680-master\bsec_integration.c.o: In function `bsec_iot_init':

C:\Users\taju\Documents\Arduino\libraries\DFRobot_BME680-master/bsec_integration.c:186: undefined reference to `bsec_init'

libraries\DFRobot_BME680-master\bsec_integration.c.o: In function `bme680_bsec_update_subscription':

C:\Users\taju\Documents\Arduino\libraries\DFRobot_BME680-master/bsec_integration.c:140: undefined reference to `bsec_update_subscription'

libraries\DFRobot_BME680-master\bsec_integration.c.o: In function `bsec_iot_loop':

C:\Users\taju\Documents\Arduino\libraries\DFRobot_BME680-master/bsec_integration.c:447: undefined reference to `bsec_sensor_control'

libraries\DFRobot_BME680-master\bsec_integration.c.o: In function `bme680_bsec_read_data':

C:\Users\taju\Documents\Arduino\libraries\DFRobot_BME680-master/bsec_integration.c:318: undefined reference to `bsec_do_steps'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board ESP32 Dev Module.

Minor Issue - begin() should return true when successful

It just took me some time to realize, that the v2.0 version returns false after successful initialization when true is expected.
This was quite confusing for me...and took me some time (as I thought having a Connection issue).

BME680 stop replying

Hi,

I'm using your example IAQ_I2C and it work fine.
Nevertheless after about an hour the BME680 stops working. There is no feedback anymore or serial output.
Could you help?

Altitude Correct?

now i've compiled the example sketch. an load it to my esp8266 12e...

Is there something wrong in calculate the altitude?
I get a negative value. (My real altitude is near by 120m)
(The gas value went higher after a few minutes. Up to 400 ppm in my living room. )

temperature(C) :21.44
pressure(Pa) :101698.00
humidity(%rh) :64.53
gas(ppm) :242
gas resistance(ohm) :126410.00
altitude(m) :-31.01

Greetings, Peter

BSEC BME680 should be updated

The BSEC BME 680 has a new version dated Jan 2020, suggest that the version wrapped up within this code should be updated to allow BSEC bugs/fixes/changes to be corrected
File bme680.c

Version with hidden data types

Hello,

thank you for your code.

Would you be able to write code to return the hidden datatypes eco2 and tvocs?

Thanks,

invalid conversion from uint8_t

Hello,
i download the Version from 11.10.2017 today (12.10.2017)
I compile the example for ess8266 (12e) i get the following error:

DFRobot_BME680.cpp:66:64: error: invalid conversion from 'uint8_t {aka unsigned char}' to 'uint8_t* {aka unsigned char*}' [-fpermissive]

bme680_sensor.write(bme680_sensor.dev_id, 0x74, convertCmd, 1);


Normalised Atmospheric Pressure

Hi,

could you add an "ALTITUDE" variable in order to obtain the "Normalised Atmospheric Pressure"?

I have changed the DFRobot_BME680.cpp file, changing the line 206 from:
return P;

into

return (P / pow(1.0 - (43.0 / 44330.0), 5.255)); where "43.0" is the altitude in meters of my location.

It would be nice to have a variable in the sketch so that one could calculate the pressure according to the altitude of the city.

Thanks

Unable to compile DFRobot_BME680_IC2 with Arduino IDE

When trying to verify/compile via Arduino IDE 1.8.7 on Windows 10 Pro, the compiler fails every time on the BSEC integration component. The warning for the bme680.c also appear to be fixed in later versions of that library, suggesting the libraries used in this package are somewhat outdated and need refresh.

C:\My Documents\Arduino\libraries\DFRobot_BME680-master\bme680.c: In function 'calc_pressure':
C:\My Documents\Arduino\libraries\DFRobot_BME680-master\bme680.c:841:12: warning: left shift count >= width of type [-Wshift-count-overflow]

var4 = (1 << 31);

        ^

C:\Users\Dave\AppData\Local\Temp\ccO4Xbmd.ltrans0.ltrans.o: In function bsec_iot_init': C:\My Documents\Arduino\libraries\DFRobot_BME680-master/bsec_integration.c:186: undefined reference to bsec_init'

C:\Users\Dave\AppData\Local\Temp\ccO4Xbmd.ltrans0.ltrans.o: In function `bme680_bsec_update_subscription':

C:\My Documents\Arduino\libraries\DFRobot_BME680-master/bsec_integration.c:140: undefined reference to `bsec_update_subscription'
collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Uno.

The Adafruit BME680 libraries compile using the Bosch driver, but lack much of the functionality of the DFRobot libraries for this sensor (also a DFRobot model). I have tried swapping out the drivers, but I cannot determine where the bsec_integration.c library came from, as it's not in any of the builds on GitHub.

Measurements only work in loop

Hi,

I am using the IAQ_I2C Arduino Sketch which works well.

I am trying to extend this sketch so that I can send the IAQ values to Thingspeak after the measurement, however, right now the sketch isn't working as expected. The IAQ value is consistently 25, it's almost like no evaluation using the BSEC Algorithm happens.

Is the IAQ_I2C Arduino Sketch only designed to work on its own? The IAQ value is consistently 25, it's almost like no evaluation using the BSEC Algorithm happens. As soon as I comment out

//thingSpeak();

then the IAQ evaluation happens again.

I would appreciate your help.

Thanks,

Justin

parameters for the sensor

Hi,
where can I adjust those parameters in the code?
would it be possible to have those parameters also available for this sensor?

// Set up oversampling and filter initialization
setTemperatureOversampling(BME680_OS_8X);
setHumidityOversampling(BME680_OS_2X);
setPressureOversampling(BME680_OS_4X);
setIIRFilterSize(BME680_FILTER_SIZE_3);
setGasHeater(320, 150); // 320*C for 150 ms

ESP8266 12E

Does this work for ESP8266 12E as well?
I'm getting the following error:
ibraries\DFRobot_BME680-master\bsec_integration.c.o:(.text.bsec_iot_init+0x8): undefined reference to `bsec_init'

libraries\DFRobot_BME680-master\bsec_integration.c.o:(.text.bsec_iot_init+0xc): undefined reference to `bsec_update_subscription'

libraries\DFRobot_BME680-master\bsec_integration.c.o: In function `bsec_iot_init':

C:\Users\Dario\Documents\Arduino\libraries\DFRobot_BME680-master/bsec_integration.c:182: undefined reference to `bsec_init'

libraries\DFRobot_BME680-master\bsec_integration.c.o: In function `bme680_bsec_update_subscription':

C:\Users\Dario\Documents\Arduino\libraries\DFRobot_BME680-master/bsec_integration.c:131: undefined reference to `bsec_update_subscription'

libraries\DFRobot_BME680-master\bsec_integration.c.o:(.text.bsec_iot_loop+0x2c): undefined reference to `bsec_sensor_control'

libraries\DFRobot_BME680-master\bsec_integration.c.o:(.text.bsec_iot_loop+0x40): undefined reference to `bsec_do_steps'

libraries\DFRobot_BME680-master\bsec_integration.c.o:(.text.bsec_iot_loop+0x83): undefined reference to `bsec_sensor_control'

libraries\DFRobot_BME680-master\bsec_integration.c.o: In function `bme680_bsec_read_data':

C:\Users\Dario\Documents\Arduino\libraries\DFRobot_BME680-master/bsec_integration.c:304: undefined reference to `bsec_do_steps'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.