Sleep mode for bmp280
-
Hello,
I try to build a battery powered temperature sensor but I only found one sensor who works with low power under 2 volt. This is the bmp280 from bosch. But in i2c mode he need a power from 0,6mA so my battery life are only 2 month. Now the library from adafruit runs the sensor in normal mode and so I insert two new functions in the library:
void Adafruit_BMP280::sleep() {
write8(BMP280_REGISTER_CONTROL, 0x3C);
}void Adafruit_BMP280::wakeup() {
write8(BMP280_REGISTER_CONTROL, 0x3F);
}The first one write 00 to the first bits in the data register - the sleep mode.
The wakeup function rewrite the first bits with 11 - the normal mode.void loop() {
...
...Temp = bmp.readTemperature();
Press = bmp.readPressure() / 100.0;
Altit = bmp.readAltitude(1013.25);bmp.sleep();
sleep(30000);
bmp.wakeup();
}Now the sketch needs only 0,2µA in the sleep mode - it is much more better than 0,6mA.
Best regards
Elmar
-
If you don't want to deal with low voltages, you could get some LiFePO4 batteries that run at 3.3V
-
Another hack is to power it from a mcu digital pin and set the pin high/low.
-
@sundberg84 if it is really 0,2µA it is actually astonishing already
-
Oh no it is 2µA
-
it is still better then the 5-6 uA I get from mine
-
Just wanted to say thanks for this, it is still relevant and useful six years later !
Suggested Topics
-
Over the air updates
General Discussion • 23 Mar 2014, 21:38 • ToSa 1 Mar 2015, 11:21 -
"Remote Irrigation with LoRaWAN: LM27313 Challenges and PCB Design"
Hardware • 24 Jan 2024, 23:06 • wrendral 3 Feb 2024, 07:13 -
Sensors and more
Hardware • 19 Jun 2023, 00:41 • Robert Leverett 19 Jun 2023, 00:41 -
Does MySensors require Arduino Timer 2?
Hardware • 6 Jan 2024, 19:39 • OldSurferDude 11 Jan 2024, 04:39 -
Newbie questions
Hardware • 14 Feb 2025, 20:03 • magwas 14 Feb 2025, 20:03 -
Best time of year to buy higher quality small project solar panels?
Hardware • 10 Jun 2021, 19:19 • NeverDie 30 Aug 2024, 14:01