I’ve built a weather station using a Grove BME280, and Grove base with ESP32C6. I need it to run in lower power mode so that a battery can power it for several weeks or months on a single charge. I read (and found out the hard way!) that the Grove BME280 board can draw significant current even when the chip itself and the ESP32 are in deep sleep mode. I also read that the way to fix this is to power the BME280 from a GPIO pin and turn it on only when the station periodically wakes up to broadcast readings using BLE. I prized the GND and 3.3V lines from the Grove cable on the I2C for the BME280 and connected them to another Grove plug which goes into GPIO 0.
The problem I’m having is that the BME280 gives quite different readings when powered from GPIO. (humidity reading doubles, pressure reading down by ~30%). The software, including BLE and deep sleep mode, all works perfectly. The problem goes away if I revert to the original cabling so it’s definitely an issue with the GPIO power. I had two thoughts:
The BME280 needs time to stabilize after power on. I’ve tried values up to 5ms but it makes no difference
The combination if I2C comms but power from GPIO has some gotchas that I’m not aware of and can’t find any online references to
Does anyone have any ideas or experience with this setup that might help?
The BME280 has a mode that stays asleep until triggered, so it should keep power consumption low even without turning off the power supply. The link below shows a similar approach, so it might be helpful.
Thanks for the reply. Yes, the BME280 chip has a sleep mode but the Grove board itself continues to draw power. My sketch wakes up for 30ms every 5 seconds so that’s just 0.6% of the time. It’s draining a 1100mAh battery in ~100 hours so that’s 11mA average consumption. I read that it’s not the BME280 chip itself but the Grove board circuitry that is the problem, so some sort of explicit on/off power management is needed. I did that quite easily, but I can’t figure out why the BME280 gives such different readings depending on the power source.
The BME280 board is here: Grove - Barometer Sensor(BME280) | Seeed Studio Wiki
It’s supposed to work on 3.3V, which is what the GPIO should give. The whole station also works fine on 3.7V LiPo rather than USB power, The wiki says operating current is 0.4mA but I’m seeing far higher than that.
Again, everything works 100% OK with just I2C cabling except that power drain is unexpectedly high. The principal issue seems to be figuring out why the sensor readings are different on GPIO power.
I suppose it is just possible that the Grove shield itself draws current even when the ESP32 is in deep sleep, but I can’t find anything on this one way or the other.
Per Pin Limit: The maximum recommended continuous current draw for a single GPIO pin is typically around 20mA, though the absolute maximum can be up to 40mA depending on the specific chip and software configuration.
However, in your specific scenario, the current limit is unlikely to be the root cause of the wildly inaccurate readings, but rather a factor in how power is delivered and stabilized
Try increasing the delay after applying power to the GPIO pin to 100ms or 200ms before initializing the I2C bus or sending any commands. This is a common requirement for complex sensors like the BME280.
for those following along,
The BME280 sensor itself is extremely low power:
Sleep Mode: As low as 0.1µA (microampere).
Active Measurement: It typically consumes less than 1mA (milliampere, or 1000µA) during measurement and communication.
AI ,
Added this ;
The problem you are experiencing is likely due to the quality of the power signal and the startup sequence, not the maximum available current:
Inrush Current/Capacitor Charging: When you first switch the GPIO pin HIGH, the sensor’s onboard decoupling capacitors need to charge instantly. This creates a very brief inrush current pulse that can be much higher than the average operating current (potentially 100mA or more for a moment).
Voltage Sag: The GPIO pin might experience a momentary voltage sag during this inrush, preventing the sensor’s internal circuitry from starting up correctly or causing its internal power-on-reset sequence to fail.
I2C State Issues: As previously mentioned, the “back-powering” issue through the SDA/SCL lines is a major source of erratic behavior when the VCC pin is switched off but the I2C lines are not properly managed.
To fix your reading issues, focus on the software sequence and potentially adding a small decoupling capacitor as suggested in the previous response, as the current limit of the pin itself is sufficient for the BME280.
HTH
GL PJ
BTW, The standard Grove BME280 breakout board might draw slightly more (around 0.4mA to 0.6mA typically, according to Seeed Studio specs) because of onboard components like pull-up resistors and, sometimes, an LED indicator.