Introduction: How To: BME680

About: I’m a dependable and passionate engineer with 6 years of experience working on a wide range of projects across multiple industries from Medical to industrial at all stages of the development cycle. Time and ti…

The goal of this guide is to demonstrate how to setup & use the BME680 Module with an Arduino in the most simple way possible!


To replicate my example you will need...

  1. BME680 Sensor Module (Almost all variants of the BME680 module should work the same or similar)
  2. Arduino Nano
  3. Breadboard
  4. Jumper Wires
  5. Arduino IDE

Step 1: What Is the BME680 Sensor?

The BME680 module is a powerful 4-in-1 sensor that can measure,

- Temperature

- Relative Humidity

- Barometric Pressure

- Gas (VOC: Volatile Organic Compounds such as Ethanol & Carbon Monoxide)

The BME680 sensor can communicate with either I2C or SPI at a logic level of 3V3.

The Adafruit BME680 shield uses an onboard regulator to step down a 5V supply to 3V3 and logic level shifts the communication line so that it can work with an Arduino's 5V logic output. (Shown below in the schematic of the module)

See the attached datasheet for BME680 sensor accuracy and specifications.

Step 2: How to Wire Up

As the BME680 module can be used in either I2C or SPI communication modes we have 2 options for wiring up the module. The I2C option uses only 4 wires so we will use that to demonstrate the functionality of the module.

Step 3: Code & Test

Before you can program the Arduino, you will need to get the Adafruit BME680 Library, to do so first open the Library Manager as shown below,

In the Library Manager search for "adafruit bme680" and install the latest version.

The Arduino code I used to test out the BME680 module can be found below, download the BME680_Demo.ino attached, and program your arduino with it via the IDE.

You should then be able to see the BME680 output all its readings every second.

Note that if you want to use the SPI interface you need to remove the comment outs around SPI comms and ensure you have followed the wire diagram correctly.

Step 4: Additional Comments

When reviewing the code you will likely have a few questions,

These answers have all come from the Bosch datasheet for the BME680 found here -


  • This is a float that is used to "Calibrate" the BME680 sensors reference to sea level pressure
  • This value is measured in milibar.

How to use SPI?

 * Default Definitions

#define BME_SCK 13 //SCL

#define BME_MISO 12 //SDO

#define BME_MOSI 11 //SDA

#define BME_CS 10  //CS

 * My example SPI pins

#define BME_SCK 7 //SCL

#define BME_MISO 5 //SDO

#define BME_MOSI 6 //SDA

#define BME_CS 4  //CS

  • Remove the comment from "Adafruit_BME680 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK); // software SPI"
  • Double check your BME_SCK, BME_MISO, BME_MOSI & BME_CS pins are defined correctly

What are these Oversampling lines?




  • These are ways to effectively increase sample time, which can remove noise at the cost of increased power consumption. The values above are default.

What is the IIR Filter?


  • The IIR Filter is used to remove short fluctuations in pressure from readings which can occur when doors / windows are open or shut.

What code gets the data out of the BME sensor?

Note that all of these commands return float values, so make sure any variables used to store this data can support decimal points.

bme.temperature: returns temperature reading

bme.pressure: returns pressure reading

bme.humidity: returns humidity reading

bme.gas_resistance: returns gas resistance

These commands will only return the last measured value, to make the BME sensor take a reading you need to first send this command.


Step 5: Thanks for Reading

I hope this short guide has been helpful, if you have any questions please leave a comment or direct message me!