BMP/BME280 Strange behaviour
Posted: Sat Dec 22, 2018 3:30 pm
I have an Aliexpress module labelled BMP/BME280 on one side and GYBMEP on the other side. The hole on the sensor is along one side rather than the corner. The Chip ID is reporting 0x60 (I put some Serial.prints in the Adafruit_BME280.cpp file). I had to change the I2C address in the Adafruit_BME280.h file to 0x76 from 0x77.
My Code:
The printValues() routine produces this:
Temperature = nan *C
Pressure = nan hPa
Approx. Altitude = nan m
Humidity = nan %
When I run the bme280test example I get this:
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v60000318
~ld
Also when I insert the Serial.prints in the Adafruit_BME280.cpp file in the begin routine I get ChipID = 0xFF. If I place them before the delay(100) I get ChipID = 0x60 (Correct!).
readCoefficients(); // read trimming parameters, see DS 4.2.2
setSampling(); // use defaults
delay(100);
Serial.print ("ChipID=");
Serial.println (read8(BME280_REGISTER_CHIPID));
return true;
My Code:
Code: Select all
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#define SEALEVELPRESSURE_HPA (1013.25)
Adafruit_BME280 bme;
float Pressure;
float BMETemp, BMEAltitude;
void setup() {
Serial.begin(115200);
boolean status = bme.begin(0x76);
}
void loop() {
printValues();
}
void printValues() {
Serial.print("Temperature = ");
Serial.print(bme.readTemperature());
Serial.println(" *C");
Serial.print("Pressure = ");
Serial.print(bme.readPressure() / 100.0F);
Serial.println(" hPa");
Serial.print("Approx. Altitude = ");
Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
Serial.println(" m");
Serial.print("Humidity = ");
Serial.print(bme.readHumidity());
Serial.println(" %");
Serial.println();
}
The printValues() routine produces this:
Temperature = nan *C
Pressure = nan hPa
Approx. Altitude = nan m
Humidity = nan %
When I run the bme280test example I get this:
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v60000318
~ld
Also when I insert the Serial.prints in the Adafruit_BME280.cpp file in the begin routine I get ChipID = 0xFF. If I place them before the delay(100) I get ChipID = 0x60 (Correct!).
readCoefficients(); // read trimming parameters, see DS 4.2.2
setSampling(); // use defaults
delay(100);
Serial.print ("ChipID=");
Serial.println (read8(BME280_REGISTER_CHIPID));
return true;