

The Adafruit BME680 (Part ID: 3660) is a versatile environmental sensor capable of measuring gas, temperature, humidity, and pressure. This sensor is ideal for applications requiring precise environmental data, such as air quality monitoring, weather stations, and IoT devices. Its compact design and I2C/SPI communication interfaces make it easy to integrate into a wide range of projects.








The Adafruit BME680 is a high-performance sensor with the following key specifications:
| Parameter | Value |
|---|---|
| Operating Voltage | 3.3V or 5V (logic level compatible) |
| Communication Protocol | I2C (default address: 0x77 or 0x76) and SPI |
| Temperature Range | -40°C to +85°C |
| Humidity Range | 0% to 100% relative humidity |
| Pressure Range | 300 hPa to 1100 hPa |
| Gas Measurement | VOCs (Volatile Organic Compounds) in the range of 0 to 500 ppm |
| Power Consumption | 0.15mA (typical in low-power mode) |
| Dimensions | 18mm x 18mm x 3mm |
The Adafruit BME680 breakout board has the following pin layout:
| Pin Name | Description |
|---|---|
| VIN | Power input (3.3V or 5V) |
| GND | Ground connection |
| SCL | I2C clock line (or SPI clock line in SPI mode) |
| SDA | I2C data line (or SPI MOSI line in SPI mode) |
| CS | Chip select for SPI communication (connect to GND for I2C mode) |
| SDO | I2C address selection (connect to GND for 0x76 or leave floating for 0x77) |
To use the Adafruit BME680 with an Arduino UNO, follow these steps:
Wiring:
VIN pin to the 5V pin on the Arduino.GND pin to the GND pin on the Arduino.SCL pin to the A5 pin (I2C clock line) on the Arduino.SDA pin to the A4 pin (I2C data line) on the Arduino.CS pin unconnected (default I2C mode).SDO pin to GND to set the I2C address to 0x76.Install the Adafruit BME680 Library:
Example Code: Use the following example code to read temperature, humidity, pressure, and gas data:
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include "Adafruit_BME680.h"
// Create an instance of the BME680 sensor
Adafruit_BME680 bme;
void setup() {
Serial.begin(9600);
while (!Serial); // Wait for serial monitor to open
// Initialize the BME680 sensor
if (!bme.begin()) {
Serial.println("Could not find a valid BME680 sensor, check wiring!");
while (1);
}
// Set up sensor settings
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() {
// Perform a measurement
if (!bme.performReading()) {
Serial.println("Failed to perform reading!");
return;
}
// Print sensor data to the serial monitor
Serial.print("Temperature = ");
Serial.print(bme.temperature);
Serial.println(" °C");
Serial.print("Humidity = ");
Serial.print(bme.humidity);
Serial.println(" %");
Serial.print("Pressure = ");
Serial.print(bme.pressure / 100.0);
Serial.println(" hPa");
Serial.print("Gas = ");
Serial.print(bme.gas_resistance / 1000.0);
Serial.println(" KOhms");
Serial.println();
delay(2000); // Wait 2 seconds before the next reading
}
Sensor Not Detected:
Inaccurate Readings:
Gas Resistance Always Zero:
setGasHeater() function is called with appropriate parameters.Q: Can the BME680 measure CO2 levels?
A: No, the BME680 measures VOCs, which can be used as an indicator of air quality but does not directly measure CO2.
Q: Can I use the BME680 with a Raspberry Pi?
A: Yes, the BME680 is compatible with Raspberry Pi. Use the Adafruit Python library for integration.
Q: How do I switch between I2C and SPI modes?
A: For I2C mode, leave the CS pin unconnected. For SPI mode, connect the CS pin to a GPIO pin and configure the SPI interface in your code.
Q: What is the typical warm-up time for gas measurements?
A: The sensor requires a warm-up time of approximately 5 minutes for accurate gas readings.