Advice with BME280 Breakout Sensor

Hey everyone.

I am working on a project with my son, monitoring the temperature and humidity in his chameleon’s cage. I had dreams of father-of-the-year with this one . My son is helping with the code and with the 3D case. But alas no, no red carpet for me this year…

I cannot get this little sensor to accurately read temperature, though it is very accurate!

I need some help with this BME280 breakout board from DIY Mall. I’m certain that the problem is electronic. That is, the sensor reads the temperature very well on a cold startup, but then the temperature starts to creep up. I am only reading it once a minute, so I don’t think I’m sampling too often. I’ve tested with and without pull-up resistors (that’s for you @bko). The sensor communicates either way quite nicely but there seems to be some heat on the tiny board.

My thought is that the sensor (obverse side, there are multiple photos in the link) may be too close to the power regulator (reverse side along wth the I<sup2C chip and a few resistors) and that the heat from the regulator may be flooding the little board. In a 72°F room, the measured temperature rises from 72°F to about 77°F. I am powering the board with 3.3V from a Photon.

The problem worsens when I added an OLED display. I am running the two devices from hardware I2C digital pins zero and one. Updating the display every 2500ms, the measured temperature will then further rise to about 85°F. I’m thinking that the additional communication to the OLED display may be exasperating the problem.

I tried to dynamically power the sensor board (i.e powering with a transistor with a digital pin on the gate) but could not get that to work (read consistently).

So I am looking for some advice in order to ameliorate the heat-rise issue.

Any recommendation on what to do in code?

Is there anything I can do to the board (perhaps some magic Heat-Be-Gone spray ;)) to minimize the effects of power and/or communications causing this heat rise?

Thanks for any suggestions, heck thanks for reading this far down!

** fyi DIY Mall did agree to replace the sensors (one year warrantee) but I’m afraid the replacements will have the same issue. I guess there may also be the problem of the voltage regulator excessively making heat.

I am going to change my username to "Mr. Pullup". :smile:

I would try temporarily attaching long wires (say 6 inch) to the BME280 board and move it physically away from the other electronics and see what it reads. I know that my DS18B20 sensors read several degrees warmer when close to a Core/Photon/Electron. There is one in the room next to me now and it is reading 82.9F when the room is more like 74F. This is particularly true on solderless breadboards which seem to hold and disperse the heat.


Physically removing the device from your other components should be a first step and (on first glance) I also think these cut/solder jumper pads on the board are there to bypass the onboard regulator if you are already using a 3.3V source.

As it seems the pull-ups are on the board already (10k).

The cut/solder jumper seems to be for address selection 0x76 respectively 0x77 when cut/soldered.
But if you are convinced the LDO causes the erronous readings, you could desolder it and bridge its pins 1-5.


@BulldogLowell, I ran a BME280 with an old Core (I had nothing else to do with it!) and had similar problems until I realized the Core was hot enough to warm up both the protoboard and the air around the sensor. I also realized that I didn’t need to keep the Core on all the time. By that time, however, the Core went into stupid mode and wouldn’t work correctly (and deep update didn’t help). So I replaced it with a Photon, sleeping for 5 mins, waking, connecting to Blynk in my case, and going back to deep sleep. The readings have been very good since.


Well, getting it off the mini breadboard solved much of the problem. that is, in 72°F air it now reads like 76°F (starts up at the correct temp, however :smile: ).

I’ve been monkeying around with transistor switching its power but I’m stumped. I’m using a 2N 3906 (I verified it is outputting 3.3V using a 220 ohm resistor at the base attached to D5.

It seems like I’m losing connection (even more weirdly: when it does, it reads back 72.086°F).

So, here is my function to call the sensor to read… anyone see anything that could help? I tried calling begin() to see of that helped, but no.

Dynamically powering the sensor function:

void getInstrumentData(Conditions& cond)
  digitalWrite(D7, HIGH);
  digitalWrite(bmePowerPin, LOW);
  delay(250);  // I've monkeyed around with this
  //if (!bme.begin()) return;  // tried this too...
  Serial.println("Reading Sensor Data ");
  cond.Temperature = bme.readTemperature() * 9.0F / 5.0F + 32.0F;
  cond.RelativeHumidity = bme.readHumidity();
  cond.Pressure = bme.readPressure() / 100.0F;
  cond.Altitude = bme.readAltitude(SEALEVELPRESSURE_HPA);
  Serial.printf("\tTempF:% 3.4f\tHumidRH:% 2.1f%%\n", cond.Temperature, cond.RelativeHumidity);
  digitalWrite(bmePowerPin, HIGH);
  digitalWrite(D7, LOW);

My setup() function retrieves the correct temp:

void setup()
  pinMode(D7, OUTPUT);
  pinMode(bmePowerPin, OUTPUT);
  Particle.variable("conditions", conditionsJSON);
  uint32_t startTime = millis();
  while(millis() - startTime < 5000) // hold here for Serial Output on startup

  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3D (for the 128x64)  MAKE SURE THE LIBRARY FILES MATCH!!!
  display.clearDisplay();   // clears the screen and buffer
  display.setTextColor(WHITE,BLACK); // Normal text
  display.drawBitmap(0, 16, chameleon, 128, 48, WHITE);
  delay(1000);  // hold splash screen
  digitalWrite(bmePowerPin, LOW);
  Serial.println(F("BME280 test"));
  if (!bme.begin())
    while (1)
      Serial.println("Could not find a valid BME280 sensor, check wiring!");
  Serial.printlnf("Fetching initial sensor Data...");
  digitalWrite(D7, HIGH);
  Conditions conditions;
  temp = conditions.Temperature;
  humid = conditions.RelativeHumidity;
  digitalWrite(bmePowerPin, HIGH);
  digitalWrite(D7, LOW);
  Serial.printf("\tTempF:%3.4f\tHumidRH:%2.1f%%\n", conditions.Temperature, conditions.RelativeHumidity);


1 Like

So, after a few at our local pub, I did a little digging trying to get this transistor switching working with the BME280.

After reviewing the Data Sheet for the BME280, it seems that the device automatically powers up in SLEEP mode. Adafruit’s library (Particle port) does not have a method to reset the registers into ready (NORMAL) mode, it is done in the constructor so the assumption must be that it remains powered, I guess.

So, not wanting to get that deep into the data sheet and write a new method, I searched and found SparkFun’s library and they had a reset() method. A little jiggering of the library for Particle and Bob’s your uncle!!

So with getting it off the breadboard (thanks @bko) and using a transistor to cycle the power the sensor breakout, I’m able to mitigate most of the heat created versus leaving it powered continuously. It now reads within 1 or 2F° from ambient, so that works.

1 Like