Hello there, hope someone could help me
I am using NodeMCU ESP32 WROOM-32 board
and I have one of this GY-91 sensors that has Bosch BME280 (not BMP280) sensor modules as well as MPU9250 on it
This is how I have it all connected: Imgur: The magic of the Internet
SCL on module -> GPIO22 (SCL)
SDA on module -> GPIO21 (SDA)
VIN on module -> 3.3V on NodeMCU
GND on module -> GND on NodeMCU
SDO on module -> NC (Not connected)
CS on module -> NC (Not connected)
I used this pinout: https://content.instructables.com/FOL/YWLI/JEOILQ5U/FOLYWLIJEOILQ5U.png
I used I2C scanner program from here: arduinoslovakia/i2c/i2c_tester_raspberry/i2c_tester_raspberry.ino at master · RoboUlbricht/arduinoslovakia · GitHub
and what is imidiatly wierd is that the program only finds 1 device (on address 0x77 which coresponds to BME280), while there should be another device (InvenSense MPU9255) on 0x68
but I said, ok, not a problem, since I need humidity and temperature from BME280 sensor only and nothing else
So I tried to use this library: GitHub - Erriez/ErriezBMX280: BMP280 / BME280 temperature/pressure/humidity sensor library for Arduino
like this
#include <Wire.h>
#include <ErriezBMX280.h>
#define SEA_LEVEL_PRESSURE_HPA 1026.25
ErriezBMX280 bmx280 = ErriezBMX280(0x77);
void setup()
{
delay(500);
Serial.begin(9600);
while (!Serial) {
;
}
Serial.println(F("\nErriez BMP280/BMX280 example"));
Wire.begin();
Wire.setClock(400000);
// Initialize sensor
while (!bmx280.begin()) {
Serial.println(F("Error: Could not detect sensor"));
delay(3000);
}
Serial.print(F("\nSensor type: "));
switch (bmx280.getChipID()) {
case CHIP_ID_BMP280:
Serial.println(F("BMP280\n"));
break;
case CHIP_ID_BME280:
Serial.println(F("BME280\n"));
break;
default:
Serial.println(F("Unknown\n"));
break;
}
bmx280.setSampling(BMX280_MODE_NORMAL, // SLEEP, FORCED, NORMAL
BMX280_SAMPLING_X16, // Temp: NONE, X1, X2, X4, X8, X16
BMX280_SAMPLING_X16, // Press: NONE, X1, X2, X4, X8, X16
BMX280_SAMPLING_X16, // Hum: NONE, X1, X2, X4, X8, X16 (BME280)
BMX280_FILTER_X16, // OFF, X2, X4, X8, X16
BMX280_STANDBY_MS_500);// 0_5, 10, 20, 62_5, 125, 250, 500, 1000
}
void loop()
{
Serial.print(F("Temperature: "));
Serial.print(bmx280.readTemperature());
Serial.println(" C");
if (bmx280.getChipID() == CHIP_ID_BME280) {
Serial.print(F("Humidity: "));
Serial.print(bmx280.readHumidity());
Serial.println(" %");
}
Serial.print(F("Pressure: "));
Serial.print(bmx280.readPressure() / 100.0F);
Serial.println(" hPa");
Serial.print(F("Altitude: "));
Serial.print(bmx280.readAltitude(SEA_LEVEL_PRESSURE_HPA));
Serial.println(" m");
Serial.println();
delay(1000);
}
but this library cannot comunicate with my BME280 sensor, I also tried Adafruit_BME280_Library (its default and bme280test example scetch) even Adafruit_BMP280_Library (thinking that maybe someone put the BMP280 to my board instead of BME280) but nothing (of course I change the default i2c address all libaries come with from 0x76 to 0x77
no matter what I do no library can comunicate with my BME280 sensor and I cannot understand why InvenSense MPU9255 is nowhere to be seen even if the chip is present on the board
also a bit wierd is why my i2c address for BME280 is 0x77 not default 0x76 since I didn't connect any CS pin to 3.3V (which is how you change address to 0x77 if I read somewhere)
Not sure whats going on
I did accidently connect my GY-71 board using wrong pinout at first: (uploaded picture)
but I knew something was not right, when my ESP32 could not program itself properly (sketch failed to upload to ESP32) but not sure how I could possibly damanged something with this if sketch didn't even upload to ESP32 and SDA and SCL pins are the same between theese 2 pinouts
so not sure what to do, hopefully someone can help me, the wierd thing is that I can detect the board with i2c scanner but cannot comunicate with it over that address
Thanks for Anwsering and Best Regards