BME280 Temp/Hum sensor on battery power increasingly skips(?) operation

  • Hi,

    I have a battery-operated temp/humidty sensor running on 2x AA batteries. Components are:

    1. Arduino Pro 3.3v clone with 47uF bulk cap (LEDs and volt regulator removed)
    2. BME280
    3. NRF24L01+ radio with 47uF bulk cap
    4. 3.3v voltage booster/regulator w/ 100uF bulk cap and 0.1uF ceramic cap

    It's set to report temp/hum every 10 minutes. Upon reset, it works flawlessly for 3 to 4 days, and then it'd start skipping an operation maybe once every a few hours (i.e. no update received). As time progresses such skips get worse, sending updates once per hour to every few hours. Eventually it'd just stop updating. Funny thing is, upon reset it'd work fine again for another few days only to get worse again following the exact same pattern described above. I'm unsure whether it's "self-resetting" I do not see the typical MySensors presentation messages when the sensor goes live again. But the smartSleep() integer counter sometimes gets reset.

    I have two other identical sensors that are each powered via a 5v wall wart, and they NEVER display this symptom. So I'm pretty sure it's related to it being battery powered.

    The battery is connected to a 3.3v voltage booster along with 100uF electrolyte bulk capacitor AND 0.1uF ceramic capacitor, as instructed by website. All components (Arduino, sensor, and radio) are powered by the output from the same voltage booster.

    Has anyone experience a similar issue? What could be the culprit, and what can I do to fix this?


  • Mod

    @gogopotato Try without the regulator, running the ProMini (through its Vcc input, regulator & LED disconnected), nRF24 and BME280 directly off 2xAA.
    I have an identical setup (without the big capacitors) that is running fine for weeks now.

  • @Yveaux Are you running the system with only the LEDs removed, and you are using the Arduino built-in voltage regulator? My concern with this setup is that it wouldn't last long since you are starting at already-low 3.0v at max. How long do you think it would last?

    I am thinking of just using 4x AAs with built-in regulator if all else fails.

  • This post is deleted!

  • Mod

    @gogopotato No, I removed both the LED and the regulator, so everything is driven directly from 2xAA.
    I have similar sensors (e.g. with Si7021 temp/hum sensor) which run for years on such setup.
    A steup converter will just reduce the battery lifetime due to its loss and power tends to be less stable than using batteries directly.

  • @gogopotato

    Can you please paste your sketch? I found some here but I think is outdated, readings not working properly . Thanks !

  • @warmaniac Here's my code:

    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    #define MY_NODE_ID 11
    //#define MY_PARENT_NODE_ID
    #include <SPI.h>
    #include <MySensors.h>
    #include <avr/wdt.h> //watchdog timer lib
    #include <Adafruit_Sensor.h>
    #include <Adafruit_BME280.h> // Change I2C address in Adafruit_BME280 library to "0x76" (line 32 in the library file)
    #include "Wire.h"
    Adafruit_BME280 bme; // I2C
    #define CHILD_ID_HUM 0  // RH
    #define CHILD_ID_TEMP_F 1 // temp in F
    // MyMessage to controler
    MyMessage msgT1(CHILD_ID_TEMP_F, V_TEMP);
    MyMessage msgH1(CHILD_ID_HUM, V_HUM);
    MyMessage msgE1(255, V_TEXT); // Debug message
    void presentation()
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Nursery", "1.2");
      present(CHILD_ID_TEMP_F, S_TEMP);
      present(CHILD_ID_HUM, S_HUM);
    void setup()
      ServerUpdate(); // for first data reading and sending to controler
    void loop()
      smartSleep(600000); // sleep for 10 mins
    void startBME()
      delay(1000); //just in case
      if (!bme.begin())
        send(msgE1.set("BME280 INIT FAIL"));
    #ifdef MY_DEBUG
        Serial.println("BME280 initialization failed!");
        while (1);
        send(msgE1.set("BME280 INIT SUCCESS"));
      delay(5000); //delay for 5 second before the 1st reading; prevents errant spike in sensor value
    #ifdef MY_DEBUG
      Serial.println("BME280 initialization success!");
    void ServerUpdate() // used to read sensor data and send it to controller
      bme.begin(); //re-initialize for each reading
      double TF, TC, P, H;
      TC = bme.readTemperature(); //read temp in C
      TF = TC * 9 / 5 + 32; // convert default Celcius reading to Fahrenheit
      H = bme.readHumidity();
      if (TF < 0 || H == 100 || H == 0) {
        // if sensor values are in error, do nothing.
      } else {
        send(msgT1.set(TF, 1));
        send(msgH1.set(H, 1));
    #ifdef MY_DEBUG
      Serial.print("T = \t"); Serial.print(TF, 1); Serial.print(" degF\t");
      //Serial.print("T = \t"); Serial.print(TC, 1); Serial.print(" degC\t");
      Serial.print("H = \t"); Serial.print(H, 1); Serial.print(" percent");
      //Serial.print("P = \t"); Serial.print(P, 1); Serial.print(" mBar\t");

  • This post is deleted!

  • @warmaniac hmm now that I am reviewing my code, I have "do nothing if value is error" logic.

      if (TF < 0 || H == 100 || H == 0) {
        // if sensor values are in error, do nothing.
      } else {
        send(msgT1.set(TF, 1));
        send(msgH1.set(H, 1));

    Perhaps the voltage booster is causing BME280 to behave badly? But then why would it work fine for the first few days? Do you think adding a bulk capacitor to BME280 would to stabilize power hence reducing errant readings? If so how big of a capacitor would I need? The mystery continues....

  • @Yveaux If step-up converter would only reduce the battery lifetime, why does page suggest using one to extend battery life? I'm new to electronics so please bear with me!

  • @gogopotato

    I had problem that BME is inaccurate outside , I'm using BME180 and BME 280 both works great inside readings are almost same , but when I put it outside temperature is much higher than real, I compare it with ds18b20 or with my standalone weather station + local weather station , it was almost same but BME is higher about 2 degrees

  • @warmaniac yeah I think my BME280 is about +2 F than real temp. Anyway, do you have any suggestions as to resolving the issue? Maybe I should just replace it with DHT22.

  • @gogopotato

    I had 5 pcs of DHT 11 and 3 pcs of DHT22 and there are seriously piece of sh.. 🙂 humidity readings was very bad only temperature okay , than if you want to measure only temperature best way is buy waterproof ds18b20 ,

  • Hero Member

    @gogopotato Taken from the BME280 datasheet: "Temperature measured by the internal temperature sensor. This temperature value depends on the PCB temperature, sensor element self-heating and ambient temperature and is typically
    above ambient temperature. " (does not explain very much ;-)) I have a good experience with this sensor when operated from a stable power source (3.3V ldo).
    Some boards of the boards sold are equiped with a LDO which can cause problems if you operate under a certain voltage. 0_1490093783939_upload-e834cb72-2a47-4b77-83a1-4caa44a4d618

  • @AWI

    I had this one, is it OK ? I power it directly from 2xAA batteries, and can operate 1,71 to 3,7 volts as I saw in datasheet .Then you said that is problem of using because it has self heating problem ?

  • @AWI This is the BME280 module I'm using, and looks like it's got an LDO built-in, am I correct? Vin is 1.8 - 5V DC. Maybe I should just bypass the voltage booster and supply power to the module directly from the battery...?

  • Hero Member

    @warmaniac That is the one without LDO (regulator). The self heating problem is not likely to occur if you are not constantly accessing the sensor and thus warming it. The main function of the temperature sensor is compensation for barometer and humidity reading. It is a rather complicated component with a lot of different settings and adjustments.

  • @AWI

    I understand but it's mysterious thing , because indoor it works ok , but when I put it outside , readings are not correct , maybe it is not for outdoor usage 😞

  • Hero Member

    @gogopotato And that one is with the LDO built in. You need to make sure that the sensor gets enough juice. I can't see which regulator is used but probably a 662K (XC6206) which is not likely to produce any voltage below 2.6V

  • Hero Member

    @warmaniac The sensor should be perfect for outdoor usage. At least you are not alone 😌 . This guy deserves some real credits doing the research and has some ideas on the cause in the article. (you can also take look at his wedding pictures 💒 there)


  • @AWI

    Thanks , I take a read after I finish in work. But I decided to use ds18b20 sealed version plus standalone humidity sensor , maybe it will be better 🙂 Then I post some experiences. Maybe you can take a look on my photos too , I like landscapes photos , but sometimes I shooting weddings too 🙂

  • My BME280 is around 1F hotter outside than a DS18B20 outside in another project. Not a big deal but I am also researching how to keep it cool. The library I am using is this one.

Log in to reply

Suggested Topics

  • 33
  • 2
  • 7
  • 6
  • 2
  • 20
  • 4
  • 15