Hello everyone
I’m trying to interface a Waveshare BME680 sensor to an Arduino UNO R4 Board.
The standard I2C bus in UNO R4, is accessible either by JANALOG header & pins A4, A5 OR JDIGITAL header & pins SDA-18, SCL-19. In both cases the bus object is "Wire".
The sensor is interfaced to the board through the SDA:Pin 18 or A4 & SCL:Pin 19 or A5 as described in the following schematic:
Facts
• The sensor is scanned through I2C scanner and found to be at 0x77 address
• The sensor is fully functional when connected through I2C (with identical wiring) to an ESP32C6 Dev Board!! (Espressif Chipset)
• I also tried to interface a similar BME680 sensor manufactured by Adafruit, but similarly failed.
• Both BME680 sensors (Waveshare / Adafruit) were interface to the R4 Board using PULL up resistors of 4,7K to the SDA/SCL pins Nothing changed compared to not using PULL up resistors
• External 5V power source was also used to power the sensor, paying attention to bridge sensor ground with the R4 Board GND. Nothing changed compared to feeding power to the sensor straight from the dev Board as per the attached schematic.
• Also tested a BME280 sensor and succeeded to connect it to the I2C of the R4 Board(!), (identical wiring) and also making use of the relevant Adafruit libraries in the IDE.
The sample code I used for the BME680 in the IDE is the following:
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME680.h>
Adafruit_BME680 bme; // I2C interface
void setup() {
Serial.begin(115200);
while (!Serial);
Wire.begin(); // Standard I2C on UNO R4 (A4/A5 or SDA/SCL)
// Typical I2C address: 0x76 or 0x77
if (!bme.begin(0x76, &Wire)) {
Serial.println("Could not find BME680 sensor, check wiring or I2C address");
while (1);
}
// Mandatory BME680 configuration
bme.setTemperatureOversampling(BME680_OS_8X);
bme.setHumidityOversampling(BME680_OS_2X);
bme.setPressureOversampling(BME680_OS_4X);
bme.setIIRFilterSize(BME680_FILTER_SIZE_3);
// Gas sensor heater configuration (required)
bme.setGasHeater(320, 150); // 320°C for 150 ms
Serial.println("BME680 initialized successfully");
}
void loop() {
if (!bme.performReading()) {
Serial.println("Reading failed");
delay(1000);
return;
}
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 Resistance: ");
Serial.print(bme.gas_resistance / 1000.0);
Serial.println(" KOhms");
Serial.println("--------------------------");
delay(2000);
Latest libraries of Adafruit_sensor & Adafruit_BME680 were installed to the Arduino IDE
The error I get through the serial monitor is
12:39:50.106 -> Could not find BME680 sensor, check wiring or I2C address
Any suggestion to spark a solution to this issue is highly appreciated!!
Thanks in Advance
