BME680 Sensor error

Hey everyone! So I’ve been working on a Arduino project that incorporates a BME680 sensor. I have checked countless times that my wiring is correct and even watched multiple tutorials. However when I check to see its output the serial monitor tells me "Could not find a valid BME680 sensor, check wiring!". I have no clue what is wrong and I need help! I really have no clue what to do at all. I will also mention I am using a Arduino UNO


#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include "Adafruit_BME680.h"

#define BME_SCK 13
#define BME_MISO 12
#define BME_MOSI 11
#define BME_CS 10

#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); // Wait for Serial Monitor to open
  Serial.println(F("BME680 test"));

  if (!bme.begin()) {
    Serial.println("Could not find a valid BME680 sensor, check wiring!");
    while (1); // Infinite loop to halt program
  }

  // 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);
}

Please post the full message that you see and a schematic of your project

Ok I will! I added the message it flags for error. What do you mean when you say schematic? And I apologize this is my first time posting here.

Reading a schematic

Colin's Lab video on reading a schematic

You might want to look at this How to get the best out of this forum before you proceed any further.

The first step with a new I2C sensor is to run the Arduino I2C Address Scanner program. If it doesn't find the sensor at a correct(*) I2C address, usually either your wiring is wrong, the sensor is not responsive, or your program is using the wrong I2C address.

(*) one of several possible valid addresses for that sensor. Your program has to use the one to which the sensor responds.

Below is a link of a website I referred to. I will say i tweaked the code due to it originally having errors.

Have you done that, and if so, what addresses were reported?

Yet again you have two questions and sadly only received the answer for one of them.
@peypey7530 please answer the part that asks you to post the full message you get and not just your summery of it.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.