BME280 Sensor IC2 not recognized with ESP8266

Hello,

I am trying to use ESP8266 with the BME280 sensor (see attachments). When I run the IC2 scanner, it says no IC2 device found. How do I trouble shoot this? I have it plugged into my computer via usb. Is it maybe not correct power that is distorting the device?

Does the breakout board have I2C pullup resistors?
Have you had success with any other I2C devices?

Have you double checked the bus pins are correct?

post the program (the sketch) you are using. ESP8266 like most other boards have a hardware-SPI-interface
and you have to adapt the IO-pins.
What is the exactly name of the ESP8266-board?
What is the exactly name of the BME280-PCB?

can you provide a datasheet of your ESP8266-board and the BME280-board?

Working with microcontrollers is not super-standardized like USB-devices. You have to check several things on your own.
Voltage-levels, IO-pins,

best regards Stefan

The board I am using: ESP8266 NodeMCU 1.0 CP2102 ESP-12E Amica

The sensor: Robojax BME280 Atmospheric Pressure, Humidity and Temperature Sensor Module for Arduino I2C

For starters, I am following this tutorial: ESP32/ESP8266 Plot Sensor Readings in Real Time Charts | Random Nerd Tutorials

Sketch:

/*********
Rui Santos
Complete project details at https://RandomNerdTutorials.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files.

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
*********/

// Import required libraries
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <Hash.h>
#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <FS.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>

#include <SPI.h>
#define BME_SCK 13
#define BME_MISO 12
#define BME_MOSI 11
#define BME_CS 10

Adafruit_BME280 bme; // I2C
//Adafruit_BME280 bme(BME_CS); // hardware SPI
//Adafruit_BME280 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK); // software SPI

// Replace with your network credentials
const char* ssid = “dlink-F356”;
const char* password = “qkvbe75408”;

// Create AsyncWebServer object on port 80
AsyncWebServer server(80);

String readBME280Temperature() {
// Read temperature as Celsius (the default)
float t = bme.readTemperature();
// Convert temperature to Fahrenheit
//t = 1.8 * t + 32;
if (isnan(t)) {
Serial.println(“Failed to read from BME280 sensor!”);
return “”;
}
else {
Serial.println(t);
return String(t);
}
}

String readBME280Humidity() {
float h = bme.readHumidity();
if (isnan(h)) {
Serial.println(“Failed to read from BME280 sensor!”);
return “”;
}
else {
Serial.println(h);
return String(h);
}
}

String readBME280Pressure() {
float p = bme.readPressure() / 100.0F;
if (isnan(p)) {
Serial.println(“Failed to read from BME280 sensor!”);
return “”;
}
else {
Serial.println(p);
return String(p);
}
}

void setup(){
// Serial port for debugging purposes
Serial.begin(115200);

bool status;
// default settings
// (you can also pass in a Wire library object like &Wire2)
status = bme.begin(0x84);
if (!status) {
Serial.println(“Could not find a valid BME280 sensor, check wiring!”);
while (1);
}

// Initialize SPIFFS
if(!SPIFFS.begin()){
Serial.println(“An Error has occurred while mounting SPIFFS”);
return;
}

// Connect to Wi-Fi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println(“Connecting to WiFi…”);
}

// Print ESP32 Local IP Address
Serial.println(WiFi.localIP());

// Route for root / web page
server.on("/", HTTP_GET, (AsyncWebServerRequest *request){
request->send(SPIFFS, “/index.html”);
});
server.on("/temperature", HTTP_GET, (AsyncWebServerRequest *request){
request->send_P(200, “text/plain”, readBME280Temperature().c_str());
});
server.on("/humidity", HTTP_GET, (AsyncWebServerRequest *request){
request->send_P(200, “text/plain”, readBME280Humidity().c_str());
});
server.on("/pressure", HTTP_GET, (AsyncWebServerRequest *request){
request->send_P(200, “text/plain”, readBME280Pressure().c_str());
});

// Start server
server.begin();
}

void loop(){

}

And. . ?

Please remember to use code tags . . yadda yadda

When I open the serial monitor it says: “Could not find a valid BME280 sensor, check wiring!”

Some trouble shooting I tried was to use was to find the IC2 address.

I used the sketch:

// --------------------------------------
// i2c_scanner
//
// Version 1
//    This program (or code that looks like it)
//    can be found in many places.
//    For example on the Arduino.cc forum.
//    The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
//     Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26  2013
//    V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
//    by Arduino.cc user Krodal.
//    Changes by louarnold removed.
//    Scanning addresses changed from 0...127 to 1...119,
//    according to the i2c scanner by Nick Gammon
//    https://www.gammon.com.au/forum/?id=10896
// Version 5, March 28, 2013
//    As version 4, but address scans now to 127.
//    A sensor seems to use address 120.
// Version 6, November 27, 2015.
//    Added waiting for the Leonardo serial communication.
//
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//
 
#include <Wire.h>
 
 
void setup()
{
  Wire.begin();
 
  Serial.begin(9600);
  while (!Serial);             // Leonardo: wait for serial monitor
  Serial.println("\nI2C Scanner");
}
 
 
void loop()
{
  byte error, address;
  int nDevices;
 
  Serial.println("Scanning...");
 
  nDevices = 0;
  for(address = 1; address < 127; address++ )
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();
 
    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("  !");
 
      nDevices++;
    }
    else if (error==4)
    {
      Serial.print("Unknown error at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.println(address,HEX);
    }    
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");
 
  delay(5000);           // wait 5 seconds for next scan
}

In the seriel monitor I received no I2C device found.

The wiring I followed was in the link:

See screenshot attached. This is the tools menu showing the setup of my device. Maybe this will help. Let me know anything else you need to understand my situation!

The sensor is actually called: GYBMEP - BME/BMP 280

is there any update on this ?
i am also facing same issue

-i2c scanner is not detesting any address
-tried 0x76 and 0x77 i2c address
-sketch gives error "check wiring"
-SPI mode also not working
-tried Sparkfun , adafruit library

i have two sensor , both giving same error

Are you also using the ESP8266? Does the board have pull-up resistors? How is the breakout connected?