Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

How to use the BME680 multi-purpose sensor with Arduino

By Usman ali Butt March 24, 2021

BME680 is a multi-purpose digital sensor, developed by Bosch after years of research, which can measure temperature, humidity, gas, and barometric pressure. Communication with this sensor is possible via the Serial Peripheral Interface (SPI) and I2C protocols.

The temperature and barometric pressure accuracy are +-1 and the humidity is +-3. The gases are measured as volatile organic compounds (VOCs) in the air. VOCs give a single value of resistance for the output. This means that we can predict that gas is present in the air, but are unable to distinguish whether it’s ethanol, carbon monoxide, or alcohol, etc.

For this project, we’ll interface the  BME680 sensor with Arduino. The main sensor is small and compact, and external resistors and capacitors are required for proper configuration. For example, both an I2C pull-up and a VOC resistor are needed when a voltage divider is necessary. The BME680 sensor can work on 3.3 and 5V.

Circuit diagram
The circuit diagram for this project is quite simple. We decided to interface the sensor with Arduino Nano using the SPI protocol. Arduino’s SPI pins are available on its digital pins 10 through 13. The sensor is powered using 3.3V output from Arduino.

Here’s a diagram…

The code
Adafruit offers a predefined library that has nearly all of this sensor’s functions available. However, the Adafruit BME sensor library first requires the Adafruit sensor, as well as Arduino’s SPI and I2C wire library to properly configure and start the BME680.

After importing the library, the SPI pins are declared. The pins must be passed to the BME constructor for initialization.

Also, for the barometric pressure measurement, it’s necessary to specify a reference pressure. So, we used the typical sea-level pressure as the reference for the barometric pressure calculation for this project.

How it works
In the setup function, Arduino’s serial monitor is started at 9600 bps. Next, the sensor must be polled to verify if the connection is established successfully.

In the loop function, the readings are continuously received from the sensor. If the data request is successful, the individual parameter values are displayed on Arduino IDE’s serial monitor.

Note: The gas and pressure values are divided by 1000 and 100, respectively, to assign them units in kOhm and hpa.  

To achieve more stable values for the individual parameters , simply increase the sampling rate for them.

Instructions

1. bme.setTemperatureOversampling(BME680_OS_8X);
2. bme.setHumidityOversampling(BME680_OS_2X);
3. bme.setPressureOversampling(BME680_OS_4X);
4. bme.setIIRFilterSize(BME680_FILTER_SIZE_3);
5. bme.setGasHeater(320, 150); // 320*C for 150 ms

To view the results, open Arduino IDE’s serial monitor at 9600 bps. During the initial boot, the sensor will require a few seconds. After a few readings, the sensor will stabilize and output accurate values.

Where to purchase the parts?

  • Arduino Nano: Mouser
  • BME680 sensor: Digi-Key

You may also like:


  • What are the top tools for developing embedded software?

  • What is the Modbus protocol and how does it work?

  • What are the different types of temperature sensors and their…

  • Build Your Own Cloud-Connected Indoor Air Quality Monitor

  • Biometric sensor with Arduino

  • Allegro releases automotive-grade interface IC for resistive bridge-pressure sensors

Filed Under: Arduino Projects, Electronic Projects
Tagged With: adafruit, Arduino
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • High Side current sensing
  • Voltage mode pushpull is a nonsense SMPS?
  • Reducing "shoot-through" in offline Full Bridge SMPS?
  • How to simulate power electronics converter in PSpice?
  • Layout IRN reduction in Comparator

RSS Electro-Tech-Online.com Discussions

  • Back to the old BASIC days
  • Parts required for a personal project
  • PIC KIT 3 not able to program dsPIC
  • Failure of polypropylene motor-run capacitors
  • Siemens large industrial PLC parts

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • What is AWS IoT Core and when should you use it?
  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe