BME680 Digital Temperature, Humidity, And Pressure Sensor CJMCU-680 High-Altitude Module Development Board
The BME680 is a "4-in-1" sensor that measures temperature, humidity, barometric pressure, and volatile organic compounds (VOC) gas. It is a favorite for weather stations and air quality monitors- VCC is the positive power supply
- GND is the ground
- SCL is the I2C/SPI clock
- SDA is the I2C/SPI data
- SDO is the SPI data
- CS is the SPI slave enable.
What's in the box?
1 x BME680 sensor
1 x 6 pin header
Resources
Since you are likely using a Raspberry Pi 5, the process is now streamlined through virtual environments and the CircuitPython/Blinka library.
1. Hardware Connections (I2C)
The BME680 supports both I2C and SPI, but I2C is the simplest way to wire it.
| BME680 Pin | Raspberry Pi Pin | Physical Pin # |
| VIN / VCC | 3.3V Power | Pin 1 |
| GND | Ground | Pin 6 |
| SCL | I2C Clock (GPIO 3) | Pin 5 |
| SDA | I2C Data (GPIO 2) | Pin 3 |
Address Tip: By default, the I2C address is usually 0x77. If your module has an "SDO" pin and you connect it to Ground, the address changes to 0x76.
2. Enable I2C
Run
sudo raspi-config.Go to Interface Options > I2C and select Yes.
Reboot your Pi.
Verify the sensor is seen:
sudo i2cdetect -y 1. You should see77or76in the grid.
On Raspberry Pi OS (Bookworm and later), you must use a virtual environment.
mkdir bme_project && cd bme_project
python3 -m venv .venv
source .venv/bin/activate
# Install the Blinka compatibility layer and the BME680 library
pip3 install adafruit-blinka adafruit-circuitpython-bme680
This script will read all four sensors.
import time
import board
import adafruit_bme680
# Create sensor object using the default I2C bus
i2c = board.I2C()
bme680 = adafruit_bme680.Adafruit_BME680_I2C(i2c)
# Change this to match your local sea-level pressure (hPa) for accurate altitude
bme680.sea_level_pressure = 1013.25
print("BME680 Warming up (Gas sensor needs ~30 mins for total stability)...")
try:
while True:
print(f"\nTemperature: {bme680.temperature:.1f} °C")
print(f"Gas Resistance: {bme680.gas} ohms")
print(f"Humidity: {bme680.relative_humidity:.1f} %")
print(f"Pressure: {bme680.pressure:.2f} hPa")
print(f"Altitude: {bme680.altitude:.2f} meters")
time.sleep(2)
except KeyboardInterrupt:
print("\nProgram stopped.")
- The "Burn-In" Period: When you first receive the sensor, Bosch recommends running it for 48 hours continuously to stabilize the gas sensor. After that, run it for 30 minutes before trusting any "Gas Resistance" values for a specific session.
- Self-Heating: Because the BME680 has an internal heater for the gas sensor, the temperature reading can be 1.5°C to 3°C higher than the actual room temperature. In your code, you should subtract an offset (e.g.,
bme680.temperature - 2.5) to get an accurate reading. - Gas vs. CO2: Remember that the BME680 measures VOCs (Total Volatile Organic Compounds), not specific CO2. If you need a "True CO2" reading, you should pair this with the SCD40/41 we discussed earlier