The BME 680 has a low power driver sensor, integrated gas detection, pressure, temperature & humidity sensor in a 4 in 1 extremely compact metal LGA package the most recent development from BOSCH SENSORTEC, the world’s leading manufacturer of MEMS (Micro Electromechanical System). This sensor is communicating by i2C, 4 Wire SPI, & 3 Wire SPI protocol that suits to any SBC, MCU devices with a package dimension of 3.0 x 3.0 mm2 a height of 1.00 mm & runs on low power range of 1.8v ~ 3.8v at low consumption suitable for battery powered or frequency coupled devices. The BME 680 can be used in many platform / integrations such Indoor air quality systems, home automation and control, Internet of things, weather forecast, GPS upgrades & integrations in most navigation systems, smart & wearable devices, smart handsets devices, robotics etc. for more readings please see the datasheet below specially for the timings and serial bus configurations.
Requirements for this experiment
- Arduino IDE | Atmel Studio | Energia | Processing
- Arduino PRO, FIO, NANO, UNO, MINI, MEGA, PRO MINI, LEO, BT, DUE, ETHERNET,LILYPAD, NodeMCU, Teensy Board, TeensyDuino, ESP8266 12, 12E, ESP32, LinkItOne, ESP8266 NodeMCU, ESPDuino, ATMEGA328 16/12, ATMEGA32u4 16/8/ MHz, ESP8266, MSP430 ,ATMEGA250 16 MHz, ATSAM3x8E, STM32.
- Note: For AVR (please see the flash size of the MCU and respective pin-outs & bus configuration )
- Note: The Diagram below is using NANO. (please refer to each MCU’s respective pin-outs & bus configuration)
- BME 680 Sensor / Module
- Capacitors (See below required value)
- Resistors (See below required value)
- PCB Designer (Circuit simulation to PCB Layout / Circuitmaker / Fritzing )
Wiring Guide
Source Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
#include <Wire.h> #include <SPI.h> #include <Adafruit_Sensor.h> #include "Adafruit_BME680.h" #define BME_SCK 13 // For SPI Configuration #define BME_MISO 12 // For SPI Configuration #define BME_MOSI 11 // For SPI Configuration #define BME_CS 10 // For SPI Configuration #define SEALEVELPRESSURE_HPA (1013.25) Adafruit_BME680 bme; // I2C //Adafruit_BME680 bme(BME_CS); // hardware SPI //Adafruit_BME680 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK); void setup() { Serial.begin(9600); while (!Serial); Serial.println(F("BME680 TEST CODE")); if (!bme.begin()) { Serial.println("Could not find a valid BME680 sensor, check wiring!"); while (1); } // Set up oversampling and filter initialization bme.setTemperatureOversampling(BME680_OS_8X); bme.setHumidityOversampling(BME680_OS_2X); bme.setPressureOversampling(BME680_OS_4X); bme.setIIRFilterSize(BME680_FILTER_SIZE_3); bme.setGasHeater(320, 150); // 320*C for 150 ms } void loop() { if (! bme.performReading()) { Serial.println("Failed to perform reading :("); return; } Serial.print("Temperature = "); Serial.print(bme.temperature); Serial.println(" *C"); Serial.print("Pressure = "); Serial.print(bme.pressure / 100.0); Serial.println(" hPa"); Serial.print("Humidity = "); Serial.print(bme.humidity); Serial.println(" %"); Serial.print("Gas = "); Serial.print(bme.gas_resistance / 1000.0); Serial.println(" KOhms"); Serial.print("Approx. Altitude = "); Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA)); Serial.println(" m"); Serial.println(); delay(2000); } |